text:
prevent erroneous setting of dps/prec on mpmath module

What we really want for Issue #657 is an exception on write access. Instead here is a partial implementation for read access.  Not even close to a solution sadly.
update: exceptions on write access to .dps and .prec in mpmath module.

Todo list

[x] depends on #663
[x] release notes?
[x] test
[x] any performance concerns?

potential changelog entry
My feeling is this maybe doesn't need a changelog, but just in case here's one:
Bug fixes:

  * Prevent accidentally setting `dps`/`prec` on the mpmath module (Colin Macdonald, Sergey Kirpichev, Warren Weckesser)

This really doesn't work very well, not sure I understand why:
>> import mpmath as mp
>> mp.dps
AttributeException(...)
>> mp.dps = 64
>> mp.dps
64

eh?  I was expecting an exception.  So unless I've done this wrong PEP 562 really doesn't offer much control here.

This really doesn't work very well, not sure I understand why:
>> import mpmath as mp
>> mp.dps
AttributeException(...)
>> mp.dps = 64
>> mp.dps
64

eh? I was expecting an exception.

Unfortunately, this is not like the property attribute on classes.  If 'dps' exists in the namespace of the module - the __getattr__() helper will not be invoked.

So unless I've done this wrong

Certainly not.

It seems, release notes (CHANGES) update happens just before release.  Probably, it's a good idea to automate this and keep things more up to date.  But don't worry here.
Yes, lets add tests.  Shouldn't be hard.
I don't think there is any performance penalty.  @oscarbenjamin?

I don't know if this is significant here or not...  I figure it potentially matters when calling frunctions from mpmath in a loop:
e.py:
import mpmath

def test1():
    f = mpmath.sin
    for i in range(0, 1000):
        f(i / 10)

def test2():
    for i in range(0, 1000):
        mpmath.sin(i / 10)

$ python -m timeit -r11 -s 'from e import test1' 'test1()'
100 loops, best of 11: 3.21 msec per loop
$ python -m timeit -r11 -s 'from e import test2' 'test2()'
100 loops, best of 11: 3.25 msec per loop

So its insignficant there, compared to the computation cost.
Of course, if I remove the computation, then I see the same results as @skirpichev:
import mpmath

def test1():
    f = mpmath.sin
    for i in range(0, 1000):
        f

def test2():
    for i in range(0, 1000):
        mpmath.sin

[cbm@x1c10 mpmath.git]$ python -m timeit -r11 -s 'from e2 import test1' 'test1()'
50000 loops, best of 11: 8.86 usec per loop
[cbm@x1c10 mpmath.git]$ python -m timeit -r11 -s 'from e2 import test2' 'test2()'
10000 loops, best of 11: 22.6 usec per loop

So is there some situation where one would tight-loop access to an attribute of mpmath without doing any real work in the loop?
Even if we cannot think of a "real life" example here, it definitely sounds like a point to make if you submit a PEP!

Here's an example, only one letter different sign instead of sin, which is much cheaper:
import mpmath

def test1():
    f = mpmath.sign
    a = 0
    for i in range(0, 1000):
        a += f(i)

def test2():
    a = 0
    for i in range(0, 1000):
        a += mpmath.sign(i)

$ python -m timeit -r11 -s 'from e import test1' 'test1()'
50000 loops, best of 11: 9.11 usec per loop
$ python -m timeit -r11 -s 'from e import test2' 'test2()'
10000 loops, best of 11: 22.2 usec per loop

And we see the slow down in a vaguely real-life example...

So is there some situation where one would tight-loop access to an attribute of mpmath without doing any real work in the loop?

Something like type(foo) is mpmath.mpf or isinstance(foo, mpmath.mpf).

an example, only one letter different sign instead of sin, which is much cheaper ... And we see the slow down in a vaguely real-life example...

Of course, all this can be workarounded by using test1() layout (or from mpmath import sign as f) instead of test2()...  So, I'm still in favor of merging this.  Let's wait few days in case  someone else will review this.

it definitely sounds like a point to make if you submit a PEP!

Unfortunately, I don't see too much usage examples for this "feature".  And mpmath's case seems to be very special.  What else?  To prevent mutations of the module __dict__, e.g. mpmath.sin="spam"?:)  On another hand, PEP 562 has not too much as well... (BTW, I don't see where stuff from that PEP was documented.)

I think that replacing the module in sys.modules like this is a bad idea. It is messing around with things that should not really be messed with and will cause something to break. I am certain that this change would end up being regretted (this looks like precisely the kind of thing that I would want to remove from a codebase if I saw it).
Being able to define __setattr__ on a module would be a useful change to the Python language. In the absence of a properly supported way to prevent attributes being set on a module though it is better just to accept that this can happen even if it is unfortunate.
It would be better to focus on designing an interface for precision control that is less prone to mistakes and misunderstanding.

will cause something to break.

Could you provide an example?  We can't reject pr only on the ground of unspecified potential problems.

Being able to define __setattr__ on a module would be a useful change to the Python language.

I doubt it will be accepted.  (As I said above, there are no good practical examples of why it could be helpful.)  But if it will - we can switch the present workaround to that solution.

In the absence of a properly supported way to prevent attributes being set on a module

Actually, Python does support customizing module attribute access, it is only slow.  The recommended way in the CPython docs is exactly how things are implemented in this pr.

FYI: https://discuss.python.org/t/extend-pep-562-with-setattr-for-modules/25506

@fredrik-johansson, how this solution looks for you?

I think this could be merged as-is, I will do this on monday.  Unfortunately, from the discussion thread it seems for me, that proposing a PEP for __setattr__ helper doesn't make sense.

There is some scenarios where measurable code slowdown exits, but I doubt this will pose real problems for someone.  And there are simple workarounds.
@oscarbenjamin, if you have any clue on what this may "break" - please show us.  BTW, similar replacing of the module in sys.modules was used for a long time in the scipy (FFT submodule).
@asmeurer, I would appreciate your opinion.

2. if you have any clue on what this may "break" - please show us

I don't have any specific examples. My experience is that when you do something like this it seems like you can reason about whether it should work but then something somewhere else turns out to have made some assumptions that will be broken as a result of the change.
I think it would be better to reflect on whether setting a global dps attribute is actually a good interface in the first place (I don't think it is) rather than making the change here to give an error for someone who sets the attribute on the wrong object. After that I would consider whether the docs can be improved so that the mistake is less likely. After that I would just do nothing. It isn't ultimately necessary to do anything in response to gh-657: sometimes an issue is just an issue but does not need to be "fixed".

Perhaps we should just leave this open, then see if such an alternative interface as @oscarbenjamin describes) can be developed.  If no such alternative materializes then we can revisit this, say in 6 months or so.
To be concrete: if the docs in the dev tree are are still recommending mp.dps = 64 in 2024, then I suggest merging this.

I don't have any specific examples.

Good news.  Then I don't see technical objections: this pr does very tiny and fine grained customization of the module behavior, exactly on the way the official docs recommends.

I think it would be better to reflect on whether setting a global dps attribute is actually a good interface in the first place (I don't think it is)

I think we all agreed that the context management could be better.  But this is much more complex change (and probably with API breakage).

It isn't ultimately necessary to do anything in response to https://github.com/mpmath/mpmath/issues/657

This is a common gotcha for mpmath users (2-3 duplicates of this issue were mentioned in the issue thread), that's why I would like to include some fix in the next (minor?) release.
Alternatively, we can add something to the docs (as a note/warning or a dedicated section), but this solution seems much better for me: it just forbids wrong scenarios of altering context attributes.

I think it's worth at least trying out https://github.com/mpmath/mpmath/issues/657#issuecomment-1498195928. It's much less invasive. I think if we put the check in the right place it won't be a major performance issue.

To be concrete: if the docs in the dev tree are are still recommending mp.dps = 64 in 2024, then I suggest merging this.

Ok.

if the docs in the dev tree are are still recommending mp.dps = 64 in 2024, then I suggest merging this.

I don't see any reason to wait until 2024: if you're going to do it then just do it now. Personally I would not do this now or later because it would be better to fix the interface design rather than add hacky workarounds to make the current interface slightly less confusing. Especially there should be no noticeable performance penalty for users who are using mpmath correctly just to provide better error messages to someone who uses it incorrectly.
It would be better to have an interface that does not depend on either attribute access or setting global variables at all and the docs could easily recommend that:
from mpmath import make_context
mp = make_context(real=True, dps=100)

Note this from the README:

4. Known problems
Mpmath is a work in progress. Major issues include:
...

The interface for switching precision and rounding is not finalized. The current method is not threadsafe.

I suggest that we think about what is (or could be) a good recommended way for users to use mpmath in the first instance and then consider what to recommend in the docs. Once that is done we might find that this issue is just not an issue any more.

it would be better to fix the interface design

I've opened an issue #683

Especially there should be no noticeable performance penalty

I don't think there is a practical performance penalty.

at least trying out https://github.com/mpmath/mpmath/issues/657#issuecomment-1498195928. It's much less invasive. I think if we put the check in the right place

@asmeurer, I doubt there is such "right place".  You will have to do it differently for every context (mp, fp, etc).  E.g. for the mp context you, probably, should adapt defun* decorators, for the fp - _mathfun() helper and so on.  I would welcome a pr, but it will definitely will be more complex than the current solution.

https://peps.python.org/pep-0726/

To be concrete: if the docs in the dev tree are are still recommending mp.dps = 64 in 2024, then I suggest merging this.

Ok, I'm going to merge this in few days.  Regardless on the PEP fate (https://github.com/python/steering-council/issues/216) - we don't have yet a better workaround for the issue.

To be concrete: if the docs in the dev tree are are still recommending mp.dps = 64 in 2024, then I suggest merging this.

Ok, I'm going to merge this in few days.  Regardless on the PEP fate (https://github.com/python/steering-council/issues/216) - we don't have yet a better workaround for the issue.

Thanks

Thanks, all!

authors: asmeurer cbm755 mdhaber oscarbenjamin skirpichev

repo: mpmath/mpmath


text:
Update sbt-assembly to 2.1.4

About this PR
📦 Updates com.eed3si9n:sbt-assembly from 2.1.1 to 2.1.4
📜 GitHub Release Notes - Version Diff
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

⚙ Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "com.eed3si9n", artifactId = "sbt-assembly" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "com.eed3si9n", artifactId = "sbt-assembly" }
}]

labels: sbt-plugin-update, early-semver-patch, semver-spec-patch, commit-count:1

Superseded by #132.

source: gharchive/pull-request

repo: mpollmeier/scala-repl-pp

license_type: permissive

license_source: github-api


text:
Job Dependencies

mProv jobs may need some method for dependencies.  ie. Repo sync finish before image generation starts.
Can probably use job params for this.  Will need a modification to the job sever.

this issue with image-update jobs was fixed in 0a2f4b6c9a7f367c63768bc76e455186a48f0cf9

source: gharchive/issue


text:
🛑 La Jolla Presbyterian Church [ljpres.org] is down

In 58a8cc4, La Jolla Presbyterian Church [ljpres.org] (https://ljpres.org) was down:

HTTP code: 0
Response time: 0 ms

Resolved: La Jolla Presbyterian Church [ljpres.org] is back up in cb8ef25.

license: MIT


text:
Rename Gamma to Embold

Gamma rebranded to Embold. This is the press release as a reference: https://www.pressebox.de/pressemitteilung/acellere-gmbh/Acellere-Announces-Rebranding-Changes-Name-to-Embold/boxid/965239

Thanks @markus-h. Had to shorten the description a little bit but it's all good now.

authors: markus-h mre

repo: mre/awesome-static-analysis


text:
As an admin, I can freeze my node

Freezing my node does this:
Only my friends can post on my node
Other people (friends of friends) can read messages.
If you are not a friend of any admin with unfrozen node, you will see a message:
"You cannot post messages until you are friends with someone who has their own node. Alternatively, you can start a node yourself."
With links. Maybe a little image of someone shrugging?

@dimakrsna @falconandy let's talk about frozen nodes. I think there should be a default that only friends can post images, and friends of friends should get a popup that tells them to either (A) start a node or (B) find a friend who has a node. This will help spread the network.
And to change defaut, I am not sure it should be visual.

Ok. This will work as follows:

I can freeze all attachments.
Or I can freeze attachments only for non-friends.
#2 above is the default mode for a node.

When 2 is set, a user will get an error message "You cannot post messages until you are friends with someone who has their own node. Alternatively, you can start a node yourself."
@falconandy please list all the modes here so we can make messages for each:
https://github.com/mreider/koto/blob/master/backend/node.md

Never mind. Let's create a different story for this, but do it some other day.

repo: mreider/koto


text:
🛑 SIA is down

In 72ef698, SIA (https://www.sickleinafrica.org) was down:

HTTP code: 0
Response time: 0 ms

Resolved: SIA is back up in f7b9966 after 11 minutes.

repo: mrejonas/websitemonitoring


text:
Wraps the front page post summaries in paragraph-tags

Unless you use <!--more--> at the end of a markdown paragraph break (assuming there is one within the summary character limit), the post summaries are stacked together with no vertical whitespace between them. Adding the <p>-tags fixes this. The main issue is inconsistency - if the summary ends at a paragraph break then you get the vertical space but it the summary just ends when the character count is full, then there will not be any vertical whitespace.
Before:

After:

Similar change should be done to the post-list partial

Thanks for the suggestion, I just released a new version of the theme.

authors: igufi mrmierzejewski

repo: mrmierzejewski/hugo-theme-console


text:
ElementNotInteractableException during MFA

Hello,
Love this repo. I created my own app for scraping the Mint web page and have been using it for a year or so on my Windows machine. Then I ran into this problem while trying to get it working on a raspberry pi 4. And now I am seeing it on both my windows and RPi machines. I've not touched the code on the Windows machine so I'm wondering if something changed at Mint.com.
I am using SMS to authenticate. In the code below, by this point, it has logged in with my credentials and Mint.com has texted me the MFA code.
Inside api.py: get_web_driver:
        else:
            driver.find_element_by_id('ius-mfa-options-form')
            driver.implicitly_wait(10)  # seconds [Note: I added this with no effect ]
            try:
                mfa_method_option = driver.find_element_by_id('ius-mfa-option-{}'.format(mfa_method))
                driver.implicitly_wait(10)  # seconds [Note: I added this with no effect ]
                mfa_method_option.click()

I have verified that mfa_method == sms so it is trying to find the ius-mfa-option-sms element, and seems to have found it successfully. But when the click is applied on the last line above, it takes an ElementNotInteractableException. I looked this exception up and saw suggestions about putting in some delay to allow the page to load, so I added a driver.implicitly_wait(10) but no help.
Here is the version information for the Pi OS, chrome driver, chrome browser, and mintapi.
pi@raspberrypi:~ $ cat /usr/lib/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
pi@raspberrypi:~ $ apt list chromium-driver
Listing... Done
chromium-driver/stable 83.0.4103.116-1~deb10u2 armhf
pi@raspberrypi:~ $ apt list chromium-browser
Listing... Done
chromium-browser/testing,now 84.0.4147.105-rpt2 armhf [installed,automatic]
pi@raspberrypi:~ $ pip show mintapi
Name: mintapi
Version: 1.44
Thanks for any help! Regards,

I am able to reproduce this. Looks like Mint.com changed the sign in process. This affects more than just the mfa workflow but occasionally the username and password inputs are on separate pages as well (which workflow I get appears to be random as I'm able to get both at roughly a 50/50 chance with no saved user session).
I'll have a merge request in just a little bit to fix it.

Thanks, Jaron, I'm happy to hear that you were able to reproduce this and submit a PR. I assume once this gets merged into the master that a new mintapi package would be released. How does one follow a PR through this process and become aware of the new package release? Regards,
Dave

You can easily subscribe to the PR by clicking the subscribe button in the right-hand column when viewing the pull request. This project doesn't have automated builds or use the GitHub release system so I don't know of a way to get notified of new releases. If you want to use this new request sooner, you could just install my fork but realize that it may or may not be as clean/stable as this repo because it hasn't gone through code review, but it works.

authors: davidacarroll jaron-l

repo: mrooney/mintapi

license: mit

license_source: bigquery


text:
❓ Stream video rather than record?

Question
Is there any way to get access to the video stream rather than the end recording?
What I tried
No response
VisionCamera Version
2.15.2
Additional information

[ ] I am using Expo
[X] I have read the Troubleshooting Guide
[X] I agree to follow this project's Code of Conduct
[X] I searched for similar questions in the issues page as well as in the discussions page and found none.

I have the same problem, I need to record the video on the device and transmit the recording in real time.
Does anyone have any suggestions or could help out?

Do you need audio? If not then you could look into frame processors

@Sid-Turner-Ellis Can u provide some way to do it? I saw Agora WebRTC can using it by this method:
Agora.pushWebRTCFrame(newFrame)

But I dont know how it were decraled

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.
If your issue has been fixed, consider sponsoring me on GitHub to say thanks 💖
JFYI; You can implement this with a native FP plugin 👍

authors: Sid-Turner-Ellis anderpaz fukemy mrousavy

repo: mrousavy/react-native-vision-camera


text:
🐛 [iOS] Facing issue while building app

What were you trying to do?
When trying to build app, skip library is failing to build with below error log.
Reproduceable Code
Integrate latest RC version of react-native-vision-camera with RN 0.72.3 with new architecture enabled (fabric).

package.json dependencies:

"dependencies": {
    "@shopify/react-native-skia": "^0.1.197",
    "react": "18.2.0",
    "react-native": "0.72.3",
    "react-native-vision-camera": "^3.0.0-rc.4",
    "react-native-worklets": "github:chrfalch/react-native-worklets#3ac2fbb"
}

do pod install with command: bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install

What happened instead?
The iOS app is not building
Relevant log output
▸ Compiling RCTModalHostViewComponentView.mm
▸ Compiling RCTInputAccessoryComponentView.mm
▸ Compiling RCTFabricComponentsPlugins.mm
▸ Compiling RCTComponentViewFactory.mm
▸ Compiling RCTActivityIndicatorViewComponentView.mm
▸ Compiling RCTKeyboardObserver.mm
▸ Compiling RCTI18nManager.mm
▸ Compiling RCTExceptionsManager.mm
▸ Compiling RCTDeviceInfo.mm
▸ Compiling RCTDevSplitBundleLoader.mm
▸ Compiling RCTDevSettings.mm
▸ Compiling RCTDevMenu.mm
▸ Compiling RCTDevLoadingView.mm
▸ Compiling RCTClipboard.mm
▸ Compiling RCTAppState.mm
▸ Compiling RCTActionSheetManager.mm
▸ Compiling RCTAccessibilityManager.mm
▸ Running script '[CP] Copy XCFrameworks'
▸ Building library libReact-RCTFabric.a
▸ Compiling RNSkMetalCanvasProvider.mm
▸ Compiling SkiaDomViewManager.mm
▸ Compiling SkiaDrawViewManager.mm
▸ Compiling RNSkManager.cpp

❌  /Users/ravindragupta/Desktop/Projects/AwesomeProject_Latest/ios/Pods/Headers/Public/RCT-Folly/folly/dynamic.h:63:10: 'boost/operators.hpp' file not found

#include <boost/operators.hpp>
                                                ^

▸ Compiling RNSkJsView.cpp
▸ Compiling RNSkDomView.cpp
▸ Compiling DrawingContext.cpp
▸ Compiling ConcatablePaint.cpp
▸ Building library libReact-CoreModules.a
    Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'AwesomeProject_Latest' from project 'AwesomeProject_Latest')
    Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'AwesomeProject_Latest' from project 'AwesomeProject_Latest')

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Error: Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening AwesomeProject_Latest.xcworkspace.".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Device
iPhone 14
VisionCamera Version
3.0.0-rc.4
Additional information

[ ] I am using Expo
[X] I have read the Troubleshooting Guide
[X] I agree to follow this project's Code of Conduct
[X] I searched for similar issues in this repository and found none.

@mrousavy Can you please check for this issue. Thanks

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.
If your issue has been fixed, consider sponsoring me on GitHub to say thanks 💖

authors: mrousavy ravindraguptacapgemini


text:
🔧 Build Error with react-native-vision-camera Example App on Windows using VS Code

How were you trying to build the app?
I was trying to build and run the example app for react-native-vision-camera on my Windows machine using Visual Studio Code. I intended to use Expo for development. I followed the instructions from the repository to set up the playground by running the following commands:
git clone https://github.com/mrousavy/react-native-vision-camera
cd react-native-vision-camera/package
yarn bootstrap
However, the build fails with a generic "Command failed with exit code 1," and I am unable to find relevant information regarding this error.
Full build logs
PS C:\Users\carol\Desktop\VISION> git clone https://github.com/mrousavy/react-native-vision-camera
>> cd react-native-vision-camera/package
>> yarn bootstrap
Cloning into 'react-native-vision-camera'...
remote: Enumerating objects: 23835, done.
remote: Counting objects: 100% (7085/7085), done.
remote: Compressing objects: 100% (2578/2578), done.
remote: Total 23835 (delta 4364), reused 5966 (delta 3511), pack-reused 16750
Receiving objects: 100% (23835/23835), 102.22 MiB | 18.26 MiB/s, done.
Resolving deltas: 100% (15102/15102), done.
yarn run v1.22.22
$ yarn && cd example && yarn && yarn pods
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "react-native > @react-native/codegen@0.72.7" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning "react-native > @react-native/codegen > jscodeshift@0.14.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning "react-native > @react-native-community/cli > @react-native-community/cli-plugin-metro > metro-react-native-babel-transformer@0.76.8" has unmet peer dependency "@babel/core@*".
warning " > react-native-reanimated@3.8.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/plugin-transform-arrow-functions@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/plugin-transform-nullish-coalescing-operator@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/plugin-transform-optional-chaining@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/plugin-transform-shorthand-properties@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/plugin-transform-template-literals@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/preset-typescript@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/preset-typescript > @babel/plugin-syntax-jsx@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/preset-typescript > @babel/plugin-transform-modules-commonjs@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/preset-typescript > @babel/plugin-transform-typescript@7.24.4" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/preset-typescript > @babel/plugin-transform-typescript > @babel/helper-create-class-features-plugin@7.24.4" has unmet peer dependency "@babel/core@^7.0.0".
warning "react-native-reanimated > @babel/preset-typescript > @babel/plugin-transform-typescript > @babel/plugin-syntax-typescript@7.24.1" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "react-native-reanimated > @babel/preset-typescript > @babel/plugin-transform-typescript > @babel/helper-create-class-features-plugin > @babel/helper-replace-supers@7.24.1" has unmet peer dependency "@babel/core@^7.0.0".
[4/4] Building fresh packages...
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
$ cd ios && bundle install && bundle exec pod install
Bundler 2.5.9 is running, but your lockfile was generated with 2.3.22. Installing Bundler 2.3.22 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.3.22
Installing bundler 2.3.22
Fetching gem metadata from https://rubygems.org/.......
Fetching minitest 5.17.0
Fetching concurrent-ruby 1.2.0
Fetching public_suffix 4.0.7
Fetching rexml 3.2.5
Fetching zeitwerk 2.6.7
Fetching httpclient 2.8.3
Installing zeitwerk 2.6.7
Installing rexml 3.2.5
Installing public_suffix 4.0.7
Installing minitest 5.17.0
Installing httpclient 2.8.3
Installing concurrent-ruby 1.2.0
Using json 2.6.3
Fetching atomos 0.1.3
Installing atomos 0.1.3
Using bundler 2.3.22
Fetching claide 1.1.0
Installing claide 1.1.0
Fetching fuzzy_match 2.0.4
Fetching nap 1.1.0
Installing fuzzy_match 2.0.4
Fetching netrc 0.11.0
Installing nap 1.1.0
Fetching ffi 1.15.5
Installing netrc 0.11.0
Fetching cocoapods-deintegrate 1.0.5
Fetching cocoapods-downloader 1.6.3
Installing cocoapods-deintegrate 1.0.5
Fetching cocoapods-search 1.0.1
Installing cocoapods-downloader 1.6.3
Fetching cocoapods-try 1.2.0
Installing cocoapods-search 1.0.1
Fetching colored2 3.1.2
Installing cocoapods-try 1.2.0
Installing ffi 1.15.5 with native extensions
Fetching escape 0.0.4
Installing colored2 3.1.2
Installing escape 0.0.4
Fetching fourflusher 2.3.1
Fetching gh_inspector 1.1.3
Fetching molinillo 0.8.0
Installing fourflusher 2.3.1
Fetching ruby-macho 2.5.1
Installing gh_inspector 1.1.3
Installing molinillo 0.8.0
Installing ruby-macho 2.5.1
Fetching nanaimo 0.3.0
Fetching addressable 2.8.1
Fetching CFPropertyList 3.0.6
Fetching algoliasearch 1.27.5
Fetching cocoapods-plugins 1.0.0
Installing nanaimo 0.3.0
Installing addressable 2.8.1
Installing CFPropertyList 3.0.6
Installing cocoapods-plugins 1.0.0
Installing algoliasearch 1.27.5
Fetching cocoapods-trunk 1.6.0
Fetching i18n 1.12.0
Fetching tzinfo 2.0.6
Installing cocoapods-trunk 1.6.0
Installing i18n 1.12.0
Installing tzinfo 2.0.6
Fetching xcodeproj 1.22.0
Installing xcodeproj 1.22.0
Fetching activesupport 6.1.7.2
Installing activesupport 6.1.7.2
Fetching ethon 0.16.0
Installing ethon 0.16.0
Fetching typhoeus 1.4.0
Installing typhoeus 1.4.0
Fetching cocoapods-core 1.11.3
Installing cocoapods-core 1.11.3
Fetching cocoapods 1.11.3
Installing cocoapods 1.11.3
Fetching cocoapods-check 1.1.0
Installing cocoapods-check 1.1.0
Bundle complete! 2 Gemfile dependencies, 39 gems now installed.
Bundled gems are installed into `./vendor/bundle`
Post-install message from algoliasearch:
A new major version is available for Algolia! Please now use the https://rubygems.org/gems/algolia gem to get the latest features.
Auto-linking React Native modules for target `VisionCameraExample`: RNGestureHandler, RNReanimated, RNScreens, RNStaticSafeAreaInsets, RNVectorIcons, react-native-blur, react-native-cameraroll, react-native-mmkv, react-native-safe-area-context, react-native-skia, react-native-video, and react-native-worklets-core
Framework build type is static library

[!] Invalid `Podfile` file: [!] Unable to locate the executable `mkdir`.

 #  from C:/Users/carol/Desktop/VISION/react-native-vision-camera/package/example/ios/Podfile:26
 #  -------------------------------------------
 #    end
 >  end
 #  # Resolve react_native_pods.rb with node to allow for hoisting
 #  -------------------------------------------
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Project dependencies
{
  "name": "react-native-vision-camera",
  "version": "4.0.1",
  "description": "A powerful, high-performance React Native Camera library.",
  "main": "lib/commonjs/index",
  "module": "lib/module/index",
  "types": "lib/typescript/index.d.ts",
  "react-native": "src/index",
  "source": "src/index",
  "files": [
    "src",
    "react-native.config.js",
    "lib/commonjs",
    "lib/module",
    "lib/typescript",
    "android/build.gradle",
    "android/gradle.properties",
    "android/CMakeLists.txt",
    "android/src",
    "ios/**/*.h",
    "ios/**/*.m",
    "ios/**/*.mm",
    "ios/**/*.cpp",
    "ios/**/*.swift",
    "app.plugin.js",
    "VisionCamera.podspec",
    "README.md"
  ],
  "scripts": {
    "typescript": "tsc --noEmit",
    "lint": "eslint \"**/*.{js,ts,tsx}\"",
    "lint-ci": "yarn lint -f ./node_modules/@firmnav/eslint-github-actions-formatter/dist/formatter.js",
    "start": "cd example && yarn start",
    "build": "bob build",
    "release": "bob build && release-it",
    "pods": "cd example && yarn pods",
    "bootstrap": "yarn && cd example && yarn && yarn pods",
    "check-android": "scripts/ktlint.sh && scripts/clang-format.sh",
    "check-ios": "scripts/swiftlint.sh && scripts/swiftformat.sh && scripts/clang-format.sh",
    "check-js": "yarn lint --fix && yarn typescript",
    "check-cpp": "scripts/clang-format.sh",
    "check-all": "scripts/check-all.sh",
    "clean-ios": "scripts/clean-ios.sh",
    "clean-android": "scripts/clean-android.sh",
    "clean-js": "scripts/clean-js.sh",
    "prepack": "cp ../README.md ./README.md",
    "postpack": "rm ./README.md"
  },
  "keywords": [
    "react",
    "native",
    "camera",
    "react-native",
    "react-native-camera",
    "vision",
    "javascript",
    "typescript",
    "android",
    "ios",
    "library",
    "instagram",
    "snapchat",
    "ai",
    "scanner",
    "qrcode",
    "barcode",
    "qr-code",
    "jsi",
    "worklet",
    "module",
    "frame",
    "processing",
    "realtime"
  ],
  "repository": "https://github.com/mrousavy/react-native-vision-camera",
  "author": "Marc Rousavy <me@mrousavy.com> (https://github.com/mrousavy)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/mrousavy/react-native-vision-camera/issues"
  },
  "homepage": "https://react-native-vision-camera.com/",
  "publishConfig": {
    "registry": "https://registry.npmjs.org/"
  },
  "devDependencies": {
    "@expo/config-plugins": "^7.2.5",
    "@jamesacarr/eslint-formatter-github-actions": "^0.2.0",
    "@react-native/eslint-config": "^0.72.2",
    "@react-native/typescript-config": "^0.74.0",
    "@release-it/conventional-changelog": "^7.0.0",
    "@shopify/react-native-skia": "^1.2.3",
    "@types/react": "^18.2.19",
    "@types/react-native": "^0.72.2",
    "eslint": "^8.46.0",
    "eslint-plugin-prettier": "^5.0.0",
    "prettier": "^3.0.1",
    "react": "^18.2.0",
    "react-native": "^0.72.3",
    "react-native-builder-bob": "^0.21.3",
    "react-native-reanimated": "^3.8.1",
    "react-native-worklets-core": "^1.1.1",
    "release-it": "^16.1.3",
    "typescript": "^5.1.6"
  },
  "peerDependencies": {
    "@shopify/react-native-skia": "*",
    "react": "*",
    "react-native": "*",
    "react-native-reanimated": "*",
    "react-native-worklets-core": "*"
  },
  "peerDependenciesMeta": {
    "react-native-worklets-core": {
      "optional": true
    },
    "react-native-reanimated": {
      "optional": true
    },
    "@shopify/react-native-skia": {
      "optional": true
    }
  },
  "release-it": {
    "git": {
      "commitMessage": "chore: release ${version}",
      "tagName": "v${version}"
    },
    "npm": {
      "publish": true
    },
    "github": {
      "release": true
    },
    "plugins": {
      "@release-it/conventional-changelog": {
        "preset": {
          "name": "conventionalcommits",
          "types": [
            {
              "type": "feat",
              "section": "✨ Features"
            },
            {
              "type": "perf",
              "section": "💨 Performance Improvements"
            },
            {
              "type": "fix",
              "section": "🐛 Bug Fixes"
            },
            {
              "type": "chore(deps)",
              "section": "🛠 Dependency Upgrades"
            },
            {
              "type": "docs",
              "section": "📚 Documentation"
            }
          ]
        }
      }
    }
  },
  "react-native-builder-bob": {
    "source": "src",
    "output": "lib",
    "targets": [
      "commonjs",
      "module",
      [
        "typescript",
        {
          "project": "tsconfig.json"
        }
      ]
    ]
  },
  "packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
}

VisionCamera Version
4.0.1
Target platforms
iOS
Operating system
Windows
Can you build the VisionCamera Example app?
No, I cannot build the Example app either
Additional information

[X] I am using Expo
[ ] I have enabled Frame Processors (react-native-worklets-core)
[X] I have read the Troubleshooting Guide
[X] I agree to follow this project's Code of Conduct
[X] I searched for similar issues in this repository and found none.

Thank you for your prompt response, I was hoping to build with Expo EAS after unpacking the project files.

[!] Invalid `Podfile` file: [!] Unable to locate the executable `mkdir`.

 #  from C:/Users/carol/Desktop/VISION/react-native-vision-camera/package/example/ios/Podfile:26
 #  -------------------------------------------
 #    end
 >  end
 #  # Resolve react_native_pods.rb with node to allow for hoisting
 #  -------------------------------------------

that path is a Windows path, so you are building on a Windows machine. I don't even know how you managed to run pod install?

Yes, I am running the project on a windows PC. I didn't run pod install, the only commands I gave were:
git clone https://github.com/mrousavy/react-native-vision-camera
cd react-native-vision-camera/package
yarn bootstrap
Any advice you have for using EAS to build the Example app would be greatly appreciated!

authors: allorazz mrousavy


text:
feat: Create TrackTimeline to properly synchronize pause/resume/start/stop video/audio buffers

What
Rewrites the RecordingSession timing/clock logic so it is battleproof.
This ensures that videos can seemlessly be paused/resumed, no blanks appear in the video file, and timestamps are always correct.
The TrackTimeline class accounts for pauses and resumes, and can even nest pauses without problems. A session is stopped at exactly the timestamp of the last video frame. This ensures that there can never be any blank frames.

The total duration of the video is summed up from the difference between the first and the last actually written timestamps, minus the total duration of all pauses between a video. No more incorrect video.duration! 🥳
Whereas before I just had a 4 second timeout if no frames arrive, I now just wait twice the frame latency (a few milliseconds) to ensure no frames are left out at maximum! 🎉
A video can be stopped while it is paused without any issues, as a pause call is taken into consideration before stopping 💪
A video file's session now exactly starts at the start() timestamp, and ends at the exact timestamp of the last video frame - this ensures there can never be any blank frames in the video, even if the audio track is longer 🤩

This was really complex to built as I had to synchronize timestamps between capture sessions, and the entire thing is a producer model - a video buffer can come like a second or so later than the audio buffer, but I need to make sure the video track starts before the audio track starts, and ends after the audio track ends - that's a huge brainf*ck! 🤯😅
There's also no helper APIs for this on iOS, and it looks like no other Camera framework (not even native Swift/ObjC iOS Camera libraries) support this - they all break when timestamps have a delay (e.g. video stabilization enabled) (or dont even support delays at all) ; so I had to build the thing myself.

Changes

Tested on

Related issues

Fixes https://github.com/mrousavy/react-native-vision-camera/issues/2790
Fixes https://github.com/mrousavy/react-native-vision-camera/issues/2732
https://github.com/mrousavy/react-native-vision-camera/issues/2497
https://github.com/mrousavy/react-native-vision-camera/issues/2934

I just tested recording a timer from 15 seconds to 40 seconds.
Starting the recording in debug took ~1 second, so the actual start is at 16 seconds. (I will try to optimize that soon with a prepareRecording(...) func)
Every 5 seconds, I call pauseRecording(), then 5 seconds later resumeRecording() again.
Between 26 seconds and 40 seconds there is a duration of 24 seconds, if we pause and resume every 5 seconds, this can happen twice in 24 seconds, so 10 seconds should be stripped from the video, resulting in a total expected duration of 14 seconds.
I just tried this at 120 FPS, and it works perfectly:
https://github.com/mrousavy/react-native-vision-camera/assets/15199031/2a872abe-b37a-4119-9761-df71162111a8
The video and audio is also perfectly synchronized, no more weird pauses inbetween, and it has no blank frames either. 🥳
Although this is insanely complex, I think it's really interesting! 😅


text:
🛑 Student Information System is down

In 3615037, Student Information System (https://filemaker.oca.ac.uk) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Student Information System is back up in 7db3f7a after 6 hours, 11 minutes.

repo: mrvinceo/ocaUptime


text:
🛑 Student Information System is down

In 414673d, Student Information System (https://filemaker.oca.ac.uk) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Student Information System is back up in 773b928.


text:
improve gap rendering

currently all gaps are rendered as ... since all gap elements are matched by the template at msdesc2html line 859. It would be better (1) to distinguish between editorial gaps (where text has been deliberately omitted) and gaps due to damage or illegibility and (2) in the case to damage or illegibility to indicate by dots the quantity of missing text, if this is specified in the TEI.

Regarding (2), there already are templates in the XSLT for displaying as many dots as specified in either @quantity or @extent, but not only if @unit is "chars" (not if it is "char" which is one of the suggested values in the TEI P5 schema, or "character" which has also been used in some of the St. John's College records).
In the documentation, there are examples using @atLeast and @atMost which won't work either.
There are also some instances in the Medieval catalogue when it looks like @n has been used instead of  @quantity or @extent, which is incorrect.

authors: andrew-morrison holfordm

repo: msDesc/consolidated-tei-schema


text:
fix for #201

Fixes #201
Changes proposed in this pull request:

removes client_secret and client_id from /oath/token for refresh tokens
This would enable developers to use your library, and their customers could have acquired their tokens from somewhere else, and your refresh tokens will still work.

Coverage remained the same at 88.939% when pulling 403bf595a12a5143ff105893cfd5c98d242fe77c on pyramation:master into c3e794461450cdb2ef8527757e4814d678a7d1c7 on mseminatore:master.

@pyramation Thank you for this PR, I've just merged.

authors: coveralls mseminatore pyramation

repo: mseminatore/TeslaJS


text:
Add "begin" & "end" matching

Treat begin and end like parenthesis or other brackets.
Highlight matching pair.

Pulled, thanks!

authors: bjaminn mshr-h

repo: mshr-h/vscode-systemverilog-support


text:
Analysis.ipynb cv2.imread BGR2RGB conversion

Analysis.ipynb, in [6]
img = cv2.imread(f'./CrackForest/Images/{ino:03d}.jpg').transpose(2,0,1).reshape(1,3,320,480)
will convert RGB image incorrectly.
(cv2 and PIL Image read RGB image format differently)
(need to use cv2.cvtColor for fixing cv2's BGR into RGB)
img = cv2.imread(f'./CrackForest/Images/{ino:03d}.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB).transpose(2,0,1).reshape(1,3,320,480)

Thank you Huang for pointing this out! Since the images are grayscale R=G=B when we load it using OpenCV. But for colour images you are absolutely right. I'll update the code to add this. :D


text:
Azure Data Factory Naming and dashes

Tool version
4.0 / 4.0.1
Describe the bug
Azure Data factory naming for factory or linked service does not correspond to standard.
To Reproduce
Steps to reproduce the behavior:

Create any linked service or data factory with standard rules, using dash as delimiter

Expected behavior

data factory - dashes are omitted
linked services - dashes are omitted

Hi @pkrzysz ,
v4.3.0 was released with Custom Resource Type support. Please review the release notes and update to the latest version to customize your resource types.
https://github.com/mspnp/AzureNamingTool/wiki/v4.3.0
Bryan

authors: BryanSoltis pkrzysz

repo: mspnp/AzureNamingTool


text:
CEP alterado, mas API retorna "não encontrado"

Em algumas buscas no site dos correios, temos a seguinte resposta : "ATENÇÃO! O CEP 13910-000 FOI ALTERADO CONFORME ABAIXO."
E informa o novo CEP.
Na consulta pela pycep-correios a resposta para este mesmo cep é :"CEP NÃO ENCONTRADO"
É possível um retorno onde traga a mesma resposta do site dos correios ?
Att,
André

Ola @ormenese isso ocorre porque o banco de dados de CEP que a PyCep-correios passou a utilizar a partir da versão 4.0.0 é a da ViaCEP (e não mais as do Correios). Ele ainda não deve ter sido atualizada com essas novas modificações. Então, não teria como retornar a mesma resposta até que a base de ceps da ViaCEP seja atualizada tambem, blz?

Obrigado pelo retorno !!!
Só um detalho com relação ao ViaCEP.
Já tentei utilizar esta API, mas se fizer muitas consultas ele acaba
negando acesso, coisa que não percebi no PyCep-correios. Será que teremos
problemas com isso ?
Eu possuo uma base com muitos endereços/CEP que precisam ser atualizados.
Eu até tenho um cache de CEP na minha base, mas é um cache recente, ainda
está em formação. Então vou fazer acesso massivo por um período.
Att,
André
Minhas figuras favoritas do folclore brasileiro são a democracia e o
estado laico.
Em sex., 3 de abr. de 2020 às 09:40, Michell Stuttgart <
notifications@github.com> escreveu:

Ola @ormenese https://github.com/ormenese isso ocorre porque o banco de
dados de CEP que a PyCep-correios passou a utilizar a partir da versão
4.0.0 é a da ViaCEP (e não mais as do Correios). Ele ainda não deve ter
sido atualizada com essas novas modificações. Então, não teria como
retornar a mesma resposta até que a base de ceps da ViaCEP seja atualizada
tambem, blz?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mstuttgart/pycep-correios/issues/63#issuecomment-608411052,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIC5O7562ASBTXXKG5DPDQ3RKXKM5ANCNFSM4L23BHGQ
.

Em relação ao ViaCEP negar acesso, eu não sabia - vou averiguar isso. Quando ao webservice anterior dos Correios, ele também possui limitação na quantidade de acessos, embora eu não saiba precisar o quanto 'de cabeça'. Eu tive de trocar para o ViaCEP porque o servidor antigo pertencia ao sigepweb, um serviço que exige contrato (mesmo que o metodo de busca de cep não precise de senha), sendo assim achei melhor desvincular do serviço.

eevssf

authors: Murillomdo mstuttgart ormenese

repo: mstuttgart/pycep-correios


text:
Provide "warm start" population

I am curious if there's a way to provide initial input values to the algorithm so that the search would be quicker?
I am not quite familiar with those genetic algorithms, correct me if I am wrong in this.

Yes, you can pre-define the initial population (this is how it would be called in evolutionary computation).
If you just know the design values:
import numpy as np

from pymoo.algorithms.so_genetic_algorithm import GA
from pymoo.factory import get_problem
from pymoo.optimize import minimize

problem = get_problem("sphere")

X = np.random.random((500, problem.n_var))

algorithm = GA(sampling=X)

res = minimize(problem,
               algorithm,
               seed=1,
               verbose=False)

print("Best solution found: \nX = %s\nF = %s" % (res.X, res.F))

If you like to provide pre-evaluated solutions:
import numpy as np

from pymoo.algorithms.so_genetic_algorithm import GA
from pymoo.factory import get_problem
from pymoo.model.evaluator import Evaluator
from pymoo.model.population import Population
from pymoo.optimize import minimize

problem = get_problem("sphere")

X = np.random.random((500, problem.n_var))

pop = Population(len(X))
pop.set("X", X)
Evaluator().eval(problem, pop)

algorithm = GA(sampling=pop)

res = minimize(problem,
               algorithm,
               seed=1,
               verbose=False)

print("Best solution found: \nX = %s\nF = %s" % (res.X, res.F))

Hope this answers your question.

Yes! Thanks for your quick respond. And thanks for this awesome library.

Sorry to reopen this issue, I am having some issues trying to set an initial x value. I am curious what does the "500" mean in the example you provided. I am using MOEA/D algorithm and elementwise evaluation and I got the following error. Thanks for your help.
Traceback (most recent call last):
  File "test.py", line 216, in <module>
    res = minimize(problem,
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\optimize.py", line 76, in minimize
    res = algorithm.solve()
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\model\algorithm.py", line 208, in solve
    self._solve(self.problem)
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\model\algorithm.py", line 289, in _solve
    self.next()
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\model\algorithm.py", line 260, in next
    self._next()
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\algorithms\moead.py", line 102, in _next
    off = crossover.do(self.problem, pop, parents[None, :])
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\model\crossover.py", line 50, in do
    X = pop.get("X")[parents.T].copy()
IndexError: index 3 is out of bounds for axis 0 with size 1

The 500 was just randomly picked. However, for MOEAD the Population object or NumPy array must be equal to the number of reference directions.
import numpy as np

from pymoo.algorithms.moead import MOEAD
from pymoo.factory import get_reference_directions, DTLZ1
from pymoo.model.evaluator import Evaluator
from pymoo.model.population import Population
from pymoo.optimize import minimize
from pymoo.visualization.scatter import Scatter

problem = DTLZ1()

ref_dirs = get_reference_directions("das-dennis", 3, n_partitions=12)
X = np.random.random((len(ref_dirs), problem.n_var))

pop = Population(len(X))
pop.set("X", X)
Evaluator().eval(problem, pop)

algorithm = MOEAD(ref_dirs, sampling=pop)

res = minimize(problem,
               algorithm,
               seed=1,
               verbose=True)

Scatter().add(res.F).show()

Does this work for you? Elementwise evaluation shall not make any difference.

Thanks for your help!
I switched to using len(ref_dirs), however, I am still getting similar errors.
I can try to reference a default problem and see if I implemented my own problem correctly, but it seems to be working fine if I remove the sampling argument.
My own problem has:

19 variables
2 objectives
over 1000 constraints

Here's what I am doing:
    # Reference direction
    ref_dirs = get_reference_directions("das-dennis", 2, n_partitions=12)
    # Generate initial condition
    x = np.full((len(ref_dirs), problem.n_var), 20)

    pop = Population(len(x))
    pop.set("X", x)
    Evaluator().eval(problem, pop)

    algorithm = MOEAD(
        ref_dirs,
        decomposition="pbi",
        prob_neighbor_mating=0.95,
        sampling=pop
    )

    termination = get_termination("n_gen", 20)

    res = minimize(problem,
               algorithm,
               termination,
               save_history=True,
               verbose=True)

Setting number of neighbours to population size: 13
====================================================================================================
n_gen |  n_eval |   cv (min)   |   cv (avg)   |  n_nds  | delta_ideal  | delta_nadir  |   delta_f
====================================================================================================
    1 |       0 |  0.146588718 |  0.146588718 |       1 |            - |            - |            -
Traceback (most recent call last):
  File "limerock2.py", line 239, in <module>
    res = minimize(problem,
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\optimize.py", line 76, in minimize
    res = algorithm.solve()
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\model\algorithm.py", line 208, in solve
    self._solve(self.problem)
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\model\algorithm.py", line 289, in _solve
    self.next()
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\model\algorithm.py", line 260, in next
    self._next()
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\algorithms\moead.py", line 102, in _next
    off = crossover.do(self.problem, pop, parents[None, :])
  File "d:\Anaconda3\envs\pymoo\lib\site-packages\pymoo\model\crossover.py", line 50, in do
    X = pop.get("X")[parents.T].copy()
IndexError: index 6 is out of bounds for axis 0 with size 1

I just debugged it. And your initial population is NOT supposed to have duplicates. Because a duplicate elimination happens the population becomes a single individual which fails. If you pass instead of X equals to 20 random values it should work.
import numpy as np

from pymoo.algorithms.moead import MOEAD
from pymoo.factory import get_reference_directions, DTLZ1, get_termination
from pymoo.model.evaluator import Evaluator
from pymoo.model.population import Population
from pymoo.optimize import minimize

problem = DTLZ1(n_obj=2)

# Reference direction
ref_dirs = get_reference_directions("das-dennis", 2, n_partitions=12)
x = np.random.random((len(ref_dirs), problem.n_var))

pop = Population(len(x))
pop.set("X", x)
Evaluator().eval(problem, pop)

algorithm = MOEAD(
    ref_dirs,
    decomposition="pbi",
    prob_neighbor_mating=0.95,
    sampling=pop
)

termination = get_termination("n_gen", 20)

res = minimize(problem,
           algorithm,
           termination,
           save_history=True,
           verbose=True)

hmm, ok, that's good to know. Thanks a lot for your help, I've added some randomness to 20 and it seems to be working fine now.

repo: msu-coinlab/pymoo


text:
Updating config.plist causes JavaScript error

Big Sur 11.5.2
Using 1.2.17 to update opencore from 0.6.5 to 0.9.2 fails at "Updating config.plist" state, but no errors are shown in the logs

Here is the config that it fails with updating if it's needed
https://pastebin.com/tNfVchvQ

The problem comes from missing NVRAM - Add - 4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14.
This program is currently designed to work with a complete config.plist(ex: sample.plist).
The sample.plist of OC 0.7.5 has 4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14, but in yours, it doesn't exist.
Adding the key should work.

authors: MonkaKokosowa mswgen

repo: mswgen/oc-updater


text:
Doesn't seem to work with Elasticsearch

Is it supposed to work with Elasticsearch? If so, can you explain what the query should look like?

Sorry, I don't use Elasticsearch. I don't know how to use histogram panel with Elasticsearch.
According to https://github.com/grafana/grafana/issues/3164 issue, @xadhoom success to use with Elasticsearch. You may get hints from the issue.

I confirm, that it works with elastic. But you should set aggregation to some value mode (Max, Avg, Min) and specify relatively small time aggregation interval.

authors: hc4 mtanda volter

repo: mtanda/grafana-histogram-panel


text:
🛑 https://hcie.ps is down

In 2a87596, https://hcie.ps (https://hcie.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://hcie.ps is back up in 951c640.

repo: mtitservice/site


text:
🛑 https://verify.moj.pna.ps is down

In 0ee0ca7, https://verify.moj.pna.ps (https://verify.moj.pna.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://verify.moj.pna.ps is back up in 3e4f75d.


text:
🛑 https://verify.moj.pna.ps is down

In a9dc6cf, https://verify.moj.pna.ps (https://verify.moj.pna.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://verify.moj.pna.ps is back up in 5ae2108.


text:
🛑 https://minfo.ps is down

In 8616b68, https://minfo.ps (https://minfo.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://minfo.ps is back up in 3154509.


text:
🛑 https://db.hcys.ps is down

In 2f83d7b, https://db.hcys.ps (https://db.hcys.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://db.hcys.ps is back up in 7a76d95.


text:
🛑 https://detulkarm.edu.ps is down

In f0ad6a2, https://detulkarm.edu.ps (https://detulkarm.edu.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://detulkarm.edu.ps is back up in 1f0a2fc.


text:
🛑 https://911.ps is down

In 29ecce7, https://911.ps (https://911.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://911.ps is back up in 8539171.


text:
Phoenix LiveView doesn't handle server restart gracefully

Hi @mtrudel,
First off, bandit is really looking great, excellent work on the whole thing!
I filed a bug report here with LiveView, but Jose asked me to file an issue with bandit instead.
The basic run-down of what is happening is:
When the server is restarting, bandit closes the websocket connection with status code 1001 (meaning: server going away). LiveView, however, is interpreting this as "browser navigated to another page" and subsequently does not attempt to reconnect, leaving the user with a spinning cursor until they reload the page manually.
Returning a status code 1000 instead would solve the issues with Phoenix. I'm not sure what your take is on that though from the perspective of standard compliance.

Fixed in 0.6.8!

Thanks for the quick turnaround on this, will push that to prod now. Shortest-lived fork I have probably ever had to run in prod.

authors: derekkraan mtrudel

repo: mtrudel/bandit


text:
The "LinkAssemblies" task failed unexpectedly.

While running in release mode, linking the assemblies am unable to run project with this nuget package.
Can you advice me the fix, for this issue. Pasting error below.
Severity	Code	Description	Project	File	Line	Suppression State
Error		The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void AiForms.Effects.Droid.ToFlatButtonPlatformEffect::OnElementPropertyChanged(System.ComponentModel.PropertyChangedEventArgs)' in assembly: 'AiForms.Effects.Droid.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve Xamarin.Forms.BindableProperty Xamarin.Forms.Button::CornerRadiusProperty
at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()System.Void AiForms.Effects.Droid.ToFlatButtonPlatformEffect::OnElementPropertyChanged
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()	MS.Digital.BOD.Android

@chennakrishnakasukurthi
Thank you for your report.
But It is not enough information to survey.
Could you give me more information such as
AiForms.Effects version, Xamarin.Forms version, Android SDK version, your linker settings and simple code in order to reproduce?
Thank you.

Thank you for reply and Help muak.
Xamarin.Forms version - 2.5.1.444934
Android SDK version - using latest Oreo (8.1), even i checked by changing  in lower versions as well up to API level 21.
Am attaching a command to StackLayout and its working great in debug mode , while coming to release facing the issue when "Linking is set to be SDK Assemblies only."
Below is sample code.

Thanks,
Chennakrishna

@chennakrishnakasukurthi
Thank you for your additional information.
Though I tried building in the same environment, couldn't reproduce it.
My build worked it without problems.
I'm sorry I couldn't be of any help.

@muak
Thanks for the response and help.

Hi all, I just ran into this issue, and deleting the /bin & /obj folder for the Android project worked for me.


text:
Add new body parameters to PATCH /api/v1/feeds/{feed_id}/

To support the option to manually edit

pretty_url (always optional) -- there is a cosmetic URL. It is designed to show the actual blog link to browse to in a web browser (not the feed)
title (optional) -- if not passed, will inherit this from the feed
description (optional) -- if not passed, will inherit this from the feed

introduced in
https://github.com/muchdogesec/history4feed/issues/76
We should allow users to also pass these to the PATCH /api/v1/feeds/{feed_id}/ to change values.
Note, all values optional and will not be changed unless the value is passed in the PATCH request (i.e. title will stay the same, unless title passed in the PATCH request)

@fqrious missing profile id

@fqrious i am proposing
https://dogesec.slack.com/archives/D05L8JEAM1N/p1732703326108849


text:
TTS with coqui: Examples missing and Error 404: sendfile: file /tmp/generated/audio/piper.wav not found

LocalAI version:
REPOSITORY                   TAG                           IMAGE ID       CREATED        SIZE
quay.io/go-skynet/local-ai   master-cublas-cuda12-ffmpeg   649611dc96ae   21 hours ago   54.5GB

Environment, CPU architecture, OS, and Version:
Environment: Docker Desktop 4.26.1 (131620)
Operating System: Windows 10 Pro 64-bit (10.0, Build 19045) (19041.vb_release.191206-1406)
Processor: AMD Ryzen 5 7600X 6-Core Processor              (12 CPUs), ~4.7GHz
Memory: 32768MB RAM
Card name: NVIDIA GeForce RTX 3060 Ti
Dedicated Memory: 8038 MB
Driver Version: 31.0.15.4584

Describe the bug
Can't receive audio when requesting /tts endpoint. Errors with a 404, seeming to be unable to send the file (Probably was not generated).
To Reproduce
curl http://localhost:8080/tts -H "Content-Type: application/json" -d '{
  "backend": "coqui",
  "model": "tts_models/en/vctk/vits",
  "input": "Hello, world!"
}'
{"error":{"code":404,"message":"sendfile: file /tmp/generated/audio/piper.wav not found","type":""}}

Expected behavior
Sends the generated audio
Logs
2:43PM INF Loading model 'tts_models/en/vctk/vits' with backend coqui
2:43PM DBG Loading model in memory from file: /models/tts_models/en/vctk/vits
2:43PM DBG Loading Model tts_models/en/vctk/vits with gRPC (file: /models/tts_models/en/vctk/vits) (backend: coqui): {backendString:coqui model:tts_models/en/vctk/vits threads:0 assetDir:/tmp/localai/backend_data context:{emptyCtx:{}} gRPCOptions:0xc0002c70e0 externalBackends:map[autogptq:/build/backend/python/autogptq/run.sh bark:/build/backend/python/bark/run.sh coqui:/build/backend/python/coqui/run.sh diffusers:/build/backend/python/diffusers/run.sh exllama:/build/backend/python/exllama/run.sh exllama2:/build/backend/python/exllama2/run.sh huggingface-embeddings:/build/backend/python/sentencetransformers/run.sh petals:/build/backend/python/petals/run.sh sentencetransformers:/build/backend/python/sentencetransformers/run.sh transformers:/build/backend/python/transformers/run.sh transformers-musicgen:/build/backend/python/transformers-musicgen/run.sh vall-e-x:/build/backend/python/vall-e-x/run.sh vllm:/build/backend/python/vllm/run.sh] grpcAttempts:20 grpcAttemptsDelay:2 singleActiveBackend:false parallelRequests:false}
2:43PM DBG Loading external backend: /build/backend/python/coqui/run.sh
2:43PM DBG Loading GRPC Process: /build/backend/python/coqui/run.sh
2:43PM DBG GRPC Service for tts_models/en/vctk/vits will be running at: '127.0.0.1:41873'
2:43PM DBG GRPC Service state dir: /tmp/go-processmanager296696034
2:43PM DBG GRPC Service Started
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:41873: connect: connection refused"
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:41873: connect: connection refused"
2:43PM DBG GRPC(tts_models/en/vctk/vits-127.0.0.1:41873): stderr Server started. Listening on: 127.0.0.1:41873
2:43PM DBG GRPC Service Ready
2:43PM DBG GRPC: Loading model with options: {state:{NoUnkeyedLiterals:{} DoNotCompare:[] DoNotCopy:[] atomicMessageInfo:<nil>} sizeCache:0 unknownFields:[] Model:tts_models/en/vctk/vits ContextSize:0 Seed:0 NBatch:0 F16Memory:false MLock:false MMap:false VocabOnly:false LowVRAM:false Embeddings:false NUMA:false NGPULayers:0 MainGPU: TensorSplit: Threads:0 LibrarySearchPath: RopeFreqBase:0 RopeFreqScale:0 RMSNormEps:0 NGQA:0 ModelFile:/models/tts_models/en/vctk/vits Device: UseTriton:false ModelBaseName: UseFastTokenizer:false PipelineType: SchedulerType: CUDA:false CFGScale:0 IMG2IMG:false CLIPModel: CLIPSubfolder: CLIPSkip:0 ControlNet: Tokenizer: LoraBase: LoraAdapter: LoraScale:0 NoMulMatQ:false DraftModel: AudioPath: Quantization: MMProj: RopeScaling: YarnExtFactor:0 YarnAttnFactor:0 YarnBetaFast:0 YarnBetaSlow:0}
2:43PM DBG GRPC(tts_models/en/vctk/vits-127.0.0.1:41873): stderr Preparing models, please wait
2:43PM DBG GRPC(tts_models/en/vctk/vits-127.0.0.1:41873): stdout <TTS.utils.manage.ModelManager object at 0x7f156cb86a50>
2:43PM DBG GRPC(tts_models/en/vctk/vits-127.0.0.1:41873): stdout  > Downloading model to /root/.local/share/tts/tts_models--en--vctk--vits
[172.17.0.1]:59762 404 - POST /tts

Subsequent requests results are identical, the logs are shorter:
2:44PM INF Loading model 'tts_models/en/vctk/vits' with backend coqui
2:44PM DBG Model already loaded in memory: tts_models/en/vctk/vits
[172.17.0.1]:37434 404 - POST /tts

Additional context

I understand coqui is pretty fresh (and just got discontinued)
The models seem to be handled internally by coqui, I found the model string here
I also ran the same request a bit later in case the model download was still going

There is nothing generated:
root@6fc11ff6b221:/build# ls -lah /tmp/generated/audio/
total 8.0K
drwxr-xr-x 2 root root 4.0K Jan  5 14:43 .
drwxr-xr-x 3 root root 4.0K Jan  5 14:43 ..

There exists model files:
root@6fc11ff6b221:/build# ls -lah /root/.local/share/tts/tts_models--en--vctk--vits/
total 152M
drwxr-xr-x 2 root root 4.0K Jan  5 14:43 .
drwxr-xr-x 3 root root 4.0K Jan  5 14:43 ..
-rw-r--r-- 1 root root  12K Jan  5 14:43 config.json
-rw-r--r-- 1 root root 152M Jan  5 14:43 model_file.pth
-rw-r--r-- 1 root root 1.8K Jan  5 14:43 speaker_ids.json

Exactly the same happens for me when using bark.

just tried on a master image and can confirm this. with bark and vall-e-x it works, seems just an issue with coqui

@mudler Did you try other voices using bark? I've tried it again and still got the same results like @dionysius (using v2/de-... voices).

@mudler Did you try other voices using bark? I've tried it again and still got the same results like @dionysius (using v2/de-... voices).

with bark I've tried without specifying any model, like this:
    curl http://localhost:8080/tts -H "Content-Type: application/json" -d '{
     "backend": "bark",
     "input":"Hello, this is a test!"
    }' | aplay

which works here. Did you tried a specific model?

fix for coqui is here: https://github.com/mudler/LocalAI/pull/1556

Hmm. If I issue the command:
curl http://localhost:8080/tts -H "Content-Type: application/json" -d '{   "model":"v2/de_speaker_3",   "backend": "bark",   "input": "Guten Tag. Wie geht es Dir?" }' --output audio.wav
I'll get
2024-01-07 19:21:26 6:21PM DBG GRPC(v2/de_speaker_3-127.0.0.1:45291): stderr   warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.") 2024-01-07 19:21:26 6:21PM DBG GRPC(v2/de_speaker_3-127.0.0.1:45291): stderr text: "Guten Tag. Wie geht es Dir?" 2024-01-07 19:21:26 6:21PM DBG GRPC(v2/de_speaker_3-127.0.0.1:45291): stderr model: "/models/v2/de_speaker_3" 2024-01-07 19:21:26 6:21PM DBG GRPC(v2/de_speaker_3-127.0.0.1:45291): stderr dst: "/tmp/generated/audio/piper_7.wav" 2024-01-07 19:21:26 6:21PM DBG GRPC(v2/de_speaker_3-127.0.0.1:45291): stderr  2024-01-07 19:21:26 [172.19.0.1]:49490 404 - POST /tts
Response is
{"error":{"code":404,"message":"sendfile: file /tmp/generated/audio/piper_7.wav not found","type":""}}

authors: dionysius kopierschnitte mudler

repo: mudler/LocalAI


text:
Question: Data Analysis

Hi!
I am looking into building some data models to understand different things about my coding time. For example:
Some initial questions include:

My most productive hour of the day
cumulative time spent in each entity/repo/lang/branch over time

And I am looking to create more visuals based on this data
I am having trouble finding the logic for the aggregation of heartbeats. Could you point me toward a specific file or function?

Check the How are durations calculated? section of the FAQ. Hope that helps!
Cumulative time spent per repo, etc., you can probably get right from Wakapi's endpoints.

authors: ethanleifer muety

repo: muety/wakapi


text:
Bantu Syarfani Akbar

Bantu pull requests pertama

Pastikan sudah melakukan perubahan dan sudah melakukan commit. Jangan lupa lakukan push ke github, di github tekan "Open Pull Request" pada contribute.

Bantuannya langsung diajarkan caranya ya @zulfahmidev . Sampai bisa melakukan pull reqeuest.

@traviafzah

authors: muhdavi zulfahmidev

repo: muhdavi/laporan-practice-big-data


text:
UMD package: export MaterialUI variable

Currently to use Material-UI with codepen.io, JSFiddle... you have to write (see https://stackoverflow.com/q/50705423):
const { Button, Input } = window['material-ui'];

This is because the output name inside rollup.config.js is 'material-ui':
https://github.com/mui-org/material-ui/blob/8013fdd36d40980ebb8f116f20e2843b781c0c39/packages/material-ui/scripts/rollup.config.js#L10
Instead it should be a name without -, something like 'MaterialUI':
const { Button, Input } = MaterialUI;

rollup.config.js example:
https://github.com/tkrotoff/react-form-with-constraints/blob/b64119bee6ab80c77417a9284a704b380b81bf5e/packages/react-form-with-constraints/rollup.config.js#L19-L27
Related issue: #7621

@tkrotoff This change sounds good to me. However, it's a breaking change. We gonna need to bump the version to v2. I'm adding it into the milestone 👍

This use case is OK: codepen.io => material-ui (with window['material-ui'])
This use case is KO: codepen.io => myLib => material-ui
I don't know how to configure myLib to use window['material-ui'] (no problem of course if material-ui exported a variable MaterialUI).
It's probably not possible, so having a MaterialUI export is not only a "nice to have".
Example code:

react-form-with-constraints-material-ui ("myLib") umd: https://unpkg.com/react-form-with-constraints-material-ui@0.9.2/dist/react-form-with-constraints-material-ui.development.js
react-form-with-constraints-material-ui rollup.config.js: https://github.com/tkrotoff/react-form-with-constraints/blob/a742293a3ef16806aaae98f4254a521a6ce196a4/packages/react-form-with-constraints-material-ui/rollup.config.js#L24-L27
codepen.io experimentations: https://codepen.io/tkrotoff/pen/MBGOQo

I don't know how to configure myLib to use window['material-ui']

@tkrotoff We will definitely move forward and address this problem in v2!

@oliviertassinari wow did not expect a release so soon! Can I make a PR to change this: https://github.com/mui-org/material-ui/blob/v3.0.0/packages/material-ui/scripts/rollup.config.js#L10 ?

@tkrotoff What do you mean? This change is still planed for v4, in 3-4 months.

Je suis un peu perdu : few days ago you were talking about a v2. I saw v3 was just released (could have been a good time to change this) and now talking about a v4.
Anyway, can I make a PR on master? (I guess not, master is for v3 and there is no branch for v4 yet).

Yeah sorry for the confusion. v2 focus has just shifted to v4 for Q1 2019.

You can definitely open a pull request now on master. We will just wait before merging it :).

authors: oliviertassinari tkrotoff

repo: mui-org/material-ui


text:
Menu in AppBar onClick causes scroll to top

[x] This is not a v0.x issue.
[x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔
The page should not scroll to top on click on AppBar Menu Items
Current Behavior 😯
While trying out the latest Material-UI version, I am having some problem when the user clicks on Menu Links, the page scrolls to top.
Steps to Reproduce 🕹
Go to: https://sour-head.surge.sh/ and try to open nav link and see it scroll to top.
Link to PR: https://github.com/fossasia/susi.ai/pull/2370
Code I am using:
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Toolbar from '@material-ui/core/Toolbar';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import Drawer from '@material-ui/core/Drawer';
import AppBar from '@material-ui/core/AppBar';
import IconButton from '@material-ui/core/IconButton';
import MenuItem from '@material-ui/core/MenuItem';
import MenuIcon from '@material-ui/icons/Menu';
import Menu from '@material-ui/core/Menu';
import Translate from '../Translate/Translate.react';
import styled from 'styled-components';
import CircleImage from '../CircleImage/CircleImage';
import { bindActionCreators } from 'redux';
import uiActions from '../../redux/actions/ui';
import Link from '../shared/Link';
import MoreVertIcon from '@material-ui/icons/MoreVert';
import SignUpIcon from '@material-ui/icons/AccountCircle';
import Settings from '@material-ui/icons/Settings';
import Exit from '@material-ui/icons/ExitToApp';
import susiWhite from '../../images/susi-logo-white.png';
import Slide from '@material-ui/core/Slide';
import useScrollTrigger from '@material-ui/core/useScrollTrigger';
import TopMenu from './TopMenu';
import LeftMenu from './LeftMenu';
import CssBaseline from '@material-ui/core/CssBaseline';

import {
  StyledIconButton,
  UserDetail,
  SusiLogo,
  FlexContainer,
} from '../shared/TopBarStyles';

const BurgerMenuContainer = styled.div`
  display: none;
  margin-right: 0.5rem;
  @media (max-width: 800px) {
    display: block;
  }
`;

const TopRightMenuContainer = styled.div`
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: -8px;
  margin-top: 1px;
`;

const StyledDrawer = styled(({ className, ...props }) => (
  <Drawer {...props} classes={{ paper: className }} />
))`
  width: 10rem;
`;

const HideOnScroll = ({ children }) => {
  const trigger = useScrollTrigger();
  return (
    <Slide appear={false} direction="down" in={!trigger}>
      {children}
    </Slide>
  );
};

HideOnScroll.propTypes = {
  children: PropTypes.element,
};

class StaticAppBar extends Component {
  static propTypes = {
    history: PropTypes.object,
    settings: PropTypes.object,
    location: PropTypes.object,
    isAdmin: PropTypes.bool,
    accessToken: PropTypes.string,
    email: PropTypes.string,
    userName: PropTypes.string,
    app: PropTypes.string,
    actions: PropTypes.object,
    showPageTabs: PropTypes.bool,
    avatarImgThumbnail: PropTypes.string,
  };

  constructor(props) {
    super(props);
    this.state = {
      anchorEl: null,
      drawerOpen: false,
    };
  }

  handleDrawerToggle = () => {
    this.setState(prevState => ({ drawerOpen: !prevState.drawerOpen }));
  };

  handleMenuClick = event => {
    this.setState({
      anchorEl: event.currentTarget,
    });
  };

  handleMenuClose = () => {
    this.setState({
      anchorEl: null,
    });
  };

  handleLogin = () => {
    const { actions } = this.props;
    this.handleMenuClose();
    actions.openModal({ modalType: 'login' });
  };

  render() {
    const {
      showPageTabs,
      accessToken,
      email,
      userName,
      avatarImgThumbnail,
      history,
    } = this.props;
    const { anchorEl, drawerOpen } = this.state;
    const open = Boolean(anchorEl);

    const Logged = props => (

        {accessToken && (
          <Link to="/settings">
            <MenuItem onClick={this.handleMenuClose}>
              <ListItemIcon>
                <Settings />
              </ListItemIcon>
              <ListItemText>
                <Translate text="Settings" />
              </ListItemText>
            </MenuItem>
          </Link>
        )}
        {accessToken ? (
          <Link to="/logout">
            <MenuItem onClick={this.handleMenuClose}>
              <ListItemIcon>
                <Exit />
              </ListItemIcon>
              <ListItemText>
                <Translate text="Logout" />
              </ListItemText>
            </MenuItem>
          </Link>
        ) : (
          <MenuItem onClick={this.handleLogin}>
            <ListItemIcon>
              <SignUpIcon />
            </ListItemIcon>
            <ListItemText>
              <Translate text="Login" />
            </ListItemText>
          </MenuItem>
        )}

    );

    let userAvatar = null;
    if (accessToken) {
      userAvatar = avatarImgThumbnail;
    }
    return (

        <CssBaseline />
        <HideOnScroll>
          <AppBar>
            <Toolbar className="app-bar" variant="dense">
              <FlexContainer>
                <BurgerMenuContainer>
                  <IconButton
                    aria-label="Menu"
                    color="inherit"
                    onClick={this.handleDrawerToggle}
                  >
                    <MenuIcon />
                  </IconButton>
                </BurgerMenuContainer>

                  <Link to="/" style={{ outline: '0' }}>
                    <SusiLogo src={susiWhite} alt="susi-logo" />
                  </Link>

                {showPageTabs ? <TopMenu /> : null}
              </FlexContainer>
              <TopRightMenuContainer>
                {accessToken && (

                )}
                <IconButton
                  aria-owns={open ? 'menu-popper' : undefined}
                  aria-haspopup="true"
                  color="inherit"
                  onClick={this.handleMenuClick}
                >
                  <MoreVertIcon />
                </IconButton>
                <Menu
                  id="menu-popper"
                  anchorEl={anchorEl}
                  open={open}
                  onClose={this.handleMenuClose}
                  anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}
                  transformOrigin={{ horizontal: 'right', vertical: 'top' }}
                  getContentAnchorEl={null}
                  transitionDuration={0}
                >
                  <MenuItem key="placeholder" style={{ display: 'none' }} />
                  <Logged />
                </Menu>
              </TopRightMenuContainer>
            </Toolbar>
          </AppBar>
        </HideOnScroll>

    );
  }
}

function mapStateToProps(store) {
  const { email, accessToken, isAdmin, avatarImgThumbnail } = store.app;
  const { userName } = store.settings;
  return {
    email,
    accessToken,
    userName,
    isAdmin,
    avatarImgThumbnail,
  };
}

const mapDispatchToProps = dispatch => {
  return {
    actions: bindActionCreators(uiActions, dispatch),
  };
};

export default withRouter(
  connect(
    mapStateToProps,
    mapDispatchToProps,
  )(StaticAppBar),
);

Context 🔦
Stop the scroll to top on AppBar menu links
Your Environment 🌎

Tech
Version

Material-UI
v4.0.2

React
v16.8.6

Browser
Any

@fragm3 Could you provide an isolated minimal reproduction? Thanks.

@oliviertassinari fixed it with popper component


text:
[Autocomplete] Prevent onInputChange when onChange is fired

I'm not really sure whether to classify this as a bug or feature request as I'm not familiar with what's actually intended here.
When onChange is fired, onInputChange is also fired, even though the user is not actually typing into the search box. Technically, the text input is changing though, so it makes sense from that standpoint that this would happen.

[x] I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

I would argue the onInputChange event should not fire when a user selects an option, and instead only fires when they type into the input field themselves.
Motivation 🔦

This is preventing me from tying an external API request to the user typing in the text field for search, as once the user selects an option, an extra API request is made with the full selection label. I don't want to make an extra request on user selection, as the options available to the user should remain the same.
I have also tried storing the selected option in state and checking that the selected option and the input don't match before making my API request. However, both onChange and onInputChange are executed before the state actually updates in React, so my check is always one state behind.

@Tybot204 We have a related issue in #18656 where we plan to switch the call order between onChange and onInputChange. However, your case is different from this related issue, it's about data fetching and not form validation.
In the google map demo, we hack this problem a bit as we listen for the change event on the text field.
Changing the change event behavior is not an option, the autocomplete value and autocomplete input value are two independent states. The alternative I can think of is to provide a dedicated prop for the data fetching prop. For instance, react-autosuggest has a onSuggestionsFetchRequested prop, EUI has a onSearchChange prop or Antd has an onSearch prop.
I think that we can add a third argument to the onInputChange callback: reason. It could either be "input" when coming from user interaction or "reset" after the value change. Would this work for you? Do you want to work on a pull request?

@oliviertassinari Ah switching the order makes sense to me. I did notice they fired in reverse order than I initially expected. You're right though, it wouldn't completely solve this issue since onChange is firing on select as well.
I think adding a reason argument makes the most sense here. It provides an option to only take action on user input, solving my issue, and also adds a lot of flexibility for other implementations. I can take a stab at a pull request. I think I should have time to get something up this weekend!

Turns out I had some extra time this afternoon to add the reason argument. PR up above!

@Tybot204 Loving it, thank you

@oliviertassinari reason is ok, but input value is changed automatically.
How to prevent this?
selectNewValue calls resetInputValue and it's automatically change input's value setInputValue(newInputValue);
What if I don't want to do that?
There is no any any flag to prevent that and control input by yourself.

@eawtf Control the component, ignore the reset event.

One of the possible solution to prevent executing onInputChange while onChange getting executed.
onInputChange={(e, value) => {
   e && e.constructor.name === "SyntheticEvent" && fetchData(value)
}}

Here, fetchData will only get executed on keypress event.

I have the same problem. My solution is to check the event "type"
                            onInputChange = {(e,v) =>{     if(e.type=== "change") //e.type = "click" when option is selected         setQueryPatient(RegExp.escape(v.toLocaleLowerCase())); }}

authors: Tybot204 absalvamante eawtf oliviertassinari parassahu


text:
Material UI for stenciljs

Summary 💡
Ability to use material ui components with stenciljs
Motivation 🔦

Material-UI is written in React. We have no plans to support Web Components at this time.

I have seen some people do it, if you find some material from the community, it would be great to share them back here.

authors: gred4 mbrookes oliviertassinari


text:
Advanced configuration not needed for SSR with emotion + next.js

As per doc, emotion > 10 just works out of box for SSR. Even next.js emotion example shows no config needed for SSR. So why in material ui example for next.js, emotion cache is needed.

Closing, as I missed the comment on material-ui next.js example which describe the potential problem.


text:
DesktopTimePicker mask doesn't work with AM/PM format

DesktopTimePicker has no effect when AM/PM is used in inputFormat

[x] The issue is present in the latest release.
[x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

When try to enter time I expect mask to kick in and guide user to type just like it does when we use only hour and minutes

Expected Behavior 🤔
I expect to support mask with am/pm format

Steps to Reproduce 🕹

Code sandbox: https://codesandbox.io/s/secondstimepicker-material-demo-forked-9z6ub?file=/demo.tsx
Context 🔦

Your Environment 🌎

`npx @mui/envinfo`
  System:
    OS: macOS 11.2.3
  Binaries:
    Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.4/bin/yarn
    npm: 6.14.10 - ~/.nvm/versions/node/v14.15.4/bin/npm
  Browsers:
    Chrome: 94.0.4606.81
    Edge: 94.0.992.47
    Firefox: 92.0.1
    Safari: 14.0.3
  npmPackages:
    @emotion/react: ^11.4.1 => 11.4.1
    @emotion/styled: ^11.3.0 => 11.3.0
    @mui/core:  5.0.0-alpha.49
    @mui/icons-material: ^5.0.1 => 5.0.1
    @mui/lab: ^5.0.0-alpha.49 => 5.0.0-alpha.49
    @mui/material: ^5.0.2 => 5.0.2
    @mui/private-theming:  5.0.1
    @mui/styled-engine:  5.0.1
    @mui/styles: ^5.0.1 => 5.0.1
    @mui/system:  5.0.2
    @mui/types:  7.0.0
    @mui/utils:  5.0.1
    @types/react: ^16.14.2 => 16.14.2
    react: ^17.0.1 => 17.0.1
    react-dom: ^17.0.1 => 17.0.1
    typescript: ^4.4.3 => 4.4.3

I would like to work on this issue.

If there is any news about this issue?

The workaround is to set disableMaskedInput={false} in component props
Should be fixed by this PR: https://github.com/mui/mui-x/pull/4731
I'm closing this issue since it's a duplicate of https://github.com/mui/mui-x/issues/4488

authors: alexfauquette alisasanib josejimenez-swipejobs repl-krishna-g


text:
[TextField] OutlinedInput does not pass "style" props to NotchedOutline

Duplicates

[X] I have searched the existing issues

Latest version

[X] I have tested the latest version

Current behavior 😯
I want to change the style of the "fieldset" of the NotchedOutline component but OutlinedInput does not pass that props:

Expected behavior 🤔
Be able to pass style props from OutlinedInput to NotchedOutline.
Steps to reproduce 🕹
No response
Context 🔦
No response
Your environment 🌎

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

We too are running into this problem.
In order to apply the styles, we're having to target the generated classnames explicitly, rather than the object keys like we're doing for the rest of the styles.
We're currently using v4 and are looking to upgrade to v5 in the future, but an update to this (or a different workaround) would be fantastic.

authors: juanbercoff scallaway


text:
Update EnhancedButton.js to prevent duplicate event processing

Reinstated the keyUp handler.
Added recording of the timestamp of events processed by handleClick to prevent processing of duplicated events. #9439 #9344
Background :
The handleKeyUp firing of handleClick is duplicating the event on the processing queue.  I've not been able to find the reason for the duplication, I suspect something lower down in the React stack... but I can't prove it either way.  This will however stop a duplicated click event being processed more than once.

@hai-cea Are you good with this PR now?


text:
[FormControlLabel] Reverse margins values when labelPlacement="start"

Fixes #12940 Issue 5

@IvanoffDan It's a great first pull request on Material-UI 👌🏻. Thank you for working on it!

authors: IvanoffDan oliviertassinari


text:
[docs] Add demo for a bottom app bar

Added a demo in the app-bar section for bottom app-bar.
Related to issue:
https://github.com/mui-org/material-ui/issues/12956#issuecomment-423920950

Edit from @eps1lon:
preview of the created demo from this PR

@oliviertassinari can you please tell me, the improvement/changes that I need to do for this? :)

@adeelibr It comes from my understanding that the pull request isn't finished yet.

Form my understanding the main pain point to solve is around scroll handling, both for top and bottom app bar. We could also have a demo with icons, closer to what the specification demonstrate.

You could try following this example: https://material.io/design/components/app-bars-bottom.html#anatomy
Centered FAB seems to be the defacto (I'm aware we need fix the default color...).

Is this better @mbrookes @oliviertassinari ? I tried replicating the example from material design

@adeelibr Better, but based on the text and choice of icons, that looks like a top app bar moved to the bottom. Better to follow the example from the spec as requested.
Also, as mentioned, thebottom app bar isn't valid usage in conjunction with a page of text: Actually, according to the spec, it isn't even valid usage: https://material.io/design/components/app-bars-bottom.html#usage

@mbrookes did you mean something like this?

and on mobile;

Also while I was looking at the link you shared above, one link let to the other 😄 and I found an issue created on the material-components https://github.com/material-components/material-components-web/issues/2659 Some one made an example with the AppBar with fab icon in center cut http://jsfiddle.net/Toufic/czpb8u0f/5/
Would it be okay to add this example using our components in the Appbar documentation, I'd love to create another PR after this is done, .. whenever this is done. 😅

Much better. You could lose the "Material-UI" text (that doesn't belong on a bottom AppBar), and set a width on the demo. You could follow: https://material-ui.com/demos/buttons/#floating-action-buttons (width: 500).
The FAB doesn't appear to stay centered as you resize.
The "Inbox" label at the top of the list doesn't look right to me. Do you have a an example of that from the spec? You could make the subheader sticky though.
Regarding the MCW inset example, it's a clever hack, but it doesn't meet the spec in a couple of important ways. The cutout is solid white rather than transparent, so content scrolled behind would get cut off. The corners of the cutout aren't rounded. IT doesn't support scrolling the app-bar out of view.
Interesting to see that MCW uses CSS variables. (No IE11 or Opera Mini support.)

The "Inbox" label at the top of the list doesn't look right to me. Do you have a an example of that from the spec? You could make the subheader sticky though.

I took the example from https://material.io/design/components/app-bars-bottom.html#behavior
I have made the subheader sticky.

Regarding the MCW inset example, it's a clever hack, but it doesn't meet the spec in a couple of important ways. The cutout is solid white rather than transparent, so content scrolled behind would get cut off. The corners of the cutout aren't rounded. IT doesn't support scrolling the app-bar out of view.

Interesting to see that MCW uses CSS variables. (No IE11 or Opera Mini support.)

The examples where not official, it was made by a contributor.  But MCW hasn't added it into their official docs.

Also regarding the earlier implementation I showed earlier, I played with it a bit, and I can see the content behind the fab button. As you can below. Your thoughts?

regarding the part

IT doesn't support scrolling the app-bar out of view.

I think we can play with this using vanilla js specifically the scroll event listener. window.addEventListener("scroll", () => {});

I can see the content behind the fab button

Interesting. There appeared to be a solid white bar behind the purple bar. I admit I didn't try creating scrollable content. Could you link to your fork of the fiddle?

Understood.
Regarding this current PR, is this PR okay to be merged?

Nearly. The sticky subheader shouldn’t have a transparent background, and now that the demo is in better shape, it also needs code review.

Done sir. Can you please review the code. @mbrookes

This is how the updated demo looks at the moment.

I added my picture at the bottom, 😅 I hope it's okay. 😄

Haha, well, we we already have remy and uxceo-128.jpg, so sure, why not one more - you.
No need to add the whole team though, just assign those three to the messages at random.

I have updated the demo, can you kindly review again 😅

This is going to seem very pedantic, but could you assign the avatars randomly 🎲 - it will look more natural.

Sir I have updated the demo, is this better now? @mbrookes

I was afraid that might happen if I didn't spell it out. My fault. :sweat_smile:
Please revert to assigning them in the array, but randomly. i.e. not 1, 2, 3, 1, 2, 3...
I also notice a couple of other niggles:

The spec says (paraphrasing) that when content overflows, it should be partially obscured, so that it's obvious that there is more content.  At the moment the first two messages fit perfectly. Perhaps change the height of the demo, or reorder the messages so that you get 2 and a bit messages showing.

The Paper needs to be square:

I have updated the demo;

random images order
paper with square prop
increased the container height to show a bit more as suggested.

I have also synced this with the latest master branch.

@adeelibr Nice job! Just compare the end result with the first draft. 👌

@mbrookes thank you for being so helpful, with the code reviews. Working on Material-UI has been a great learning experience and with every code review and suggestion that I get from the team members here. I just improve a lot. So thank you for giving me an opportunity to work on this.

@eps1lon It's how the pinned sub-header behaves in the list demo. List sub-headers don't have a divider in the spec, although I couldn't see an example of pinned sub-headers. Lets park this for now, and keep the examples consistent.
Feel free to open an issue if you think we can improve the ListSubheader component.

🎉

authors: adeelibr mbrookes oliviertassinari


text:
[docs] Close context menu if repeated

Closes #19145
new contextmenu demo
Closer to how native context menus behave in chrome 84 with ubuntu 18.04. It's missing that right click on a contextmenu item acts like a click but I couldn't make it work. Might require more involved work.
Simplified types along the way.

If this solution looks like merged and is closed, why this problem still exists in official releases?

If this solution looks like merged and is closed, why this problem still exists in official releases?

@TomasKomprs Because it was fixed in v5

@TomasKomprs Because it was fixed in v5

@TomasKomprs Because it was fixed in v5 (assuming you are still on v4)

@oliviertassinari Hi, thank you. Yes I'm still on v4.

@TomasKomprs Because it was fixed in v5 (assuming you are still on v4)

@oliviertassinari Hi, thank you. Yes I'm still on v4.

authors: TomasKomprs eps1lon oliviertassinari


text:
[core] Update issue mark duplicate

[x] I have followed (at least) the PR section of the contributing guide.

https://github.com/mui-org/material-ui/pull/24283#issuecomment-756322211

@xrkffgg Thanks for the follow-up, let's give it a try :)

@xrkffgg Thanks for the follow-up, let's give it a try :)

Actually, I thought about it again, I don’t need to remove issue-labeled.yml.
Like this https://github.com/mui-org/material-ui/issues/24314
You add the duplicate, not type Duplicate of #xx, it will auto remove this 2 labels.
If you need, you can add it yourself~ 😊

Actually, I thought about it again, I don’t need to remove issue-labeled.yml.
Like this https://github.com/mui-org/material-ui/issues/24314
You add the duplicate, not type Duplicate of #xx, it will auto remove this 2 labels.
If you need, you can add it yourself~ 😊

@xrkffgg I think that we are good

@xrkffgg I think that we are good

I might have found a new bug. https://github.com/mui-org/material-ui/issues/24365 see how "duplicate" is added and removed at the same time.

I might have found a new bug. https://github.com/mui-org/material-ui/issues/24365 see how "duplicate" is added and removed at the same time.

I think it may happen occasionally because of asynchronous processing.
Don't worry, let me improve it. Thank you for telling me about this bug.

I think it may happen occasionally because of asynchronous processing.
Don't worry, let me improve it. Thank you for telling me about this bug.

After many tests, I also have this phenomenon

I think it's probably because of the API
https://docs.github.com/en/free-pro-team@latest/rest/reference/issues#set-labels-for-an-issue

Set labels for an issue
Removes any previous labels and sets the new labels for an issue.

I will circumvent this API and use other perfect functions

After many tests, I also have this phenomenon

I think it's probably because of the API
https://docs.github.com/en/free-pro-team@latest/rest/reference/issues#set-labels-for-an-issue

Set labels for an issue
Removes any previous labels and sets the new labels for an issue.

I will circumvent this API and use other perfect functions

authors: oliviertassinari xrkffgg


text:
Icon buttons are not keyboard navigable

add a tabIndex="0" to them, and the make sure to have keyUp of "Space" and keyDown of "Enter" activate them.

Thanks @rpflorence  - We've fixed icon buttons to respond to space and enter.

Encountered this problem today: keyUp and keyDown events are working in 2023 and the issue was between keyboard and chair
onClick events should be attached to the <IconButton> component and not its child

as of today, onkeydown is not working.
I have a button that opens a modal, when I press enter I want to close the modal, for some reason the onclick of the modal is triggered, when I press enter and it returns to set the state that opens it.
With a div, box or anything else it works fine

authors: adamjameshuston albert-benavent hai-cea ryanflorence

repo: mui/material-ui