[BUG] dask.array.linalg.inv fails on CuPy backed arrays

Linalg.inv appears to fail for the same general reason as #4898 . Filing this for visibility purposes in case others run into this issue before #4731 is resolved.
import dask.array as da
import cupy as cp
import numpy as np

np.random.seed(12)
arr = np.random.normal(10, 10, (1000,1000))
arr_cp = cp.asarray(arr)
darr_cp = da.from_array(arr_cp, asarray=False)
da.linalg.inv(darr_cp).compute()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-a9c479838e0d> in <module>
      7 arr_cp = cp.asarray(arr)
      8 darr_cp = da.from_array(arr_cp, asarray=False)
----> 9 da.linalg.inv(darr_cp).compute()

/conda/envs/rapids/lib/python3.7/site-packages/dask/base.py in compute(self, **kwargs)
    154         dask.base.compute
    155         """
--> 156         (result,) = compute(self, traverse=False, **kwargs)
    157         return result
    158

/conda/envs/rapids/lib/python3.7/site-packages/dask/base.py in compute(*args, **kwargs)
    396     keys = [x.__dask_keys__() for x in collections]
    397     postcomputes = [x.__dask_postcompute__() for x in collections]
--> 398     results = schedule(dsk, keys, **kwargs)
    399     return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
    400

/conda/envs/rapids/lib/python3.7/site-packages/dask/threaded.py in get(dsk, result, cache, num_workers, pool, **kwargs)
     74     results = get_async(pool.apply_async, len(pool._pool), dsk, result,
     75                         cache=cache, get_id=_thread_get_id,
---> 76                         pack_exception=pack_exception, **kwargs)
     77
     78     # Cleanup pools associated to dead threads

/conda/envs/rapids/lib/python3.7/site-packages/dask/local.py in get_async(apply_async, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, **kwargs)
    460                         _execute_task(task, data)  # Re-execute locally
    461                     else:
--> 462                         raise_exception(exc, tb)
    463                 res, worker_id = loads(res_info)
    464                 state['cache'][key] = res

/conda/envs/rapids/lib/python3.7/site-packages/dask/compatibility.py in reraise(exc, tb)
    110         if exc.__traceback__ is not tb:
    111             raise exc.with_traceback(tb)
--> 112         raise exc
    113
    114     import pickle as cPickle

/conda/envs/rapids/lib/python3.7/site-packages/dask/local.py in execute_task(key, task_info, dumps, loads, get_id, pack_exception)
    228     try:
    229         task, data = loads(task_info)
--> 230         result = _execute_task(task, data)
    231         id = get_id()
    232         result = dumps((result, id))

/conda/envs/rapids/lib/python3.7/site-packages/dask/core.py in _execute_task(arg, cache, dsk)
    117         func, args = arg[0], arg[1:]
    118         args2 = [_execute_task(a, cache) for a in args]
--> 119         return func(*args2)
    120     elif not ishashable(arg):
    121         return arg

/conda/envs/rapids/lib/python3.7/site-packages/scipy/linalg/decomp_lu.py in lu(a, permute_l, overwrite_a, check_finite)
    209     """
    210     if check_finite:
--> 211         a1 = asarray_chkfinite(a)
    212     else:
    213         a1 = asarray(a)

/conda/envs/rapids/lib/python3.7/site-packages/numpy/lib/function_base.py in asarray_chkfinite(a, dtype, order)
    493
    494     """
--> 495     a = asarray(a, dtype=dtype, order=order)
    496     if a.dtype.char in typecodes['AllFloat'] and not np.isfinite(a).all():
    497         raise ValueError(

/conda/envs/rapids/lib/python3.7/site-packages/numpy/core/numeric.py in asarray(a, dtype, order)
    536
    537     """
--> 538     return array(a, dtype, copy=False, order=order)
    539
    540

ValueError: object __array__ method not producing an array

I do have the NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=1 environment variable set for this test
import os
os.environ['NUMPY_EXPERIMENTAL_ARRAY_FUNCTION']
'1'

This is somewhat tangential, but are you sure that you want inv?  The inv function is almost never appropriate to call.  Perhaps you wanted to call solve instead?  It is usually much faster and more numerically stable.

It would be interesting to know more about the context where inv is used (if that can be shared).

Let's take that discussion offline unfortunately.

For the record, we'll need #4883 for this.

It sounds like this is less important.

Agreed. This does not need to be prioritized.

It seems like this can be worked on now, since #4883 is in.

Not really, this still doesn't work because dask.linalg is a module that relies mostly on SciPy, which today doesn't support NEP-18 and NEP-35. I think we'll need special-casing to handle things such as linalg.inv moving forward.


Feature: NFT Dutch Auction

Description
In this example, we will show the implementation of an NFT minting contract using a Dutch Auction, where the minting price follows a decreasing price curve.
Minting Details

The seller of the NFT deploys this contract with a startingPrice.
The auction lasts for a specified duration.
The price decreases over time.
Participants can purchase NFTs at any time as long as the totalSupply has not been reached.
The auction ends when either the totalSupply is reached or the duration has elapsed.

Criteria:

Price is denominated in IERC20 priceToken
Include comprehensive tests
Deploy the contract on a testnet

Ressources:

Solidity By Example - Dutch Auction

ODHack
To be eligible for additional rewards, be sure to review and follow the ODHack Common Guidelines and Contributing Guidelines.
Be sure to join the telegram group and introduce yourself.

c

I'll like to work on this

Hello @julio4 , I'm James Harrison, an experienced engineer and have built on the web2 and web3 space. I can work on this task effectively.

Kindly drop link to the StarknetByExample telegram group please.
@julio4

Hi @julio4, I'm a returning contributor from previous ODHacks (check my OD profile here) and I'd love to handle this issue.
In particular, I have experience porting Solidity code to Cairo as I did in Solidity EIPs to Cairo conversions such as ERC7496 and ERC7498.
I will study the Solidity by Example code and carefully replicate it using Cairo and OpenZeppelin ERC20/ERC721 implementations.
I will replace the Solidity price logic using msg.value with proper Starknet logic using an ERC20 as price token and transfer_from method.
I will include starknet-foundry to write comprehensive tests making sure we have 100% coverage for this example and deploy on Starknet Sepolia.

@princeibs Are you still working on this?
@julio4 Following up on my TimeLock implementation in #201 I'd like to continue working on StarknetByExample and handle this issue (please refer to my previous comment).

Yeah sure. Almost done.
Will be creating a PR asap.

Yeah sure. Almost done. Will be creating a PR asap.

Thank you, please open a draft PR as soon as possible!


Check for authentication types  (OAuth) that datasources will require

We seem to have Domain objects in place for OAuth 2.0. Not sure if we want to support OAuth 1.0.

No changes required from OAuth2.0 perspective, hence closing it. Not addressing OAuth1.0 right now, as discussed on Slack actions-pod channel.


Not able to get migrate-from-jslink-to-spfx-extensions to load

I followed the steps to setup my dev environment on https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment
Everything compiles fine. When I run gulp serve --nobrowser and open a browser and try to run the extension the OnRenderCell does not seem to be called. I cannot tell if the extension is being loaded or not.
I saw comments from a few years ago that was saying this only worked on classic sites in a dev tenant. Is that still true? If so, how do I create a classic site vs. clicking the classic experience link?
node: 16.13.2
yo: 4.3.1
@microsoft/generator-sharepoint: 1.16.1

It looks like the OnInit() is firing, but the OnRenderCell will not fire when the column type is "Choice". If I create a text field it will fire. Change the column type from a Choice to Text will also not work.

@mickeybnet - that is a "by-design" behavior.  Custom formatting has a priority over SPFx Field Customizers


Change deleteIdleStats default value from false to true

Statsd has a deleteIdleStats option that is responsible for removing unused statistics.  The default value is false, which means once statsd has seen a stat, it will repeatedly send it forever regardless of weather it sees that stat come in again.  I propose a default value of true, which is far less likely to cause harm.  In practice, stat names change regularly and I've seen this feature cause more than 500,000 unused, worthless stats to be sent to a single Graphite instance every five seconds without end.  Even a well-spec'd Graphite instance can struggle to keep up with that volume of data, especially since that's not including the actual live data that people want.  Graphite does not include good facilities for identifying where a given stat comes from so identifying statsd as the source of the flood of stats took many man-hours.  Please save many headaches and remove unused stats by default by setting deleteIdleStats to true out of the box.

Thanks for the patch! We have thought about that before, however it's a breaking change with the current configuration and therefore we will postpone it into the v1.0.0 release for which we have a couple of other breaking changes that we want to do.


Can't install package from Melpa

It gives this error:
Contacting host: melpa.org:80
package--with-response-buffer-1: http://melpa.org/packages/go-mode-20200822.1936.el: Not found

That looks like an issue with melpa, not go-mode.
The version you are trying to fetch is a few months old. Maybe try M-x package-refresh-contents to fetch new metadata.
If you are still having issues, the melpa project will be better able to assist you than we will.


S3 Bucket Storage Path

Hi,
i am using Backup and S3 for the first time, and i got stuck... The backup test seems not to be working, so after i execute the following:
backup perform -t production_backup
i get the following log:

[2016/05/31 18:27:41][info] Database::PostgreSQL Started...
[2016/05/31 18:27:41][info] Using Compressor::Gzip for compression.
[2016/05/31 18:27:41][info]   Command: '/bin/gzip'
[2016/05/31 18:27:41][info]   Ext: '.gz'
[2016/05/31 18:27:41][info] Database::PostgreSQL Finished!
[2016/05/31 18:27:41][info] Creating Archive 'app_archive'...
[2016/05/31 18:27:41][info] Running system utility 'tar'...
[2016/05/31 18:27:41][info] tar:STDOUT: tar (GNU tar) 1.27.1
[2016/05/31 18:27:41][info] tar:STDOUT: Copyright (C) 2013 Free Software Foundation, Inc.
[2016/05/31 18:27:41][info] tar:STDOUT: License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
[2016/05/31 18:27:41][info] tar:STDOUT: This is free software: you are free to change and redistribute it.
[2016/05/31 18:27:41][info] tar:STDOUT: There is NO WARRANTY, to the extent permitted by law.
[2016/05/31 18:27:41][info] tar:STDOUT:
[2016/05/31 18:27:41][info] tar:STDOUT: Written by John Gilmore and Jay Fenlason.
[2016/05/31 18:27:41][info] Using Compressor::Gzip for compression.
[2016/05/31 18:27:41][info]   Command: '/bin/gzip'
[2016/05/31 18:27:41][info]   Ext: '.gz'
[2016/05/31 18:28:03][info] Archive 'app_archive' Complete!
[2016/05/31 18:28:03][info] Packaging the backup files...
[2016/05/31 18:28:03][info] Splitter configured with a chunk size of 250MB and suffix length of 3.
[2016/05/31 18:28:03][info] Packaging Complete!
[2016/05/31 18:28:03][info] Cleaning up the temporary files...
[2016/05/31 18:28:04][info] Storage::S3 Started...
[2016/05/31 18:28:04][info] Storing 'db-backups-backups/production/production_backup/2<IP_ADDRESS>.27.41/production_backup.tar'...
[2016/05/31 18:28:04][info]   Initiate Multipart 'db-backups-backups/production/production_backup/2<IP_ADDRESS>.27.41/production_backup.tar'
[2016/05/31 18:28:04][info] CloudIO::Error: Retry #1 of 10
[2016/05/31 18:28:04][info]   Operation: POST 'db-backups-backups/production/production_backup/2<IP_ADDRESS>.27.41/production_backup.tar' (Initiate)
[2016/05/31 18:28:04][info] --- Wrapped Exception ---
[2016/05/31 18:28:04][info] TypeError: no implicit conversion of Array into String

after nine more atempts...

[2016/05/31 18:32:34][info] CloudIO::Error: Retry #10 of 10
[2016/05/31 18:32:34][info]   Operation: POST 'db-backups-backups/production/production_backup/2<IP_ADDRESS>.27.41/production_backup.tar' (Initiate)
[2016/05/31 18:32:34][info] --- Wrapped Exception ---
[2016/05/31 18:32:34][info] TypeError: no implicit conversion of Array into String
[2016/05/31 18:33:04][error] Model::Error: Backup for Production Backup (production_backup) Failed!
[2016/05/31 18:33:04][error] --- Wrapped Exception ---
[2016/05/31 18:33:04][error] CloudIO::Error: Max Retries (10) Exceeded!
[2016/05/31 18:33:04][error]   Operation: POST 'db-backups-backups/production/production_backup/2<IP_ADDRESS>.27.41/production_backup.tar' (Initiate)
[2016/05/31 18:33:04][error]   Be sure to check the log messages for each retry attempt.
[2016/05/31 18:33:04][error] --- Wrapped Exception ---
[2016/05/31 18:33:04][error] TypeError: no implicit conversion of Array into String
[2016/05/31 18:33:04][error]
[2016/05/31 18:33:04][error] Backtrace:
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/fog-aws-0.1.1/lib/fog/aws/signaturev4.rb:12:in +' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/fog-aws-0.1.1/lib/fog/aws/signaturev4.rb:12:in initialize'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/fog-aws-0.1.1/lib/fog/aws/storage.rb:509:in new' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/fog-aws-0.1.1/lib/fog/aws/storage.rb:509:in setup_credentials'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/fog-aws-0.1.1/lib/fog/aws/storage.rb:492:in initialize' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/fog-core-1.29.0/lib/fog/core/service.rb:115:in new'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/fog-core-1.29.0/lib/fog/core/service.rb:115:in new' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/fog-core-1.29.0/lib/fog/storage.rb:25:in new'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/cloud_io/s3.rb:136:in connection' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/cloud_io/s3.rb:157:in block in initiate_multipart'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/cloud_io/base.rb:21:in with_retries' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/cloud_io/s3.rb:156:in initiate_multipart'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/cloud_io/s3.rb:48:in upload' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/storage/s3.rb:109:in block in transfer!'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/storage/s3.rb:105:in each' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/storage/s3.rb:105:in transfer!'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/storage/base.rb:45:in perform!' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/model.rb:334:in block in store!'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/model.rb:332:in map' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/model.rb:332:in store!'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/model.rb:306:in block in procedures' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/model.rb:269:in call'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/model.rb:269:in block in perform!' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/model.rb:268:in each'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/model.rb:268:in perform!' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/lib/backup/cli.rb:156:in perform'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.18.1/lib/thor/command.rb:27:in run' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in invoke_command'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.18.1/lib/thor.rb:363:in dispatch' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.18.1/lib/thor/base.rb:439:in start'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/backup-4.2.3/bin/backup:5:in <top (required)>' [2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/bin/backup:23:in load'
[2016/05/31 18:33:04][error]   /home/deploy/.rbenv/versions/2.2.0/bin/backup:23:in `'
[2016/05/31 18:33:04][warn] Cleaner::Error: Cleanup Warning
[2016/05/31 18:33:04][warn]   The temporary backup folder '/home/deploy/Backup/.tmp'
[2016/05/31 18:33:04][warn]   appears to contain the backup files which were to be stored:
[2016/05/31 18:33:04][warn]   /home/deploy/Backup/.tmp/production_backup.tar
[2016/05/31 18:33:04][warn]
[2016/05/31 18:33:04][warn]   Make sure you check these files before the next scheduled backup for
[2016/05/31 18:33:04][warn]   'Production Backup (production_backup)'
[2016/05/31 18:33:04][warn]   These files will be removed at that time!
[2016/05/31 18:33:04][info] Sending notification using Notifier::Mail...

My Backup config script:
`Model.new(:production_backup, 'Production Backup') do
split_into_chunks_of 250
compress_with Gzip
database PostgreSQL do |db|
db.name               = "my_db"
db.username           = "deploy"
db.password           =  ENV["DB_PASSWORD"]
db.host               = "localhost"
db.port               = 5432
db.additional_options = ["-xc", "-E=utf8"]
end
archive :app_archive do |archive|
archive.add '/home/deploy/my_rails_app/'
end
store_with S3 do |s3|
s3.access_key_id = ENV['AWS_ACCESS_KEY_ID']
s3.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY_ID'],
s3.region = "eu-central-1"
s3.bucket = ENV['AWS_BUCKET_BACKUPS']
s3.path = "production"
end
notify_by Mail do |mail|
...
end
end`
Hope someone can give me a hint. Thanks in advance

hmm i already found the error... i had a point after the s3.secret_access_key
s3.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY_ID'],
:(


Update links away from pilot naming

I've fixed the pre-commit.ci error in #1133 that was introduced as part of #1091.
This PR assumes we rename 2i2c-org/pilot-homepage as discussed in https://github.com/2i2c-org/pilot-homepage/issues/12, so don't merge this until this is merged!

Can you also update https://github.com/2i2c-org/infrastructure/blob/c8b87a407bbc4e490bf5485c36c61a52be32f720/deployer/hub.py#L64?


CU View attributes not recognized

Thanks Greg for your work and great plugins
New work era have began :)

I am testing generating CU view with preset settings, but grasshopper anyway return view with wrong settings.
Preset settings in green and how the view should look if I generate it in Tekla drawing mode.
Can you check please what could be an issue?

Good to hear :)
Please, check below link, because I'm pretty sure that this is about of object level settings which you have in these preset:
https://github.com/LetsConstructIT/Grasshopper-TeklaDrawingLink/issues/30#issuecomment-2054126548

Thanks Grzegorz
I didnt see closed issue list before )


3D Globe should have zoom in and zoom out feature.

What problem does this feature solve?
In my project, I have implemented a 3D globe. I can zoom in and zoom out using the mouse wheel. My requirement is to get zoom in and zoom out by clicking the button just like in Google Maps. On clicking the zoom in (+) button, the globe should zoom in and by clicking zoom out (-), the globe should zoom out.
What does the proposed API look like?
chartDataZoom event used but it doesn't work with 3d Globe. This event is only work when toolbar option is use. Can you suggest relevant API for Globe zoom?

Can anyone please response?

Can anyone please response?

I solved this issue by adding two sperate buttons for zoom in and zoom out the 3D Globe. Also set globe's distance and maxDistance property to implement zoom out and distance and minDistance property to zoom In the 3D globe.


Scrollbar: Fixed wrap resizing scrollbar not recalculating

Please make sure these boxes are checked before submitting your PR, thank you!

[x] Make sure you follow Element's contributing guide (中文 | English | Español).
[x] Make sure you are merging your commits to dev branch.
[x] Add some descriptions and refer relative issues for you PR.

Issues without a valid reproduction link will be closed directly.


getting TypeError: Cannot read properties of null (reading 'CodeMirror')

Greetings,
seems not to be asked here, but we are getting lots of errors like this
TypeError: Cannot read properties of null (reading 'CodeMirror')
  at ? (<anonymous>:7:17)

We haven't used codemirror in our project but getting reported this issue to sentry from last 24 hours. Did anyone have idea why this TypeError ?

If you don't use CodeMirror, then I guess people are loading broken extensions that try to use it, to get this error? In any case, there's not much I say do about this without a lot more context, so I'm going to close this.

Thanks, @marijnh we will sort it

See also #7003, which indeed points at a browser plugin


react-datepicker does not  'registerLocale'.

I'm trying to do an IMPORT to registerLocale  like this.
import { registerLocale } from 'react-datepicker';
And that's the result:
'react-datepicker' does not contain an export named 'registerLocale'.

I have faced the same problem @shmulikamin. I figure out that it's a named export.
import DatePicker, { registerLocale } from "react-datepicker";
You can check it here: https://github.com/Hacker0x01/react-datepicker/blob/master/docs-site/src/examples/locale.jsx

Thanks
But I tried it already, and I still get the same message

ah sorry, my bad, I thought you were trying to import it directly like:
import registerLocale  from "react-datepicker";

Check the version you are using, if you using previous versions update to the latest one.
I faced the same problem with older versions, updating to newer version fixed the issue.

I have same issue. How do I solve it ?
import DatePicker, { registerLocale } from 'react-datepicker';

I am also seeing this issue in my production build, but not in my dev environment... my production build is using the minified build and giving me this error. any suggestions?

I am also seeing this issue in my production build, but not in my dev environment... my production build is using the minified build and giving me this error. any suggestions?
version 2.9.6

Hi guys. I found this solution that works for me
import DatePicker, { registerLocale } from "react-datepicker/dist/es"


Node Library Section in Readme.md needs more content

The "Node Library" section of Readme.md is lacking a lot of content that would be valuable to users who are trying to use the module within projects.
Please either include relevant information for this section (methods available, etc) or a link to documentation that clarifies this to the user.

Hey @theaccordance, it's great to hear that you're using the PG CLI as a node module. I wrote that documentation when we original created the PG CLI, but I've only heard of a few people using it programmatically.
For now, the most accurate documentation would be the source code.

All of the available methods are listed here.
Each method should contain a dox-style comment block (e.g. phonegap.create(options, callback)).

It would be nice to see these documentation rendered out to an API webpage. If there's more interested, I'd be open to doing more of the leg work.

I'm going to close this as a duplicate of #16, where we want to investigate generating the documentation programmatically.


Utilize AsyncSemaphore from SpeziFoundation

Problem
As of now, SpeziLLM depends on AsyncSemaphore from an external SPM package. However, we plan to implement an AsyncSemaphore within SpeziFoundation.
Solution
Using the AsyncSemaphore from SpeziFoundation to have a unified semaphore used within the Spezi ecosystem.
Additional context
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct and Contributing Guidelines

Addressed via: https://github.com/StanfordSpezi/SpeziLLM/pull/47


Enabled generation of changelog

In order to enable changelog and automate generation of release notes tasks "generateChangelog" and "githubRelease" were added to release.gradle (and "generateChangelog" was removed from build.gradle).
Also in build.gradle replaced version of shipkit-auto-version and shipkitChangelog with "0.0.+".
githubRelease is now included in CI build steps in build.yml.

Looks great, thank you!


GraphQL Error response broken when path contains number

When the graphql error Path contains a number, we would previously return HTTP 422 Unprocessable Entity with an empty errors: [] response.
For some background see the commit message of a commit that at least doesn't make it silent anymore:

We seem to be doing some interesting type conversion, we're first
marshalling the entire graphql response to JSON and then unmarshalling
it again into the go-swagger resopnse type. This seems to work fine for
most cases, but there is an edge cases where it breaks miserably:
When the graphql error response contains a list the path array will be
something like ["Get", "Things", 0, "foobar"]. Notice the third element
is a number, whereas all the other ones are string. Therefore this type
is defined in the graphql package as []interface{}. Howevever, we are
using OpenAPI2 with go-swagger, where variable types ("oneOf", "anyOf")
are not supported yet. Therefore the code generated by go-swagger has
the path field as []string.
The above case breaks the marhshal->unmarshal->marshal chain. Previously
it would fail silently. This commit makes sure the failure is at least
not silent anymore. Nevertheless it's not a very nice response yet. We
should improve upon this by actually converting from one response type
to the other (we can then simply convert the int to a string), rather
than using this marshal->unmarshal-marhsal magic.

The point of this issue is to make the error response consistent with our usual responses.

This is still very relevant and in fact quite a bit annoying if we run into this. We should fix this. Not closing.


Improve init readme

For me was not clear to think that I have to enter chrome and firefox directories to see the corresponding README  and/or documentation. Seems that Google search does not have it clear too (or I was not using good keywords in the search), because pointed me to mailing list, github issues, etc. but not these places (I tried several times in several dates). Now that I know, yes, it is so obvious. But for new people, I would like to help them.

so what ?

Oops, sorry, I had forgotten to merge this one :-S Done!


how can I debug Databox source code

Hello,
Could you please tell me how can I debug the Databox?
Thanks you

docker service logs [service name]
Is a good starting point, what are you trying to get working?

thank you, :)
docker service logs [service name]
Ihave used it.
And I tried to debug the Databox in eclipse,netbeans and visual studio but I failed.
I need to know the databox source code flow .

The software is not written by a single individual in a single IDE, so unlike something like Android, we don't have a single IDE where you can load the whole platform and debug through it.
The good news is that in anticipation of an upcoming Hackathon*, we will have much better documentation coming, so you shoudl be able to see these appearing soon on the me-box front page over the next few weeks.

https://www.databoxproject.uk/2017/09/02/databox-hackday-at-mozfest-2017-thu-26-oct/


TinyUSB header not found (IDFGH-8429)

Answers checklist.

[X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.
v5.1-dev-1006-g02605f1a31
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
No response
What is the expected behavior?
I expected to build the examples about usb without problems.
What is the actual behavior?
Actually, tinyusb.h is not found with every example I tried.
/save/scripts/esp-idf/examples/peripherals/usb/device/tusb_serial_device/main/tusb_serial_device_main.c:11:10: fatal error: tinyusb.h: No such file or directory    11 | #include "tinyusb.h"       |          ^~~~~~~~~~~ compilation terminated.
Steps to reproduce.
I just entered
idf.py build
Build or installation Logs.
Executing action: all (aliases: build)
Running make in directory /save/scripts/esp-idf/examples/peripherals/usb/device/tusb_serial_device/build
Executing "make -j 6 all"...
[  0%] Built target _project_elf_src
[  0%] Built target memory_ld
[  0%] Built target partition_table_bin
[  0%] Built target custom_bundle
Consolidate compiler generated dependencies of target __idf_ulp
[  0%] Performing build step for 'bootloader'
[  0%] Built target __idf_ulp
Consolidate compiler generated dependencies of target __idf_esp_serial_slave_link
[  0%] Built target __idf_esp_serial_slave_link
Consolidate compiler generated dependencies of target __idf_log
Consolidate compiler generated dependencies of target __idf_sdmmc
[  1%] Built target _project_elf_src
[  5%] Built target __idf_log
[  1%] Built target __idf_sdmmc
Consolidate compiler generated dependencies of target __idf_esp_rom
Consolidate compiler generated dependencies of target __idf_esp_https_ota
[ 12%] Built target __idf_esp_rom
[  1%] Built target __idf_esp_https_ota
Consolidate compiler generated dependencies of target __idf_esp_common
[ 14%] Built target __idf_esp_common
Consolidate compiler generated dependencies of target __idf_esp_http_server
Consolidate compiler generated dependencies of target __idf_esp_hw_support
[  2%] Built target __idf_esp_http_server
[ 24%] Built target __idf_esp_hw_support
Consolidate compiler generated dependencies of target __idf_esp_http_client
Consolidate compiler generated dependencies of target __idf_esp_system
[  3%] Built target __idf_esp_http_client
[ 26%] Built target __idf_esp_system
Consolidate compiler generated dependencies of target __idf_efuse
[ 34%] Built target __idf_efuse
Consolidate compiler generated dependencies of target __idf_tcp_transport
Consolidate compiler generated dependencies of target __idf_bootloader_support
[  4%] Built target __idf_tcp_transport
[ 57%] Built target __idf_bootloader_support
Consolidate compiler generated dependencies of target __idf_esp_gdbstub
Consolidate compiler generated dependencies of target __idf_esp_app_format
[  5%] Built target __idf_esp_gdbstub
[ 59%] Built target __idf_esp_app_format
Consolidate compiler generated dependencies of target __idf_hal
Consolidate compiler generated dependencies of target __idf_esp_eth
[ 65%] Built target __idf_hal
[  6%] Built target __idf_esp_eth
Consolidate compiler generated dependencies of target __idf_micro-ecc
[ 68%] Built target __idf_micro-ecc
Consolidate compiler generated dependencies of target __idf_esp_adc
Consolidate compiler generated dependencies of target __idf_soc
[  7%] Built target __idf_esp_adc
[ 90%] Built target __idf_soc
Consolidate compiler generated dependencies of target __idf_esp-tls
Consolidate compiler generated dependencies of target __idf_xtensa
[  8%] Built target __idf_esp-tls
[ 93%] Built target __idf_xtensa
Consolidate compiler generated dependencies of target __idf_http_parser
Consolidate compiler generated dependencies of target __idf_main
[  9%] Built target __idf_http_parser
[ 95%] Built target __idf_main
Consolidate compiler generated dependencies of target __idf_esp_wifi
[ 98%] Built target bootloader.elf
[ 10%] Built target __idf_esp_wifi
[100%] Built target gen_project_binary
Bootloader binary size 0x66c0 bytes. 0x940 bytes (8%) free.
[100%] Built target bootloader_check_size
[100%] Built target app
Consolidate compiler generated dependencies of target __idf_wpa_supplicant
[ 10%] No install step for 'bootloader'
[ 19%] Built target __idf_wpa_supplicant
Consolidate compiler generated dependencies of target __idf_esp_netif
[ 19%] Completed 'bootloader'
[ 21%] Built target __idf_esp_netif
[ 22%] Built target bootloader
Consolidate compiler generated dependencies of target __idf_lwip
[ 33%] Built target __idf_lwip
Consolidate compiler generated dependencies of target __idf_vfs
[ 34%] Built target __idf_vfs
Consolidate compiler generated dependencies of target __idf_esp_phy
[ 34%] Built target __idf_esp_phy
Consolidate compiler generated dependencies of target __idf_nvs_flash
[ 36%] Built target __idf_nvs_flash
Consolidate compiler generated dependencies of target __idf_esp_event
[ 37%] Built target __idf_esp_event
Consolidate compiler generated dependencies of target __idf_esp_timer
[ 38%] Built target __idf_esp_timer
Consolidate compiler generated dependencies of target __idf_esp_common
[ 38%] Built target __idf_esp_common
Consolidate compiler generated dependencies of target __idf_cxx
[ 38%] Built target __idf_cxx
Consolidate compiler generated dependencies of target __idf_newlib
[ 40%] Built target __idf_newlib
Consolidate compiler generated dependencies of target __idf_freertos
[ 43%] Built target __idf_freertos
Consolidate compiler generated dependencies of target __idf_esp_hw_support
[ 46%] Built target __idf_esp_hw_support
Consolidate compiler generated dependencies of target __idf_soc
[ 49%] Built target __idf_soc
Consolidate compiler generated dependencies of target __idf_heap
[ 49%] Built target __idf_heap
Consolidate compiler generated dependencies of target __idf_log
[ 49%] Built target __idf_log
Consolidate compiler generated dependencies of target __idf_hal
[ 54%] Built target __idf_hal
Consolidate compiler generated dependencies of target __idf_esp_rom
[ 55%] Built target __idf_esp_rom
Consolidate compiler generated dependencies of target __idf_esp_system
[ 59%] Built target __idf_esp_system
Consolidate compiler generated dependencies of target __idf_pthread
[ 59%] Built target __idf_pthread
Consolidate compiler generated dependencies of target __idf_spi_flash
[ 61%] Built target __idf_spi_flash
Consolidate compiler generated dependencies of target __idf_app_update
[ 62%] Built target __idf_app_update
Consolidate compiler generated dependencies of target __idf_bootloader_support
[ 64%] Built target __idf_bootloader_support
Consolidate compiler generated dependencies of target __idf_esp_app_format
[ 64%] Built target __idf_esp_app_format
Consolidate compiler generated dependencies of target mbedtls
[ 66%] Built target mbedtls
Consolidate compiler generated dependencies of target mbedx509
[ 67%] Built target mbedx509
Consolidate compiler generated dependencies of target mbedcrypto
[ 78%] Built target mbedcrypto
Consolidate compiler generated dependencies of target __idf_mbedtls
[ 79%] Built target __idf_mbedtls
Consolidate compiler generated dependencies of target __idf_esp_pm
[ 80%] Built target __idf_esp_pm
Consolidate compiler generated dependencies of target __idf_driver
[ 86%] Built target __idf_driver
Consolidate compiler generated dependencies of target __idf_efuse
[ 87%] Built target __idf_efuse
Consolidate compiler generated dependencies of target __idf_esp_ringbuf
[ 87%] Built target __idf_esp_ringbuf
Consolidate compiler generated dependencies of target __idf_xtensa
[ 88%] Built target __idf_xtensa
Consolidate compiler generated dependencies of target __idf_json
Consolidate compiler generated dependencies of target __idf_protobuf-c
Consolidate compiler generated dependencies of target __idf_app_trace
Consolidate compiler generated dependencies of target __idf_unity
Consolidate compiler generated dependencies of target __idf_esp_hid
Consolidate compiler generated dependencies of target __idf_console
[ 88%] Built target __idf_app_trace
[ 88%] Built target __idf_protobuf-c
[ 88%] Built target __idf_json
[ 89%] Built target __idf_unity
[ 89%] Built target __idf_esp_hid
Consolidate compiler generated dependencies of target __idf_esp_lcd
Consolidate compiler generated dependencies of target __idf_espcoredump
Consolidate compiler generated dependencies of target __idf_perfmon
Consolidate compiler generated dependencies of target __idf_mqtt
Consolidate compiler generated dependencies of target __idf_wear_levelling
[ 91%] Built target __idf_console
[ 92%] Built target __idf_esp_lcd
[ 93%] Built target __idf_espcoredump
[ 93%] Built target __idf_perfmon
[ 94%] Built target __idf_wear_levelling
Consolidate compiler generated dependencies of target __idf_spiffs
[ 94%] Built target __idf_mqtt
Consolidate compiler generated dependencies of target __idf_cmock
Consolidate compiler generated dependencies of target __idf_protocomm
[ 95%] Built target __idf_spiffs
[ 95%] Built target __idf_cmock
Consolidate compiler generated dependencies of target __idf_fatfs
[ 97%] Built target __idf_protocomm
[ 98%] Built target __idf_fatfs
Consolidate compiler generated dependencies of target __idf_esp_local_ctrl
Consolidate compiler generated dependencies of target __idf_wifi_provisioning
[ 98%] Built target __idf_esp_local_ctrl
[ 99%] Built target __idf_wifi_provisioning
[ 99%] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/tusb_serial_device_main.c.obj
/save/scripts/esp-idf/examples/peripherals/usb/device/tusb_serial_device/main/tusb_serial_device_main.c:11:10: fatal error: tinyusb.h: No such file or directory
   11 | #include "tinyusb.h"
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [esp-idf/main/CMakeFiles/__idf_main.dir/build.make:76: esp-idf/main/CMakeFiles/__idf_main.dir/tusb_serial_device_main.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:4336: esp-idf/main/CMakeFiles/__idf_main.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
make failed with exit code 2, output of the command is in the /save/scripts/esp-idf/examples/peripherals/usb/device/tusb_serial_device/build/log/idf_py_stderr_output_110020 and /save/scripts/esp-idf/examples/peripherals/usb/device/tusb_serial_device/build/log/idf_py_stdout_output_110020

More Information.
Maybe it's unrelated, but in the serial usb example, it is said that it is possible to access the TinyUSB stack with menuconfig, however I couldn't.

What is the board/target?

The target is Esp32-S2.

Occurs even if target is esp32.
$ cd esp-idf/examples/peripherals/usb/device/tusb_serial_device
$ idf.py build
../main/tusb_serial_device_main.c:11:10: fatal error: tinyusb.h: No such file or directory
   11 | #include "tinyusb.h"

hello can I use ESP32-WROVER-E as my target device? I f yes then what configurations to be done in sdkconfig file

@radhikapatel15
Usb can only use esp32s2/s3.


chore: update README.md for Alpha release

Here is the suggestion from our technical writer, we may update the texts accordingly: https://docs.google.com/document/d/1wwGPSi7Gigz2AK058PIMiBASg0IbTB7se4UtFcBuieQ/edit?resourcekey=0-c_mw1sGcPMoFfqIt6m2x1A


Document.url returns a relative url when WAGTAILDOCS_SERVE_METHOD is not direct.

Issue Summary
I'm not sure if this is truly a bug, but it is an inconsistency that caught my attention. The URL property of the file types (image, image rendition, media, document) is a fully qualified URL in all but one case.
Both AbstractRendition.url and AbstractMedia.url call though to FileField.url and in turn  Storage.url which joins against Storage.base_url and uses either the specific base_url passed to the storage instance or settings,MEDIA_URL to construct the fully qualified domain.  This is important when working with CDNs and alternate storage providers like S3.
But AbstractDocument.url doesn't conform to this implicit interface. It returns a relative URL when settings.WAGTAILDOCS_SERVE_METHOD is not 'direct'.
I can see the intention here to support redirect and serve. Just because I'm using these serve_method doesn't mean that I want a relative URL.  Typically I will be using a CDN for these endpoints regardless and I don't want to deal with potentially caching a response for each domain that may point to my site.  On a project I'm currently working on, we have separate CDNs for media and content and generally, I would want to serve these through our MEDIA CDN since it has much cheaper bandwidth pricing and is optimized around sending larger file than our CONTENT CDN.  I don't think MEDIA_URL is necessarily an appropriate base url in this scenario, maybe it calls for a separate DOCUMENTS_URL that is used for redirect and serve_view delivery methods that falls back to the normal site base url.
Steps to Reproduce
My assertions are based purely on code review at this juncture and was discovered in https://github.com/torchbox/wagtail-grapple/issues/234. I plan to add an example to validate this in the example there, but wanted to go ahead an open an upstream issue for discussion.
Expectation
I would expect that Document.url returns a fully qualified url in all cases like all the other file types.

Actually, I take that back, Now that I am into testing I see that storage.baseUrl does return relative paths.


Box plots, number of zeros, and aggregate graph in the Regression Examples file

Looks great. Can you squash all the commits into one commit?


Add interaction data

Add interaction_data in SettledBatchAuctionModel to allow more complex settlements

I have read the CLA Document and I hereby sign the CLA


Update documentation table to indicate IReadOnlyDictionary => Dictionary

On https://github.com/dotnet/roslyn-analyzers/pull/3149 the rule was updated to suggest the Dictionary suffix for types implementing IReadOnlyDictionary instead of the former Collection.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 83202117-8bd8-aa22-d55c-42ecc59fc11f
Version Independent ID: 2374ea4f-0f8d-283e-5803-7c8de04b48f7
Content: CA1710: Identifiers should have correct suffix - Visual Studio
Content Source: docs/code-quality/ca1710.md
Product: visual-studio-windows
Technology: vs-ide-code-analysis
GitHub Login: @Mikejo5000
Microsoft Alias: mikejo

@Evangelink -- Amaury, thank you for your feedback.  That page appears to be up-to-date, noting:

Types that implement IDictionary have names that end with the word 'Dictionary' even if the type also implements IEnumerable or ICollection.

Please let me know if that is sufficient.

@WilliamAntonRohm Types implementing IReadOnlyDictionary do not usually implement IDictionary so the statement is inaccurate (that was the goal of the PR).
The idea would be to add in the table the following mapping System.Collections.Generic.IReadOnlyDictionary<TKey,TValue> to Dictionary. And also, to update the quoted statement from Types that implement IDictionary to Types that implement IDictionary or IReadOnlyDictionary.
Thanks

@Evangelink -- Amaury, thank you for clarifying.
@Mikejo5000 -- Mike, please look into this issue.

Updating doc


[Coder]: Dive Broken on Superclass

On Mac, Cmd-g inserts a "g" in the superclass name instead of spawning a pane with an inspector on the class
https://github.com/feenkcom/gtoolkit/assets/184176/195aeffd-77f7-4cc9-b0aa-131c9d5365ba

Still broken in v.1.0.372


Market approval: dify

I would like to publish it on the official marketplace. Here is the information about my bot.

bot_id
bot_name
bot_description

60cf2fc1-e680-497c-8906-c1174398cf4b
dify
Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.

done


File not found when building

Describe the bug
The build does not run properly, error: no such file or directory
Logs
❯ npm run build

><EMAIL_ADDRESS>build /home/sovlookup/桌面/新建文件夹 (2)/midway-svelte
> svelte-kit build

vite v2.3.7 building for production...
✓ 92 modules transformed.
build/manifest.json                    1.56kb
build/layout.svelte-646c1d37.js        0.49kb / brotli: 0.29kb
build/error.svelte-71b8bb5c.js         1.19kb / brotli: 0.57kb
build/pages/index.svelte-a4c45f6d.js   1.16kb / brotli: 0.57kb
build/assets/start-a8cd1609.css        0.16kb / brotli: 0.10kb
build/chunks/vendor-f965f831.js        18.55kb / brotli: 6.31kb
build/chunks/index-650274ee.js         24.97kb / brotli: 7.49kb
build/start-d1d56062.js                17.18kb / brotli: 5.50kb
> ENOENT: no such file or directory, open '/home/sovlookup/桌面/新建文件夹 (2)/midway-svelte/.svelte-kit/output/client/_app/manifest.json'
Error: ENOENT: no such file or directory, open '/home/sovlookup/桌面/新建文件夹 (2)/midway-svelte/.svelte-kit/output/client/_app/manifest.json'
    at Object.openSync (node:fs:583:3)
    at Object.readFileSync (node:fs:451:35)
    at build_client (file:///home/sovlookup/%E6%A1%8C%E9%9D%A2/%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9%20(2)/midway-svelte/node_modules/_@sveltejs_kit@1.0.0-next.115@@sveltejs/kit/dist/chunks/index5.js:354:49)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async build (file:///home/sovlookup/%E6%A1%8C%E9%9D%A2/%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9%20(2)/midway-svelte/node_modules/_@sveltejs_kit@1.0.0-next.115@@sveltejs/kit/dist/chunks/index5.js:231:26)
    at async file:///home/sovlookup/%E6%A1%8C%E9%9D%A2/%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9%20(2)/midway-svelte/node_modules/_@sveltejs_kit@1.0.0-next.115@@sveltejs/kit/dist/cli.js:648:23
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR<EMAIL_ADDRESS>build: `svelte-kit build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sovlookup/.npm/_logs/2021-06-14T02_14_30_601Z-debug.log

To Reproduce
https://github.com/SOVLOOKUP/midway-svelte
Severity
The bug prevents me from deploying the app... Hope it can be resolved soon.

have you tried to use a project directory with only ascii characters in it ? i suspect this parrt 桌面/新建文件夹 (2) is not handled correctly either by sveltekit or vite. its either the chinese characters, the space, () or a combination of it, so maybe try removing them one by one to find the culprit

on second thought, the  part .svelte-kit/output/... doesn't look right. I was able to replicate the error with an ascii only path
 ENOENT: no such file or directory, open '/home/dominikg/develop/reproductions/midway-svelte/.svelte-kit/output/client/_app/manifest.json'
Error: ENOENT: no such file or directory, open '/home/dominikg/develop/reproductions/midway-svelte/.svelte-kit/output/client/_app/manifest.json'
    at Object.openSync (fs.js:498:3)
    at Object.readFileSync (fs.js:394:35)
    at build_client (file:///home/dominikg/develop/reproductions/midway-svelte/node_modules/@sveltejs/kit/dist/chunks/index5.js:354:49)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async build (file:///home/dominikg/develop/reproductions/midway-svelte/node_modules/@sveltejs/kit/dist/chunks/index5.js:231:26)
    at async file:///home/dominikg/develop/reproductions/midway-svelte/node_modules/@sveltejs/kit/dist/cli.js:648:23
npm ERR! code ELIFECYCLE

does midway mess with the build/output config of vite in any way? (not familiar with it at all)

We need @Lxxyx to give some help🤔

@dominikg @SOVLOOKUP
Midway will modify Vite's output directory to build and enable manifest.
https://github.com/midwayjs/hooks/blob/2d9a9e49678d818327f5ba07dbb393d17392ac24/packages/vite-plugin-hooks/src/plugin.ts#L75-L78

@dominikg @SOVLOOKUP
Midway will modify Vite's output directory to build and enable manifest.
You can modify this config at midway.config.ts.

midway.config.ts

import { defineConfig } from '@midwayjs/hooks';

export default defineConfig({
  build: {
    viteOutDir: '<Custom Path>'
  }
})

https://github.com/midwayjs/hooks/blob/2d9a9e49678d818327f5ba07dbb393d17392ac24/packages/vite-plugin-hooks/src/plugin.ts#L75-L78

so i should redirect output to .svelte-kit/output/ ?

so i should redirect output to .svelte-kit/output/ ?

You can try to see if this works

@Lxxyx

You can try to see if this works

It doesn't work, and more strange problems have come up...
To Reproduce: https://github.com/SOVLOOKUP/midway-svelte
Is it possible that the midway/vite-plugin-hooks can work with kit without any extra config？

@Lxxyx
Is it possible that the midway/vite-plugin-hooks can work with kit without any extra config？

The following method will build properly.
import { defineConfig } from '@midwayjs/hooks';

export default defineConfig({
  superjson: true,
  routes: [
    {
      baseDir: 'lambda',
      basePath: '/api',
    },
  ],
  build: {
    viteOutDir: null
  }
} as any);

Thanks for the feedback, I'm considering removing the option to specify viteOutDir in the build to make sure there are no conflicts with other Vite based frameworks


Issues when trying to convert html to md

Hello, Rafal.
Thanks a lot for your code. It will be very helpful on my workflow to convert html files (old Onenote exports) into markdow.
For now, I could not make it work:

download the mac version.
unzip the file at Downloads
run ./markup "20110114_01.00 - Análise Estratégica - Meta Processo.html" html_md in terminal from Downloads

Result
Traceback (most recent call last):
File "main.py", line 55, in
File "main.py", line 49, in main
File "MarkUP/convert.py", line 131, in html_md
File "MarkUP/convert.py", line 96, in convert_file
File "MarkUP/files.py", line 31, in save_str_as_file
OSError: [Errno 30] Read-only file system: '/20110114_01.00 - Análise Estratégica - Meta Processo.md'
[40098] Failed to execute script main
Expected result:
20110114_01.00 - Análise Estratégica - Meta Processo.md file created.
Could you please help me out?
Thanks again

Hi @jmbenedetto,
Thank you for your interest in this project and for submitting the detailed issue. I could indeed reproduce the issue on my machine (M1 Pro).
I haven't contributed to this repo for a while and it looks like macOS hardened its security settings in the meantime.
Here's a workaround:

In Finder or Terminal, in your home directory, create a directory (e.g. create an "output" directory).
NOTE: Do not create directories with spaces and special symbols.
Run: ./markup "20110114_01.00 - Análise Estratégica - Meta Processo.html" html_md -out ~/output
NOTE: Do not put the ~/output folder in quotation marks.

It looks like the macOS security is hardened for the "default" directories like the Downloads, Desktop, or your home directory. Because of that, my app cannot write to these directories. That's why I suggested to create the output directory.
Please let me know if this resolves your issue!

Thanks a lot!
It worked for individual files, but I got an error message when trying to convert all files from a folder. See the message below:
(base) [jmbenedetto:~/code/markup]$ ./markup /Users/jmbenedetto/Documents/3_references/Strategy html_md --out ./markup/output
Traceback (most recent call last):
  File "__main__.py", line 55, in <module>
  File "__main__.py", line 49, in main
  File "MarkUP/convert.py", line 133, in html_md
  File "MarkUP/convert.py", line 72, in convert_folder
  File "MarkUP/files.py", line 31, in save_str_as_file
NotADirectoryError: [Errno 20] Not a directory: './markup/output/20120315_Livro - Michael Porter - Competitive Advantage.md'
[77210] Failed to execute script __main__

At any rate, I was able to do a batch conversion by not changing the output folder:
./markup /Users/jmbenedetto/Documents/3_references/Strategy html_md
Thanks a lot for your code :)


⚠ SceneTime has degraded performance

In 3ed1749, SceneTime ($ST) experienced degraded performance:

HTTP code: 200
Response time: 4797 ms

Resolved: SceneTime performance has improved in e628fbd after 6 minutes.


Pure computations can throw

I find it surprising there is no IOE :> es constraint on the MonadThrow et al. instances for Eff. I shouldn't get exceptions from pure computations. Please add IOE :> es constraint. Those who want these kinds of surprise exceptions can already use throw from Control.Exception. Furthermore, MonadCatch can catch exceptions from Effectful.Error.Static, which is also not great.

I shouldn't get exceptions from pure computations

You can't prevent that because Haskell is a language where any expression is free to have a  throw inside, not to mention asynchronous exceptions.

Those who want these kinds of surprise exceptions can already use throw from Control.Exception.

Exactly, that's why adding an IOE requirement to MonadThrow changes nothing, because you can always use throw.

Furthermore, MonadCatch can catch exceptions from Effectful.Error.Static, which is also not great.

Yes, that is quite unfortunate, but it's only a problem if you catch SomeException and ignore it, which you should never do.
To summarize:

MonadMask can't require IOE because it allows usage of functions like bracket and finally to perform cleanup actions (like restoring a state on error), even within runPureEff.
MonadThrow is inconsequential because anything can throw at any time.
MonadCatch is the one that would be nice to require IOE, but it can't because if it did, MonadMask would also have to because of arguably invalid class hierarchy in the exceptions package and that ship unfortunately has sailed.

Good points, in particular for MonadThrow, you have changed my mind.
Regarding your first and last points, consider this: If the finalization you want to do is for an effect that you run entirely within the catch, then whatever thing you did in finalization will be irrelevant because the exception threw the context away. If it's dependent on an effect that is also in the stack that's doing the catching (and in particular, it's stateful: IOE, State), then it makes sense, because that context will still be relevant after catching. Because of that, I it doesn't seem to be a real problem that you cannot bracket if you cannot catch.

I hadn't meant to post just yet. There is of course one effect that is relevant even if you never catch: IOE (because thankfully exceptions don't delete the universe 🙂). If you have IOE you should absolutely be able to bracket, which is the case even if MonadMask requires IOE, so no problem there. As far as I can tell that is the only exception (haha), so it shouldn't be a problem to have the constraint.

I find it hard to visualize what you described, but if MonadMask required IOE, the following function
transactionally :: forall s es a. State s :> es => Eff es a -> Eff es a
transactionally = bracketOnError (get @s) (put @s) . const

cannot be written.
Moreoever, even if your effect stack has IOE, ideally you want to not have it visible in your application code and only use more restricted effects. Again, if MonadMask required IOE, you couldn't use things like bracket in your functions without bringing in the whole IOE, which would be bad.

I agree IOE is overkill for a function like transactionally. So let's write an Effect then 🙂. I'll call it Catch for now. Catch will let you catch any (synchronous) IO exception, and another effect Mask will let you do masking. Then, looking at the new function type, the possible effects would amount to State s, "can catch any exception" and "can mask", which are indeed the only effects done by transactionally.
You've mentioned it would be nice to have MonadCatch require IOE. I'm guessing you would find Catch nice for similar reasons. Here is one motivation: if I pass a throwing higher order effect, and my exceptions disappear, I can find what functions might be responsible; namely those with Catch or IOE. Functions without either are transparent to exceptions.
We could also have another effect for catching only exceptions of a particular type.
More concretely why MonadCatch => MonadMask makes sense.
Let's suppose that the higher order effect in transactionally throws. If the exception is never caught, or is caught in a context in which State s has already been run, then the (put @s) finalization will be irrelevant, because that state will be gone by the time we get control again:

main = neverCatches (transactionally ...) -- Program exits. Bracketing useless.
catch (runState (neverCatches (transactionally ...)))
      (\e -> ...) -- State inaccessible. Bracketing useless.
runState $ catch (transactionally ...)
                 (\e -> ...) -- Still using that state. Bracketing helped.

Now let's say the function using transactionally doesn't have a Catch constraint. Then using transactionally will be disallowed, but that's okay because unless we catch, or run in a context where catching is possible, the effects of the bracket will not be appreciable. Furthermore, the implementation of bracket actually requires catching, so it makes sense that that constraint would be required.
Now, if the effect is IOE, then it's a little different:

main = neverCatches (bracket allocRealWorldResource
                             freeRealWorldResource
                             badAction)
  -- Real world still exists, bracket action still relevant.

But this bracket doesn't need you to say we can Catch, because with IOE we get MonadUnliftIO. So in the one effect you might want to bracket without being able to catch, you can! (Though of course, IOE can catch too. 🙂)
Similarly with mask, the corruption that mask would prevent is only relevant if we ever catch, enabling access to our state again. However, it is true that masking itself doesn't technically require the capability to catch, so having an Effect just for masking might be nice. Then a function that just masks doesn't look like it might catch when it asserts there is catching in the effect stack. MonadMask still needs Catch because it provides a bracket. But if for some reason you only wanted to mask, you could use the Mask effect.

I'm willing and able to implement these effects.

Please also see https://github.com/haskell-effectful/effectful/issues/65#issuecomment-1121579676.
I pondered the idea of having an Except effect and constraint these instances to this effect, but discarded the idea precisely because exceptions are everywhere in Haskell.

However, it is true that masking itself doesn't technically require the capability to catch, so having an Effect just for masking might be nice

That would be nice, but it's not possible because of the superclass hierarchy. Try it yourself. It would have to be:
instance Catch :> es => MonadCatch (Eff es)
instance (Catch :> es, Mask :> es) => MonadMask (Eff es)

if you attempt to do this:
instance Catch :> es => MonadCatch (Eff es)
instance Mask :> es => MonadMask (Eff es)

you'll get an error
• Could not deduce (Catch :> es)
        arising from the superclasses of an instance declaration
      from the context: Mask :> es
      ...

if I pass a throwing higher order effect, and my exceptions disappear, I can find what functions might be responsible; namely those with Catch or IOE. Functions without either are transparent to exceptions.

That's a good argument, but we're unfortunately tied by the class hierarchy of these classes.

Now let's say the function using transactionally doesn't have a Catch constraint. Then using transactionally will be disallowed, but that's okay because unless we catch, or run in a context where catching is possible, the effects of the bracket will not be appreciable. Furthermore, the implementation of bracket actually requires catching, so it makes sense that that constraint would be required.

The problem is that bracket catching exceptions is an implementation detail :disappointed: The caller of bracket doesn't care how it works, so requiring a Catch effect for it is weird.

I'll close this for now. There is no good solution to this problem because of the unfortunate class hierarchy in exceptions, but I consider the current one the most pragmatic.


Drop Python 3.7 support

As per https://github.com/brainglobe/bg-gitbook/pull/5, this drops Python 3.7 support. This only removes support for testing. For package wheel building I intend to drop the support in https://github.com/brainglobe/cellfinder-core/pull/41.

Codecov Report

Merging #46 (47a45a6) into main (161087d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #46   +/-   ##
=======================================
  Coverage   99.54%   99.54%
=======================================
  Files           8        8
  Lines         221      221
=======================================
  Hits          220      220
  Misses          1        1

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 161087d...47a45a6. Read the comment docs.