Boost.X stylization in library pagelets

The Libraries home page names libraries in exactly the same way as the old website, some relevant examples follow:

Accumulators
Container Hash
Multi-Array
Functional/Factory
Functional/Overloaded Function
STL_interfaces
Property Map (Parallel)

Now, within each library pagelet, the "Boost.X" stylization is used by simply prepending "Boost." to the previous names:

Boost.Accumulators
Boost.Container Hash
Boost.Multi-Array
Boost.Functional/Factory
Boost.Functional/Overloaded Function
Boost.STL_interfaces
Boost.Property Map (Parallel)

In fact all the cases marked in bold are wrong. Official naming guidelines are woefully incomplete in regards to the many potential situations exemplified, stating only that a library named "xxx" is stylized as "Boost.Xxx". This doesn't cover patterns such as "xxx yyy", "xxx-yyy", etc. actually in use, so let's look at the established practice:

"xxx yyy" goes to "Boost.XxxYyy": "Container Hash" --> "Boost.ContainerHash"
"xxx-yyy" goes to "Boost.XxxYyy": "Multi-Array" --> "Boost.MultiArray"
"xxx/yyy" goes to "Boost.Xxx/Yyy": The only cases here are Boost.Functional/* libraries, which internally have decided to keep the slash symbol (see docs).
"xxx/yyy zzz" goes to "Boost.Xxx/YyyZzz", the only case being Boost.Functional/OverloadedFunction.
"xxx_yyy" goes to "Boost.XxxYyy", the only case being Boost.STLInterfaces.
The only "xxx (yyy)" case is Property Map (Parallel), which unfortunately uses internally the incorrect stylization "Boost Property Map (Parallel)" (no dot used). My suggestion is that we use "Boost.PropertyMap(Parallel)" here.

To sum it up, the correct stylized names are:

Boost.Accumulators
Boost.ContainerHash
Boost.MultiArray
Boost.Functional/Factory
Boost.Functional/OverloadedFunction
Boost.STLInterfaces
Boost.PropertyMap(Parallel)

and the associated styilization algorithm can be defined as follows:

Split the library name as given in the Libraries home page  into words (alphanumeric characters, including digits) and separators (anything else, like blanks and "-")
Capitalize the initial letter of each word
Eliminate the following separators: white space, "-", "_"
Prepend "Boost."

These should all be better now on staging: https://www.stage.boost.cppalliance.org/libraries/msm/boost-1-84-0/
An exception is STLInterfaces, but its name in the database is Stl_interfaces. This originates from libraries.json.

Reopening because of these two cases:

PolyCollection is styilized as Boost.Polycollection (should be Boost.PolyCollection)
ThrowException is stylized as Boost.Throwexception (should be Boost.ThrowException)

In general, capitalization of the first letter should not touch other letters that may be capitalized.

nice catch! fixed in staging now


fix: Inconsistency of flashlight/torch behavior in Scan tab

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/34457
PROPOSAL: https://github.com/Expensify/App/issues/34457#issuecomment-1890362015
Tests

Login to native/mweb App
Tap FAB button
Tap Request money
Tap on flashlight icon to enable (verify nothing happens)
Tap on green circle to take a shoot with camera (verify photo is taken with flashlight is ON)
Mobile Web
Login to ND Expensify
Tap FAB button
Tap Request money
Tap on flashlight icon to enable (verify flashlight is ON)
Tap on flashlight icon to disable ((verify flashlight is OFF)
Verify that Flashlight should function exactly same behavior both mobile apps and mobile web: the flash only applies when talking photos.

[x] Verify that no errors appear in the JS console

Offline tests

Same as above
QA Steps

Login to native/mweb App
Tap FAB button
Tap Request money
Tap on flashlight icon to enable (verify nothing happens)
Tap on green circle to take a shoot with camera (verify photo is taken with flashlight is ON)
Mobile Web
Login to ND Expensify
Tap FAB button
Tap Request money
Tap on flashlight icon to enable (verify flashlight is ON)
Tap on flashlight icon to disable ((verify flashlight is OFF)
Verify that Flashlight should function exactly same behavior both mobile apps and mobile web: the flash only applies when talking photos.

[x] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If a new component is created I verified that:

[x] A similar component doesn't exist in the codebase
[x] All props are defined accurately and each prop has a /** comment above it */
[x] The file is named correctly
[x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[x] The only data being stored in the state is data necessary for rendering and nothing else

[x] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)

[x] All JSX used for rendering exists in the render method
[x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[x] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native

Android: mWeb Chrome

iOS: Native

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

I can't test this either. My phone does not seem to support the web camera feature neither the simulator. Will ask for someone to take over this PR review/test

@s77rt @tienifr I tested the adhoc builds on the Android and iOS Physical devices. Attached are the videos.
The expected result works fine on native iOS and Android app. mWeb Safari no flash light icon (expected result). mWeb Chrome turning on the flashlight has not impact on the camera flash.
Video for iOS native app.
https://github.com/Expensify/App/assets/3069065/cb0a4088-e554-49fe-8619-18e5dbaa81b1
Video for mWeb Safari.
https://github.com/Expensify/App/assets/3069065/0de9d365-0cc4-424e-a213-878bc2db29a5
Video for Android native app:
https://github.com/Expensify/App/assets/3069065/4f7c22f1-a7e3-4fa3-98ab-d7565fa96204
Video for mWeb Chrome.
https://github.com/Expensify/App/assets/3069065/504b1449-4de9-418d-afc7-d939caf1795b

@tienifr The use of setTimeout is discouraged. Can we instead implement a Promise for the get screenshot method?

Sure can we trigger the adhoc build? That would be the fastest to test.

@mountiny Can you please trigger adhoc build

https://github.com/Expensify/App/actions/runs/7645656648

@tienifr Why it's not working in this case? Shouldn't the applyConstraints promise guarantee that the flash in on?

The example on MDN https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/applyConstraints#examples shows like what we are doing should be possible. Maybe there is a problem with getScreenshot. Try to log a message after the promise resolves see if it's logged while the flash is on or not

That still does not make much sense. How is it possible that the flash is on and still get a photo with no flash? We shouldn't use setTimeout unless it's necessary. At this point I think we still need to know why this is failing

@tienifr Any updates here?

@tienifr Are you still working on this? Any updates on the investigation?

I think it may be better to bring this back to the drawing board (gh issue) and close this PR

But at the time we call getScreenshot, the video stream doesn't have the torch effect yet

Why is that? If anything we should wait for the video stream to update. Using setTimeout is still a hacky solution here.

@mountiny Can you please trigger an adhoc build?

@ishpaul777 Did the flash work as expected? I'm not sure I can tell a diff, try in a dark area

@ishpaul777 Please do same test on mWeb, it should have similar feel as in iOS

@ishpaul777 What's your device?

Reviewer Checklist

[X] I have verified the author checklist is complete (all boxes are checked off).
[X] I verified the correct issue is linked in the ### Fixed Issues section above
[ ] I verified testing steps are clear and they cover the changes made in this PR

[X] I verified the steps for local testing are in the Tests section
[X] I verified the steps for Staging and/or Production testing are in the QA steps section
[X] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[X] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[X] I checked that screenshots or videos are included for tests on all platforms
[X] I included screenshots or videos for tests on all platforms
[X] I verified tests pass on all platforms & I tested again on:

[X] Android: Native
[X] Android: mWeb Chrome
[X] iOS: Native
[X] iOS: mWeb Safari
[X] MacOS: Chrome / Safari
[X] MacOS: Desktop

[X] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[X] I verified proper code patterns were followed (see Reviewing the code)

[X] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[X] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[X] I verified that comments were added to code that is not self explanatory
[X] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[X] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[X] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[X] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[X] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[X] I verified the JSDocs style guidelines (in STYLE.md) were followed

[X] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[X] I verified that this PR follows the guidelines as stated in the Review Guidelines
[X] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[X] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[X] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[X] If a new component is created I verified that:

[X] A similar component doesn't exist in the codebase
[X] All props are defined accurately and each prop has a /** comment above it */
[X] The file is named correctly
[X] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[X] The only data being stored in the state is data necessary for rendering and nothing else
[X] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[X] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[X] All JSX used for rendering exists in the render method
[X] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[X] If any new file was added I verified that:

[X] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[X] If a new CSS style is added I verified that:

[X] A similar style doesn't already exist
[X] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)

[X] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[X] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[X] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[X] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[X] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:

[X] I verified that all the inputs inside a form are aligned with each other.
[X] I added Design label and/or tagged @Expensify/design so the design team can review the changes.

[X] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[X] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native

https://github.com/Expensify/App/assets/16493223/130ba519-9c16-4187-89d6-7abfc3e543fb

Android: mWeb Chrome

https://github.com/Expensify/App/assets/16493223/84bddb0d-4052-4d40-964a-df2a296b5f86

iOS: Native

https://github.com/Expensify/App/assets/16493223/25437cf0-ebab-4630-9570-fc32e5211ed0

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

@tienifr Can you please clear up / remove duplicated testing steps and just specify that the flash should be turned on after pressing the shutter button

Tap on flashlight icon to enable (verify nothing happens)

This may be confusing, the button should turn into a pressed state (highlighted). Instead specify that the flash is not turned on yet

@tienifr we have conflicts

Tests were passing

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.56-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.56-8 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


[Rn] 2635 confirm n share

Need to verify on react-native

[ ] sending to contact behave as expected
[ ] is useOnPress usage required?
[ ] compare original native styles from sendlinksummary and receivesummary to the new screen SummaryGeneric, see if anything native specific need to be applied
[ ] validate SummaryGeneric looks good on native

@sirpy this PR is missing the change in Summary.js, is that a master only change? either way I'll continue with review as it is a minor change

@mauriguz please add that change here also


Screencap is generating corrupted PNG files

Describe the bug
When I run the snippet below the generated PNG file is corrupted.
try (FileOutputStream outputStream = new FileOutputStream(aDevice.toString().replace(":", "")+".png")) {
    stdout = aDevice.executeShell("screencap", "-p");
    Stream.copy(stdout, outputStream);
}

The script is taken from the examples:
https://github.com/vidstige/jadb/blob/fedca18ae1ca3e5167487f737e48877939ca8dc7/test/se/vidstige/jadb/test/integration/RealDeviceTestCases.java#L112
No error is raised during the run time.
I am able to correctly generate png file from the command prompt using a standard command like this:
adb.exe  -s <IP_ADDRESS>:5555 exec-out screencap -p > test.png
To Reproduce
Steps to reproduce the behavior:

Below you can find the full example class with the whole example code
I am using Bluestacks emulator to perform the tests
Run the code
Check the generated PNG

Expected behavior
The generated file is a valid PNG.
Screenshots
Hex dump of the corrupted file generated via jadb

Hex dump of the correct file generated via command line

You can notice differences starting from byte number 4 (value is 0d instead of 0a).
Other Notes
Apparently this is a know issue and I've found a relevant topic in stack overflow.
https://stackoverflow.com/questions/13578416/read-binary-stdout-data-like-screencap-data-from-adb-shell
Suggestion there is to use exec-out command, but apparently I am not able to make it work with jdb. Looking into open issues, this may be related to #149 and #150.
Desktop (please complete the following information):

OS: Windows 11
Version 1.2.1
Java 17.0.1

Full class source
package org.example;

import se.vidstige.jadb.*;

import java.io.*;
import java.net.InetSocketAddress;
import java.util.List;

public class Main {

    public static void main(String[] args) {

        // we launch the ADB Server
        try {
            new AdbServerLauncher(new Subprocess(), "D:\\Android\\SDK\\platform-tools\\adb.exe").launch();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (InterruptedException e) {
            System.out.println("AdbServerLauncher InterruptedException: " + e);
        }

        // We connect to the right device
        JadbConnection jadb = new JadbConnection();
        try {
            jadb.connectToTcpDevice(new InetSocketAddress("<IP_ADDRESS>", 5555));
        } catch (IOException e) {
            System.out.println("connectToTcpDevice IOException: " + e);
        } catch (JadbException e) {
            System.out.println("connectToTcpDevice JadbException: " + e);
        } catch (ConnectionToRemoteDeviceException e) {
            System.out.println("connectToTcpDevice ConnectionToRemoteDeviceException: " + e);
        }

        try {
            List<JadbDevice> devices = jadb.getDevices();
            devices.forEach(aDevice -> {
                System.out.println(aDevice.toString());

                // https://github.com/vidstige/jadb/blob/fedca18ae1ca3e5167487f737e48877939ca8dc7/test/se/vidstige/jadb/test/integration/RealDeviceTestCases.java#L112
                InputStream stdout;
                try {
                    try (FileOutputStream outputStream = new FileOutputStream(aDevice.toString().replace(":", "")+".png")) {
                        stdout = aDevice.executeShell("screencap", "-p");
                        Stream.copy(stdout, outputStream);
                    }

                } catch (IOException e) {
                    System.out.println("FileOutputStream IOException: " + e);
                } catch (JadbException e) {
                    System.out.println("FileOutputStream JadbException: " + e);
                }

            });
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (JadbException e) {
            System.out.println(e.getMessage());
        }

    }
}

Thanks for this very detailed issue report. I didn't notice it until right now. I don't have time to look into it currently, and it seems none of the maintainers don't either. It seems like a very nice thing to add though!
I don't currently have java development setup with and IDE and Android emulator, etc. But if someone would like to look into it, that would be great. I would be glad to help in any way I can as I know my way around the source code in this project.


Feature Request: Change namespace property in sensu_check from string to array

And automatically create the check in every namespace in the array. I'm currently doing this:
$namespaces = ['test1', 'test2']
  $namespaces.each |$namespace| {
  sensu_check {"${namespace}-check-hardware":
      command       => "${ruby} ${install_path}/check-hardware-fail.rb -L emerg, alert, crit",
      handlers      => lookup('page::for::production::only'),
      interval      => 60,
      annotations   => {
        'fatigue_check/occurrences' => '5',
      },
      subscriptions => 'hardware',
      namespace     => $namespace,
    }
  }

It would be nice if we could do this instead:

  sensu_check {'check-hardware':
    command       => "${ruby} ${install_path}/check-hardware-fail.rb -L emerg, alert, crit",
    handlers      => lookup('page::for::production::only'),
    interval      => 60,
    annotations   => {
      'fatigue_check/occurrences' => '5',
    },
    subscriptions => 'hardware',
    namespace     =>['test1', 'test2'],
    }
  }

Maybe rename namespace parameter to namespaces if this happens?

A few comments.
First I'd prefer to add a new property called namespaces that would accept an array of namespaces. Most if not all properties of the types are directly mapped to resource properties in Sensu Go so changing namespace to be something different than what Sensu Go accepts is not ideal.
Also your second example wouldn't work because of how we prefetch resources from sensuctl. We look just at name so test1 or test2 would be seen and the other ignored if name is the same. I'll have to investigate if there's a way around this. I think this would require us to employ compound titles so the name would be seen as check-hardware in test1.
Lastly, because Puppet dictates state there is no way to find the state of a property like namespaces because it's not a state in Sensu Go. We'd have to do something like iterate over all checks and group ones with same name and different environments and build namespaces property. Not 100% sure that's possible.

@csoleimani I am still investigating if something like a namespaces property would be possible.  I have fixed several issues with namespace handling in #1126 so now you could do something like this:
$namespaces = ['test1', 'test2']
  $namespaces.each |$namespace| {
  sensu_check {"check-hardware in ${namespace}":
      command       => "${ruby} ${install_path}/check-hardware-fail.rb -L emerg, alert, crit",
      handlers      => lookup('page::for::production::only'),
      interval      => 60,
      annotations   => {
        'fatigue_check/occurrences' => '5',
      },
      subscriptions => 'hardware',
    }
  }

The main change is the composite name that defines namespace so that in sensuctl check list the name would just be check-hardware.  Another possible solution is if you define checks in Hiera and want to have all checks in multiple namespaces:
sensu_checks:
  check-hardware:
    command: ...
    handlers: ...
sensu_namespaces:
  - test1
  - test2

$checks = lookup('sensu_checks')
$namespaces = lookup('sensu_namespaces')

$checks.each |$check_name, $check_properties| {
  $namespaces.each |$namespace| {
    sensu_check { "${check_name} in ${namespace}":
      * => $check_properties,
    }
  }
}

Similar solution where namespaces are define for a check and not globally:
sensu_checks:
  check-hardware:
    command: ...
    handlers: ...
    namespaces:
      - test1
      - test2

$checks = lookup('sensu_checks')

$checks.each |$check_name, $check_properties| {
  $namespaces = $check_properties['namespaces']
  $properties = delete($check_properties, 'namespaces')
  $namespaces.each |$namespace| {
    sensu_check { "${check_name} in ${namespace}":
      * => $properties,
    }
  }
}

@csoleimani Adding a namespaces property isn't going to work. Changing namespace to be an array would not match the property from Sensu Go docs and all Puppet type properties are currently mapped to Sensu Go resource properties.

The changes you implemented look awesome! I'm going to give them a shot. Thanks a bunch!

This appears to be working great. Thanks a bunch!

Going to leave this open until we actually merge those changes.


BEAM-7475: Update programming guide with stateful and timer example

Added example of Python stateful operator and timer example

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

[ ] Choose reviewer(s) and mention them in a comment (R: @username).
[ ] Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
[ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

Post-Commit Tests Status (on master branch)

Lang
SDK
Apex
Dataflow
Flink
Gearpump
Samza
Spark

Go

---
---

---
---
---

Java

Python

---

---
---
---

Pre-Commit Tests Status (on master branch)

---
Java
Python
Go
Website

Non-portable

Portable
---

---
---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@tweise @robertwb @pabloem

R: @tweise @robertwb @pabloem

Thanks Rakesh! This LGTM.
Note to @pabloem : should add java example.


Add support for custom JSON values

A small change to show how custom values in JSON data could be supported by the JSON decoder.
For example one could use
struct MyData : Codable {
let test : String
}
with
{"test":<"my""strange""data">}
and easily get
""my""strange""data""
into test.
This can be used to bypass JSON validation and decode for some data e.g. to have JSON as String inside of JSON without double quotes escape madness.

As this changes public API, we would need matching changes in the Darwin implementation of Foundation, which is not part of this project. @parkera can comment on whether that's likely 🙂

@neon12345 thanks for the idea. Let's discuss it on the Swift forums before proposing a source change here.

@neon12345 Discussion on custom encoders and decoders is occurring in several threads on the Swift forums, including:
https://forums.swift.org/t/pitch-export-jsonencoder-jsondecoder/6945
https://forums.swift.org/t/writing-new-encoders-and-decoders/10207


Roll Flutter Engine from e3fe6dade964 to 6425ae2b5f99 (4 revisions)

https://github.com/flutter/engine/compare/e3fe6dade964...6425ae2b5f99
2023-02-03<EMAIL_ADDRESS>Revert "[impellerc] sort uniforms on metal backend (#39345)" (flutter/engine#39356)
2023-02-03<EMAIL_ADDRESS>Roll Skia from a4079ec4c399 to ee68f3edfa96 (1 revision) (flutter/engine#39355)
2023-02-03<EMAIL_ADDRESS>Roll Fuchsia Linux SDK from pWloCaRzjLEAUvQEz... to CAyoT0SrHHyXCMF31... (flutter/engine#39354)
2023-02-03<EMAIL_ADDRESS>[impellerc] sort uniforms on metal backend (flutter/engine#39345)
Also rolling transitive DEPS:
fuchsia/sdk/core/linux-amd64 from pWloCaRzjLEA to CAyoT0SrHHyX
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC bdero@google.com,rmistry<EMAIL_ADDRESS>on the revert to ensure that a human
is aware of the problem.
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Commit queue failed; closing this roll.


Update laptop_types.html.erb

Content update
https://trello.com/c/Iwq4zRWk

Superseded by https://github.com/DFE-Digital/get-help-with-tech/pull/1658/files


[Feature Request] Swagger (OpenAPI) import

It would really take the client to a whole new level, if I could point it at a Swagger definition file, and it would import all the resources into my environment.
A feature worth paying for, I might add.

I have to admit that I have not used insomnia yet. I want to try it out with our REST services, but we only provide a Swagger definition. I would really appreciate this feature.

@andrioid could you post an example of a Swagger definition file?

By a quick look at the codebase, I'm fairly certain that you could use SwaggerJS (https://github.com/swagger-api/swagger-js) to integrate with Swagger. Their current branch doesn't work with our older Swagger definition (frameworks, meh) though. But it would be a cool feature, regardless of me being able to use it, or not.
 It uses v1.2 of Swagger, while I believe OpenAPI is using v3.

I'm not sure swagger-js would solve this issue. The main problem is parsing and converting the Swagger definition into the Insomnia data format. Paw is currently working on a project to help convert API definition standards back and forth, and I have been working on a PR for (https://github.com/luckymarmot/API-Flow/pull/136).

Whatever works 👍

I think API flow would work great, for both importing and exporting formats so one could choose their client and export to another format for productions or sharing with others

Same here as @nedy13. I didn't use insomnia yet but am keen on doing so. Still we are documenting all our services with swagger. As long as this isn't supported I cannot give it a try.

It would be great to have this feature.

https://github.com/getinsomnia/importers/issues/14

Now that Swagger has become openAPI I think this is even more important. Would it be possible to either store the API data as swagger natively? If not, export as swagger is a much-needed feature as well.

@stale don't you dare closing this.

I won't let it close!

There, now @stale will ignore it with that label 😀

I get No importers found for file when trying https://api.symplur.com/v1/openapi.json with Insomnia 5.14.6. Any guidance on this?

@audvin For now, this plugin supports only Swagger 2.0 format. Your specfication is written in 3.0.0.

That makes sense. I guess we're on OpenAPI 3.0.0

I had the same problem with swagger 2, turns out definitions with non-ascii won't import (generated by https://github.com/mulesoft/oas-raml-converter) e.g.:
{
    "swagger": "2.0",
    "info": {
      "title": "API with Examples",
      "version": ""
    },
    "definitions": {
      "something_User": {
        "example": {
          "name": "Bob",
          "lastname": "Marley"
        },
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "lastname": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "lastname"
        ]
      },
      "something_Org": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "paths": {
      "/organisation": {
        "post": {
          "operationId": "POST_organisation",
          "responses": {
            "default": {
              "description": ""
            }
          },
          "consumes": [
            "application/json"
          ],
          "parameters": [
            {
              "description": "the identifier for the user that posts a new organisation",
              "type": "string",
              "in": "header",
              "name": "UserID",
              "required": true
            },
            {
              "schema": {
                "example": {
                  "name": "Doe Enterprise",
                  "value": "Silver"
                },
                "$ref": "#/definitions/something_Org"
              },
              "in": "body",
              "name": "body",
              "required": true
            }
          ]
        },
        "get": {
          "description": "Returns an organisation entity.",
          "operationId": "GET_organisation",
          "produces": [
            "application/json"
          ],
          "responses": {
            "201": {
              "description": "",
              "examples": {
                "application/json": {
                  "acme": {
                    "name": "Acme"
                  },
                  "softwareCorp": {
                    "name": "Software Corp",
                    "address": "35 Central Street",
                    "value": "Gold"
                  }
                }
              },
              "schema": {
                "$ref": "#/definitions/Org"
              }
            }
          }
        }
      }
    }
  }

The importer fails if a parameter type is object (generated from https://github.com/mulesoft/oas-raml-converter):
{
  "swagger": "2.0",
  "info": {
    "title": "Api",
    "description": "",
    "version": "v1"
  },
  "x-basePath": "/api/{version}/Api",
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/{id}": {
      "parameters": [
        {
          "description": "A NUMBER OR STRING",
          "type": "object",
          "in": "path",
          "name": "id",
          "required": true
        }
      ]
    }
  }
}

Change the type to string and it works correctly.

Hi!
First of all, this example is not valid swagger file. There are at least few problems:

http method missing in endpoint definition
you can NOT use object as type of path parameters (specification)
responses field missing in Path Item Object

...so at the first glance it's not a suprise that it doesnt work. However, I've fixed you example, and find out it still doesnt work.
Here is my input:
{
  "swagger": "2.0",
  "info": {
    "title": "Api",
    "description": "",
    "version": "v1"
  },
  "x-basePath": "/api/{version}/Api",
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/{id}": {
      "get": {
        "parameters": [
          {
            "description": "A NUMBER OR STRING",
            "type": "string",
            "in": "path",
            "name": "id",
            "required": true
          },
          {
            "description": "THIS IS AN EXAMPLE OF OBJECT TYPE PROPERTY",
            "schema": {
              "type": "object"
            },
            "in": "body",
            "name": "body",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Expected response to a valid request"
          }
        }
      }
    }
  }
}

I'am almost 100% sure it's caused by lack of  object parameter's properties definition. I was convinced that this obligatory when using object type parameters, but after second check I know i was wrong. The fix is needed. Till now you can partiali omit the bug by adding "properties": {} to all object type parameters. Working example:
{
  "swagger": "2.0",
  "info": {
    "title": "Api",
    "description": "",
    "version": "v1"
  },
  "x-basePath": "/api/{version}/Api",
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/{id}": {
      "get": {
        "parameters": [
          {
            "description": "A NUMBER OR STRING",
            "type": "string",
            "in": "path",
            "name": "id",
            "required": true
          },
          {
            "description": "THIS IS AN EXAMPLE OF OBJECT TYPE PROPERTY",
            "schema": {
              "type": "object",
              "properties": {}
            },
            "in": "body",
            "name": "body",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Expected response to a valid request"
          }
        }
      }
    }
  }
}

Any plans on supporting OpenApi v3? There are a lot of people ready to jump over from Postman if support for openapi v3 is added (see https://github.com/postmanlabs/postman-app-support/issues/3390).

I have 2.0 spec generated with Swashbuckle.AspNetCore but importer fails to import it. It should work pretty much like swagger-ui.

Yeah, I'm running into the same issue even with Swagger 2.0. I used api-spec-converter to convert our spec, and swagger-parser says it's a valid Swagger 2.0 spec. But Insomnia gives a "No importers found for file" error.
Would be nice if Insomnia actually logged what it didn't like about the imported schema, or ignored non-fatal errors.

Hmm, I'm not familiar with Swagger but here's the code to validate an imported document (it's very simple). Can you spot what the problem might be?
https://github.com/getinsomnia/insomnia/blob/8a751883f893437c5228eb266f3ec3a58e4a53c8/packages/insomnia-importers/src/importers/swagger2.js#L1-L18

That's what the above snippet is doing (you may need to scroll down in it). It checks if api.swagger === '2.0'.
   if (!api || api.swagger !== SUPPORTED_SWAGGER_VERSION) {
     return null;
   }

It's tricky to display the errors because the importer could get any file type. For example, if the user imports a regular insomnia.json file, the Swagger will fail (because it's not Swagger) but the user should not be made aware of that.

Perhaps giving the user the ability to see the logs from each parser, more for debugging purposes, would be useful.

Ehr, what the code is doing now is:
  const api = await parseDocument(rawData);
  if (!api || api.swagger !== SUPPORTED_SWAGGER_VERSION) {
    return null;
  }

I was proposing instead doing something like:
    const rawJson =
      unthrowableParseJson(rawData) || SwaggerParser.YAML.parse(rawData);
    if (!rawJson.swagger) {
      return null;
    }

    try {
      assert.equal(rawJson.swagger, SUPPORTED_SWAGGER_VERSION, 'Only 2.0 is supported');
      const api = parseDocument(rawJson);
    } catch (err) {
      log(err);  // If we got here, this was a Swagger doc but has some validation error.
    }

That way if the JSON/YAML is at least valid and looks like a Swagger spec, Not sure how easy it is to wire that message up to the UX but at least logging the error would help folks debug the issue.

Oh that makes sense. Great idea! I'll see if I can get that into the next release

@gschier , i've looked through the branches and have not seen this fix implemented anywhere.  Has this been de-prioritized? It's frustrating not conveniently having access to what is wrong with the swagger doc (especially if the swagger linter says its valid). Thanks.

Is there any way to help get OpenAPI 3 support going? I forked the project and did a very simple/hacky addition to the importers that updates swagger-importer and fills out the basics using most of the same code as the current swagger2 stuff: https://github.com/trinary/insomnia/tree/openapi3 It works, but someone who knows the codebase better can certainly do a cleaner/more complete job.

@trinary your branch doesn't look hacky to me. As long as it works. If you added some test cases I'd be happy to merge it.
Some support is better than no support for this sort of thing, then the community can help improve it later as needed 😄

Great, I'll get it in shape to be merged soon.

Awesome work folks! Btw it's not called Swagger anymore and hasn't been for a while. Let's just call it "OpenAPI" from now on, regardless of v2 or v3. Old tooling has old names but new tooling should use new name! 🤓

Ah, this was done a while ago. Please report any problems as new issues

Sorry, how do I import data from OpenAPI?
I just tried an import from OpenAPI json url and got "no importers found for file"?

@trinary It would be awesome to have your openapi3 importer in insomnia! Are you still on it?

@gschier Can you confirm if Insomnia actually supports OpenAPI import?
I see this issue as closed and accepted, but when I try to import OpenAPI I get no importers found for file.

@audvin - I noticed that Open API v2 JSON worked, but Open API 3 JSON or YAML did not. Wasn't too big a deal to me because the API I am using is fronted by an API gateway that supports all three, but it is a caveat of which to be aware.

Should I open a feature request for Open API 3 support?


Multiple Sample for bPTR

Hi Team,
I am running bPTR prediction for multiple samples (30+ samples). I would like to know if there any ways to fasten the process for the bPTR prediction for multiple sam files and multiple genomes.
Command i use:
bPTR -f sample_data/Multiple*(3000Genomes).fna -s sample_data/Multiple(30+Samples)*sam -o test.bPTR.tsv -plot test.bPTR.pdf -m coverage
Kindly assist.
Thanks

Hi,
The bottleneck in the process is the time that it takes to read though the SAM files. To speed things up you can parallelize by running several jobs at the same time, each set to a different SAM file (at least until you run into IO issues). For each of those jobs, you should still include paths to the full set of genomes.
Hope this helps. Let me know if you have questions.
Best,
Chris

On Mar 4, 2019, at 7:51 PM, santoshe1<EMAIL_ADDRESS>wrote:
Hi Team,
I am running bPTR prediction for multiple samples (30+ samples). I would like to know if there any ways to fasten the process for the bPTR prediction for multiple sam files and multiple genomes.
Command i use:
bPTR -f sample_data/Multiple*(3000Genomes).fna -s sample_data/Multiple(30+Samples)*sam -o test.bPTR.tsv -plot test.bPTR.pdf -m coverage
Kindly assist.
Thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


How to remove item from array

Hi, I only find push method to push into an array, if there is any method to remove item from array directly? or I need get array first and remove whole array by key, then update one of item in array and insert again?

Hi. Thanks for your message. Yes, at the moment there is no direct way of removing an item from an array. Yes, you can use the workaround as you describe.
But I think your request is very valid. I am happy to implement a remove method for arrays.
Maybe something similar to the remove method of Vec:
pub fn remove(&mut self, index: usize) -> T
Would that be something you are looking for?

Hi again.
There is a new method on tree and on the write guarded tree:
pub fn remove_at(&mut self, index: usize) -> Result<&mut Self, NanoDBError>
BR


How Google Pay and Apple Pay works

Hey I am new at Payment in flutter and I have some simple questions, I am searching for a payment method for a service app (like uber or food delivery).

Can I use this package to implement this kind of payment (service/ product payment) ?

Where I add my billing information for apple and google?

For example in Stripe I have an account with my own api where I add my billing information and check payment status and analytics

After I have configured the app and all the merchantID etc... When and how Apple an google will send my user payments?

Is there a tax like for in app purchase?

Thank you so much.
Seems simple things but I think should be added to package description to help distribute the usage of this package to new adopter like me :)

Hi @kekko7072.

You can use regular payment mechanisms (non-store) for physical services.
Services like Apple Pay or Google Pay do not replace your payment service provider, but work together in combination. Take a look at the list of supported payment providers for Apple Pay and Google Pay.
Apple Pay and Google Pay facilitate the payment method selection for your users. Once they choose one, the payment method is encrypted and returned back to your application, which you can then use to create an order against your PSP (similar to how you do for orders with regular cards). Take a look at the payment result handling sections in the integration guides for Apple Pay (on the "Handle Payment Success or Failure" section) and Google Pay.
Using both the Apple Pay and Google Pay APIs for mobile is free today.

Resources with these topics are included in the table at the end of the readme. Were you able to find them?

Thank you so much.


failed to obtain certificates

I installed the tool as your said in debian vps from digital ocean.
pointed the name servers
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
from the cpanel to godady.
added A record to main ip.
I dont know why i get this error . please let me know if im missing anything.
everything looks to be cool through mx toolbox.
[07:00:20] [err] phishlet hostname must end with 'jingjing.work'
: phishlets hostname linkedin linkedin.jingjing.work
[07:00:34] [inf] phishlet 'linkedin' hostname set to: linkedin.jingjing.work
[07:00:34] [inf] disabled phishlet 'linkedin'
: phishlets enable linkedin
[07:00:45] [inf] enabled phishlet 'linkedin'
[07:00:45] [inf] setting up certificates for phishlet 'linkedin'...
[07:00:45] [war] failed to load certificate files for phishlet 'linkedin', domain 'linkedin.jingjing.work': open /root/.evilginx/crt/linkedin.jingjing.work/linkedin.crt: no such file or directory
[07:00:45] [inf] requesting SSL/TLS certificates from LetsEncrypt...
[07:00:49] [err] [www.linkedin.jingjing.work] acme: Error 400 - urn:acme:error:dns - DNS problem: NXDOMAIN looking up A for www.linkedin.jingjing.work
Error Detail:
Validation for www.linkedin.jingjing.work:80
Resolved to:
Used:

[07:00:49] [!!!] failed to obtain certificates
[07:00:49] [inf] disabled phishlet 'linkedin'

Create an A record for www.linkedin.jingjing.work

stupid of me . thanks alot mate!!

[17:37:25] [inf] enabled phishlet 'facebook'
[17:37:25] [inf] setting up certificates for phishlet 'facebook'...
[17:37:25] [war] failed to load certificate files for phishlet 'facebook', domain 'facebook.efefzeqergveqrg.tk': open /root/.evilginx/crt/facebook.efefzeqergveqrg.tk/facebook.crt: no such file or directory
[17:37:25] [inf] requesting SSL/TLS certificates from LetsEncrypt...
[17:38:02] [err] [www.facebook.efefzeqergveqrg.tk] acme: Error 400 - urn:acme:error:connection - Fetching http://www.facebook.efefzeqergveqrg.tk/.well-known/acme-challenge/RSqivlEhw3kRy4EwhjpOSvJHFjksCd0HYpNl88g_YDM: Timeout during connect (likely firewall problem)
Error Detail:
Validation for www.facebook.efefzeqergveqrg.tk:80
Resolved to:
My public IP
Used: My public IP
[17:38:02] [err] [m.facebook.efefzeqergveqrg.tk] acme: Error 400 - urn:acme:error:connection - Fetching http://m.facebook.efefzeqergveqrg.tk/.well-known/acme-challenge/AttNOeR9Rfx0z07fl23sWguahUt6vE0rhBF46V91Ypw: Timeout during connect (likely firewall problem)
Error Detail:
Validation for m.facebook.efefzeqergveqrg.tk:80
Resolved to:
My public IP
Used: My public IP
[17:38:02] [err] [static.facebook.efefzeqergveqrg.tk] acme: Error 400 - urn:acme:error:connection - Fetching http://static.facebook.efefzeqergveqrg.tk/.well-known/acme-challenge/G1G5AI4UMlDYdybRmHRqAMDz0x913nkjt-AqsnjSy-g: Timeout during connect (likely firewall problem)
Error Detail:
Validation for static.facebook.efefzeqergveqrg.tk:80
Resolved to:
My public IP
Used: My public IP
Of course I ve set my public IP found on https://mon-ip.io/, I have configure my domain on Freenom

Make sure that nothing is using porn 80
And try again to get acme asl certificate


Anyone able to run this?

Is there additional info located anywhere on getting this to run?
I configured a SQL database and updated appsettings.json but how does my SQL database get populated?  Can't the solution just use the embedded SQLLite.db to demo with?
Is there a live example online that is accessible anywhere?
When settings Maanfee.Dashboard.Server as the startup project I just get a blank white page.

Can't get this to run either...  Any demo live site running somewhere we can check out?


Memory profiling and fixing memory leak

What kind of change does this PR introduce?
Bugfix and add memory profiling.

Checklist

[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my code
[ ] If applicable, I have added tests to prove my fix is functional/effective
[ ] I have linted my code locally prior to submission
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation (e.g. README.md, requirements.txt)
[ ] New and existing unit tests pass locally with my changes

Summary

This PR responds to Issue #5. The goal is to add memory profiling to record.py, add memory usage to performance plots, and fix the memory leak caused by the screenshots described here.
How can your code be run and tested?
git remote add angelala3252 https://github.com/angelala3252/OpenAdapt.git
git fetch angelala3252
git checkout feat/memory
pip install -r requirements.txt
python -m openadapt.record "testing out openadapt"

@angelala3252
Resolved Merge Conflicts. Let me know if there are any issues :)

Updates:

the memory leak seems to have been resolved after adding del prev_event to process_events. sleeping for any amount of time in read_screen_events had no effect.

Comparison of memory usage before and after any changes on a shorter recording:
tracemalloc found 202mb from screenshots, and pympler found 189.85 MB
Performance graph:

After after adding del prev_event:
tracemalloc found 16mb from screenshots, and pympler found 7.91 MB
Performance graph:

This is a significant decrease in memory usage, and I also tested it with longer recordings and got great results. Before, longer recordings would cause Pycharm to take up to 4-5000 MB of memory when a lot of input was given, and around 2-3000 MB when no input was given. After this change, Pycharm only takes up ~1200MB on longer recordings and stays pretty constant even if a lot of input is given.

Excellent work @angelala3252 ! What else is required here in order to be ready for review?

@abrichr The only thing left to do is plotting the memory usage over time

After testing recording a bit more, I don't think that the memory leak has actually been fixed, because it's very inconsistent. Sometimes, the memory usage returns to the previous memory usage before the changes, using 4-5 GB of memory, and sometimes the memory stays around 600 MB. I'm not sure how the results I got previously were so good, but perhaps it was because the recordings were relatively shorter and didn't have as many ActionEvents, but the memory usage doesn't stay as low when I produce more ActionEvents by typing really fast. The problem is still the screenshots, and it seems like the screenshots are just being put into the queue faster than they are processed because eventually, the memory usage goes back down to a base level of around 400MB. I will have to continue looking into the memory leak and how to fix this.

Thanks @angelala3252 ! As discussed this is expected behavior and we can delay addressing this for now.

added memory to the legend in 2918fc6
updated code to write memory data to database instead of a file in 3a8d4b3

Thanks @angelala3252 ! Can you please show an updated screenshot? Also please fix merge conflicts 🙏

Updated screenshot:

@abrichr resolved merge conflicts and addressed comments

@abrichr ready for review

Thanks @angelala3252 ! I get this exception when creating a recording:

2023-07-02 10:45:43.902 | INFO     | openadapt.config:<module>:130 - DIRNAME_PERFORMANCE_PLOTS=performance
2023-07-02 10:45:45.232 | INFO     | __main__:wrapper_logging:88 -  -> Enter: record(foo)
2023-07-02 10:45:45.252 | INFO     | __main__:record:614 - task_description='foo'
2023-07-02 10:45:45.253 | INFO     | __main__:wrapper_logging:88 -  -> Enter: create_recording(foo)
2023-07-02 10:45:45.310 | INFO     | __main__:create_recording:555 - recording=Recording(id=5, timestamp=1688309145.2541811, monitor_width=1512, monitor_height=982, double_click_interval_seconds=0.5, double_click_distance_pixels=5, platform='darwin', task_description='foo')
2023-07-02 10:45:45.310 | INFO     | __main__:wrapper_logging:92 -  <- Leave: create_recording(Recording(id=5, timestamp=1688309145.2541811, monitor_width=1512, monitor_height=982, double_click_interval_seconds=0.5, double_click_distance_pixels=5, platform='darwin', task_description='foo'))
2023-07-02 10:45:45.312 | INFO     | __main__:wrapper_logging:88 -  -> Enter: read_window_events(<queue.Queue object at 0x142efb9d0>, <multiprocessing.synchronize.Event object at 0x142fc0280>,<PHONE_NUMBER>.2541811)
2023-07-02 10:45:45.318 | INFO     | __main__:read_window_events:429 - starting
2023-07-02 10:45:45.329 | INFO     | __main__:process_events:132 - starting
2023-07-02 10:45:45.335 | INFO     | __main__:read_screen_events:402 - starting
2023-07-02 10:45:45.335 | INFO     | __main__:read_screen_events:402 - starting
2023-07-02 10:45:45.538 | INFO     | __main__:read_window_events:448 - _window_data={'title': 'Terminal OpenAdapt — tmux — 214×51', 'left': 0, 'top': 38, 'width': 1512, 'height': 944, 'window_id': 204051}
2023-07-02 10:45:45.538 | INFO     | __main__:read_window_events:448 - _window_data={'title': 'Terminal OpenAdapt — tmux — 214×51', 'left': 0, 'top': 38, 'width': 1512, 'height': 944, 'window_id': 204051}
2023-07-02 10:45:47.155 | INFO     | __mp_main__:wrapper_logging:88 -  -> Enter: performance_stats_writer(<multiprocessing.queues.Queue object at 0x109ff0790>,<PHONE_NUMBER>.2541811, <multiprocessing.synchronize.Event object at 0x143243880>)
2023-07-02 10:45:47.162 | INFO     | __mp_main__:performance_stats_writer:479 - performance stats writer starting
2023-07-02 10:45:47.165 | INFO     | __mp_main__:wrapper_logging:88 -  -> Enter: write_events(action, <function write_action_event at 0x142b91a20>, <multiprocessing.queues.Queue object at 0x1098f4790>, <multiprocessing.queues.Queue object at 0x142baf880>,<PHONE_NUMBER>.2541811, <multiprocessing.synchronize.Event object at 0x142bafbb0>)
2023-07-02 10:45:47.172 | INFO     | __mp_main__:write_events:273 - event_type='action' starting
2023-07-02 10:45:47.185 | INFO     | __mp_main__:wrapper_logging:88 -  -> Enter: write_events(screen, <function write_screen_event at 0x144ec1bd0>, <multiprocessing.queues.Queue object at 0x10bbec790>, <multiprocessing.queues.Queue object at 0x144edf880>,<PHONE_NUMBER>.2541811, <multiprocessing.synchronize.Event object at 0x144edfbb0>)
2023-07-02 10:45:47.192 | INFO     | __mp_main__:write_events:273 - event_type='screen' starting
2023-07-02 10:45:47.195 | INFO     | __mp_main__:wrapper_logging:88 -  -> Enter: write_events(window, <function write_window_event at 0x1429d1c60>, <multiprocessing.queues.Queue object at 0x109750790>, <multiprocessing.queues.Queue object at 0x1429ef880>,<PHONE_NUMBER>.2541811, <multiprocessing.synchronize.Event object at 0x1429efbb0>)
2023-07-02 10:45:47.194 | INFO     | __mp_main__:memory_writer:501 - Memory writer starting
2023-07-02 10:45:47.202 | INFO     | __mp_main__:write_events:273 - event_type='window' starting
Process Process-5:
Traceback (most recent call last):
  File<EMAIL_ADDRESS>line 314, in _bootstrap
    self.run()
  File<EMAIL_ADDRESS>line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/abrichr/oa/OpenAdapt/openadapt/record.py", line 517, in memory_writer
    crud.insert_memory_stat(
  File "/Users/abrichr/oa/OpenAdapt/openadapt/crud.py", line 118, in insert_memory_stat
    _insert(memory_stat, MemoryStat, memory_stats)
  File "/Users/abrichr/oa/OpenAdapt/openadapt/crud.py", line 39, in _insert
    assert not event_data, event_data
AssertionError: {'memory_usage': 889.0}

Any ideas?


WIP: upgrade iavl and cosmos-sdk with fast storage

Closes: #XXX
Description

For contributor use:

[ ] Targeted PR against correct branch (see CONTRIBUTING.md)
[ ] Updated relevant documentation (docs/) or specification (x/<module>/spec/)
[ ] Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
[ ] Re-reviewed Files changed in the Github PR explorer

Codecov Report

Merging #857 (09f5ce2) into main (39c4457) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #857   +/-   ##
=======================================
  Coverage   19.86%   19.86%
=======================================
  Files         190      190
  Lines       24763    24763
=======================================
  Hits         4918     4918
  Misses      18982    18982
  Partials      863      863

Continue to review full report at Codecov.

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


Can the pre-trained model be used both indoor and outdoor ?

Thank you for sharing your brilliant work.
I have a little question.
Can the pre-trained patch2pix_pretrained.pth model be used both indoor and outdoor ?

Hi,
Yes you can used it for both indoor and outdoors, as we showed in the paper.

@GrumpyZhou Thanks for your reply 😊 .


Different results after saving & loading model

I have built U-Net with EfficientNetB7 as the backbone and after fine-tuning, I am trying to load the model generated by the ModelCheckpoint() callback with save_weights_only=False.
If I load the model after training for inference, the output from predict() does not reflect the metrics during training or the inference results if I use the model from the final epoch.
As a test, I trained model then saved and loaded it into a new model test_model. For some reason, the inference results are completely different. Here is the code for my model:
# two Conv2D with optional batchnorm layer
def ConvBlock(inputs, filters, batchnorm, l2_reg, index):
    def ConvUnit(inputs, layer_index):
        x = Conv2D(filters, 3, padding='same', name='conv_'+layer_index, use_bias=not(batchnorm), kernel_initializer='he_normal', kernel_regularizer=l2(l2_reg))(inputs)
        if batchnorm:
            x = BatchNormalization(name='bn_'+layer_index)(x)
        return Activation('relu', name='relu_'+layer_index)(x)

    x = ConvUnit(inputs, index+'a')
    return ConvUnit(x, index+'b')

# Conv2DTranspose with optional batchnorm layer
def UpsampleBlock(inputs, filters, batchnorm, l2_reg, index):
    x = Conv2DTranspose(filters, 2, padding='same', name='up_'+index, use_bias=not(batchnorm), kernel_initializer='he_normal', kernel_regularizer=l2(l2_reg), strides=2)(inputs)
    if batchnorm:
        x = BatchNormalization(name='bn_'+index)(x)
    return Activation('relu', name='relu_'+index)(x)

# model details
enc_stages = ["stem_activation", "block2g_add", "block3g_add", "block5j_add", "block7d_add"]
dec_filters = [512, 256, 128, 64, 32]
batchnorm = False
l2_reg = 1e-3
freeze_backbone = False

# input
input = keras.Input(shape = (512, 512, 3), name = 'main_input')

# encoder
backbone = EfficientNetB7(
    include_top = False,
    weights = 'imagenet',
    input_tensor = input
)

# freeze entire backbone or just batchnorm layers
if freeze_backbone:
    for layer in backbone.layers:
        layer.trainable = False
else:
    for layer in backbone.layers:
        if isinstance(layer, tf.keras.layers.BatchNormalization):
            layer.trainable = False

# extract output at various stages
backbone_outputs = [backbone.get_layer(stage).output for stage in enc_stages]
encoder = tf.keras.Model(inputs = input, outputs = backbone_outputs)
enc_outputs = encoder.output

# decoder
up_31 = UpsampleBlock(enc_outputs[4], dec_filters[0], batchnorm, l2_reg, '31')
cat_31 = Concatenate(name='cat_31')([up_31, enc_outputs[3]])
conv_31 = ConvBlock(cat_31, dec_filters[0], batchnorm, l2_reg, '31')

up_22 = UpsampleBlock(conv_31, dec_filters[1], batchnorm, l2_reg, '22')
cat_22 = Concatenate(name='cat_22')([up_22, enc_outputs[2]])
conv_22 = ConvBlock(cat_22, dec_filters[1], batchnorm, l2_reg, '22')

up_13 = UpsampleBlock(conv_22, dec_filters[2], batchnorm, l2_reg, '13')
cat_13 = Concatenate(name='cat_13')([up_13, enc_outputs[1]])
conv_13 = ConvBlock(cat_13, dec_filters[2], batchnorm, l2_reg, '13')

up_04 = UpsampleBlock(conv_13, dec_filters[3], batchnorm, l2_reg, '04')
cat_04 = Concatenate(name='cat_04')([up_04, enc_outputs[0]])
conv_04 = ConvBlock(cat_04, dec_filters[3], batchnorm, l2_reg, '04')

# final layers
up_final = UpsampleBlock(conv_04, dec_filters[4], batchnorm, l2_reg, 'final')
sigmoid = Conv2D(1, 1, activation='sigmoid', name='main_output', kernel_initializer='he_normal', padding='same', kernel_regularizer=l2(l2_reg))(up_final)

model = keras.Model(inputs=input, outputs=sigmoid, name = 'Eff-UNet')

Here is the code for training:
# generate results dir
if isdir(results_dir): # on Google Colab so results_dir looks like /content/drive/MyDrive/results
    shutil.rmtree(results_dir)

mkdir(results_dir)

# compile model
model.compile(optimizer = Adam(learning_rate=learning_rate), loss = 'binary_crossentropy', metrics = ['accuracy', 'Precision', 'Recall'])

# set callbacks
callbacks = [
    CSVLogger(join(results_dir, 'metrics.csv'), separator=',', append=False),
    ModelCheckpoint('/content/best.model.keras', verbose=1, save_best_only=True, save_weights_only=False),
]

# train model
model.fit(
    dataset['train'],
    epochs=num_epochs,
    steps_per_epoch=train_steps,
    validation_steps=val_steps,
    validation_data=dataset['val'],
    callbacks=callbacks,
    verbose=1
)

# save and load model
model.save('/content/test.model.keras')
test_model = load_model('/content/test.model.keras')

This is the code for inference, where I use either model or test_model:
# redefine training and validation dataset
# train_images and val_images are lists of image files like [1.jpg, 2.jpg, ...]
# image_source is the path to the files like /content/drive/MyDrive/data/images
train_dataset = tf.data.Dataset.from_tensor_slices([image_source + img for img in train_images])
val_dataset = tf.data.Dataset.from_tensor_slices([image_source + img for img in val_images])

def parse_inference_image(img_path):
    # read image and load it into 3 channels (pre-trained backbones require 3)
    image = tf.io.read_file(img_path)
    image = tf.image.decode_png(image, channels=3)

    # convert tensor objects to floats and normalize images ([0,255] -> [0.0, 1.0]) and return tensor
    return tf.cast(image, tf.float32) / 255.0

# replace every image path in the training and validation directories with a loaded image and annotation pair
train_dataset = train_dataset.map(parse_inference_image, num_parallel_calls=AUTOTUNE)
val_dataset = val_dataset.map(parse_inference_image, num_parallel_calls=AUTOTUNE)

# batch data
train_dataset = train_dataset.batch(1)
val_dataset = val_dataset.batch(1)

# get predictions
train_preds = model.predict(train_dataset, verbose=1)
val_preds = model.predict(val_dataset, verbose=1)

# define output directories
train_save_dir = join(results_dir, 'train_preds')
mkdir(train_save_dir)
train_save_fns = [join(train_save_dir, fn + '.png') for fn in train]

val_save_dir = join(results_dir, 'val_preds')
mkdir(val_save_dir)
val_save_fns = [join(val_save_dir, fn + '.png') for fn in val]

# function for looping through preds and saving them
def save_preds(pred_tensor, save_fns):
    for idx, pred in enumerate(pred_tensor):
        save_img(save_fns[idx], pred)

# save train and val preds
save_preds(train_preds, train_save_fns)
save_preds(val_preds, val_save_fns)

Here is a prediction using model:

Here is the same prediction using test_model:

I have also tested this with the ordinary U-Net model (same code, just different encoder) and the results matched as expected. For some reason, when EfficientNet is used, the results do not match. I have used the following code snippet to compare the weights of both models. In this case, no difference was found, despite the inference results not matching.
 for i, layer in enumerate(model.layers):
    weights = layer.get_weights()
    test_weights = test_model.layers[i].get_weights()

    if len(weights) != 0:
        for arr in range(len(weights)):
            if not np.allclose(weights[arr], test_weights[arr]):
                print(f"Difference found in layer {i} ({layer.name})")

If there is anything else that would account for the difference upon loading the model, please let me know. Thank you.

What Keras version are you on? I think I recall we fixed this issue in the past.

Try pip install keras --upgrade

Upgrading to Keras 3.6.1 fixed the issue. Thank you for your help.


NSURLErrorDomain (code = -1202)

Hi everyone, I am new to Telegraph. I got the error NSURLErrorDomain, code = -1202 when trying to run on HTTPS. I am using the ca.der and localhost.p12 provided in the sample.
I tried with HTTP and it works. Not sure what is the problem with HTTPS, Any idea?
override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(webView)
        loadCertificates()
        if let identity = identity, let caCertificate = caCertificate {
            server = Server(identity: identity, caCertificates: [caCertificate])
        } else {
            server = Server()
        }
        guard let url = URL(string: "https://localhost:3231/index.html") else {
            return
        }
        webView.uiDelegate = self
        let path = Bundle.main.url(forResource: "public", withExtension: nil)!
        server.serveDirectory(path)
        try! server.start(port: 3231, interface: "localhost")
        webView.load(URLRequest(url: url))
    }

private func loadCertificates() {
        if let identityURL = Bundle.main.url(forResource: "localhost", withExtension: "p12") {
            identity = CertificateIdentity(p12URL: identityURL, passphrase: "test")
        }
        if let caCertificateURL = Bundle.main.url(forResource: "ca", withExtension: "der") {
            caCertificate = Certificate(derURL: caCertificateURL)
        }
        if let caCertificate = caCertificate {
            tlsPolicy = TLSPolicy(commonName: "localhost", certificates: [caCertificate])
        }
    }

func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping(URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
        if let serverTrust = challenge.protectionSpace.serverTrust {
            let credential = URLCredential(trust: serverTrust)
            completionHandler(.useCredential, credential)
        }else{
            completionHandler(.useCredential, nil)
        }
    }

plist.info
<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
		<key>NSExceptionDomains</key>
		<dict>
			<key>localhost</key>
			<dict>
				<key>NSExceptionAllowsInsecureHTTPLoads</key>
				<true/>
				<key>NSIncludesSubdomains</key>
				<true/>
			</dict>
		</dict>
	</dict>

Hi, when you use a certificate it should come from a trusted root certificate authority. The error -1202 is indicating that the certificate is invalid.
In the demo app you can see that we work around this issue by explicitly trusting the certificate. See https://github.com/Building42/Telegraph/blob/main/Examples/Demo/TelegraphDemo.swift#L213
Another thing you could do is add the certificate on the client's system and mark it as trusted (using the Keychain Access app). You can find some information on certificates here: https://github.com/Building42/Telegraph#how-do-i-create-the-certificates


Add support for transaction memos.

Purpose
Add support for transfers with memo.
Changes

New endpoint v1/accTransactions which lists transfers with a memo.
v0/transactionCost endpoint is updated to support new transfer types. The change is backwards compatible.
Existing v0/accTransactions endpoint converts outcomes of new transaction types to old ones.

Checklist

[ ] My code follows the style of this project.
[ ] The code compiles without warnings.
[ ] I have performed a self-review of the changes.
[ ] I have documented my code, in particular the intent of the
hard-to-understand areas.
[ ] (If necessary) I have updated the CHANGELOG.

Still missing

[ ] update dependencies after concordium-client is properly updated


Tooltip don't work when app is on fullscreen

Getting errors on hover when I put my app on fullscreen.
chrome 59 errors:
Uncaught TypeError: Cannot read property 'offsetHeight' of null from popper.js
Uncaught TypeError: Cannot read property 'contains' of null from tooltip.js
same issue on all browsers

Do you have a repro?

It's working in the demo.

Hello,
First of all, thanks for your great work !
I've set up a quick CodeSandBox that shows what happens when you bring a part of the page to fullscreen.
In this example, each blue button has a tooltip that works as expected. But when your bring that to fullscreen, the tooltips won't work anymore.
I guess this is related to the way poppers attach its dom elements to the body (which is probably not accessible from the fullscreen mode).
Maybe this could be fixed with an advances config ?
https://79ez9.csb.dev/
https://codesandbox.io/s/v-tooltip-fullscreen-79ez9 (fullscreen is not allowed inside CodeSandBowx editor. You have to test with the standalone url above).
Thanks for your attention

Have same problem

You need to set the container of the tooltips to an element within the element that is in full-size mode


Review AU controls with 3PAO

Review this control set with Veris, using an appointment booked via the slots on this calendar.

@dlapiduz already met with Veris on this one.

AU-3 (1) needs to remove the section about BOSH CLI


[SPARK-15294][R] Add pivot to SparkR

What changes were proposed in this pull request?
This PR adds pivot function to SparkR for API parity. Since this PR is based on https://github.com/apache/spark/pull/13295 , @mhnatiuk should be credited for the work he did.
How was this patch tested?
Pass the Jenkins tests (including new testcase.)

Hi, @shivaram , @felixcheung .
This is the up-to-date pivot PR.

Test build #60872 has started for PR 13786 at commit 54b9dbc.

Test build #60872 has finished for PR 13786 at commit 54b9dbc.

This patch fails R style tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60872/
Test FAILed.

Test build #60874 has started for PR 13786 at commit cb5db57.

Test build #60874 has finished for PR 13786 at commit cb5db57.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60874/
Test PASSed.

Test build #60878 has started for PR 13786 at commit c462296.

Test build #60878 has finished for PR 13786 at commit c462296.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60878/
Test PASSed.

Test build #60883 has started for PR 13786 at commit da92ae4.

Test build #60885 has started for PR 13786 at commit 288cbe1.

Test build #60885 has finished for PR 13786 at commit 288cbe1.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60885/
Test PASSed.

Test build #60883 has finished for PR 13786 at commit da92ae4.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60883/
Test PASSed.

Thank you for review, @shivaram and @felixcheung .
Now, it's ready for review again.

minor comment, LGTM otherwise. thanks!

Thank you always, @felixcheung !

Test build #60898 has started for PR 13786 at commit 63ef66b.

Test build #60899 has started for PR 13786 at commit f2b010e.

LGTM!

Test build #60898 has finished for PR 13786 at commit 63ef66b.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60898/
Test PASSed.

Merged build finished. Test PASSed.

Test build #60899 has finished for PR 13786 at commit f2b010e.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/60899/
Test PASSed.

Merged build finished. Test PASSed.

LGTM. Merging this to master, branch-2.0

Thank you, @shivaram !

Thanks @dongjoon-hyun @shivaram  and all. I haven't got time to finish this fully, so thanks for picking this up!!

Hello everyone,  Thanks a lot for implementing the pivot functionality. I have started using SparkR recently and would like to know if the pivot method is included in the library as I don't find it in the documentation. Also, I am looking to use the unpivot functionality. It would be great if it is included.

By unpivot, do you mean something like reshape2::melt function?
Pivot function is included in branch-2.0.0 so you would have to build Spark
distribution from this branch yourself
2016-06-24 4:25 GMT+02:00 Div333<EMAIL_ADDRESS>
Hello everyone, Thanks a lot for implementing the pivot functionality. I
have started using SparkR recently and would like to know if the pivot
method is included in the library as I don't find it in the documentation.
Also, I am looking to use the unpivot functionality. It would be great if
it is included.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/apache/spark/pull/13786#issuecomment-228241166, or mute
the thread
https://github.com/notifications/unsubscribe/ACMWZMcCWQ7P7HS0frScfGwAuIVqz5LGks5qO0A3gaJpZM4I6HCi
.

Hi, @Div333 .
@mhnatiuk is right.
For the binary and document, Spark 2.0 is very close to release. You had better wait. :)

Hi,
@mhnatiuk @dongjoon-hyun  Thanks for your quick response. Yes, I am looking for equivalent of reshape2::melt function.


Multiple vcard file download in Codeigniter

vcard export download in Codeigniter works only once.
I want my user to select multiple contacts and export their details in vcard format.This is my controller:
        function get_contacts_email_vcard()
        {
            $this->load->library('vcard');
            $datavcard = $this->getvcard($this->user_model->get_email_contacts());
        }
        function getvcard($dat)
        {
            $datavcarddata = array();
            foreach($dat as $data){
            $datavcarddata['display_name'] = $data->name;
            $datavcarddata['cell_tel'] = $data->mobile_no;
            $datavcarddata['email1'] = $data->email;
            if (is_array($datavcarddata))
            {
                $this->vcard->vcard($datavcarddata);
            }
            else
            {
                $this->vcard->vcard();
            }
            $this->vcard->zipdownload();
            }
            return $datavcarddata;
        }

This is my view

<a href="<?php echo base_url(); ?>auth/get_contacts_email_vcard">vCard(Address Book)

This is my model:
function get_email_contacts(){
$this->db->select('*');
        $this->db->from('contacts');
        $this->db->where('user_id', $this->session->userdata('user_id'));
        $this->db->order_by('date_created', 'DESC');
        $query = $this->db->get();
        $result = $query->result();
        return $result;
}

The issue I am facing is that this works only once. Only the data of the last contact from my database gets downloaded in a zip file. I want to create different zip files or vcf files for different contacts. And i also want to create a single zip file containing all the vcf files.

Sorry, but this is not StackOverflow ... we only accept bug reports here.
Any other questions that you might have, you should ask on the forums.


fix: path segment names are not all localizable

Prerequisites
If this PR changes PHP code or dependencies:

[x] I've run composer format and fixed any code formatting issues.
[ ] I've run composer analyze and addressed any static analysis issues.
[ ] I've run php artisan test and ensured that all tests pass.
[x] I've run composer localize to update localization source files and committed any changes.

If this PR changes CSS or JavaScript code or dependencies:

[ ] I've run npm run lint and fixed any linting issues.
[ ] I've run npm run build and ensured that CSS and JavaScript assets can be compiled.

Routes can't be translated in to ASL or LSQ. I note there is no ASL file. Should it just be duplicated from English?

I'm not 100% sure I'm understanding this correctly, so please let me know if I've misunderstood. I believe if there is no localization provided that it will fall back to the key which is in English so the ASL related routes should be the same as EN. Regarding LSQ this should be copied from FR when the localize command runs the folder copy action. This will use the French localization for the Routes to match the French text used on the pages when LSQ is set.


chore: Unpin @types/jsonwebtoken

Fixes #1723

Looks like the issue is now fixed in https://github.com/firebase/firebase-admin-node/pull/1747


UI - WebUI.Call throttle - Silent crash can occur without throttle

https://github.com/kapraran/vu-debug-gui/blob/b90dc6a21566a392c633252ec29499c1eccf7243/ui/src/app/index.js#L33
Commented out this function and worked fine, but as soon as I uncommented and played around with the sliders I silent crashed (from time to time, hard to reproduce).

fixed in https://github.com/kapraran/vu-debug-gui/commit/0eefd625d698c66d9aba9c4e201c3ceeeafdbf6d


replace fors by forEach where it is possible

mostly in scrapers there are nested for loops

I have checked and reduced the number of nested loops earlier, the current ones are using break -s inside the loops which cannot be reimplemented with forEach formula right now.
...maybe in nokedli.js scraper it could be done. that one requires full refactor already, and deserves a module dedicated for table OCR-ing.
I close the issue now


Current URL to be appended at log messages

It is often useful to know not only the file and line where the error occurred, but also the actual URL.

If I can edit log_filename and log_date_format, why not this?
I did it primarily for myself and my fork, so I offer it here as well.

Thanks for the PR, but I can't merge it.
While for you it might be the URL, for other people might be the controller name/method name, and so on. While for you it might be an appending, for others a prepending would be better, and so on.
Indeed, the solution to this is to extend the core class of the framework's base code and adapt it to your needs.


import_measures failed with 500 error for 2017_09

The error's from BigQuery:
Traceback (most recent call last):                                                                                File "manage.py", line 12, in <module>                                                                                execute_from_command_line(sys.argv)
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/webapps/openprescribing/openprescribing/pipeline/management/commands/fetch_and_import.py", line 12, in handle
    run_all(kwargs['year'], kwargs['month'])
  File "/webapps/openprescribing/openprescribing/pipeline/runner.py", line 438, in run_all
    run_task(task, year, month, last_imported=last_imported)
  File "/webapps/openprescribing/openprescribing/pipeline/runner.py", line 403, in run_task
    task.run(year, month, **kwargs)
  File "/webapps/openprescribing/openprescribing/pipeline/runner.py", line 254, in run
    call_command(*tokens)
  File "/webapps/openprescribing/openprescribing/pipeline/runner.py", line 383, in call_command
    return django_call_command(*args)
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 119, in call_command
    return command.execute(*args, **defaults)
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/webapps/openprescribing/openprescribing/frontend/management/commands/import_measures.py", line 95, in handle
    practice_rows_created = practice_calculation.calculate()
  File "/webapps/openprescribing/openprescribing/frontend/management/commands/import_measures.py", line 534, in calculate
    number_rows_written = self.write_practice_ratios_to_database()
  File "/webapps/openprescribing/openprescribing/frontend/management/commands/import_measures.py", line 639, in write_practice_ratios_to_database
    for datum in self.get_rows_as_dicts(self.table_name()):
  File "/webapps/openprescribing/openprescribing/gcutils/bigquery.py", line 152, in get_rows_as_dicts
    for row in self.get_rows():
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/google/cloud/iterator.py", line 218, in _items_iter
    for page in self._page_iter(increment=False):
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/google/cloud/iterator.py", line 254, in _page_iter
    page = self._next_page()
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/google/cloud/iterator.py", line 348, in _next_page
    response = self._get_next_page_response()
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/google/cloud/iterator.py", line 399, in _get_next_page_response
    query_params=params)
  File "/webapps/openprescribing/.venv/local/lib/python2.7/site-packages/google/cloud/_http.py", line 293, in api_request
    raise exceptions.from_http_response(response)
google.cloud.exceptions.InternalServerError: 500 GET https://www.googleapis.com/bigquery/v2/projects/ebmdatalab/datasets/measures/tables/practice_data_ace/data?pageToken=BHDWKOW7L4AQAAASAUIIBAEAAUNAQCGF2INBBIENAYQP777777777777P4VAA%3D%3D%3D: An internal error occurred and the request could not be completed.

Two questions:

what's failed (and was it our fault?)
what state is the system in now?

Pretty sure this isn't our fault.
And nothing's been written to the database yet:
>>> MeasureValue.objects.filter(month='2017-09-01').count()
0
>>> MeasureGlobal.objects.filter(month='2017-09-01').count()
0

so it should be safe to re-run the pipeline.


CashAddress hash methods for P2KH and P2SH not specified

https://github.com/bitcoincashorg/bitcoincash.org/blob/master/spec/cashaddr.md#hash
Hash methods for P2KH and P2SH aren't specified here. I assume the method is just PubKey -> SHA-256 -> RIPEMD160 however it would be nice to get some clarification from the spec.

@crawfobw was this resolved?


Terminal looses output when running command that uses progress indicator

Windows Terminal version
1.15.3465.0
Windows build number
10.0.19045.2486
Other Software
WSL-Version: <IP_ADDRESS>
WSL distribution: Debian Bullseye
Steps to reproduce
In a tab for the WSL distribtuion, run a command that uses a progress indicator and produces more lines of output than the terminal windows has, e.g. apt-get install php.
Expected Behavior
All lines of output are available when scrolling back up after the command finishes.
Actual Behavior
Most lines of output are lost except for some initial lines (probably not handled be the progress indicator) and the lines shown in the terminal when the command has finished.
The problem does no occur if the option -q (--quiet) is used with apt-get.

What's happening here is that apt-get is setting the scrolling margins (DECSTBM) to keep the progress indicator line fixed, while the top part of the screen scrolls. Unfortunately Windows Terminal doesn't handle that situation very well, so the lines that scroll off the top end up being erased when they should be moved into the scrollback buffer. We're already tracking this problem in issue #3673.

/dup #3673
Thanks!


Enhancement: equality of slides across files

At the moment, there doesn't seem to be an easy way of checking for equality of slides (or, I guess, any object) across different files. This is the current behavior:
# file1_copy is an identical duplicate of file1
>>> p1 = Presentation('file1.pptx')
>>> p2 = Presentation('file1_copy.pptx')
# ideally this check should return True
>>> p1.slides[0] == p2.slides[0]
False

The current __eq__ implementation seems to pay attention to the actual source of proxied XML elements, but I guess it doesn't do it across separate XML trees.

In this case, the following expression should work:
p1.slides[0]._element.xml == p2.slides[0]._element.xml

Seems like a very narrow case though. This requirement is pretty narrow (not often called for) to begin with, but then there are a number of "shades" of equality I can think of. This one is actual literal equality of expression, but what about the same shapes in a different z-order? That would be visually equivalent. And there can be other alternative ways ways to express a visually identical slide, like grouping differences or optional attributes that express the same thing as the default (omitted) attribute.
The existing slide == other_slide behavior is important because there can be more than one Slide object referring to the same slide in the underlying XML. A Slide object is just a proxy to the underlying XML and this "points to the same underlying XML slide" behavior comes up as important to know in several places.
So you get the idea. This would be far along on the long tail of infrequently needed features and actually identifies a family of features, each of which is even further down the tail.
I expect the best course for someone needing this would be to implement it themselves according to their particular requirements, unless the literal equality does the trick.


Save assignee on mas

@miq-bot add_label wip, performance, providers/containers

@miq-bot remove_label wip

cc @kbrock

@kbrock Thanks. No need for migration since this is prototype only and no one outside is using this.

@simon3z this is one of the performance items mentioned suggested by @kbrock, please review

@simon3z I think this one is ready

Thanks @moolitayer

:+1:


Cannot find the web based UCP in the files.

Well, in the features in both the github and the samp forums thread, they both said that there is a web based UCP in the files, but I cant find it.

Enable short tags as well

Link broken :/


ui: encryption stats on stores report

PR: https://github.com/cockroachdb/cockroach/pull/26890
From release notes:

The Stores report now shows encryption statistics. [#26890][#26890] {% comment %}doc{% endcomment %}

Not sure if/how to document this. Might be more for admin ui reference docs, @Amruta-Ranade, not sure.

Already on the encryption page. Not sure we need more than that for now.


tgi server keeps repeating short words in the output.

System Info
optimum-habana                         1.7.2
text-generation                        0.6.0
text-generation-server                 1.0.3
langchain                              0.0.279

Information

[ ] The official example scripts
[ ] My own modified scripts

Tasks

[ ] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
[ ] My own task or dataset (give details below)

Reproduction
Step to reproduce:

start text-generation-server following the instruction:
https://github.com/huggingface/optimum-habana/tree/main/text-generation-inference
launch bash in the docker,
inside the docker:
pip install langchain text-generation
python run the following script-- lclient.py

from langchain import  HuggingFaceTextGenInference
llm = HuggingFaceTextGenInference(
inference_server_url="http://<IP_ADDRESS>:80",
max_new_tokens=64,
top_k=10,
top_p=0.95,
typical_p=0.95,
temperature=0.01,
repetition_penalty=1.03,
)
output = llm("What is Machine Learning?")
print(output)

noticed:
on the client side, for the first launch, the output is as follows which is ok.

root@653f39f1fd71:/text-gen/client# python lclient.py
Learn More
The purpose of this article is to show you how to use the machine learning algorithm to solve a problem. The goal of this article is to demonstrate that the machine learning algorithm can solve many problems. Learn More
The first section of our book is about general computer programs and their usage. We will cover
then after the first launch, the output is as follows.
root@653f39f1fd71:/text-gen/client# python lclient.py
explain give cover give then then give then give then cover cover give explain discuss explain discuss cover then give discuss give cover then give then explain give then explain explain discuss explain cover give give discuss cover explain then discuss cover discuss then cover explain discuss then explain explain then cover give cover explain discuss cover give explain explain give cover cover discuss
root@653f39f1fd71:/text-gen/client# python lc.py
give give explain explain explain then cover then cover explain give then give then discuss explain cover give give give give then then explain then cover explain cover then discuss cover cover explain then give cover then cover then discuss then cover cover give explain discuss then discuss cover cover cover explain explain explain then then explain give give cover discuss give give then
root@653f39f1fd71:/text-gen/client# python lc.py
cover give discuss explain explain cover then explain then explain give discuss explain discuss discuss discuss give give then then give cover cover explain cover then give then then give then discuss discuss then discuss explain then explain then give give then explain explain cover discuss discuss cover discuss discuss discuss discuss then discuss cover discuss then explain discuss give then cover give discuss
Expected behavior
The second client request should yield samiliar expected output as the first.

I am also facing similar issue when running with Lang chain (played around with temperature settings to improve response quality). First response is good but subsequent query response is gibberish. Same behavior observed irrespective of model (tried Bloomz,Llama 2).

By cache=False in the Lang chain call along with higher max token value, we are able to avoid this issue.
llm_local = HuggingFaceTextGenInference(
inference_server_url=inference_server_url_local,
max_new_tokens=1024,
top_k=10,
top_p=0.95,
typical_p=0.95,
temperature=1,
repetition_penalty=1.03,
cache= False,
)
Another observation, whenever response gets truncated due to max_new_tokens subsequent responses are repeating the last word in the truncated response. Increasing max tokens helped here.

By adding cache=False in the Lang chain call along with higher max token value, we are able to avoid this issue.
llm_local = HuggingFaceTextGenInference( inference_server_url=inference_server_url_local, max_new_tokens=1024, top_k=10, top_p=0.95, typical_p=0.95, temperature=1, repetition_penalty=1.03, cache= False, )
Another observation, whenever response gets truncated due to max_new_tokens subsequent responses are repeating the last word in the truncated response. Increasing max tokens helped here.

Sorry, in my case,  bigscience/bloom-560m. I still got gibberish words after cache=False is set

@htang2012 @avinashkarani Could you try now? #404 should have solved this issue

Has this issue been solved?

@regisss I got a chance to test this, and issue seems to be resolved now. Thanks for the update


the weight file

Hello author, I am very interested in your work. Could you please send me the weight file so I can test it? Thank you

We're non profit research agent funded by government, also interested in testing the model with weights


Unbreak the cluster destroy job

Current error:

eks-cluster: the plan would destroy this resource, but it currently has
lifecycle.prevent_destroy set to true.

https://github.com/ljfranklin/terraform-resource says:

Terraform variables will be merged from the following locations in increasing
order of precedence: source.vars, put.params.vars, and [...]

have you tested this works? ... my understanding was that for this to work we will need to first do a terraform apply (to set the value to false in state) and THEN a terraform destroy ... I could be wrong tho

Plan was for it to be merged and then tested. Unless you want me to do the awkward set-pipeline + hijack dance to try it out?

happy for you merge ... but I suspect you might need to add an additional put: cluster-state before the destroy one

this will of course conflict with 0.12 changes in #707