Exposing process and accept methods in TcpSocket and UdpSocket

We are trying to implement a proxy tunnel, which will automatically establish a new TCP connection or UDP association based on packet received from a tun device.
The current implementation requires TcpSocket to listens or UdpSocket to binds on a specific port otherwise the interface will ignore or send RST to TCP clients. But what I want is to create a new TcpSocket when receives a packet that points to a new destination and then proxy its packets to a proxy server.
It is required for us to use process to feed the received IP packets from tun devices to drive the TCP state forward:
https://github.com/smoltcp-rs/smoltcp/blob/1134eb28d8c6886034f6ccad452101dc5e6d679c/src/socket/tcp.rs#L1256-L1261

process and accepts on sockets are internal implementation details and are unlikely to be made public. They'd expose too much and make it harder to make changes.
There might be alternative ways? Maybe a way for TcpSocket/UdpSocket to listen on any ip+port, so Interface works for these transparent proxy use cases?

https://github.com/smoltcp-rs/smoltcp/blob/1134eb28d8c6886034f6ccad452101dc5e6d679c/src/iface/interface.rs#L650-L699
Since one call of poll may receives multiple IP packets, if these packets have different dst_addrs, then how can one TcpSocket or UdpSocket who listens on any ip+port handles all of them? Or I have to add many TcpSockets into the socket set just in case?

How about making some new wrapper types, like TcpRawSocket and UdpRawSocket?

Or I have to add many TcpSockets into the socket set just in case?

Yes, that. You have to do that in regular TCP servers too in case you receive multiple connections. There's no "tcp listener" (yet?).

How about making some new wrapper types, like TcpRawSocket and UdpRawSocket?

It has the same problems as exposing process/accepts: it exposes fairly low-level internal details in a public api, that then have to be maintained and compatibility kept. I'm not convinced that's the right approach, when Interface can be made to work.
Also it's not quite useful on its own, there's quite a bit of logic in Interface that you'd have to replicate...

If I added a lot of pre-generated TcpSockets into the socket set, how can I identify which one just being connected? Or I have to maintain another set to record which sockets was in opened state and then check it again after poll? With the process APIs, I can create one TcpSocket once I receive the first SYN, which is a lot graceful and elegant.

Same here, I'm looking for tun implement (for shadowsocks-rust ;) ) using tcp/ip stack, but I found tcp#process function is not callable
leaf https://github.com/eycorsican/leaf/blob/b0779107921683204a65bb1d41edc07a52688613/leaf/src/proxy/tun/netstack/tcp_listener_impl.rs#L51 have a impl, which binding to a random port.
What the leaf do is modifying lwip source codes to make all packets go through the accept callback regardless of tcp destination port.
https://github.com/eycorsican/lwip-leaf/search?q=TUN2SOCKS
https://github.com/eycorsican/lwip-leaf/blob/86632e2747c926a75d32be8bd9af059aa38ae75e/core/tcp_in.c#L686
Leaf's approach is good, but it need to hacking into library source codes, I want to find alternative approach to solve the problem.
As a tcp/ip stack, I think smoltcp should give developer more power to change/reroutes socket layer packet

While I agree that the ability to externally advance the socket state might be beneficial, one should already be able to implement a tool like tun2socks with zero modifications to smoltcp (master branch).

Instantiate a TunTapInterface for the device you want to operate on, e.g. tun0.
Implement a virtual device, i.e. implement the Device trait for a device that does nothing more except for providing the ability to manually add and remove packets to and from input and output buffers. The receive method will then read from the input buffer and TxToken consumption will write to the output buffer. Clone the capabilities from the TunTapInterface.
Instantiate an Interface for the virtual device with any_ip, route <IP_ADDRESS>/0 and default gateway <IP_ADDRESS>. I will refer to this interface as virtual interface in the following.
Read from the TunTapInterface directly using receive. When you see a new TCP connection (SYN packet), instantiate a TcpSocket that listens on the destination endpoint and add it to a SocketSet you manage for the virtual interface. Then add the SYN packets and all following packets belonging to the connection to the input buffer of your virtual device.
Call poll on the virtual interface. It will read from the input buffer of the virtual device and will advance the states of the sockets in the SocketSet.
The previous call to poll may have caused the sockets to generate packets. Thus, read them from the output buffer of the virtual device.
Use can_recv and recv of the sockets normally.

Sending should work similarly.

It should be a practical solution. The key is to parse the received packets in the Device instance and check if there are new connections when receiving SYNs in receive(). I should try that.

I have been working on something similar. It's not complete yet, but if the proxy server does not misbehave, it works. Maybe this helps.
https://github.com/blechschmidt/tun2proxy

The method have been proved to work. Closing the issue.


Map should use context to pass map reference to child components

Right now, Map passes itself as "mapHolderRef" through props to child components via cloning of children. This gets dicey when creating subclasses. For example, this doesn't work:
class GeoJsonPolygon extends React.Component {
  render(){
    const {paths} = this.props;
    const newpaths = convertGeoJsonPaths(paths);

    return <Polygon paths={newpaths}/>
  }
}

It breaks (without a good error message) because secret mapHolderRef prop is not passed down to Polygon. The fix is easy (pass rest of props using rest-spread) but I had to dig into the code to figure out the problem.
It would be much easier to use the library, and to compose components, if map reference was passed to the whole subtree behind-the-scenes using react's Context feature: https://facebook.github.io/react/docs/context.html

Merged in #224


MRG: Update base estimator

Taking over #3988, which was a takeover of #3570.
@kingjr can you see if this satisfies your case?

yes

Okay, I'll update whats_new.rst about a bug. This is ready for review whenever you have time

Can you add a test?
I'm sorry, the next two weeks will be very busy for me, I don't think I can review PRs seriously.

BaseEstimator is implicitly tested, as it's a base class of a bunch of Decoding things -- it's also copy-paste from sklearn to fixes.py so I don't think we need to test that. Do you mean test the std thing?

yes the std error
On 22 February 2017 at 10:41, Eric Larson<EMAIL_ADDRESS>wrote:

BaseEstimator is implicitly tested, as it's a base class of a bunch of
Decoding things -- it's also copy-paste from sklearn to fixes.py so I
don't think we need to test that. Do you mean test the std thing?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mne-tools/mne-python/pull/4007#issuecomment-281706287,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEp7DBsOpl99WBLeBX6iZI9lV51hNzbGks5rfFcvgaJpZM4MH4Ck
.

Well the docstring does say "standardize data across channels", but that's a bit vague. I would expect this to mean each channel (over time) would then have mean 0 std 1, but what it does is instead makes each time point (over channels) have mean 0 std 1. @kingjr which did you expect?

@jasmainak do you have time to look? I clarified docs and added a test.

Codecov Report

Merging #4007 into master will decrease coverage by -0.17%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #4007      +/-   ##
==========================================
- Coverage   86.05%   85.88%   -0.17%
==========================================
  Files         350      350
  Lines       62985    62961      -24
  Branches     9629     9623       -6
==========================================
- Hits        54202    54077     -125
- Misses       6101     6208     +107
+ Partials     2682     2676       -6

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 b1786b2...4927c5c. Read the comment docs.

I would expect :
X = epochs.get_data()
X.transpose(1, 0, 2).reshape(X.shape[1], -1)  # stack epochs and time
together
X -= X.mean(1) # mean over time & epochs
X /= X.std(1) # std over time and epochs
X.reshape(n_chans, n_times, n_trials).transpose(2, 0, 1)  # back to
expected dimension

On 22 February 2017 at 11:14, Eric Larson<EMAIL_ADDRESS>wrote:

Well the docstring does say "standardize data across channels", but that's
a bit vague. I would expect this to mean each channel (over time) would
then have mean 0 std 1, but what it does is instead makes each time point
(over channels) have mean 0 std 1. @kingjr https://github.com/kingjr
which did you expect?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mne-tools/mne-python/pull/4007#issuecomment-281716969,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEp7DF-ThYTfR3E3ojDn7hq5pw9bEkKBks5rfF7ugaJpZM4MH4Ck
.

@kingjr that's not what it does -- not even on a per-epoch basis. It normalizes each time point, within each epoch, to have mean zero std 1 (for each channel type). Have you been using it expecting the other way?

In that case, this one should be good to go. Updated axis=-2 in the tests to reflect current behavior.

LGTM ... maybe one more person can take a look what's up with the BaseEstimator? I didn't check that carefully ...

@agramfort this could use another set of eyes and merge if you have time

@kingjr @dengemann you merged this Scaler code but it seems that it's not used in any example or tutorial and to be honest I am not sure what's the use case. You use StandardScaler from sklearn in many places to standardize across epochs which is classic for ML but this Scaler approach I don't know.
@kingjr @dengemann or maybe @jasmainak can you help me understand?

Yes, we need to add examples.
This is useful when doing decoding pipelines that use multiple time points
of with mixed channels. E.g. Xdawn(MEEG)
On 26 February 2017 at 10:19, Alexandre Gramfort<EMAIL_ADDRESS>wrote:

@kingjr https://github.com/kingjr @dengemann
https://github.com/dengemann you merged this Scaler code but it seems
that it's not used in any example or tutorial and to be honest I am not
sure what's the use case. You use StandardScaler from sklearn in many
places to standardize across epochs which is classic for ML but this Scaler
approach I don't know.
@kingjr https://github.com/kingjr @dengemann
https://github.com/dengemann or maybe @jasmainak
https://github.com/jasmainak can you help me understand?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mne-tools/mne-python/pull/4007#issuecomment-282562959,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEp7DNK9cfzLETZR6N5_XKS7Wh1_9K9uks5rgZgXgaJpZM4MH4Ck
.

In the meantime this should be good to go, for Scaler it only clarifies
current behavior

This is useful when doing decoding pipelines that use multiple time points
of with mixed channels. E.g. Xdawn(MEEG)

can you share a code snippet to illustrate the benefit / necessity?
I would just have just scaled each channel type by a scalar.

You'd mainly need a data simulation snippet than an analytic one. E.g. (not
tested)
# make up random MEEG data
X = np.random.randn(n_epochs, n_chans, n_times)
y = np.arange(n_epochs) % 2

# Scale by chan type
X[:, :306:3, :] /= 1e-11  # scale grad channels
X[:, 1:306:3, :] /= 1e-11  # scale grad channels
X[:, 2:306, :] /= 1e-13  # scale mag channels
X[:, 306:, :] /= 1e6 # scale eeg channels

# Add annoying typicalities
baseline_shifts = np.random.randn(n_epochs, n_chans)
X += baseline_shits[:, :, np.newaxis]
bad_channels = np.random.randint(0, n_channels, 10)
X[:, bad_channels, :] = np.random.randn(n_epochs, 10, n_times]

# Pipeline
train, test = range(n_epochs//2), range(n_epochs//2, n_epochs)
xdawn = make_pipeline(mne.decoding.Scaler(), XdawnTransformer())
xdawn.fit(X[train], y[train])
X_clean = xdawn.transform(X[test]).inverse_transform(X[test])

On 26 February 2017 at 10:39, Alexandre Gramfort<EMAIL_ADDRESS>wrote:

This is useful when doing decoding pipelines that use multiple time
points
of with mixed channels. E.g. Xdawn(MEEG)

can you share a code snippet to illustrate the benefit / necessity?
I would just have just scaled each channel type by a scalar.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mne-tools/mne-python/pull/4007#issuecomment-282564348,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEp7DH3lIObm0lD0oZJBZ89Fe4zggAg0ks5rgZy7gaJpZM4MH4Ck
.

# make up random MEEG data
X = np.random.randn(n_epochs, n_chans, n_times)
y = np.arange(n_epochs) % 2

# Scale by chan type
X[:, :306:3, :] /= 1e-11 # scale grad channels
X[:, 1:306:3, :] /= 1e-11 # scale grad channels
X[:, 2:306:3, :] /= 1e-13 # scale mag channels
X[:, 306:, :] /= 1e6 # scale eeg channels

this suggests a global scaling per channel type as I said above.

Add annoying typicalities
baseline_shifts = np.random.randn(n_epochs, n_chans)
X += baseline_shits[:, :, np.newaxis]

this will get fixed by high pass or baseline correction

bad_channels = np.random.randint(0, n_channels, 10)
X[:, bad_channels, :] = np.random.randn(n_epochs, 10, n_times]

Scaler will not be robust to bad channels of if artifact is big
it might wash out your effect (div by std)

I'm not the creator of this class, I'm just indicating where it can be
useful. My and Asish' contributions were made to make it API compatible
with the other decoding classes and with scikit-learn's pipeline.

this suggests a global scaling per channel type as I said above.

yes, what else?

this will get fixed by high pass or baseline correction

which can introduce other issues; that's another discussion.

Scaler will not be robust to bad channels of if artifact is big; it might
wash out your effect (div by std)

Yes, we already have had this discussion in multiple places. This is why I
suggested to add a method='robust'.
On 26 February 2017 at 10:59, Alexandre Gramfort<EMAIL_ADDRESS>wrote:

# make up random MEEG data
X = np.random.randn(n_epochs, n_chans, n_times)
y = np.arange(n_epochs) % 2

# Scale by chan type
X[:, :306:3, :] /= 1e-11 # scale grad channels
X[:, 1:306:3, :] /= 1e-11 # scale grad channels
X[:, 2:306:3, :] /= 1e-13 # scale mag channels
X[:, 306:, :] /= 1e6 # scale eeg channels

this suggests a global scaling per channel type as I said above.

Add annoying typicalities
baseline_shifts = np.random.randn(n_epochs, n_chans)
X += baseline_shits[:, :, np.newaxis]

this will get fixed by high pass or baseline correction

bad_channels = np.random.randint(0, n_channels, 10)
X[:, bad_channels, :] = np.random.randn(n_epochs, 10, n_times]

Scaler will not be robust to bad channels of if artifact is big
it might wash out your effect (div by std)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mne-tools/mne-python/pull/4007#issuecomment-282565640,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEp7DPPyCVKBBWLs6GnDbyHZzMdA1U9Uks5rgaFMgaJpZM4MH4Ck
.

@agramfort the fix to Scaler is bugfix and documentation. The intended behavior has not been changed. I can summarize the discussion IRL for you if you want.
Everyone seems to agree that a constant scaler is the way to go. I think I might have misunderstood what needed to be implemented 4 years ago and it passed through the reviews unnoticed back then ... it can be fixed but this is not the PR to fix it. It's https://github.com/mne-tools/mne-python/pull/3672

ok fair enough. thanks @jasmainak for clarifying. I had not realized it the history...
let's discuss this IRL during the sprint


Update Entry in Archive

It's possible to add and remove files to and from an Archive. But it's not possible to update a file. Of course I could remove the old one and add the changed one, but that will append the file to the end of the Archive. In the most cases this is not problematic, but for example for files like OpenDocument files the order of the files in the archive is important.
So I would suggest to add a func called updateEntry in the Archive.swift.
Some thoughts to that: I checked, how the zip cli is doing this. If you use zip -u archive.zip changedFile, then it really changes the file in the Archive.
My suggestion: I think one could use the code from the func remove in Archive+Writing.swift. Then instead of skipping the removed item you can add the new entry. Unfortunately I do not completely understand the code here yet, otherwise I would make a pull request.

Hi Joachim,
ZIP files are organized as "sequence of files" with some interleaved metadata and a central directory structure (at the end of the file) that maintains additional metadata and offsets.
When an entry gets removed, all subsequent entries have to be rewritten and the central directory must be updated to contain the new offsets.
ZIP Foundation does that by streaming all entries of an archive to a temp location, skipping the entry that should be removed. After it reaches the end of the archive, it replaces the old archive with the new one.
There might be slightly faster approaches that truncate the original file in-place and only rebuild the entries that are placed after the removed entry - But our approach should be more secure on most file systems in the case that anything goes off the rails while rebuilding the tail entries.

My suggestion: I think one could use the code from the func remove in Archive+Writing.swift. Then instead of skipping the removed item you can add the new entry. Unfortunately I do not completely understand the code here yet, otherwise I would make a pull request.

I am not familiar with the OpenDocument format, but we are currently already have to balance performance and safety. Since the ZIP format specification does not make guarantees about entry order, I think it's better to handle that at the consuming side of the API.
To implement that, you could look at the remove function linked above and instead of just skipping the removed entry, you could sneak-in the entry that you'd like to have at that location (You will also have to modify the code that does the book keeping of the offsets).

Hi Thomas,
thank you for your answer. The OpenDocument standard says (here): The “mimetype” file shall be the first file of the zip file. It shall not be compressed, and it shall not use an 'extra field' in its header.
But this is only one background.... I just was wondering, why there is no function to update files (would be easier in the most cases then removing and adding and entry, especially because removing and adding both causes a complete rewrite of the file, does it?

The OpenDocument standard says (here): The “mimetype” file shall be the first file of the zip file. It shall not be compressed, and it shall not use an 'extra field' in its header.

Thanks for the link and for the background info.

I just was wondering, why there is no function to update files
...
especially because removing and adding both causes a complete rewrite of the

Consider you have the files ["A", "B", "C"] in an archive. If you replace "B" with a new file "D" (which could also be an updated version of "B"), you have to rebuild everything after "A" onwards because of size and offset changes.
If "D" would have a smaller file size than "B", you could theoretically just overwrite parts of the former "B" but that would leave some remains of "B" in place. And you'd still have to update all metadata re. size. If "D" is larger than "B" you can't position the file pointer at the position of the former "B" and just write the contents of "D". In that case, you'd overwrite parts of "C" and corrupt the archive.
So in terms of ZIP, there is no such thing as modify/update in-place.

So in terms of ZIP, there is no such thing as modify/update in-place.

Of course, I know that (before using ZIPFoundation I started to create an own library for zip files, so I know sth. about the zip container). I'm absolutely aware, that you need to rewrite the file and change the offsets in the central directory. This is actually exactly what I am supposing, but I thought you may be faster adding such a function then me, because I don't completely understand your code yet ;)


Explore topological sort

It would produce a bigger graph (no laziness) but wouldn't require predecessor tracking, which is expensive.

Try generating the whole graph to count nodes.

I'm no longer convinced this is worthwhile after trying iterative Dijkstra.


rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.txdata).R

JsonRpcError: rlp: non-canonical integer (leading zero bytes) for *big.Int, decoding into (types.Transaction)(types.txdata).R
    at JsonRpcError.ExtendableBuiltin (file:///Applications/EmeraldWallet.app/Contents/Resources/app.asar/app/index.js:23949:30)
    at new JsonRpcError (file:///Applications/EmeraldWallet.app/Contents/Resources/app.asar/app/index.js:23978:116)
    at file:///Applications/EmeraldWallet.app/Contents/Resources/app.asar/app/index.js:24015:19
    at <anonymous>

dup #863


Logging active mass

Extract active mass and return the result as logging info because it can be zero.

@d-cogswell I committed adjustments to the mass logging and included remarks logging. I don't know how to formally request a review from you, so this will have to do!

The position of all the data like barcode, start time, end time, remarks, active mass, step file name etc. are relative to the position of the word "BTS Client" in BTS 4000 nda files and not an absolute position.

Interesting, I have not yet had a case where the absolute index didn't work for 4000 files, but I can make these adjustments! Increased compatibility is a good thing!

@AdamOpps what are the active masses for the BTS 9000 files you emailed? I'm not sure your solution is returning the correct values, but I also don't have a version of BTSDA that will let me see the
@vividh-garg if you turn on logging, you see some client/server version info. Unfortunately, I don't think there is a universal solution that works for every file. Instead you need different solutions based on the nda file version.

@AdamOpps what are the active masses for the BTS 9000 files you emailed? I'm not sure your solution is returning the correct values, but I also don't have a version of BTSDA that will let me see the

I am paraphrasing my email here:
I am able to process those files with this code for the 9000 extraction and I can confirm it returns the expected values (10.8152mg) for active mass and remarks, at least on my end!
@vividh-garg Do you have a file that you would be willing to send to me or @d-cogswell where the absolute reference does not work? You could truncate the binary file before any actual cycling data begins, if you want to obscure sensitive information. If not, just the nda File version would also potentially be helpful.

@AdamOpps thanks for confirming the mass. I made a few minor tweaks and I think this is good to merge.


ESP32 mcuboot bootloader failed

Describe the bug
Bluetooth initial failed after enabling BOOTLOADER_MCUBOOT.
To Reproduce
Steps to reproduce the behavior:

flash mcuboot.  ( https://github.com/mcu-tools/mcuboot/blob/main/docs/readme-espressif.md)
west build -b esp32 samples/bluetooth/peripheral/ -- -DCONFIG_BOOTLOADER_MCUBOOT=y
west flash --bin-file build/zephyr/zephyr.signed.confirmed.bin

Logs and console output
============ PuTTY log 2022.01.13 11:34:27 ============
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff8598,len:4604
ho 0 tail 12 room 4
load:0x40085000,len:14964
load:0x4009d000,len:3624
entry 0x40085478
[esp32] [INF] *** Booting MCUboot build v1.7.0-421-g399720d ***
[esp32] [INF] Primary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x1
[esp32] [INF] Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[esp32] [INF] Boot source: primary slot
[esp32] [INF] Swap type: none
[esp32] [INF] br_image_off = 0x10000
[esp32] [INF] ih_hdr_size = 0x20
[esp32] [INF] DRAM segment: start=0x54e8, size=0x17e4, vaddr=0x3ffbdb60
[esp32] [INF] IRAM segment: start=0x6ccc, size=0x115d0, vaddr=0x40080000
[esp32] [INF] start=0x4009014c
*** Booting Zephyr OS build v2.7.99-3070-g7eb50bebe486 ***
Bluetooth init failed (err -45)
[00:00:01.119,000] bt_settings: settings_subsys_init failed (err -45)
Environment (please complete the following information):

OS: Ubuntu

A few context questions, might be useful:

Exactly what ESP32 module are you using
Are we sure that bluetooth is supported on ESP32? It was not as of October https://www.cnx-software.com/2021/10/31/esp32-zephyr-nuttx-rtos-support/
Have you tested this without MCUboot to verify that MCUboot is the problem?

A few context questions, might be useful:

Exactly what ESP32 module are you using
The module is ESP32-DevKitC, support wifi , ble.

Are we sure that bluetooth is supported on ESP32? It was not as of October https://www.cnx-software.com/2021/10/31/esp32-zephyr-nuttx-rtos-support/

Bluetooth is supported on ESP32, i am sure.

Have you tested this without MCUboot to verify that MCUboot is the problem?

I has test Hello World with MCUBOOT, it is work fine.
and test the project esp32 samples/bluetooth/peripheral without  enable BOOTLOADER_MCUBOOT, bluetooth is work fine.

@sam131208, the 3rd step is wrong. You should not flash zephyr.signed.confirmed.bin, but zephyr.signed.bin.  Besides this, I recommend you to run only west flash. As MCUBOOT is enabled, west flash will take care of flashing zephyr.signed.bin automatically. Would you try again?

@sylvioalves
It seems can't bootload success.
Steps to reproduce the behavior:

flash mcuboot. ( https://github.com/mcu-tools/mcuboot/blob/main/docs/readme-espressif.md)
west build -b esp32 samples/bluetooth/peripheral/ -- -DCONFIG_BOOTLOADER_MCUBOOT=y
west flash
or   west flash --bin-file build/zephyr/zephyr.signed.bin

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7088
load:0x40078000,len:14312
load:0x40080400,len:3688
entry 0x40080678
I (52) boot: ESP-IDF release/v4.3-116-gbd2e2d8dc 2nd stage bootloader
I (52) boot: compile time 10:37:02
I (54) boot: chip revision: 1
I (58) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (74) boot.esp32: SPI Speed      : 40MHz
I (74) boot.esp32: SPI Mode       : DIO
I (74) boot.esp32: SPI Flash Size : 16MB
I (79) boot: Enabling RNG early entropy source...
I (84) boot: Partition Table:
I (88) boot: ## Label            Usage          Type ST Offset   Length
I (95) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (102) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (110) boot:  2 factory          factory app      00 00 00010000 00100000
I (118) boot: End of partition table
E (122) esp_image: image at 0x10000 has invalid magic byte
W (128) esp_image: image at 0x10000 has invalid SPI mode 243
W (134) esp_image: image at 0x10000 has invalid SPI size 9
E (140) boot: Factory app partition is not bootable
E (146) boot: No bootable app partitions in the partition table
ets Jun  8 2016 00:22:57

@sylvioalves  It seems can't bootload success.
To Reproduce
Steps to reproduce the behavior:
1. flash mcuboot. ( https://github.com/mcu-tools/mcuboot/blob/main/docs/readme-espressif.md)
     1) cmake -DCMAKE_TOOLCHAIN_FILE=tools/toolchain-esp32.cmake -DMCUBOOT_TARGET=esp32 -B build -GNinja
     2) cmake --build build/
     3) esptool.py --chip esp32 elf2image --flash_mode dio --flash_freq 40m --flash_size 1MB -o build/mcuboot_esp32.bin build/mcuboot_esp32.elf
     4) esptool.py -p /dev/ttyUSB0 -b 921600 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size 1MB --flash_freq 40m 0x00001000 build/mcuboot_esp32.bin
2. west build -b esp32 samples/bluetooth/peripheral/ -- -DCONFIG_BOOTLOADER_MCUBOOT=y
3.  west flash

Logs and console output:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2022.01.19 16:20:59 =~=~=~=~=~=~=~=~=~=~=~=
ets Jun  8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff8598,len:4604
ho 0 tail 12 room 4
load:0x40085000,len:14964
load:0x4009d000,len:3624
entry 0x40085478
[esp32] [INF] *** Booting MCUboot build v1.7.0-421-g399720d ***
[esp32] [INF] Primary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x1
[esp32] [INF] Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[esp32] [INF] Boot source: primary slot
[esp32] [INF] Swap type: none
[esp32] [INF] br_image_off = 0x10000
[esp32] [INF] ih_hdr_size = 0x20
[esp32] [INF] DRAM segment: start=0x54e8, size=0x17e4, vaddr=0x3ffbdb60
[esp32] [INF] IRAM segment: start=0x6ccc, size=0x115d0, vaddr=0x40080000
[esp32] [INF] start=0x4009014c
*** Booting Zephyr OS build v2.7.99-3070-g7eb50bebe486  ***
Bluetooth init failed (err -45)
[00:00:01.119,000]  bt_settings: settings_subsys_init failed (err -45)

@sam131208 I read you are using ESP32 DevkitC. It should have 4MB of flash. It means that --flash_size 1MB in both esptool.py commands should be replaced by --flash_size 4MB. Can you confirm that?

@sylvioalves  Thanks! you are right, the flash_size is flash chip size, not the image size. Now bootloader work fine.


Custom crash handler

Right now, there's a default trap_exit for the pool's actors: https://github.com/celluloid/celluloid-pool/blob/master/lib/celluloid/supervision/container/pool.rb#L163.
It would be awesome if there was an option for a custom trap_exit handler to deal with the (actor, reason) that right now is being discarded (something like exit_handler as an initialize argument to the pool alongside size?).
I could be totally wrong and there's another way to handle this, but finalize on the actual actor does not seem to get the reason.

You can use trap_exit :handler where :handler is the name of a method, i.e. def handler(actor, reason); end ... that does get both the actor who died, and the reason.

You can read about this here:
https://github.com/celluloid/celluloid/wiki/Linking

@digitalextremist I don't think that helps here: this is specifically to get the exits for the pooled workers. I am using the pool to avoid doing the manual work of linking to the workers and managing which ones are living/dead.
I looked at how Sidekiq handled it, and Sidekiq manually manages the worker pool explicitly so it can catch the exits of the linked wokers: https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/manager.rb#L17 which basically re-implements the pool behavior (https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/manager.rb#L102).
I tried adding a trap_exit to the pooled class, but it didn't seem to do anything (was not called when it died during normal operation). I'm not sure where else I can add the trap_exit handler.
If I monkeypatch the Pool class, I get the behavior I want:
module Celluloid
  module Supervision
    class Container
      # Manages a fixed-size pool of actors
      # Delegates work (i.e. methods) and supervises actors
      # Don't use this class directly. Instead use MyKlass.pool
      class Pool
        # Spawn a new worker for every crashed one
        def __crash_handler__(actor, reason)
          @mutex.synchronize {
            @busy.delete actor
            @idle.delete actor
            @actors.delete actor
          }

          STDERR.puts "CRASH_HANDLER: #{reason}"
          # would call the exit_handler at the pool level here

          return unless reason

          @idle << __spawn_actor__
          signal :respawn_complete
        end
      end
    end
  end
end

(I'm using this now to handle my use case: https://gist.github.com/nickelser/9f2af7cdfcbc62737982)

Oh yes, I see your problem. trap_exit is used by Pool itself to maintain actors, so it does need to be patched to allow for a secondary handler as you're demonstrating in your gist.
Please do post a PR with an implementation as you've shown or similar. You do seem to be using the kind of injections being used in Pool and Supervision -- so nice adaptation.


RDKit does not support ChemAxon generic atom extension

Describe the bug
As opposed to the documentation (https://www.rdkit.org/docs/RDKit_Book.html#mol-sdf-support-and-extensions),
RDKit does not fully support the ChemAxon extension for generic atom types like AH (unless merely reading and writing counts as support).
The query gets lost when trying to match.
To Reproduce
from rdkit import Chem
from rdkit.Chem import rdChemReactions
from rdkit.Chem.Draw import MolsToGridImage
from IPython.display import display

if __name__ == "__main__":
    r = Chem.MolFromMolBlock("""
  MJ240100

  6  5  0  0  0  0  0  0  0  0999 V2000
   -0.4125   -0.7144    0.0000 A   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 B   0  0  0  0  0  0  0  0  0  0  0  0
    0.8250    0.0000    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    1.2598    0.7364    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.4125    0.7144    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.0348    1.5180    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  2  3  1  0  0  0  0
  2  5  1  0  0  0  0
  5  6  1  0  0  0  0
  3  4  1  0  0  0  0
A    4
AH
A    6
AH
M  END
""")
    mol = Chem.MolFromSmiles("[H]OB(O[H])C(C)C")
    p = mol.GetSubstructMatches(r)
    print(p)

Expected behavior
Match
Screenshots
If applicable, add screenshots to help explain your problem.
Configuration (please complete the following information):

RDKit version: 2023.9.6
OS: macOS 14 arm
Are you using conda? No

Hi @rachelnwalker
Thanks for chiming in!
I think I tried that and the problem is then, that it does not recognize COB(OC)C(C)C anymore.
AFAIU the ChemAxon extension to the end of the mol block should make sure that these atoms are recognized as AH instead.
...
A    4
AH
A    6
AH
M  END

But this does not work with RDKit, although it is described in the docs. Maybe I am using the syntax wrong?

Ah sorry @jpfeuffer, I didn't look at this close enough. I haven't seen the special queries after the bond block, I usually include them in the atom block like you did with the A. RDKit should accept the special queries defined in the Atom block.
The problem is that RDKit substructure matching doesn't match AH/QH/XH/MH to non-graph hydrogens (afiak, maybe there is an option I don't know about). The other ChemAxon atom queries should work. If you skip sanitization on your target structure,  it should work.

I get around this by doing two queries: one with the AH/QH/etc, one without that atom and instead requiring a neighbor atom to have at least 1 hydrogen. Maybe this enumeration would be helpful in MolEnumerator or something if its not already somewhere in RDKit.

In the general rdkit representation, hydrogens are suppressed (even coming from mol files)  The only way to properly handle queries that can match hydrogens or other atoms (i.e. AH) is to add hydrogens to your graph.  This can be done by not removing hydrogens from the input, or calling Chem.AddHs
>>> from rdkit.Chem import SmilesParserParams
>>> params = SmilesParserParams()
>>> params.removeHs = False
>>> mol = Chem.MolFromSmiles("[H]OB(O[H])C(C)C", params=params)
>>> mol.Debug()
Atoms:
	0 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb: S
	1 8 O chg: 0  deg: 2 exp: 2 imp: 0 hyb: SP3
	2 5 B chg: 0  deg: 3 exp: 3 imp: 0 hyb: SP2
	3 8 O chg: 0  deg: 2 exp: 2 imp: 0 hyb: SP3
	4 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb: S
	5 6 C chg: 0  deg: 3 exp: 3 imp: 1 hyb: SP3
	6 6 C chg: 0  deg: 1 exp: 1 imp: 3 hyb: SP3
	7 6 C chg: 0  deg: 1 exp: 1 imp: 3 hyb: SP3
Bonds:
	0 0->1 order: 1
	1 1->2 order: 1
	2 2->3 order: 1
	3 3->4 order: 1
	4 2->5 order: 1
	5 5->6 order: 1
	6 5->7 order: 1

or
>>> mol = Chem.AddHs(mol)
>>> mol.Debug()
Atoms:
	0 8 O chg: 0  deg: 2 exp: 2 imp: 0 hyb: SP3
	1 5 B chg: 0  deg: 3 exp: 3 imp: 0 hyb: SP2
	2 8 O chg: 0  deg: 2 exp: 2 imp: 0 hyb: SP3
	3 6 C chg: 0  deg: 4 exp: 4 imp: 0 hyb: SP3
	4 6 C chg: 0  deg: 4 exp: 4 imp: 0 hyb: SP3
	5 6 C chg: 0  deg: 4 exp: 4 imp: 0 hyb: SP3
	6 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
	7 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
	8 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
	9 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
	10 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
	11 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
	12 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
	13 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
	14 1 H chg: 0  deg: 1 exp: 1 imp: 0 hyb:
Bonds:
	0 0->1 order: 1
	1 1->2 order: 1
	2 1->3 order: 1
	3 3->4 order: 1
	4 3->5 order: 1
	5 0->6 order: 1
	6 2->7 order: 1
	7 3->8 order: 1
	8 4->9 order: 1
	9 4->10 order: 1
	10 4->11 order: 1
	11 5->12 order: 1
	12 5->13 order: 1
	13 5->14 order: 1

However, if you are looking for functional groups and the like, there are a lot of pre-made queries in Functional_Group_Hierarchy.txt
BoronicAcid			[$(B-!@[#6])](O)(O)		Boronic Acid		[#6:1]-!@[B:2]([O:3])[O:4]>>[#6:1][X].[B:2]([O:3])[O:4]
  BoronicAcid.Aromatic		[$(B-!@c)](O)(O)	Aromatic	[c:1]-!@[B:2]([O:3])[O:4]>>[c:1][X].[B:2]([O:3])[O:4]
  BoronicAcid.Aliphatic		[$(B-!@C)](O)(O)		Aliphatic	[C:1]-!@[B:2]([O:3])[O:4]>>[C:1][X].[B:2]([O:3])[O:4]

These are also available in the rdkit as a dictionary of name:smarts_mol. These don't care if H is in the graph or not.
>>> from rdkit.Chem import FilterCatalog
>>> hier = FilterCatalog.GetFlattenedFunctionalGroupHierarchy()
>>> hier
{'AcidChloride': <rdkit.Chem.rdchem.Mol object at 0x154485e70>, 'AcidChloride.Aliphatic': <rdkit.Chem.rdchem.Mol object at 0x154485c40>,  ...

>>> mol.HasSubstructMatch(hier['BoronicAcid'])
True
>>> Chem.RemoveHs(mol).HasSubstructMatch(hier['BoronicAcid'])
True

Oh I was so sure that I tried adding explicit hydrogens and the other notation. I probably missed the exact combination.
I can confirm it works.
Thanks a lot to you both!


Speech Synthesis

Goal(s)

Generating speech from text

Input(s)

Audio

Output(s)

Text

Objective Function(s)

TBD

See tasks/speech/speech-synthesis


⚠ ClamAV has degraded performance

In e7382b4, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 71 ms

Resolved: ClamAV performance has improved in dddd114.


Refactor the dcmparser module

The dicom parser (dcmpipe_lib/src/core/dcmparser.rs) is a giant file clocking in at over 1k lines, and it contains a few extra structs (like the errors, parser-builder, iterator implementation, and dataset wrapper modules). I think it would make sense to split this out into a separate module to keep the code manageable.
I think we could take dcmparser.rs and dcmparser_util.rs and move them into their own separate module simply called parser:
/core/parser/mod.rs -- this file should only re-expose things in the module to be public
/core/parser/builder.rs -- move the parser builder to its own file
/core/parser/dataset.rs -- the dataset wrapper modules can be moved here
/core/parser/error.rs -- move the error type to its own file
/core/parser/iter.rs -- the implementation of Iter<> could move to its own file
/core/parser/parser.rs -- the parser struct + impl
/core/parser/util.rs -- move the dcmparser_util.rs into here

The parser.rs file would probably still be nearly 1k lines but I think pulling out all the extra structs/impls would make it more easily digested.

Just submitted a PR for this, let me know what you think

All planned changes are done


variadic overload of std.algorithm.searching.countUntil should return which needle was found

greensunny12 reported this on 2017-07-11T16:07:21Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=17634
CC List

razvan.nitu1305

Description
Find does this already:

https://dlang.org/phobos/std_algorithm_searching.html#.find.4

> A tuple containing haystack positioned to match one of the needles and also the 1-based index of the matching element in needles (0 if none of needles matched, 1 if needles[0] matched, 2 if needles[1] matched...). The first needle to be found will be the one that matches. If multiple needles are found at the same spot in the range, then the shortest one is the one which matches (if multiple needles of the same length are found at the same spot (e.g "a" and 'a'), then the left-most of them in the argument list matches).

It would be convenient if countUntil would behave the same, but it's probably too late to change the return type, so the only way left is adding an optional `out` parameter.

dlang-bot commented on 2021-10-15T13:08:55Z
@wilzbach updated dlang/phobos pull request #5618 "Fix Issue 17634 - variadic overload of std.algorithm.searching.countUntil should return which needle was found" fixing this issue:

- Fix Issue 17634 - variadic overload of std.algorithm.searching.countUntil should return which needle was found

https://github.com/dlang/phobos/pull/5618

b2.temp commented on 2017-09-01T21:22:24Z
"dropExactly(c).startWith(...)" would allow to find the needle

also we can imagine a struct-based return type that doesn't break the current code:

struct countUntilResult()
{
ptrdiff_t pos; size_t index;
}


Cannot extract new html5 attribute data-role

The function sfToolkit::stringToArray is used to get the element properties in a jQuery way.
But the way the key of the attribute is extracted cannot handle the new html5 attribute data-role. The dash in the property is ignored, so the resulting attribute is wrong.
For example the following string '#myID.myClass data-role="content"' get the following properties :
id="myID"
class="myClass"
role="content"
As you can see the attribute "data-role" is evaluated as "role".
I have made a code modification in the stringToArray function to solve this issue. It would be great if it could be implemented.
Here is my code modification :
sfToolkit.class.php , function stringToArray line 277 :
Original :
\s*(\w+)              # key

Modified :
\s*(\w*\-*\w+)        # key

As you can see I have juste added the following
\w*\-*

to get the property data-role to be evaluated.
Sorry if my english is not perfect, it is not my native language.
What do you think of this issue ?

+1
I will make a commit and a testcase

Happy new year and happy diem usage :)

small update for that, attributes like data-foo-bar were not supported, it works now :)


Fixes Okta default scope

Describe your changes :

fix #6817

Type of change :

[x] Bug fix
[ ] Improvement
[ ] New feature
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] Documentation

Frontend Preview (Screenshots) :
For frontend related change, please link screenshots of your changes preview! Optional for backend related changes.

Checklist:

[x] I have read the CONTRIBUTING document.
[ ] I have commented on my code, particularly in hard-to-understand areas.
[ ] I have added tests that prove my fix is effective or that my feature works.
[x] All new and existing tests passed.

Reviewers

@open-metadata/ingestion

The cypress failure is not related to this PR, merging this.


Uglify test (to new branch)

Still need to push out to beta and do some performance tests. This creates a publish function that combines all of the js files into one and then minifies it using js::uglify_optimize. Combining means we go from loading 18 individual files to 2 (all.min.js and build_map.js). Minifying brings the combined file from 98 KB to 54 KB.
The build_map.js script still has to be standalone because it can't be loaded until after divs have been created (I took out some of the functions and put them in a secondary js that was bundled up called build_map_utils.js). This is why you see the script tag farther down the page.
Part of #358.

I see a 20~25% improvement in initial load time w/ this (emulating a 3G connection locally). :+1:

Note we also have 6 CSS files that are also taking up multiple connections and likely should be rolled up into one as well.

Interesting that all of the custom js (minus build map) is larger than the state borders topojson:

Neat that the borders are that small.

We really have 6? Huh wow, we do. I'll do some quick research into that separately.

yes, but note the 6 includes some (one or two?) that are coming out of the vizlab package.

actually, 4 are from vizlab. This viz only has custom.css and map.css

OK, merging. Any CSS bundling will come separately.


Accordion doesn't pass through open attribute

As the accordion is based on the HTML details element, it would be great if the open attribute could be used on db-accordion to have the accordion toggled open on load.
Currently not working:
<db-accordion summary="Test" open>Content</db-accordion>

Working with Core:
<details class="cmp-accordion" open>
  <summary>Test</summary>
  Content
</details>

<3


Aligner shows null values when reopened and Accepted

v2.0.0 build a2a20c1 QA.
Aligner screen goes blank with null values when it is fully aligned and user Clicks on Accept.
Steps to replicate:

Click on the Alignment link icon, It opens up the aligner screen or a list of verses(in case of Reference ranges, choose the verse).
If the alignment is all complete, click on Accept. Note that the Broken alignment link is shown for that verse.
Open the Aligner again and note that the screen has null values.

Note: It works fine if user clicks on Cancel button instead of Accept.
https://images.zenhubusercontent.com/310359593/2f880541-dfa2-4d7f-8344-e1f784a223ad/screen_recording_2023_04_25_at_11_17_27_am.mov

@kintsoogi looks good in the deploy preview link. Not seeing the Aligner going blank on switching between verses or scriptures.

Looks good, that seems like it fix the problem. Tested with v2.0.0 build ee140bd QA.

@danielklapp This was in the review column, but it looks like you approved it so I moved it to in QA since I am not certain where it should go. @elsylambert

@PhotoNomad0 We did approve it, and shortly after kintsoogi and Abel discovered that the verse and alignment data wasn’t updating correctly on book & chapter select. We decided to put it back in review column since that bug was introduced after the fix. I'll take another look at it.

@danielklapp OK that is a confusing case.  But I would suggest that QA fail would be a better spot to draw attention to something being broken.

@PhotoNomad0 Ok that’s good to know, thanks. After testing several times with v2.1.0 build 5c24985 QA it seemed to work fine. Last time testing in case of reference ranges I was able to recreate the failed scenario. Maybe we can move it to our QA Watchlist @elsylambert.

Not seeing this issue in v2.0.0 build c8df80d QA at https://release-v2-0-0--gateway-edit.netlify.app/. so Passing this issue.

I figured out a scenario to recreate the aligner showing null values after reopened and accepted. It happens after messing with the list of verses in reference range. Then right after go to a single verse outside of reference range, click aligner button and just accept. The verse turns to null and then everything in aligner is null. Here’s a video of that. I'm testing with v2.0.0 build c8df80d QA.
https://github.com/unfoldingWord/gateway-edit/assets/82067076/2a905d27-001e-4cd9-ab95-1a18b0cf950e

@kintsoogi after your merge I'm not seeing this issue anymore. Looks like that fixed it. Tested with v2.0.0 build e8a3884 QA.


refactor(core): remove deprecated APIs for v11

Removes the deprecated APIs for v11 from material/core. Also fixes that the MDC-based form field doesn't support the global floatLabel option.
BREAKING CHANGES:

MAT_LABEL_GLOBAL_OPTIONS from material/core has been removed. Import MAT_FORM_FIELD_DEFAULT_OPTIONS from material/form-field instead.
FloatLabelType from material/core has been removed. Import FloatLabelType from material/form-field instead.
LabelOptions from material/core has been removed. Import MatFormFieldDefaultOptions from material/form-field instead.
MAT_DATE_LOCALE_PROVIDER has been removed, because it is no longer needed since MAT_DATE_LOCALE has been changed to a scoped injectable. If you are importing and providing this in your code you can simply remove it.
MatLineSetter class has been removed. Use the setLines function instead.
hammer property from GranularSanityChecks has been removed, because it isn't being used anymore.
document parameter of the MatCommonModule constructor is now required.

@crisbeto Please resolve this merge conflict

Rebased.

@crisbeto I think the recently merged mdc_select was using MAT_LABEL_GLOBAL_OPTIONS can you switch it to MAT_FORM_FIELD_DEFAULT_OPTIONS?

Fixed.


refactor, optimization, and replacement of socket.write with mmap file

Lots of changes to the library here after many benchmarks and test. Don't know if it's perfect yet but it would be good for someone else to try it out. Some notes:

cleaned up most of the code while implementing ES6
using a mmap file (mmap-object lib) for writing to spawned processes
mmap file is saved and then removed from /tmp (special events may prevent the removal)
removed lodash and it's vm usage, not sure if this is currently in use
removed the sandcastle code coverage since the blanket patch needs a patch to handle ES6 better
test has been updated in the losant-platform branch SP-2556-rawFunctionNodePerformance

I ran the losant tests with this branch, it left the following in tmp:
0 Nov 12 11:57 sandcastle_0.sock=
0 Nov 12 11:57 sandcastle_1.sock=
0 Nov 12 11:57 sandcastle_2.sock=
0 Nov 12 11:57 sandcastle_3.sock=
5242880 Nov 12 11:54 shared-3c4qbxio7aj2
8448000 Nov 12 11:54 shared-3ccqbxnol5yx
8448000 Nov 12 11:54 shared-3clqbzdnww29

is this ready for more review again?

good for review


Setting Trust Level of Installed Keys

Hi,
There doesn't appear to be any way to set the trust level of installed keys when using this module to add gnupg keys.  This can be necessary if, for example, gpg public keys are being installed which are going to be used to encrypt files (in which case, gpg likes the public keys involved to be trusted).
Could we adapt the module to allow setting of trust levels via a parameter to the gnupg_key type?
Something like:
  gnupg_key {
    'mykey - public':
      ensure      => present,
      key_id      => 'a2b4c6f8',
      user        => 'root',
      key_content => "-----BEGIN PGP PUBLIC KEY BLOCK-----
      ...
-----END PGP PUBLIC KEY BLOCK-----",
      key_trust   => 6,
      key_type    => public;
}

The --import-ownertrust gpg command could be used, to this end.
Ref: https://www.gnupg.org/documentation/manuals/gnupg/Operational-GPG-Commands.html#option-_002d_002dexport_002downertrust

Sure we can add this parameter. I can have a look in the next week or if you have time you can create a PR.

@n1tr0g I did some initial work on it, have attached a PR.  I have not fully tested it, I just wanted to get some progress and see what you thought of the approach.
There are no tests (should we add some?) and there is no verification that an existing key is set to the right trust level (I'm not sure how to approach that).  Trust level is just set on initial key addition.

@dgolja Any update on this?


--stdout should print a single token and exit

Hi, first of all, this tool is fantastic and has made my life a lot easier - so thanks for that!
I think the --stdout flag would be more useful if its behavior was changed to only output a single auth token, and then exit. No bells and whistles of mutating your pasteboard. This would make automating with other tools more useful, and is also more standard since it's what the --stdout flag usually does in a program.
An example of where this is useful is with CLI tools that use MFA tokens. If you have MFA and you need to auth you can use command substitution to do this, eliminating the step of needing to paste the code.
$ program login --mfa-token $(twofa get code)

Hi @c-bandy, thanks for the feedback. Very happy this is useful to others.
This is a good point. I agree that a command line utility should be composable and behave predictably.
I use the mutating pasteboard heavily myself, so I'll take a look, and see how I could refactor this to accomodate both use cases.

@kirsis Maybe the --stdout flag can have the behavior I describe, and passing --show-token will have the current behavior of --stdout?

Hello, we used complex passwords, where OTP is part of password. I used before:
oathtool --totp -b ${OTP_TOKEN}

Your tool is great, cos it used Touch ID. Will be nice to have some behariour as oathtool, without any interractive modes. Simple print token and exit.

fwiw
def twofa(user, account):
    resp = deque(maxlen=6)
    with popen(f'twofa get --stdout {user}@{account}') as p:
        while 1:
            resp.append(p.stdout.read(1).decode())
            code = ''.join(resp)
            if re.match(r'[0-9]{6}', code):
                return code

    return None

Exactly the tool I was looking for and so glad I didn't have to write it myself! Thanks! Just wanted to add another vote to this issue. I need to include this in other automation scripts. Doesn't matter to me what flag is used or if one is used at all, but this behavior of printing one code and exiting is an absolute necessity.


Account for eresources in catalog_date

The current implementation for get_catalog_date in the AlmaAdapter does not take into account eresources (AVE fields). See https://github.com/pulibrary/marc_liberation/pull/1112
We decided to delay the processing of AVE fields until the Alma API has a mechanism to get the "activation_date" for AVE records in one API call rather than one call per portfolio. ExLibris has indicated that they will add this feature around May/2021 (see https://3.basecamp.com/3765443/buckets/20717908/messages/3475344037).
In the meantime this ticket is marked as blocked.
See original ticket https://github.com/pulibrary/marc_liberation/issues/925 for more details.

I'm removing the block label because according to the timeline exlibris would have released the update we required; anyone picking up the ticket will need to check!

closing in favor of #1478


Update from-gogs.en-us.md

Updated upgrade from gogs instructions. This is for binary, however should work for others as well.

Made the changes requested by tboerger, apologies again for the lengthy delay.

conflict

Depricated in favour of #61 ?

Why? 61 is the same thing with less detail from what I can see. Up to you
guys. Let me know.
On Jan 9, 2017 11:44 AM, "bkcsoft"<EMAIL_ADDRESS>wrote:

Depricated in favour of #61 https://github.com/go-gitea/docs/pull/61 ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/go-gitea/docs/pull/42#issuecomment-271387267, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AEklXs5-HfHD_QvdufNvpCOpBwYIe1Dxks5rQo46gaJpZM4LXDQy
.

seems conflict with #61

Looks like #61 has been merged, o well I will try again in the future. Thanks for helping guys!

https://github.com/go-gitea/docs/pull/61 have been merged to master, this PR targets the release/v1.0 branch. These branches should be properly in sync.

#68 was merged into v1.0 is this dead, should I close?

Please close this one. @termlimit Thanks!

No problem on the close. Good call, between this being first contribution as well as my move and work. Just was unable to provide a resolution in a timely manner. I did learn a lot and I appreciate all the feedback.


Printing out notions

Print out the notions in the order of appearance in the diagnose file.

Implemented in v0.2.3


bottleneck version

Not sure if this is possible to specify in the setup.py as bottleneck is not required. However, if bottleneck is used it should probably be in version 1.0. For version 0.8.0 I get the following error:
>>> move_mean() got an unexpected keyword argument 'min_count'
Feel free to close.

Setuptools has the concept of extras_require but the application doesn't really work with our optional import of bottleneck (ref). I think what may work here is to check the bottleneck version on import and raise a warning if the version is not sufficient for all the functionality we use it for.
So here may look something like:
try:
    import bottleneck as bn
    has_bottleneck = True
    if bn.__version__ < 1.0:
        warnings.warn('insufficient bottleneck version...')
except ImportError:
    # use numpy methods instead
    bn = np
    has_bottleneck = False

Alternatively, we could raise an error or fall back to use the numpy methods.

At the least, we should probably list this requirement on the installation page.

see #1190 for a belated fix for this issue.


Separate non-authorized APIs of the UserController into a new controller in the TodoTemplate project

Currently, both authorized and non-authorized APIs exist in the UserController. it is better to separate these APIs and put the non-authorized (AllowAnonymous) ones into a new controller named AuthController.

@ysmoradi


Print help on run_mosaic_trainer.py, cleaned up verbosity.

Moved the datadir onto trainer hparams to avoid an UnusedArgumentWarning
Setting the default loglevel to warning
Cleaned up warnings to not print a useless extra second line showing the source code of the warning.warn call
Cleaned up the launch script to be not-very-verbose by default; but added a -v option for verbosity.
If run_mosaic_trainer.py is run without args, then the help is printed.

Closes #88, #128

lgtm. I also have a preference for fstrings instead of old python2 format. Even if wanting to put args at the end, I think I'd still prefer

FYI here is the convention: https://docs.python.org/3/howto/logging-cookbook.html#formatting-styles

lgtm. I also have a preference for fstrings instead of old python2 format. Even if wanting to put args at the end, I think I'd still prefer

FYI here is the convention: https://docs.python.org/3/howto/logging-cookbook.html#formatting-styles

I don't think we need to follow this convention although it does save one evaluation call.  %s does lead to bugs when you are printing tuples and items such as that.  Becomes more confusing in terms of readability as well


readme: remove Dependency CI

It's been 5 months of pending builds: https://dependencyci.com/github/GoogleCloudPlatform/google-cloud-node?page=23
And if you go before that, we always had failed builds because of things we can't control-- dependencies of dependencies of dependencies, etc. Is it cool to remove this?
cc @lukesneeringer

Coverage remained the same at 100.0% when pulling 92afbf0ed92e5944ea11fa9029c30e76ec9adca4 on stephenplusplus:spp--remove-dependency-ci into 5883af7c1ffccfae644683d8d45acf1d62c544bf on GoogleCloudPlatform:master.

👍


[Improvement] Add more sales data

I'd like to add more sales data but loading via SQL through Trino is slow. Is there a better way to load more data?

Perhaps something like this?
load data local inpath '/tmp/customers.csv' overwrite into table sales.customers;
load data local inpath '/tmp/sales.csv' overwrite into table sales.sales;
customers.csv
sales.csv


⚠ Bofrost.com has degraded performance

In a4b00a8, Bofrost.com (https://www.bofrost.com) experienced degraded performance:

HTTP code: 200
Response time: 1289 ms

Resolved: Bofrost.com performance has improved in 2db1cff after 6 minutes.


Add - Comics Valley (NSFW)

Source name
Comics Valley
Source link
https://comicsvalley.com/home-3/
Source language
English
Other details
(and they also upload comics in other languages)
only adult comics
18+/NSFW = yes
Acknowledgements

[X] I have checked that the extension does not already exist by searching the extension listing and verified it does not appear there.
[X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
[X] I have written a meaningful title with the source name.
[ ] I have admitted that I am a clown by having checked this box, as I have not read these acknowledgements.
[X] I will fill out all of the requested information in this form.

Ok, I understand that someone requested an extension for the Hindi language, but the page is written in English. Therefore, I would humbly request that you include them in the English extensions section.
Also, when installing the extension in Hindi I found that the first two categories do not work. I hope you guys can fix it. (I add the screenshots of the first two categories that do not work)
1°

2°

3°


workflow, handle missing state name

For some reason, some of my stories do not appear to have state
name. This is most likely a bug (either with this mode or the
API), regardless of the missing name should be handled gracefully.
Without the if guard, I would get an error because s-upcase does not handle nil.

cool


Create generic, smooth API interface

Description
Adds three generic functions that cover a broad variety of API responses:

apiSingleResponse<T>. This is when the JSON response is a flat mapping of keys that corresponds to a single object, and we want to extract the information from the response and map it onto a type we use in the Typescript app.
apiSplitResponse<T extends any[]>. This is when the JSON response is an object with multiple keys, and each key corresponds to a type. The function is used with a tuple type, eg apiSplitResponse<[Group, User]>(...)
apiCollectionResponse<T>. This is when the JSON response is an array of objects, all of the same type; the function returns any array of objects of type T.

This makes adding new API endpoints very, very easy; all you have to do is define a type, define a mapping if any of the keys are different cases, and call one of the generics.
Issue
ch<fill_in_issue_number>
Test plan
Right now it's kind of tested ad hoc, with the existing api interfaces.

General questions:

Is apiSingleResponse a special case of apiSplitResponse, and if so, can they be collapsed?
What happens if the response is an array of composite objects a la apiSplitResponse?

Hmm, apiSingleResponse` expects a the root JSON object to represent the type, something like

{
    -key1
    -key2
}

whereas apiSplitResponse expects the JSON structure to look like
{
    -type {
        -key1
        -key2
    }
}

so they don't match up one to one. We could add a branching statement in a collapsed function to use one or the other pattern depending on the number of mappings passed in, but since we return a tuple with a single value in it which then has to be destructured (not bad, but not intuitive); I'm not sure it's possible to return a union type where one is a subtype of the other but that would require casting the return object to the single type anyway. In short, I don't think it would be saving any code and it makes for a nicer dev experience to just be able to call one or the other.

that is not supported by any of the functions, but definitely doable. I can't think of why we would ever return an array of compose objects though, instead of different arrays under their own keys.

Ok, realized we don't have an API endpoint that returns only a single object. So I'm not sure what that should look like :) but I think the point about having more useful experience with them in two different functions stands.

You can already call apiSplitResponse with just one type in the tuple and it should work, though.

Philosophically, it's probably the right thing to return an array.  We should always return keyed responses so we can extend the API.  I'm less certain if we should wrap everything in an extra object for consistency.
e.g.,
{'response': [my_magic_array]}

Now does that mean for singletons, we do this?
{'response': {my_object}}

Would it be possible to show a short example of each? (Like what Tony started above)
Generally agree that we should always return keyed responses for the sake of any bioinformaticians that may want to contribute or adapt down the line.

Philosophically, it's probably the right thing to return an array. We should always return keyed responses so we can extend the API. I'm less certain if we should wrap everything in an extra object for consistency.
e.g.,
{'response': [my_magic_array]}

Now does that mean for single objects, we do this?
{'response': {my_object}}

The first is how I'm most used to working with api responses, but I do see the second as having a lot of advantages! My thing with api's is just as long as the format is consistent across all types of requests things are setup well.


feat(useClick): add ignoreKeyboard option

When is this needed?

When is this needed?

When write a searchable and disable closeOnSelect option Select Component.
because need focus on search input, so need keep keyboard event on reference dom.
source example: https://github.com/huijiewei/agile-ui/blob/main/packages/react/src/select/Select.tsx

If the reference is an input (combobox), shouldn't useFocus (w/ keyboardOnly disabled) be used instead of useClick?

Select component with searchable need click open option menu, not need focus open menu. can try React Select: https://codesandbox.io/s/codesandboxer-example-forked-g7ei5v ,it's events very awesome. now i need same action with closeMenuOnSelect.
sorry my english.

The selector component needs to be clicked on to close it. Clicking on it with the closeOnSelect property on is still valid, but keyboard actions should be ignored.
For example, the behavior of the React-Select component is the effect I want。
https://codesandbox.io/s/codesandboxer-example-forked-g7ei5v?file=/example.tsx:1443-1460

Does disabling toggle option work?

If toggle is disabled, the original behavior on the reference is disabled

@huijiewei can you make a demo of this on CodeSandbox (minimal repro) of what you want? I'm lost
Regardless, I think this option should be addKeyboardHandlers or something (which is set to true by default) because this ignoreKeyboard behavior won't work for <button> elements.

You are right, I use the option name ignoreKeyboard just to correspond to ignoreMouse, addKeyboardHandlers or other option names are more suitable, later I will submit a minimum example, the code is more

mini demo :https://codesandbox.io/s/hardcore-khayyam-11lv3h?file=/src/App.tsx

So to clarify:

useFocus isn't suitable because you don't want the floating element to open right away when tabbing into the input?
toggle: false in useClick isn't suitable because you don't want pressing Enter while on the input to open the floating element?

As far as I can tell those are the only differences with your custom click solution

yes, i don't need focus open.
if toggle set false, the mouse click can't toggle open and close.

i want to third(closeOnSelect is off and use ignoreKeyboard) demo.

Okay I see. It's fine to merge if this option name is changed to keyboardHandlers: boolean

Thanks.


Future proofing

Is your feature request related to a problem? Please describe.
When we create a test double (stub, mock, other...) for a class which defines a method that returns a future, it is tempting to use Mocktail to return a canned future. This is a good approach to improve speed and reliability. Yet it must be arranged in a careful way to avoid complications.
Mocktail should prohibit developers to return a canned future with .thenReturn(). Instead, developers should be advised to use .thenAnswer().
Indeed, as Futures don't have a "start button", they run soon after they are instantiated. In the context of a canned future for tests, they are unfortunately likely to complete before our production code asks for the future.
Since await doesn't yield/block when applied to a completed future (it just unpacks the value), we write asynchronous code but run it synchronously from our tests. In short, we believe the production code is tested when we are actually testing a different program.
In my case, this led to many race conditions and an overcomplicated solution to address these race conditions.
Describe the solution you'd like
My suggestion is to throw an error from within .thenReturn() when the argument is of type Future. The error, may provide a brief explanation as to why it's a mistake, and a suggestion to use .thenAnswer() instead.
This is what I changed in a fork of your repository and have been running it successfully for a few days now. I did find that 42 out of ~150 tests were making this mistake.
Provided that in rare cases it is perhaps desirable to return a completed Future, Mocktail could provide a distinct method to allow this, even though it should be discouraged. Perhaps the name of that method will leave no doubts?
Describe alternatives you've considered
None besides being careful and consistent.
Additional context
The docs of SynchronousFuture warn us but are not very well connected to your library:

In general use of this class should be avoided as it is very difficult to debug such bimodal behavior.

I also assume that alternatives to Mocktail expose their users to a similar issue.

This has been addressed by #22 and is available in v0.0.2-dev 🎉

Hi @felangel ,
I don't think #22 addresses it. Doing .thenReturn(Future(() => "a value")) is still going to schedule the future right now, and quite possibly make it complete before the stub is exercised by the production code. Then, the production code will get a completed future, thereby making it run ~asynchronously~ synchronously.
Have I missed anything? If so, can you explain?


How to create an instance of ParseServer, and mount it on a new or existing Express website?

No clue about it.
I've searched for some tutorial, most of them are "git clone https://github.com/ParsePlatform/parse-server-example", modify mongo_uri, masterkey blabla, then npm install & npm start. I tried it and it runs successfully.
While I have no idea about how to create an instance from this parse-server project. (I think parse-server-exmaple is an instance of ParseServer, right?)

The example is pretty concise, you can use it in an existing server like so:
npm install --save parse-server
import { ParseServer } from 'parse-server';

app.use('/parse', new ParseServer({
    databaseURI: process.env.MONGODB_URL,
    cloud: path.resolve("./dist", "cloud.js"),
    appId: 'myAppId',
    masterKey: 'mySecretMasterKey',
    fileKey: 'optionalFileKey'
});

I would refer to you the parse-server-example repo, or the various guides from Heroku and Digital Ocean available on the wiki.


Remove hard coded top level Frame

Svelte native uses a top level implicit Frame. It requires this due to how the css is managed for the application. It was pointed out that there are some undocumented css methods that might be used to remove this requirement
https://github.com/NativeScript/NativeScript/blob/master/nativescript-core/ui/styling/style-scope.ts#L316
Note "Keep in mind that these methods (if I remember correctly) don't automatically refresh the styling, So you may need to call _onCssStateChange on the root view/the view you're changing."

Looks like it used to be there to support frame level styles. This was changed to global styles in this commit so we can remove the default frame to fully support sidebar
https://github.com/halfnelson/svelte-native/commit/1f3dbef8e34c8fc8e0a74697c6c1bf50efaa6a11#diff-36a65663f84a274bb9496e96b3fc473bR15


[release-1.0.1] Bump Contour to v1.19.1

Closes https://github.com/knative-sandbox/net-contour/issues/648.
Question: is v1.0.1 the next version we want for net-contour?

/retest

Question: is v1.0.1 the next version we want for net-contour?

No, the next version is v1.1 and I think you just need to send the PR against main branch as it was not cut yet.

Gonna try to fix this by opening a new PR.

See: https://github.com/knative-sandbox/net-contour/pull/689#issuecomment-993863919.


multiple ping sensors

I see in the readme as known bug multiple targets are not supported. What does this exactly mean?
What I try to use is:
- platform: ping
  ip_address: <IP_ADDRESS>
  update_interval: 120s
  num_attempts: 6
  timeout: 1sec
  latency:
    name: WAN Latency
    icon: mdi:console-network-outline
    accuracy_decimals: 3
  loss:
    id: loss_wan
    icon: mdi:console-network-outline
    name: WAN Packet loss
- platform: ping
  ip_address: <IP_ADDRESS>
  update_interval: 120s
  num_attempts: 2
  timeout: 1sec
  loss:
    id: loss_gw
    icon: mdi:console-network-outline
    name: GW Packet loss

So one sensor is for <IP_ADDRESS>, the other one is for <IP_ADDRESS>. Is this supported or not?
I experienced reboots of the ESP32 (with Ethernet) every 1-2 hours...

please enable debug log level, provide the full configuration and logs.

"multiple targets are not supported" means that multiple targets are not supported. my use case needs a single target, and i wrote the code for that.


added link to NFT wiki on home page

Thank you for your contribution to the KodaDot NFT gallery.
👇  _ Do a quick check before the merge.
PR type

[ ] Bugfix
[X] Feature
[ ] Refactoring

Before submitting Pull Request, please make sure:

[X] My contribution builds clean without any errors or warnings
[X] I've merged recent default branch -- main and I've no conflicts
[X] I've tried respect high code quality standards
[X] I've didn't break any original functionality
[X] I've posted screenshot of demonstrated change in this PR

Optional

[ ] I've tested it at </rmrk/collection/26902bc2f7c20c546a-1FVG7>
[ ] I've tested PR on mobile and everything works
[ ] I found edge cases

What's new?

[ ] PR closes #<issue_number>
[X] <added a button on the home page that takes the user to https://en.wikipedia.org/wiki/Non-fungible_token to teach them about what NFTs are>

Had issue bounty label ?

[ ] Fill up your KSM address: Payout

Community participation

[ ] Are you at KodaDot Discord?

Screenshot

 [] My fix has changed something on UI, a screenshot for others, is best to understand changes.

okay, this is cute!

let's grab some issue from our issues to get bounty!


Parse Rest schema to detect mistyped labels/metrics in templates

https://github.com/NetApp/harvest/pull/1231#discussion_r955245205

Perhaps add to harvest doctor

Covered in existing unit tests and CI


chore: Add github actions for integration tests

Description

Changes proposed in this pull request:

Add integration jobs to new "integration" GH action job
Add lint manifests to "governance" GH action job
Add golangci linting to new static "code checks" GH action job
Add unit tests to new static "code checks" GH action job
Splitted k3d provisioning into provision and image build
Download golangci-lint  binaries now
Added slack notification for gardener job

Related Issues and Documents

Closes:
Related issues:
https://github.com/kyma-project/telemetry-manager/issues/480
Traceability

[ ] The PR is linked to a GitHub Issue.
[ ] New features have a milestone label set.
[ ] New features have defined acceptance criteria in a corresponding GitHub Issue, and all criteria are satisfied with this PR.
[ ] The corresponding GitHub Issue has a respective area label.
[ ] The follow-up issues (if any) are linked in the Related Issues section.

Testability
The feature is unit-tested:

[ ] Yes.
[ ] No, because unit tests are not needed.
[ ] No, because of ...

The feature is e2e-tested:

[ ] Yes.
[ ] No, because e2e-tests are not needed.
[ ] No, because of ...

Tests conducted for the PR:

Codebase

[ ] My code follows the Effective Go style guidelines.
[ ] The code was planned and designed following the defined architecture and the separation of concerns.
[ ] The code has sufficient comments, particularly for all hard-to-understand areas.
[ ] This PR adds value and shows no feature creep.
[ ] I have augmented the test suite that proves my fix is effective or that my feature works.
[ ] Adjusted the documentation if the change is user-facing.

/retest

/retest

/retest


Adds Elasticsearch 5.x support via storage type: elasticsearch-http

This allows use of Elasticsearch 5.x and its notable ingest pipeline
feature when using zipkin-storage-elasticsearch-http.
It is important to note that zipkin-storage-elasticsearch remains
pinned to ES 2.x libraries as they are compile incompatible with 5.x.
In other words, you must use http if you want to use ES 5 (for now).
Version detection is implemented in order to choose the coirrect index
template format for the major version number. The implementation of
such is string manip, as it was less work than making a new type.
This adds a new parameter ES_PIPELINE which allows you to manipulate
the json sent by Zipkin collector before it is indexed. This could be
used for many things including cleaning service names or adding ingest
timestamps.
Integration tests run version 2.x on CircleCI and 5.x on Travis
Fixes #1312
Fixes #1318

cc @openzipkin/elasticsearch and @dragontree101 @dan-tr @shakuzen and @mansu particularly (as they had a lot of interest here)

circleci died trying to start elasticsearch 5, so swapped and have travis running it (which has more resources)

here's the playbook I used to test this.
Install elasticsearch 5 by downloading and running it
$ curl -SL https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz | tar xz
$ elasticsearch-*/bin/elasticsearch

Add a custom pipeline to it
$ curl -X PUT -s localhost:9200/_ingest/pipeline/zipkin -d '{
  "description" : "add collector_timestamp_millis",
  "processors" : [
    {
      "set" : {
        "field": "collector_timestamp_millis",
        "value": "{{_ingest.timestamp}}"
      }
    }
  ]
}'

Start zipkin, pointed at that pipeline
$ STORAGE_TYPE=elasticsearch ES_HOSTS=http://localhost:9200 ES_PIPELINE=zipkin java -jar zipkin-server/target/zipkin-*exec.jar

Add some traces (ex using one of the examples), then check the resulting index
$ curl -s localhost:9200/zipkin-2016-11-15/_search|jq '.hits|.hits[]|._source.collector_timestamp_millis'


Question: Is it possible to change days of the week order?

Found it, need to change firstWeekday of Calendar instance

how ?


Fixing bug where on first rotation, can cause menu to change to a nei…

…ghboor view controller on it's own

Simple enough! LGTM


[CP] When shutting down chrome, guard the call to ChromeConnection.getTab

Issue Link
https://github.com/flutter/flutter/issues/153064
Target
stable
Cherry pick PR Link
https://github.com/flutter/flutter/pull/154380
Changelog Description
Prevents CLI crashes when shutting down after running a Flutter app on a browser.
Impacted Users
All Flutter for Web developers
Impact Description
Impacts development during flutter run -d <browser> workflows. Noisy crashes are generated in scenarios where the CLI tool cannot communicate to the browser (e.g. because the user closed the browser before the app finished bootstrapping).
Workaround
No. There is nothing to do but to ignore the crash output.
Risk
low
Test Coverage
yes
Validation Steps
Create a Flutter app that targets the web. Run flutter run -d chrome. Once the app has finished running., press q to quit. The CLI should terminate without a crash.

Approved in https://github.com/flutter/flutter/pull/154380


Enhanced Interactive Ruby Environment

Then if the Ruby team is unwilling to develop a IDE for end-users and developers to program in.  Then, perhaps you might want to build a Enhanced Interactive Ruby Environment with all the bells and whistles of GNU Emacs, or stand-a-lone IDEs.

@AGoh2019 Feel free to put your hand on something like this, but for RubyInstaller it's beyond the project scope.


The Levenshtein distance (Edit distance) Problem in Python

Information about Algorithm

The Levenshtein distance between two words is the minimum number of single-character edits (i.e., insertions, deletions, or substitutions) required to change one word into the other
Have you read the Contributing.md and Code of conduct

[x] Yes
[ ] No

Other context

I have noticed that Python section doesn't have this problem, could you please assign it to me?
Regards

i would like to work on this,please assign it to me


Running two instances seems fine, but is not.

First of all: great simple software.
I am having just one minor inconvenience:
When one instance is already running, and I am trying to start another one there are two problems:

When in the same directory it complains about output.pdf already existing
When running in a different directory it seems to work fine at a first glance, but:
The server fails to bind to the port (which is immediately printed to and cleared from the console), suggesting everything is fine,
while only the previous instance is accessible on localhost:5999

Suggestions on how to fix it:

Is creating the output.pdf in a tmp folder a bad idea?
Should typst-live even create an output.pdf or can this be hidden behind a cmd option? For my part I only use it as a previewer only.
This can actually interfere with file syncing, as changes to output.pdf might keep getting synced, inflating the number of versions
To implement this feature (this lib) could be used
Could typst-live just search for the next open port and bind to that?
Maybe searching these ports first
This could again be hidden behind another cmd option

There was an option to use a different port with --port argument but I changed it so now it looks for an open port if default is not available. See CHANGELOG.md


Add Reaction time challenge python file

A python GUI to compare your reaction time with your friend.

update project_doc.md file with the description of your project or add another readme file in your project folder and raise another PR.


adding player names to end-level feedback

What's this PR do?
A lot has been changed, but the basic functionality of this PR is simple. It:

Adds a new feature: at the end of each level, all players receive a message telling them which players answered correctly (there's a flag right now to make sure this feature only appears for the story id of 301.)
Adds tests for this feature.
Adds a new small module with string helper functions (obscenity checkers, etc.). When players enter their names, our apps now add a character limit (10 chars) and check for obscenities. Player names are also now added to user profiles on mobile commons with a more elegant syntax: "Tom, Barry, & Andrea" instead of "Tom, Barry, Andrea".

Where should the reviewer start?
Files to pay attention to:

playerNameHelpers.js - this is where the endLevelMessageWithSuccessPlayerNames.js function is actually written, handling the meat of the end-level player name messaging logic.
SGcompetitiveStoryController.js, gameMessageHelpers.js, logicUserAction.js - have been modified to support the implementation of this feature.
competitiveStoriesConfigModel.js - modified to support the four new opt in paths required for the player name feature.

**Tests files changed

testHelperFunctions.js now supports checking end-level messages
GameAlphaStart.js tests the validity of player name messages during the onboarding process.
BullyText2015ABTest.js tests the validity of end-level player name messages.
_init.test.js starts the new tests.

Files to pay less attention to:

/string-validators/index.js, DonorsChooseDonationController.js - I moved the obscenity checkers out from the DonorsChoose library and into a new library.

How should this be manually tested?
npm test! I've manually tested this feature extensively with Postman creating a four-user game, but Alysha and @ArielSD will be QB-ing a manual testing strategy for this feature.
What are the relevant tickets?
Closes #434, #433, #432, #430.

I might have missed it when looking through this, what happens when this code runs on games that may not be setup to handle the personalized end-level messages? Does any special config need to happen?
Looking good :+1:

@jonuy the normal game runs for games not set up to handle end-level player name messages. (There's a flag set up to check that the game doc has a story_id of 301 before sending player name messages. Not the most ideal situation. I created an issue to make sure I stay on top of removing this flag once we know we want this feature for all games.)


Wiki: Removes unnecessary 'else' clause from README.md

See https://github.com/spotify/mobius/pull/115


GH-29 Implement in-memory Merkle trees

This PR is the in-memory implementation of GH-29.
The only commit distinctive to this PR is ff064ef.
I proposed changes upstream in order not to require forking the merkle tree library - see https://github.com/KrzysiekJ/gb_merkle_trees/pulls
Depends on PR #50 (included in this PR).
Depends on PR #49 up to commit 14ffcdc (included in this PR). When PR #49 is merged, I am happy to rebase.
Supersedes PR #52 .

You are missing type specifications.

@cytadela8 Thanks for your feedback. As this portion of code is not settled yet (e.g. PR 49 needs merge), I suggest to defer type specifications for the moment.


Text in terminal panel sometimes becomes invisible

VSCode Version: 1.40.1 (user setup)
OS Version: Windows 10 Pro 10.0.18362

Steps to Reproduce:

Run a long-lived process, such as ng serve in the VSCode terminal panel.
Keep working for a few hours with no issues, then come back to a terminal that looks like this:
Try closing the process and typing something: the inserted text is completely invisible, and only the caret is shown.

I'm still not able to reproduce this bug methodically but I can attest that it happens daily if not multiple times a day.
Hiding/showing the panel does nothing. The only working solution I've found is completely restarting VSCode.

Does this issue occur when all extensions are disabled?: N/A as I would have to use VSCode without extensions for several hours on end, and it's impractical as I need them to work.

/duplicate https://github.com/Microsoft/vscode/issues/69665


Transitive dependencies hoisted by rollup cause warnings when importing libraries with multiple chunks

Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
Yes
Description
In a project that has large parts split off into libraries (ng g lib), building the main application (which imports those libraries) I am drowned in a huge amount of warnings about imports being ignored because their packages are marked as having no side effects, e.g.:
▲ [WARNING] Ignoring this import because "dist/sioux/app/fesm2022/sioux-app.mjs" was marked as having no side effects [ignored-bare-import]

    dist/sioux/admin/fesm2022/sioux-admin-acl-editor.component-CbLkugjk.mjs:21:7:
      21 │ import '@sioux/app';
         ╵        ~~~~~~~~~~~~

  "sideEffects" is false in the enclosing "package.json" file:

    dist/sioux/app/package.json:59:2:
      59 │   "sideEffects": false
         ╵   ~~~~~~~~~~~~~

What appears to be happening is that rollup splits the library into multiple chunks and, while doing so, hoists transitive imports. An explanation of the background can be found here: https://rollupjs.org/faqs/#why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting
Apparently, it should be possible to prevent this hoisting by configuring the hoistTransitiveImports option for rollup: https://rollupjs.org/configuration-options/#output-hoisttransitiveimports
Yet, it appears that Angular won't let me add any custom configuration options for rollup. So, I wonder if hoisting of transitive imports shouldn't be disabled by default when building libraries in order to avoid these unnecessary warnings.
Unfortunately, I fail to produce a minimal example of a library that would be split into chunks and have its imports hoisted.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
▲ [WARNING] Ignoring this import because "dist/sioux/app/fesm2022/sioux-app.mjs" was marked as having no side effects [ignored-bare-import]

    dist/sioux/admin/fesm2022/sioux-admin-acl-editor.component-CbLkugjk.mjs:21:7:
      21 │ import '@sioux/app';
         ╵        ~~~~~~~~~~~~

  "sideEffects" is false in the enclosing "package.json" file:

    dist/sioux/app/package.json:59:2:
      59 │   "sideEffects": false
         ╵   ~~~~~~~~~~~~~

Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 17.3.3
Node: 20.12.2
Package Manager: npm 10.5.0
OS: linux x64

Angular: 17.3.3
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, localize, material
... platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.5
@angular-devkit/build-angular   17.3.3
@angular-devkit/core            17.0.5
@angular-devkit/schematics      17.3.3
@schematics/angular             17.3.3
ng-packagr                      17.3.0
rxjs                            7.8.1
typescript                      5.4.4
zone.js                         0.14.4

Anything else?
No response

Thanks a lot for the effort. Unfortunately, this does not appear to fix the issue. I have finally managed to produce a repo that I can publish and which exhibits the issue: https://github.com/schoel-bis/ng-build-warn
You can clone that, npm i, and then ng build @warn/time-messaging. Don't judge me by the code in that library, please: it is a contrieved mess constructed solely for the purpose. The multi-step lazy loading combined with Angular's DI (esp. the inject of the TimeMessagingService into TimeMessagingComponent) seem to play a role in the surfacing of this issue, though.
Now, over the last couple of days I tried a few things, including your fix. Unfortunately, ng-packagr does not even seem to ever call that particular piece of code. If you place a throw new Error() just above the place where you added the setting, nothing bad happens at all. That's because in writebundles.transform.ts it enters the if-block in line 31 and then returns from line 64. Somehow, the bundling/flattening happens before this (and the only call to rollupBundleFile in the entirety of ng-packagr that I could find). I wasn't able to figure out where it does, though.

With the fix applied, I was able to successfully clone your repository and build the provided libraries without any issues or side affectless import. Have you tried deleting your .angular directory before building? I also tested the fix with our internal framework, and I can confirm that all warnings have been resolved.

Oh, yes, after deleting the .angular directory the patch works as expected. That also explains why ng-packagr kept diverting into that if-block for me. Thanks for the tip.


Linting fails in the second condition of a ternary

From @ThinkDigitalRepair on December 29, 2018 4:28
Steps to Reproduce
Please tell us what you were doing and what went wrong
Using a ternary and needing to change the Variable type but only getting errors on the first operand.

After changing only one operand. This, I'm sure, should throw an error if it's ever false.

Version info
Please paste the output of running flutter doctor -v here (available from the command
line or from Tools > Flutter > Flutter Doctor). It will provide the version of the
Flutter framework as well as of the IntelliJ plugin.
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-US)
• Flutter version 1.0.0 at /Users/thinkdigital/development/flutter
• Framework revision 5391447fae (4 weeks ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /Users/thinkdigital/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/thinkdigital/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
• ios-deploy 1.9.4
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 30.0.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[!] IntelliJ IDEA Ultimate Edition (version 2018.3.1)
• IntelliJ at /Users/thinkdigital/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
• Dart plugin version 182.5124
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
[✓] VS Code (version 1.30.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.21.1
[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554                        • android-x86 • Android 8.1.0 (API 27) (emulator)
• iPhone X                  • 67D4E3CB-0E25-487C-A979-722757E1B383 • ios         • iOS 12.1 (simulator)
! Doctor found issues in 2 categories.
Copied from original issue: flutter/flutter-intellij#3002

Thanks for the report @ThinkDigitalRepair.
This is definitely not right and I can reproduce it.  Really neither of your examples should analyze cleanly (since ImageAsset is not a widget) but it looks like there's a hiccup in the way types are inferred in the ternary.  I'm going to move this issue over to the SDK for the analyzer folks to look at.
Thanks for the catch!

/cc @stereotype441 @bwilkerson
Here's a simplified repro:

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ClipOval(
              child:
                  _counter == 1 ? Image.asset("foo.png") : AssetImage("bar.png"),
            ),
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ),
    );
  }
}

It appears that _counter == 1 ? Image.asset("foo.png") : AssetImage("bar.png") is being treated as type Widget (and it shouldn't).

Thanks!
On Sat, Dec 29, 2018, 7:20 AM Phil Quitslund<EMAIL_ADDRESS>wrote:

/cc @stereotype441 https://github.com/stereotype441 @bwilkerson
https://github.com/bwilkerson
Here's a simplified repro:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
  appBar: AppBar(
    title: Text(widget.title),
  ),
  body: Center(
    child: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        ClipOval(
          child:
              _counter == 1 ? Image.asset("foo.png") : AssetImage("bar.png"),
        ),
        Text(
          'You have pushed the button this many times:',
        ),
        Text(
          '$_counter',
          style: Theme.of(context).textTheme.display1,
        ),
      ],
    ),
  ),
  floatingActionButton: FloatingActionButton(
    onPressed: _incrementCounter,
    tooltip: 'Increment',
    child: Icon(Icons.add),
  ),
);

}
}
It appears that _counter == 1 ? Image.asset("foo.png") :
AssetImage("bar.png") is being treated as type Widget (and it shouldn't).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dart-lang/sdk/issues/35517#issuecomment-450499736,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AV-HfUsWt_fKl-aClGt9QODoKEr0CexCks5u94g_gaJpZM4Zkm-7
.

The current behavior ('The argument type 'Object' can't be assigned to the parameter type 'Widget?'.') is just fallout from the Least Upper Bound of the two types in the conditional operator.


Updating the store with a different query could cause a query to fail due to missing fields

Closing in favor of #487


Move Wiki from prod-devel

Result can be seen at https://rshym.github.io/wiki

Thanks. This is a good job. But, this is not a wiki anymore. So I propose to rename "wiki" to "documentation". This applies to directory name and to mentions in text.

Thanks!
Acked-by: Volodymyr Babchuk<EMAIL_ADDRESS>

Ack is added.
Ready to be merged


#496 ensure file handles are closed on failure

Fixes issue https://github.com/jankotek/MapDB/issues/496 where file handles are not closed when StoreDirect can not be instantiated.

Merged into 1.0 branch. Will be in 1.0.8 release