text:
[BUG]: Error in validating payment method

Is there an existing issue for this?

[X] I have searched the existing issues.

🐞 Describe the Bug
I am implementing React-Paypal integration for Advanced Payment using our own Api built with dotnet to prepareForPayment, createOrder and capturePayment. I used the same example as yours for hostedfield but keep getting errors. I did check on our dotnet side and test our api in Postman, it was working well. So, I assume this must be a bug from react-paypal-js
The errors:

Failed to load the PayPal JS SDK script. Error: Expected client-id to be passed (debug id: f175715de182b)
GET https://www.paypal.com/sdk/js?components=buttons,hosted-fields&intent=capture&vault=false net::ERR_ABORTED 400 react-paypal-js.js:520
GET https://www.paypal.com/sdk/js?components=buttons,hosted-fields&intent=capture&vault=false 400 react-paypal-js.js:679

These are my react code:-
MainWrapper.js
import { useState } from "react";
import { PayPalScriptProvider } from "@paypal/react-paypal-js";

import PrepareForPayment from "./PrepareForPayment";
import "../styles/ProductCard.css";

const MainWrapper = () => {

	const [clientId, setClientId] = useState(null)
    const [clientToken, setClientToken] = useState(null)
	const [merchantRef, setMerchantRef] = useState(null)
	const [sessionHash, setSessionHash] = useState(null)
	const [showData, setShowData] = useState(false);

	const baseUrl = "http://local.payment.web"

	const onClick = async () => {
		console.log("onClick ran");
		return await fetch(`${baseUrl}/api/Ppal/ReactApi/PrepareForPayment`, {
				mode: "cors",
				method: "post",
				headers: {
					'content-type': 'application/json',
					'Access-Control-Allow-Origin': '*'

				},
				body: JSON.stringify({
					"curCode": "USD",
					"orderAmount": 500
				})
			}).then(res => {
				console.log("fetch Data : ", res);
				return res.json()
			}).then(data => {
				console.log("fetch Data : ", data);
				setShowData(true)
				setClientId(data.ClientId)
				setClientToken(data.ClientToken)

				if (data.prepareForPayment) {
					setMerchantRef(data.merchantRef)
					setSessionHash(data.sessionHash)
				}
			}).catch(err => console.log(err))
	}

	return (
		<>
			<button onClick={onClick} disabled={showData ? true : false}>Prepare for payment</button>
			{
				showData && (
                    <PayPalScriptProvider
                    options={{
                        "client-id": clientId,
                        components: "buttons,hosted-fields",
                        "data-client-token": clientToken,
                        intent: "capture",
                        vault: false,
                    }}
                    >
                        <PrepareForPayment merchantR={merchantRef} sessionH={sessionHash} clientT={clientToken} clientI={clientId} />
                    </PayPalScriptProvider>
				)
			}
		</>
	)
}

export default MainWrapper

PrepareForPayment.jsx
import { useState } from "react";
import {
	PayPalScriptProvider,
	PayPalHostedFieldsProvider,
	PayPalHostedField,
    usePayPalHostedFields
} from "@paypal/react-paypal-js";
import "../styles/Checkout.css";

const SubmitPayment = ({ merchantR, sessionH }) => {
    // Here declare the variable containing the hostedField instance
    const hostedFields = usePayPalHostedFields();

    const baseUrl = "http://local.payment.web"

    const submitHandler = () => {
        if (!typeof hostedFields.submit !== "function") return; // validate that `submit()` exists before using it
        hostedFields
            .submit({
                // The full name as shown in the card and billing address
                cardholderName: "John Wick",
            })
            .then((order) => {
                fetch(
                    `${baseUrl}/api/Ppal/ReactApi/CaptureOrder`, {
                        mode: "cors",
						method: "post",
						headers: {
							'content-type': 'application/json'
						},
						body: JSON.stringify({
							merchantRef: merchantR,
							sessionHash: sessionH
						})
                    }
                )
                    .then((response) => response.json())
                    .then((data) => {
                        console.log("data from pay button : ", data);
						if(data.isApproved) {
							alert("Payment successful")
						}
						if(!data.isApproved) alert("Payment declined")
						if(data.isExpired) alert("Payment expired")
                    })
                    .catch((err) => console.log("Error here : ", err));
            });
    };

    return <button onClick={submitHandler}>Pay</button>;
};

const PrepareForPayment = ({ merchantR, sessionH, clientT, clientI }) => {
    const [orderId, setOrderId] = useState(null)

    const baseUrl = "http://local.payment.web"

	return (
		<>
			{clientT ? (
				<PayPalScriptProvider
					options={{
                        "client-id": clientI,
						components: "buttons,hosted-fields",
						"data-client-token": clientT
					}}
				>
					<PayPalHostedFieldsProvider
						styles={{".valid":{"color":"#28a745"},".invalid":{"color":"#dc3545"},"input":{"font-family":"monospace","font-size":"16px"}}}
						createOrder={async() => {
                            return await fetch(`${baseUrl}/api/Ppal/ReactApi/CreateOrder2`, {
                                method: 'post',
                                headers: {
                                    'content-type': 'application/json'
                                },
                                body: JSON.stringify({
                                    merchantRef: merchantR,
                                    sessionHash: sessionH
                                })
                            }).then(res => {
                                console.log("res from createOrder", res);
                                return res.json()
                            }).then(data => {
                                console.log("orderId from button : ", data?.orderId);
                                if (data?.createOrder) return setOrderId(data?.orderId)
                            })
                        }}
					>

                            Card Number
                            *

                        <PayPalHostedField
                            id="card-number"
                            className="card-field"
                            hostedFieldType="number"
                            options={{
                                selector: "#card-number",
                                placeholder: "4111 1111 1111 1111",
                            }}
                        />

                            CVV*

                        <PayPalHostedField
                            id="cvv"
                            className="card-field"
                            hostedFieldType="cvv"
                            options={{
                                selector: "#cvv",
                                placeholder: "123",
                                maskInput: true,
                            }}
                        />

                            Expiration Date
                            *

                        <PayPalHostedField
                            id="expiration-date"
                            className="card-field"
                            hostedFieldType="expirationDate"
                            options={{
                                selector: "#expiration-date",
                                placeholder: "MM/YYYY",
                            }}
                        />
                        <SubmitPayment merchantR={merchantR} sessionH={sessionH} />
					</PayPalHostedFieldsProvider>
				</PayPalScriptProvider>
			) : (

Loading token...

			)}
		</>
	);
}

export default PrepareForPayment

😕 Current Behavior

🤔 Expected Behavior
It should capture our api and validate payment
🔬 Minimal Reproduction
No response
🌍 Environment
| Software         | Version(s) |
| ---------------- | ---------- |
| react-paypal-js  |     ^7.8.1       |
| Browser          |      Chrome      |
| Operating System |     windows       |

Relevant log output
No response
Code of Conduct

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

➕ Anything else?
No response

First thing I am noticing is that you should only be rendering one instance of PayPalScriptProvider in your component tree. You appear to be rendering two instances one in the parent MainWrapper and one in the child PrepareForPayment. Any providers should be rendered once if possible to avoid refetches of the sdk. Typically this is easiest when they are rendered at or near the root of your application. Please see our [usage guide] (https://github.com/paypal/react-paypal-js#usage).
The client-id is safe to use directly in front end code. Do not share any other tokens with client code.  I noticed that you are retrieving client-id from the backend and doing a hide show operation in state. If the script provided is mistakenly loaded with a null value for client-id it will fail the fetch request similar to what you see in Chrome dev tools. You can choose to retrieve it from your backend but please ensure your React application code is not passing null to the PayPalScriptProvider at any time.
Here is a codesandbox for buttons that is working correctly given your MainWrapper component code. I did have to remove hosted fields as it requires the secret token which can not be shared in public. I also did a promise around the state setters to mimic the async logic of the fetch request where you retrieve your client-id.

@westeezy Thank you for responding to this. I did another implementation by only rendering 1 instance on #305 but React skipped HostedField
The one that you implemented is for PaypalButton , I can make it work with that but what I want to achieve is by using card fields

In that case I will close this and we can handle conversation about #305 in its respective issue.

authors: tengkuzulfadli westeezy

repo: paypal/react-paypal-js


text:
#599 sbt-updates plugin

Thanks for your pull request.  Please review the following guidelines.

[x] Title includes issue id.
[x] Description of the change added.
[x] Commits are squashed.
[ ] Tests added.
[x] Documentation added/updated.
[x] Also please review CONTRIBUTING.md.

The only upgrade left is val heikoseebergerAkkaHttpJsonV = "1.18.0" moving to val heikoseebergerAkkaHttpJsonV = "1.19.0".  However, the new API in akka-http-jackson requires TypeTag instead of a ClassTag.  So, getting difficult to satisfy from Java API in JacksonMapperSupport.

I just addressed the heikoseebergerAkkaHttpJsonV = "1.19.0" as well.

Actually, https://github.com/paypal/squbs/pull/573 needs to be merged for the build to succeed.  I am actively working on https://github.com/paypal/squbs/pull/573.

source: gharchive/pull-request

repo: paypal/squbs

license_type: permissive

license_source: bigquery


text:
Issue parsing updated date from OPDS feed

Traceback (most recent call last):
  File "/home/kevin/.local/bin/sebsync", line 8, in <module>
    sys.exit(main())
  File "/home/kevin/.local/pipx/venvs/sebsync/lib/python3.10/site-packages/sebsync.py", line 199, in main
    sebsync(auto_envvar_prefix="SEBSYNC", show_default=True)
  File "/home/kevin/.local/pipx/venvs/sebsync/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/kevin/.local/pipx/venvs/sebsync/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/kevin/.local/pipx/venvs/sebsync/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/kevin/.local/pipx/venvs/sebsync/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/kevin/.local/pipx/venvs/sebsync/lib/python3.10/site-packages/sebsync.py", line 174, in sebsync
    remote_ebooks = get_standard_ebooks(opds, email)
  File "/home/kevin/.local/pipx/venvs/sebsync/lib/python3.10/site-packages/sebsync.py", line 64, in get_standard_ebooks
    updated=datetime.fromisoformat(entry.find("atom:updated", ns).text),
ValueError: Invalid isoformat string: '2024-07-22T17:33:40Z'

Possible issue with older (3.10) Python version?

Confirmed: the Python 3.10 batteries-included ISO parser is not capable of parsing an RFC 3339 string. The trailing "Z" (UTC) character is making it unhappy.

Fixed in 1.0a3.

source: gharchive/issue

repo: pbryan/sebsync

license_source: github-api


text:
hide the filterable list + request focus to open keyboard

For the most part of it, this library is great. However, I've been pulling my hair over simple issues.

How do I hide the filterable list manually? Once it's open, there's no way to close it other than clicking an item. I've tried

mChipsInput.setFilterableList(new ArrayList<ChipInterface>());
mChipsInput.getEditText().getFilterableListView().fadeOut();
mChipsInput.getEditText().getFilterableListView().fadeOut();
mChipsInput.getFilterableList().clear(), and called mChipsInput.invalidate() afterwards

The view logic is just so poorly designed, none of these seem to work. I've been digging into the source code and see that fadeOut() is to hide it from within the library. Why doesn't it work when used as an api?

Open the soft-keyboard automatically when the mChipsInput is clicked.
I've tried the following:
 mChipsInput.requestFocus();
 mChipsInput.getEditText().requestFocus();
 openKeyboard(mChipsInput.getEditText());  // this uses the InputManager to open the keyboard on this view.
 mChipsInput.getEditText().performClick();

Again, none of these work!

Turns out it was a really silly line in the code that was causing the issue as for 1.
I've sent a PR #99
It creates the edittext only once, instead of creating a new one each time getEditText is called.

repo: pchmn/MaterialChipsInput


text:
Fix some translation format problems for Chinese and move the 'Fork me' image to local

Add blank spaces between Chinese and English words.
Replace “gitHub” with “Github”.
For amazonaws.com is unaccessible to some region.

@pcottle, is there any reason why you are not using those pure CSS 'fork me' ribbons instead of using an image?

For amazonaws.com is unaccessible to some region.

Oh dang I had no idea! Yeah lets totally just use a local resource. thanks a bunch :D
@mgarciaisaia -- no particular reason, I just didn't know about the pure CSS versions. If we use that I could actually make the label intl-aware (since I think I can tag html elements with intl-aware and they live update). Although I have no translations right now for "Fork me on Github" so shrug
Let's get this in for now and maybe switch to pure CSS after

The only downside of this is that the image isn't likely to be cached in the browser (compared to the static aws one) but that's a fine downside compared to having the image available globally

authors: mdluo mgarciaisaia pcottle

repo: pcottle/learnGitBranching

license: mit


text:
Fix typo of ZH_CN translation.

Fix typo of ZH_CN translation.

awesome! thanks a bunch. im working on the native version of this app right now so things are a bit unstable, so it might take a few days for these changes to get pushed out to prod.

authors: Hao-Wu pcottle


text:
Lottie with cocos creator Javascript (ES5)

I'm very happy that you can integrate lottie into cocos2d-x
I am using Cocos creator to build my application and want to use lottie to do some effects for the application
I tried to get your code at project https://github.com/pd4d10/lottie-cocos2dx and integrated into my project but it does not work
Can you give me a hint or tutorial so I can integrate lottie into my project.
Thank you very much

Thanks for your report. Is there any error message when using lottie-cocos2dx?
In addition, it would be helpful for debugging if you could upload your JSON file exported by Bodymovin

Thank you for the reply.
lottie-cocos2dx use ES6, But my project is written with javascript code ES5, and it does not work.
This is the JSON file I downloaded from the home page https://www.lottiefiles.com/
favorite_star.json.zip
if you can let me guide the lottie take on the Cocos creator with the javascript code ES5
Thank you very much.

The code published to NPM is already compiled to ES5
Seems the JSON file you use has shape animation, which is not supported currently. See roadmap. We need to do more work to implement this

license: MIT


text:
Release v1.1.0

Summary
Remove two schematron rules
Test Data and/or Report
All tests pass
Related Issues
PR #16 had the wrong branch name, and thus didn't trigger a release.  This one should do it.

Changes are minor, and expedited release is required, so bypassing review requirement.

repo: pds-data-dictionaries/ldd-vgr


text:
⚠ Hartman Foundation has degraded performance

In 586a25d, Hartman Foundation (https://gordonhartman.com/) experienced degraded performance:

HTTP code: 200
Response time: 2776 ms

Resolved: Hartman Foundation performance has improved in 9fce5fc.

repo: pearanalytics/uptime


text:
Fail faster on services that do not even start

Instead of waiting for the healthcheck, let's fail fast when we notice starting the systemd unit failed.
Proposed fix for #8

Tested in the field

repo: pebble/spacel-agent


text:
Camera resolution not changing

I am trying to stream video for this resolution 1280 x 720 but it always goes to default 640 x 480
I am using the following function and calling it before the streaming is started and resolution.width and resolution.height comes correctly as 1280 and 720 but when I see the streaming output it shows only 640 x 480 resolution.
    private boolean prepareEncoders(int getSelectedItemPosition, int Fps, int VideoBitrate) {
    Camera.Size resolution =
            rtmpCamera1.getResolutionsBack().get(getSelectedItemPosition);
    int width = resolution.width;
    int height = resolution.height;

    return rtmpCamera1.prepareVideo(width, height, Fps,
            VideoBitrate * 1024,
            false, CameraHelper.getCameraOrientation(this))
            && rtmpCamera1.prepareAudio(128 * 1024,44100,
            true, true,
            true);
     }

I am keeping the AspectRation = true
<com.pedro.rtplibrary.view.OpenGlView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/surfaceView"
app:keepAspectRatio="true"
app:AAEnabled="false"
app:numFilters="15"
app:isFlipHorizontal="false"
app:isFlipVertical="false"
/>
Am I doing anything wrong here.

Make sure that this log show your resolution correctly:
https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/encoder/src/main/java/com/pedro/encoder/input/video/Camera1ApiManager.java#L170
Try with a surfaceview instead of openglview to discard opengl problems.
If you can share me an activity code to reproduce your case.

I had used WebView for getting values from Website and display it inside the application. My Final output looks like this

import android.app.ProgressDialog;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.Typeface;
import android.hardware.Camera;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Display;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.ConsoleMessage;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import com.pedro.encoder.input.gl.SpriteGestureController;
import com.pedro.encoder.input.gl.render.filters.object.ImageObjectFilterRender;
import com.pedro.encoder.input.gl.render.filters.object.TextObjectFilterRender;
import com.pedro.encoder.input.video.CameraHelper;
import com.pedro.encoder.input.video.CameraOpenException;
import com.pedro.encoder.utils.gl.TranslateTo;
import com.pedro.rtplibrary.rtmp.RtmpCamera1;
import com.pedro.rtplibrary.view.OpenGlView;
import java.io.File;
import net.ossrs.rtmp.ConnectCheckerRtmp;
import android.webkit.WebView;
import com.facebook.AccessToken;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.lastmanstands.tv.ui.MultiStateButton;
import org.json.JSONObject;
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
public class StreamingActivity extends AppCompatActivity
implements ConnectCheckerRtmp, View.OnClickListener, SurfaceHolder.Callback,
View.OnTouchListener {
private Integer[] orientations = new Integer[] { 0, 90, 180, 270 };
private Context contextForDialog = null;
private RtmpCamera1 rtmpCamera1;
private MultiStateButton mBroadCast;
private Button bRecord;
private Button getvalue;
String strTheme;
String value="";
String videoId="";
private String currentDateAndTime = "";
private File folder = new File(Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/rtmp-rtsp-stream-client-java");
private OpenGlView openGlView;
private SpriteGestureController spriteGestureController = new SpriteGestureController();
WebView myWebView;
TextView myResultView;
String strHomeTeam="";
String strAwayTeam="";
private ProgressDialog dialog;
String FixtureId="";
int width = 0;
int height = 0;
String strBattingTeamName;
String strBowlingTeamName;
String strBattingTeamRuns;
String strBattingTeamWickets;
String strBattingTeamOvers;
String[] strBatting;
String[] strCurrentBatsman;
String[] strNonStriker;
String[] strCurrentBowler;
String[] strInnings;
AssetManager assetManager;
int iSelectedItemPosition;
int iFPS;
int iVideoBitrate;
@Override
protected void onResume() {
super.onResume();
setLMSLogoToStream();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.activity_streaming);
    Display display = getWindowManager(). getDefaultDisplay();
    Point size = new Point();
    display. getSize(size);
    width = size. x;
    height = size. y;

    openGlView = findViewById(R.id.surfaceView);
    contextForDialog = this;
    dialog = new ProgressDialog(contextForDialog);
    Bundle extras = getIntent().getExtras();
    assetManager = getAssets();
    if (extras != null) {
        value = extras.getString("stream_url");
        videoId = extras.getString("id");
        FixtureId = extras.getString("FixtureId");
        strHomeTeam = extras.getString("HomeTeam");
        strAwayTeam = extras.getString("AwayTeam");
        iSelectedItemPosition = extras.getInt("getSelectedItemPosition");
        iFPS = extras.getInt("Fps");
        iVideoBitrate = extras.getInt("etVideoBitrate");
        strTheme = extras.getString("ThemeName");
    }
    getvalue = (Button) findViewById(R.id.getvalue);
    myResultView = (TextView)this.findViewById(R.id.myResult);
    myWebView = (WebView)this.findViewById(R.id.myWebView);
    WebSettings webSettings = myWebView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    myWebView.setWebChromeClient(new WebChromeClient());
    myWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    myWebView.getSettings().setBlockNetworkImage(false);
    myWebView.getSettings().setAllowFileAccess(true);
    myWebView.getSettings().setAllowFileAccessFromFileURLs(true);
    myWebView.getSettings().setAllowUniversalAccessFromFileURLs(true);
    String url= getResources().getString(R.string.fixture);
    url = url.replace("FixtureId",FixtureId);
    myWebView.loadUrl(url);

    myWebView.setWebChromeClient(new WebChromeClient() {
        public void onProgressChanged(WebView view, int progress){

        }
        public boolean onConsoleMessage(ConsoleMessage cm) {
            if(cm.message().contains("Score::::")){
                strBatting = cm.message().split("::::");
                strBattingTeamName = strBatting[1];
                strBowlingTeamName = strBatting[2];
                strBattingTeamRuns = strBatting[3];
                strBattingTeamWickets = strBatting[4];
                strBattingTeamOvers = strBatting[5];
                setBottomImageToStream();
                setLMSLogoToStream();
                setBattingTeamToStream(strBatting[1]);
                setBowlingTeamToStream(strBatting[2]);
                setBattingTeamScoreToStream(strBatting[3] + " - " + strBatting[4]);
                setBattingTeamOversToStream(strBatting[5]);
            }
            if(cm.message().contains("currentbatsman::::")){
                strCurrentBatsman = cm.message().split("::::");
                setCurrentBatsmanNameToStream(strCurrentBatsman[1]);
                setStrikerRunsScoreToStream(strCurrentBatsman[2] + "("+strCurrentBatsman[3]+")");
            }

            if(cm.message().contains("nonstriker::::")){
                strNonStriker = cm.message().split("::::");
                setNonStrikerBatsmanNameToStream(strNonStriker[1]);
                setNonStrikerRunsScoreToStream(strNonStriker[2] + "("+strNonStriker[3]+")");
            }

            if(cm.message().contains("currentbowler::::")){
                strCurrentBowler = cm.message().split("::::");
                setCurrentBowlerScoreToStream(strCurrentBowler[1] + " "+ strCurrentBowler[3] +"-" + strCurrentBowler[4] + "("+strCurrentBowler[2]+")");
            }

            if(cm.message().contains("innings::::")){
                strInnings = cm.message().split("::::");
                if(strInnings[1].equals("1")) {
                    setInningsToStream("1st Innings");
                } else {
                    setInningsToStream("2nd Innings");
                }
            }

            return true;
        }
    });

    mBroadCast = findViewById(R.id.ic_broadcast);
    mBroadCast.setOnClickListener(this);
    mBroadCast.setState(false);
    mBroadCast.setEnabled(true);
    bRecord = findViewById(R.id.b_record);
    bRecord.setOnClickListener(this);
    MultiStateButton switchCamera = findViewById(R.id.ic_switch_camera);
    switchCamera.setOnClickListener(this);
    getvalue.setOnClickListener(this);

    rtmpCamera1 = new RtmpCamera1(openGlView, this);
    rtmpCamera1.setVideoBitrateOnFly(iVideoBitrate);
    openGlView.getHolder().addCallback(this);
    openGlView.setOnTouchListener(this);

}

private void setBowlingTeamToStream(String scores) {
    String upToNCharacters = scores.substring(0, Math.min(scores.length(), 15));
    upToNCharacters = upToNCharacters.toUpperCase();
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(3,textObjectFilterRender);
    textObjectFilterRender.setText(upToNCharacters, 15, Color.BLACK, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(9,84);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setBattingTeamToStream(String scores) {
    String upToNCharacters = scores.substring(0, Math.min(scores.length(), 15));
    upToNCharacters = upToNCharacters.toUpperCase();
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(4,textObjectFilterRender);
    textObjectFilterRender.setText(upToNCharacters, 17, Color.WHITE, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(9,89);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setBattingTeamScoreToStream(String scores) {
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    scores = scores.toUpperCase();
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(5,textObjectFilterRender);
    Log.e("Score",scores);
    textObjectFilterRender.setText(scores, 15, Color.BLACK, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(30,89);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setBattingTeamOversToStream(String scores) {
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    scores = scores.toUpperCase();
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(6,textObjectFilterRender);
    Log.e("Score",scores);
    textObjectFilterRender.setText(scores, 15, Color.WHITE, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(42,89);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setCurrentBatsmanNameToStream(String scores) {
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    scores = "*"+ scores.toUpperCase();
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(7,textObjectFilterRender);
    Log.e("Score",scores);
    textObjectFilterRender.setText(scores, 15, Color.BLACK, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(52,88);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setNonStrikerBatsmanNameToStream(String scores) {
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    scores = scores.toUpperCase();
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(8,textObjectFilterRender);
    textObjectFilterRender.setText(scores, 15, Color.BLACK, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(52,93);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setCurrentBowlerScoreToStream(String scores) {
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    scores = scores.toUpperCase();
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(9,textObjectFilterRender);
    Log.e("Score",scores);
    textObjectFilterRender.setText(scores, 15, Color.BLACK, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(72,88);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setNonStrikerRunsScoreToStream(String scores) {
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    scores = scores.toUpperCase();
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(10,textObjectFilterRender);
    textObjectFilterRender.setText(scores, 15, Color.BLACK, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(64,93);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setStrikerRunsScoreToStream(String scores) {
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    scores = scores.toUpperCase();
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(11,textObjectFilterRender);
    textObjectFilterRender.setText(scores, 15, Color.BLACK, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(64,88);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setInningsToStream(String scores) {
    Typeface plain = Typeface.createFromAsset(assetManager, "trebuchet.ttf");
    Typeface bold = Typeface.create(plain, Typeface.BOLD);
    scores = scores.toUpperCase();
    TextObjectFilterRender textObjectFilterRender = new TextObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(12,textObjectFilterRender);
    textObjectFilterRender.setText(scores, 15, Color.WHITE, bold);
    textObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    textObjectFilterRender.setPosition(74,93);
    spriteGestureController.setBaseObjectFilterRender(textObjectFilterRender); //Optional
}

private void setLMSLogoToStream() {
    ImageObjectFilterRender imageObjectFilterRender = new ImageObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(2,imageObjectFilterRender);
    imageObjectFilterRender.setImage(
            BitmapFactory.decodeResource(getResources(), R.drawable.rlogo));
    imageObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    imageObjectFilterRender.setPosition(TranslateTo.TOP_RIGHT);
    spriteGestureController.setBaseObjectFilterRender(imageObjectFilterRender); //Optional
    spriteGestureController.setPreventMoveOutside(true); //Optional
}

private void setBottomImageToStream() {
    ImageObjectFilterRender imageObjectFilterRender = new ImageObjectFilterRender();
    rtmpCamera1.getGlInterface().setFilter(1,imageObjectFilterRender);
    if(strTheme.equals("Green")) {
        imageObjectFilterRender.setImage(
                BitmapFactory.decodeResource(getResources(), R.drawable.background_green640));
    } else if(strTheme.equals("Purple")){
        imageObjectFilterRender.setImage(
                BitmapFactory.decodeResource(getResources(), R.drawable.background_purple640));
    } else if(strTheme.equals("Navy")){
        imageObjectFilterRender.setImage(
                BitmapFactory.decodeResource(getResources(), R.drawable.background_navy640));
    } else {
        imageObjectFilterRender.setImage(
                BitmapFactory.decodeResource(getResources(), R.drawable.background_green640));
    }
    imageObjectFilterRender.setDefaultScale(rtmpCamera1.getStreamWidth(),
            rtmpCamera1.getStreamHeight());
    imageObjectFilterRender.setPosition(TranslateTo.BOTTOM);
    spriteGestureController.setBaseObjectFilterRender(imageObjectFilterRender);
    spriteGestureController.setPreventMoveOutside(false); //Optional
}

@Override
public void onConnectionSuccessRtmp() {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Toast.makeText(StreamingActivity.this, "Connection success", Toast.LENGTH_SHORT).show();
        }
    });
}

@Override
public void onConnectionFailedRtmp(final String reason) {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Toast.makeText(StreamingActivity.this, "Connection failed. " + reason, Toast.LENGTH_SHORT)
                    .show();
            rtmpCamera1.stopStream();
            ///But
        }
    });
}

@Override
public void onNewBitrateRtmp(long bitrate) {

}

@Override
public void onDisconnectRtmp() {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Toast.makeText(StreamingActivity.this, "Disconnected", Toast.LENGTH_SHORT).show();
        }
    });
}

@Override
public void onAuthErrorRtmp() {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Toast.makeText(StreamingActivity.this, "Auth error", Toast.LENGTH_SHORT).show();
        }
    });
}

@Override
public void onAuthSuccessRtmp() {
    runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Toast.makeText(StreamingActivity.this, "Auth success", Toast.LENGTH_SHORT).show();
        }
    });
}

@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.getvalue:
            break;
        case R.id.ic_broadcast:
            //if(prepareEncoders(iSelectedItemPosition,iFPS,iVideoBitrate)){
            if (!rtmpCamera1.isStreaming()) {
                if (rtmpCamera1.isRecording()
                        || rtmpCamera1.prepareAudio() && rtmpCamera1.prepareVideo()) {
                    mBroadCast.setState(true);
                    mBroadCast.setEnabled(true);
                    rtmpCamera1.startStream(value);
                    setLMSLogoToStream();
                } else {
                    Toast.makeText(this, "Error preparing stream, This device cant do it",
                            Toast.LENGTH_SHORT).show();
                }
            } else {
                try {

                    GraphRequest request = GraphRequest.newPostRequest(
                            AccessToken.getCurrentAccessToken(),
                            "/"+videoId,
                            new JSONObject("{\"end_live_video\":\"true\"}"),
                            new GraphRequest.Callback() {
                                @Override
                                public void onCompleted(GraphResponse response) {
                                    try {
                                        Log.e("response", response.toString());
                                    } catch (Exception e) {
                                        Log.e("Err", e.toString());
                                    }
                                }
                            });
                    request.executeAsync();
                    mBroadCast.setState(false);
                    mBroadCast.setEnabled(true);
                    rtmpCamera1.stopStream();

                } catch (Exception e){
                    Log.e("Exception",e.toString());
                }
            }
           // }
            break;
        case R.id.ic_switch_camera:
            try {
                rtmpCamera1.switchCamera();
            } catch (CameraOpenException e) {
                Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
            }
            break;
        default:
            break;
    }
}

@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {

}

@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {
    rtmpCamera1.startPreview();
}

@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
    if (rtmpCamera1.isStreaming()) {
        rtmpCamera1.stopStream();
    }
    rtmpCamera1.stopPreview();
}

@Override
public boolean onTouch(View view, MotionEvent motionEvent) {

    int action = motionEvent.getAction();
    if (motionEvent.getPointerCount() > 1) {
        if (action == MotionEvent.ACTION_MOVE) {
            rtmpCamera1.setZoom(motionEvent);
        }
    } else {
        if (action == MotionEvent.ACTION_UP) {
            Log.e("Stop","Zoom");
        }
    }
    if (spriteGestureController.spriteTouched(view, motionEvent)) {
        spriteGestureController.moveSprite(view, motionEvent);
        spriteGestureController.scaleSprite(motionEvent);
        return true;
    }
    return true;
}

@Override
public void onBackPressed() {
    if (myWebView.canGoBack()) { //if going back is possible in webview then go back within webview
        myWebView.goBack();
    } else {
        super.onBackPressed(); //otherwise go back within the app
    }
}

private boolean prepareEncoders(int getSelectedItemPosition, int Fps, int VideoBitrate) {
    Camera.Size resolution =
            rtmpCamera1.getResolutionsBack().get(getSelectedItemPosition);
    int width = resolution.width;
    int height = resolution.height;

    return rtmpCamera1.prepareVideo(width, height, Fps,
            VideoBitrate * 1024,
            false, CameraHelper.getCameraOrientation(this))
            && rtmpCamera1.prepareAudio(128 * 1024,44100,
            true, true,
            true);
}

}

<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:sampleui="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="start"
android:id="@+id/activity_custom"
>
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

<!-- The primary full-screen view. This can be replaced with whatever view
     is needed to present your content, e.g. VideoView, SurfaceView,
     TextureView, etc. -->

<FrameLayout
    android:id="@+id/cameraView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#0d0d0d">

    <com.pedro.rtplibrary.view.OpenGlView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/surfaceView"
        app:keepAspectRatio="true"
        app:AAEnabled="false"
        app:numFilters="15"
        app:isFlipHorizontal="false"
        app:isFlipVertical="false"
        />
    <WebView
        android:id="@+id/myWebView"
        android:visibility="gone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    </WebView>

</FrameLayout>

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="end|center_vertical"
    android:layout_alignParentEnd="false"
    android:layout_alignParentRight="false"
    android:padding="2dp"
    android:layout_alignParentStart="true"
    android:layout_alignParentLeft="true"
    >

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:background="@drawable/rounded_corner"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false">

        <com.lastmanstands.tv.ui.MultiStateButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/ic_switch_camera"
            android:src="@drawable/ic_switch_camera"
            android:cropToPadding="false"
            android:background="#000000ff"
            android:padding="10dp"
            android:contentDescription="Switch Camera" />
        <com.lastmanstands.tv.ui.MultiStateButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/ic_broadcast"
            android:src="@drawable/ic_stop"
            sampleui:offSrc="@drawable/ic_start"
            android:layout_alignParentTop="true"
            android:cropToPadding="false"
            android:background="#000000ff"
            android:layout_centerHorizontal="true"
            android:layout_margin="10dp" />

        <com.lastmanstands.tv.ui.MultiStateButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/ic_settings"
            android:src="@drawable/ic_settings"
            android:background="#000000ff"
            android:padding="10dp"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true" />

        <com.lastmanstands.tv.ui.TimerView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="00:00:00"
            android:id="@+id/txtTimer"
            android:layout_centerHorizontal="true"
            android:background="@drawable/rounded_corner"
            android:textColor="#ffffff"
            android:textStyle="bold"
            android:typeface="monospace"
            android:textAppearance="@android:style/TextAppearance.Medium"
            android:visibility="gone"/>

    </LinearLayout>

</RelativeLayout>
<Button
    android:text="Get Value"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="gone"
    android:id="@+id/getvalue"
    />

<TextView
    android:id="@+id/myResult"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
<EditText
    android:textColor="@color/appColor"
    android:textColorHint="@color/appColor"
    android:inputType="textUri"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_margin="20dp"
    android:visibility="gone"
    android:id="@+id/et_rtp_url"
    />
<Button
    android:text="@string/start_record"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginRight="5dp"
    android:id="@+id/b_record"
    android:visibility="gone"
    />

</androidx.drawerlayout.widget.DrawerLayout>

You have a code error:
 //if(prepareEncoders(iSelectedItemPosition,iFPS,iVideoBitrate)){
            if (!rtmpCamera1.isStreaming()) {
                if (rtmpCamera1.isRecording()
                        || rtmpCamera1.prepareAudio() && rtmpCamera1.prepareVideo()) {
                    mBroadCast.setState(true);
                    mBroadCast.setEnabled(true);
                    rtmpCamera1.startStream(value);
                    setLMSLogoToStream();
                } else {
                    Toast.makeText(this, "Error preparing stream, This device cant do it",
                            Toast.LENGTH_SHORT).show();
                }
            }

As you can see you never set 1280x720 resolution because prepareEncoders method is commented, you are using prepareVideo without params

I only commented it because when we press the Streaming button, the images got disappeared, so only commented it.
         if(prepareEncoders(6,30,2500)){    // in my mobile the value for 6 is 1280 x 720 resolution... I tried but it did not worked
            if (!rtmpCamera1.isStreaming()) {
              if (rtmpCamera1.isRecording()
                    || rtmpCamera1.prepareAudio() && rtmpCamera1.prepareVideo()) {
                mBroadCast.setState(true);
                mBroadCast.setEnabled(true);
                rtmpCamera1.startStream(value);
                setLMSLogoToStream();
            } else {
                Toast.makeText(this, "Error preparing stream, This device cant do it",
                        Toast.LENGTH_SHORT).show();
            }
        }
      }

There is one more thing, when I stop the streaming the following error comes
E/AndroidRuntime: FATAL EXCEPTION: Thread-6
Process: com.lastmanstands.tv, PID: 30554
java.lang.IllegalStateException
at android.media.MediaCodec.getBuffer(Native Method)
at android.media.MediaCodec.getOutputBuffer(MediaCodec.java:3178)
at com.pedro.encoder.video.VideoEncoder.getDataFromSurfaceAPI21(VideoEncoder.java:371)
at com.pedro.encoder.video.VideoEncoder.access$000(VideoEncoder.java:33)
at com.pedro.encoder.video.VideoEncoder$1.run(VideoEncoder.java:249)
at java.lang.Thread.run(Thread.java:764)

Now I called this function from onCreate(Bundle savedInstanceState)
     prepareEncoders(iSelectedItemPosition,iFPS,iVideoBitrate);

Then again from here
      if(prepareEncoders(iSelectedItemPosition,iFPS,iVideoBitrate)){
        if (!rtmpCamera1.isStreaming()) {
            if (rtmpCamera1.isRecording()
                    || rtmpCamera1.prepareAudio() && rtmpCamera1.prepareVideo()) {
                mBroadCast.setState(true);
                mBroadCast.setEnabled(true);
                rtmpCamera1.startStream(value);
                setLMSLogoToStream();
            } else {
                Toast.makeText(this, "Error preparing stream, This device cant do it",
                        Toast.LENGTH_SHORT).show();
            }
        }

I set the resolution 1920 x 1080 it worked correctly for a period of time, after that it went back to 640 x 480
After that whatever I change the resolution is not changing it takes only 640 x 480 only...

You still have a code error, try this:
if (!rtmpCamera1.isStreaming()) {
            if (rtmpCamera1.isRecording()
                    || prepareEncoders(iSelectedItemPosition,iFPS,iVideoBitrate)) {
                mBroadCast.setState(true);
                mBroadCast.setEnabled(true);
                rtmpCamera1.startStream(value);
                setLMSLogoToStream();
            } else {
                Toast.makeText(this, "Error preparing stream, This device cant do it",
                        Toast.LENGTH_SHORT).show();
            }
        }

About videoencoder crash i'm working in a solution for it.

Now resolution works perfectly thanks a lot


text:
Add scoped API keys authentication

This change is

Coverage decreased (-0.9%) to 92.308% when pulling 1eb1afb8b37928fe33e2368ca964c291e81cff01 on josacar:add-scoped-api-keys into 5618c7bc24b8c05ab17646790c25130e260cc342 on peertransfer:master.

authors: coveralls josacar

repo: peertransfer/glare


text:
Support exporting parsers as ES2015 modules

Currently the buildParser method returns either an object or an IIFE. This prevents seamless ES6-style imports.
There is a plugin that allows importing parsers built from grammar files, rollup-plugin-pegjs. It currently can't do much more than either export default generatedParser; or module.exports = generatedParser;.
Despite the claims in the rollup-plugin-pegjs README that
import { parse } from "grammar.pegjs";

is possible, I've been unable to do so and have to rely on this:
import parser from "grammar.pegjs";
const { parse } = parser;

So taking that into consideration, would it be ok if there was another option for output: source-es6 or source-es6-module that would have IIFE stripped and would have ES6-style exports instead of returning an object?
I could do the PR if the idea is accepted.

The way I see it, there are two questions in play here:

What is the responsibility of the buildParser function?
What exactly should be exported?

As for 1, in the current architecture buildParser returns either the parser object or source code which produces it when evaluated. This invariant is encoded into the compiler. The function doesn’t deal with the module system at all (this is done  in bin/pegjs).
This design is simple and understandable, but your request made me realize that it’s probably not the most practical one. The code which handles exporting currently has to be replicated in many tools which use PEG.js API (e.g. gulp-peg or grunt-peg). It would be more useful to put export handling into buildParser itself (either by allowing more output values or by adding specialized option(s) valid when output is set to "source"). I’ll have a look at this as part of #362 (I just added an item into a checklist there).
As for 2, the core issue is whether generated parsers are objects or modules. In the pre-ES6 Node.js world this question doesn’t have to be answered because modules are represented by objects and export works the same for both. In the ES6 world the situation is different. If generated parsers are objects, the proper way to export them is using the default export. Import and usage would then look something like this:
import parser from "parser";

try {
  parser.parse(...);
} catch (e) {
  if (e instanceof parser.SyntaxError) {
    // ...
  } else {
    // ...
  }
}

On the other hand, if generated parsers are modules, the proper way to export them is using named exports. Import and usage would then look something like this:
import { parse, SyntaxError } from "parser";

try {
  parse(...);
} catch (e) {
  if (e instanceof SyntaxError) {
    // ...
  } else {
    // ...
  }
}

or, alternatively:
import * as parser from "parser";

try {
  parser.parse(...);
} catch (e) {
  if (e instanceof parser.SyntaxError) {
    // ...
  } else {
    // ...
  }
}

The current code assumes that generated parsers are objects — you can even reference the parser object from a grammar as parser. I’d like to keep things that way, at least for the time being.
In practice, I think it means adding ES6-style exports to generated parsers is not necessary at this point. The only practical way to use ES6 modules right now is through transpilers, and at least Babel (with the es2015 preset) seems to be able to correctly handle both modules that use module.exports = ... (the current way) and those that use export default ... (the ES6 way). So I don’t think any change is needed here, at least form the practical standpoint.
I’ll leave this issue open in case the problem is actually more complex than I think. Also, I assume adding support for ES6 modules will become necessary at some later point when they will be supported natively more widely, so the issue will need to be resolved eventually.

I agree that this is not necessary and it is possible to use pegjs as it is now, even with rollup.
The main benefit of ES6-style exports is removing the unnecessary IIFE. Also rollup removes any exports that are not used anywhere, but I'm not so experienced with pegjs as to know whether this is a big optimalization. Using an IIFE makes static analysis much harder, if not impossible.
Anyway, I've since forked this repo and applied the changes I needed (or more exactly: my friend needed), so you can see the results here for future reference if you decide it's ok to go the ES6-style exports way:

The main commit
The list of commits (I messed one thing up, so 2 commits in total)

I also had an idea of how to (maybe) improve the current architecture: the generate-js pass could return only the code containing functions, objects, etc.; exporting could be handled in another pass. This would improve readability a bit, since the files are huge now. I also think it would be less painful to deal with exports when they would be separated from the parser-generating logic.

I would like to have a --format esm option that outputs a ECMA Script Module format (aka as es6 module format) compatible file. I need this to import it seamlessly in typescript.
I think this should be quite simple to implement. Looking at the commonjs output it does:
  return {
    SyntaxError: peg$SyntaxError,
    parse:       peg$parse
  };

So instead just remove the IIFE and do:
    export const SyntaxError = peg$SyntaxError,
    export const parse = peg$parse

Should we do a PR for this?

It seems like the demand for ES2015-style parser modules is bigger than I thought.
In a previous comment, I discussed whether the parser really is an object or a module and what exactly should be exported. I concluded that:

The current code assumes that generated parsers are objects — you can even reference the parser object from a grammar as parser. I’d like to keep things that way, at least for the time being.

I think it’s time to reverse this position. Generated parsers should be treated as modules exporting the parse function and the SyntaxError constructor (and optionally the DefaultTracer constructor). Note the parser variable mentioned in the comment is not available anymore (since 0.10.0).
@jonaskello You or anyone else are welcome to submit a PR implementing this. It should be trivial.

Since I've already created a fork with the required changes some time ago, I'd happily update it and prepare the PR. The problem is, I can do this at earliest a week from now.
If anyone wants to take care of this in the meanwhile, I've left some reference links to my changes in the previous comments.

I have no urgent need for this at the moment. @fatfisz If you already have the changes needed I think it would be best if you do it.

I propose that this be re-opened.  This has fairly significant consequences for tree shaking.

@futagoza - please consider reopening this.

@StoneCypher Why reopen this? It's already been implemented in v0.11, I just need to find more time to finish of the test suite re-write before I release v0.11

I didn't know it was already implemented.
I apologize for the noise.

So, I'm kind of annoyed, because you told me to not re-open this in May of 2019 because it was already done, but in February of 2020, it's actually not on NPM yet, and you just said a month ago that version 0.11.0 is never happening
This needs to be re-opened, and left open until it's actually done.  Done-in-a-failed-branch doesn't count
Cleaning up this repo's issue tracker to re-open all the things that shouldn't be closed is going to be terrible

The correct fix for this is easily ported into 0.10.0 and published.  It's a six line copy paste, and it's very high stakes for a lot of us.
Why haven't you done that yet?  We shouldn't be waiting on your 0.11.0, your 0.12.0, your OpenPeg, your PegX, et cetera
Please re-open this issue, and add a maintainer who can make this project healthy again.

What's still missing to release this?
I'm willing to help out!

The new maintainer has never released since he took over, and ghosted months ago

authors: StoneCypher dmajda fatfisz futagoza jonaskello leifg

repo: pegjs/pegjs


text:
Using {{customVariables}} with oneOf schema objects throw an Exception: violated Too many elements

Steps to reproduce

Register some custom variable (EdgeInsetsGeometry or BorderRadius) in the Registry.
Use that variable in any json

JSON example
{
  "type": "scaffold",
  "args": {
    "appBar": {
      "type": "app_bar",
      "args": {
        "title": {
          "type": "text",
          "args": {
            "text": "Example"
          }
        }
      }
    },
    "body": {
      "type": "set_value",
      "args": {
        "customPadding": 16
      },
      "child": {
        "type": "flat_button",
        "args": {
          "padding": "{{customPadding}}"
        },
        "child": {
          "type": "text",
          "args": {
            "text": "Random Text"
          }
        }
      }
    }
  }
}

For what I was checking, this error happens when the Schema of the objects uses SchemaHelper.objectSchema(id) and the schema referenced by that id uses oneOf and one of the options is 'string'.

This also happens if insted of "{{customPadding}}" the property receive a random string.

Issue confirmed, investigating...

I think I may have to abort on the schemas.  I don't want to, but the library I'm depending on hasn't been maintained in over a year and there's no good reason this shouldn't have validated because when it his the schema it is a string; which doesn't make sense to fail out with a "too many elements" error since that error is supposed to be for when you have an object with elements that don't exist in the object definition.

Phew, nope.  Found the issue.
It's going to take some more effort, but the problem is that the EdgeInsetsPadding allowed a string value and the objectSchema did too.  Removing one of those allowed it to validate.
There's some other objects that fall under this same setup so I need to trace those out to make sure this is properly fixed.
Seriously, congrats and thanks for finding this because "padding" is one of an exceptionally small few values that would trigger this particular issue.  Radius is the other I can think of off the top of my head.

Fix checked in to json_theme and applied to here as well.
I added your example to prove the fix, but because of how unique and strange this particular issue ended up being, I would like to ask you please retest and close if you feel this is resolved.

I retested it, everything works fine now!

authors: jpeiffer limonadev


text:
🛑 Beyond.pl is down

In 56f3d69, Beyond.pl (http://www.beyond.pl) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Beyond.pl is back up in 21daf91.

repo: pejotes/upptime


text:
🛑 Beyond.pl is down

In 1b6d9d3, Beyond.pl (http://www.beyond.pl) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Beyond.pl is back up in 319a7d3.


text:
🛑 Beyond.pl is down

In 67ea02f, Beyond.pl (http://www.beyond.pl) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Beyond.pl is back up in 89ec960 after 18 minutes.


text:
🛑 Beyond.pl is down

In 0a78ea5, Beyond.pl (http://www.beyond.pl) was down:

HTTP code: 403
Response time: 660 ms

Resolved: Beyond.pl is back up in 4224631 after 11 minutes.


text:
How to configure a Failover Partner?

In .NET, I'd add something like this to the connection string to set the main server and failover server:
Data Source=2342878-db1; Failover Partner=61989-db2;
What are the tedious config properties to use (if it supports this feature)?  (I'm using the node-mssql module and opened the same issue days ago in it's repository with no response as yet.)

There's no way to configure a failover partner at the moment.
You could definately build something around existing tedious functionality, where if the initial connection to your primary data source fails, you reconnect to the failover partner instead.
This would mirror the "Failover Partner" connection string functionality, but it would not mirror all the functionality the .Net driver has for high availability / database mirroring. I checked the documentation for the .Net driver, and apparently SQL Server additionally sends the failover partner information after a successful connection was established, and the "Failover Partner" setting in the connection string is only used on the initial connection attempt, but not when a failover happens after the initial connection attempt.
Making this work correctly would require some changes in the innards of tedious.

OK.  We'll looking into developing support for this ourselves.  Thanks.
On Wed, Sep 9, 2015 at 11:53 AM Arthur Schreiber notifications@github.com
wrote:

There's no way to configure a failover partner at the moment.
You could definately build something around existing tedious
functionality, where if the initial connection to your primary data source
fails, you reconnect to the failover partner instead.
This would mirror the "Failover Partner" connection string functionality,
but it would not mirror all the functionality the .Net driver has for high
availability / database mirroring. I checked the documentation for the .Net
driver, and apparently SQL Server additionally sends the failover partner
information after a successful connection was established, and the
"Failover Partner" setting in the connection string is only used on the
initial connection attempt, but not when a failover happens after the
initial connection attempt.
Making this work correctly would require some changes in the innards of
tedious.
—
Reply to this email directly or view it on GitHub
https://github.com/pekim/tedious/issues/315#issuecomment-138973186.

Just to be clear, Database Mirroring is a deprecated feature of SQL Server.

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. We recommend that you use AlwaysOn Availability Groups instead.

(Source)
Tedious does support AlwaysOn Availability Groups. If possible, I would suggest looking into migrating to that solution.

Thanks.  We are currently on SQL Server 2012, we are aware of the loss of
support for Mirroring in later versions of SQL Server...given the cost of
AlwaysOn etc we'll likely investigate other backend solutions.
On Wed, Sep 9, 2015 at 1:36 PM Bret Copeland notifications@github.com
wrote:

Just to be clear, Database Mirroring is a deprecated feature of SQL Server.
This feature will be removed in a future version of Microsoft SQL Server.
Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. We recommend that you use
AlwaysOn Availability Groups instead.
(Source https://msdn.microsoft.com/en-us/library/ms190202.aspx)
Tedious does support AlwaysOn Availability Groups. If possible, I would
suggest looking into migrating to that solution.
—
Reply to this email directly or view it on GitHub
https://github.com/pekim/tedious/issues/315#issuecomment-139000988.

authors: arthurschreiber bretcope cmeans

repo: pekim/tedious


text:
Send correct servername in Login7 after rerouting

In addition to #309.
I can push another beta package, just need some other pair of eyes looking over this.
//cc @gleeds @bretcope @tysjiang @SyRenity @spanditcaa PTAL

Appveyor build for 0.10 failed because of some unrelated issue. I'll merge this and tag a new beta release.

will update and let you know what we find.

Published as tedious@1.11.5-beta.5-gb7b6e4d.

I retested with this version, it seems like it has fixed the issue for me (#262).  I personally never ran into the #272, so I can't confirm if that is resolved.

We're working with some Microsoft folks who were able to trigger a failover/reroute for us.  The driver restored connection as desired.

However - this was from a host running outside the Azure datacenter.  It seems we aren't able to connect from a host running in Azure.  We're troubleshooting this now.  As I understand, there is a different connection path from internal to Azure datacenters.

@spanditcaa I can only get the initial redirect when connecting from a host inside Azure, when I connect from a host outside of azure I never get redirected to another server (maybe because the other server isn't publicly routable?)
Another thing that keeps tripping me up is that I have tedious twice in the app I'm trying to test on (because I'm dumb), both in the root, and as a part of the mssql npm library, and I keep accidentally updating only one or the other.  Also the Kudu deployment thing seems to sporadically run npm update when I deploy.  You might double check your package.json for tedious on the deployed server to make sure it really is the right one.

@gleeds @arthurschreiber
We had what seems to be an unrelated deployment issue.  I ran a clean deployment in Azure and everything is working normally.  We also had another failover/reroute triggered and the hosts picked up the new servers and reconnected in about 200ms.

That sounds great. I'm really glad the fix is working for you.
I'll need to polish the changes a bit and create some unit tests for this, and then I'll push new 1.11 and 1.12 releases containing the fix.
I won't get around to doing this today, but I hope I can find some time this weekend.

Everyone listening in on this, I released 1.11.5 and 1.12.3 containing this fix.

Thanks @arthurschreiber.  I think 1.11.5 may need an npm publish.  I only see 1.12.3 added there.

@spanditcaa It should be available now. There's some issue with pushing to the npm registry using older  versions of the npm client, which caused the push from Travis to fail. I pushed the version manually for now.

authors: arthurschreiber gleeds spanditcaa


text:
🛑 PELLIT-PAGE is down

In ff2c964, PELLIT-PAGE (https://pellit.com.ar/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: PELLIT-PAGE is back up in 5db9892 after 3 minutes.


text:
Complexity of current implementation is too high

Doing concat on normal js Array has quadratic complexity, plus doing map on the history  is linear.
So I belive complexity this far is O(n^2 + n). but this is for nth yield, if i'm correct, using this for some program With n yield, will have complexity of O(n * (n^2 + n)) i.e. O(n^3+n^2). and I think this should be at least noted in readme.
btw the O(n^2 + n) part could be optimised to O(n) by using some some sequence structure which has constant time push (as you push one element only), you could even use normal Lined list for it (List = Nil | Cons a (List a)). this way complexity for some program With n yield will be O(n * n) i.e. O(n^2).

Hm, I don't think you're right about that. Concatenating 2 arrays of length n and m would be O(n + m), but appending a single element to the end of an array, as we're doing here, is just O(n). Using a cons-list for the history would make appending an element constant time, but because of the map the overall complexity of a single yield would remain O(n).

Correct, so concat will be O(n) + map O(n) so single yield will stay O(n), i.e. we can't fix it.
But I still think that, it should be noted in readme, as users of immutagen and burrido might not be aware of this.

Quoting from the current README:

Note also that there is inherent inefficiency in this technique, because every yield expression requires replaying the entire history up to that point. For this reason it's advisable to keep expensive computations to a minimum inside immutable generators, particularly as the number of yield expressions in the generator grows. Even if there isn't a lot of expensive computation, the runtime complexity will be quadratic in the number of yield expressions to be evaluated, so be careful.

Is that not sufficiently clear?

didn't saw that in "burrido"

I'd be happy to review a PR on the burrido repo that adds wording to that effect.

Issue moved to pelotom/burrido #2 via ZenHub

authors: pelotom safareli

repo: pelotom/immutagen


text:
🛑 Dinas Koperasi, Usaha Kecil dan Menengah is down

In 438210c, Dinas Koperasi, Usaha Kecil dan Menengah (https://dkukm.bekasikota.go.id) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Dinas Koperasi, Usaha Kecil dan Menengah is back up in 50962e4.

repo: pemkotbekasi/website-status


text:
🛑 Kecamatan Bekasi Utara is down

In 2ac7d9b, Kecamatan Bekasi Utara (https://kec-bekasiutara.bekasikota.go.id) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Kecamatan Bekasi Utara is back up in cc0eaa5.


text:
🛑 Dinas Pemberdayaan Perempuan dan Perlindungan Anak is down

In 4f1ba29, Dinas Pemberdayaan Perempuan dan Perlindungan Anak (https://dpppa.bekasikota.go.id) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Dinas Pemberdayaan Perempuan dan Perlindungan Anak is back up in 3779d61.


text:
可以增加下JBOSS的支持么

特别是老版本的JBOSS

Jboss 低版本套的是 tomcat，直接使用 tomcat 内存马即可，详见Jboss 内存马。


text:
add stellar-relay pallet to runtime

You'll have to add the following to the construct_runtime! macro in the runtime:
StellarRelay: stellar_relay::{Pallet, Call, Config<T>, Storage, Event<T>}

And the following config:
impl stellar_relay::Config for Runtime {
    type Event = Event;
    type WeightInfo = ();
    type ParachainBlocksPerBitcoinBlock = ParachainBlocksPerBitcoinBlock;
}

And make sure it compiles.
Refer to this file as a guide: https://github.com/interlay/interbtc/blob/master/standalone/runtime/src/lib.rs
(Note in this reference it will be called BTCRelay)

Closing this because it was done in #99.

authors: ashneverdawn ebma

repo: pendulum-chain/spacewalk


text:
Uploading a photo to Wikipedia

Hello,
Thank you for your great project. I am editing Framework's Wikipedia page. And I would like to see this photo, images/mainboard-terminal-heroshot.jpg on the Wikipedia page.
Do you mind that you upload the photo image by yourself there or you declare at least the image with "CC BY-SA 4.0" license? I tried to upload the image to the Wikipedia. But it seems the MIT licence is not allowed to upload it. So, this repository's possible license might be "MIT or CC BY-SA 4.0".
If you declare the license, I can upload it. However it seems it's much less trouble when you, the actual license holder would upload it, seeing other cases.
Here is the example of "CC BY-SA 4.0" license file.
How to upload the image to the Wikipedia: Create your account on Wikipedia, and upload at UploadWizard. The document.
Thank you!

@junaruga thanks for the report, let re re-license it.

Thank you! As a reference, here is an example of license "MIT or CC-BY-SA", https://github.com/assaf/uuid#license- . But I might recommend "CC BY-SA 4.0" rather than "CC-BY-SA". as the "CC BY-SA 4.0" is Wikipedia's default license.

Thank you!

Your photo is uploaded to the Framework's Wikipeida page now! Thank you.

authors: junaruga penk

repo: penk/MainboardTerminal


text:
[SP-5059] Backport of PDI-18026 - Text File Output: 'Accept Field as …

…File Name' Functionality not Working for > 1 Row of Data (7.1 Suite)
cherry-pick of 58bec60
@RPAraujo

Build Completed
:fire: This pull request has some issues. It would be preferable to fix them in order for it to be just perfect. See below for more details. Some links are also available below for further assistance in addressing those issues.
Build Commands
ant -Dtestreports.dir=bin/reports/unit-test -f engine/build.xml clean-all resolve jacoco && ant -f engine/build.xml checkstyle publish-local

Cleanup Commands
rm -r ~/.ivy2/local || echo no publish local to remove

Changed files
  engine/src/org/pentaho/di/trans/steps/textfileoutput/TextFileOutput.java

Unit Test Coverage
These statistics help you identify how your changes have affected the coverage of the following files. If a file is not in this list, then its coverage was not affected by your changes. To get some help interpreting these metrics, please refer to Jacoco's documentation.

:warning: Coverage Changes: +0.1% (click to expand)
org.pentaho.di.job.entries.evalfilesmetrics.JobEntryEvalFilesMetrics

Branch Change: -0.8% :small_red_triangle_down:
Complexity Change: -1% :small_red_triangle_down:
Instruction Change: -0.2% :small_red_triangle_down:

org.pentaho.di.job.entries.sql.JobEntrySQL

Instruction Change: -3.3% :small_red_triangle_down:
Line Change: -3.9% :small_red_triangle_down:

org.pentaho.di.trans.step.StepMeta

Branch Change: -0.7% :small_red_triangle_down:
Complexity Change: -0.6% :small_red_triangle_down:
Instruction Change: -0.2% :small_red_triangle_down:
Line Change: -0.2% :small_red_triangle_down:

org.pentaho.di.trans.steps.groupby.GroupByMeta

Branch Change: -2% :small_red_triangle_down:
Complexity Change: -2% :small_red_triangle_down:
Instruction Change: -0.1% :small_red_triangle_down:
Line Change: -0.4% :small_red_triangle_down:

org.pentaho.di.trans.steps.memgroupby.MemoryGroupByMeta

Branch Change: -1.1% :small_red_triangle_down:
Complexity Change: -1.3% :small_red_triangle_down:
Instruction Change: -0.1% :small_red_triangle_down:
Line Change: -0.4% :small_red_triangle_down:

org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta

Instruction Change: -0.1% :small_red_triangle_down:

org.pentaho.di.trans.steps.sortedmerge.SortedMergeMeta

Instruction Change: -0.2% :small_red_triangle_down:

org.pentaho.di.trans.steps.textfileinput.TextFileInputMeta

Branch Change: -0.5% :small_red_triangle_down:

org.pentaho.di.trans.steps.textfileoutput.TextFileOutput

Complexity Change: -0.1% :small_red_triangle_down:

org.pentaho.di.trans.steps.uniquerows.UniqueRowsMeta

Instruction Change: -0.1% :small_red_triangle_down:

authors: ssamora wingman-pentaho

repo: pentaho/pentaho-kettle


text:
[SECURITY] Use HTTPS to resolve dependencies in Maven Build

Want to take over the Java ecosystem? All you need is a MITM!
Update: Want to take over the Java ecosystem? All you need is a MITM!

This is a security fix for a  vulnerability in your Apache Maven pom.xml file(s).
The build files indicate that this project is resolving dependencies over HTTP instead of HTTPS.
This leaves your build vulnerable to allowing a Man in the Middle (MITM) attackers to execute arbitrary code on your or your computer or CI/CD system.
This vulnerability has a CVSS v3.0 Base Score of 8.1/10.
POC code has existed since 2014 to maliciously compromise a JAR file in-flight.
MITM attacks against HTTP are increasingly common, for example Comcast is known to have done it to their own users.
This contribution is a part of a submission to the GitHub Security Lab Bug Bounty program.
Detecting this and Future Vulnerabilities
This vulnerability was automatically detected by LGTM.com using this CodeQL Query.
As of September 2019 LGTM.com and Semmle are officially a part of GitHub.
You can automatically detect future vulnerabilities like this by enabling the free (for open-source) LGTM App.
I'm not an employee of GitHub nor of Semmle, I'm simply a user of LGTM.com and an open-source security researcher.
Source
Yes, this contribution was automatically generated, however, the code to generate this PR was lovingly hand crafted to bring this security fix to your repository.
The source code that generated and submitted this PR can be found here:
JLLeitschuh/bulk-security-pr-generator
Opting-Out
If you'd like to opt-out of future automated security vulnerability fixes like this, please consider adding a file called
.github/GH-ROBOTS.txt to your repository with the line:
User-agent: JLLeitschuh/bulk-security-pr-generator
Disallow: *

This bot will respect the ROBOTS.txt format for future contributions.
Alternatively, if this project is no longer actively maintained, consider archiving the repository.
CLA Requirements
This section is only relevant if your project requires contributors to sign a Contributor License Agreement (CLA) for external contributions.
It is unlikely that I'll be able to directly sign CLAs. However, all contributed commits are already automatically signed-off.

The meaning of a signoff depends on the project, but it typically certifies that committer has the rights to submit this work under the same license and agrees to a Developer Certificate of Origin
(see https://developercertificate.org/ for more information).
- Git Commit Signoff documentation

If signing your organization's CLA is a strict-requirement for merging this contribution, please feel free to close this PR.
Tracking
All PR's generated as part of this fix are tracked here:
https://github.com/JLLeitschuh/bulk-security-pr-generator/issues/2

:white_check_mark: Build finished in 1m 42s
Build command:
mvn clean verify -B -e -Daudit -amd

:ok_hand: All tests passed!
Tests run: 101, Failures: 0, Skipped: 0    Test Results

:information_source:  This is an automatic message

:white_check_mark: Build finished in 5m 23s
Build command:
mvn clean verify -B -e -Daudit -amd

:ok_hand: All tests passed!
Tests run: 101, Failures: 0, Skipped: 0    Test Results

:information_source:  This is an automatic message

:white_check_mark: Build finished in 52m 20s
Build command:
mvn clean verify -B -e -Daudit -amd

:exclamation: No tests found!
:information_source:  This is an automatic message

:white_check_mark: Build finished in 1h 47m 5s
Build command:
mvn clean verify -B -e -Daudit -amd

:exclamation: No tests found!
:information_source:  This is an automatic message

authors: JLLeitschuh buildguy

repo: pentaho/pentaho-mongodb-plugin


text:
Make get more efficient by never generating proofs

Resolves #44, making get save work by never doing any of the effort required to generate a proof which it will then throw away. I implemented this without particularly deep knowledge of how the JMT works, by starting with a copy of get_with_proof (called get_without_proof) and removing the output proof, then correcting errors that resulted from that, then following "unused variable" warnings, and proceeding into subroutines to generate less-effortful versions of them as necessary also.
It would be nice to have a test which shows that tree.get_with_proof(key).0 == tree.get(key) for all key. We could use proptest for this, or we could feel satisfied by a couple of unit tests? What do you think @aubrika?

Merging this optimistically so it will be pulled into pd.

authors: hdevalence plaidfinch

repo: penumbra-zone/jmt


text:
Wallet: Separate spending and viewing authority

Currently pcli is assuming that the user has spend authority, generating a spend key for them if they don't have one. But as @hdevalence pointed out on Discord, we will need to also support the case where one only has viewing keys and no spend authority.
This would mean at least:

What we save in the wallet file needs to change, we won't have a SpendSeed to save, and instead will have one or more viewing keys, which could be incoming, outgoing, or full
The ClientState needs to change, currently the keys field on that struct simply stores a SpendKey
more TK

This issue is for deciding what the best way to support both situations is in pcli.

I think we can punt on this for a while, since the only case that this will be useful is when we have some external signing mechanism like a hardware wallet.

This was done as part of the wallet rewrite.

authors: hdevalence redshiftzero

repo: penumbra-zone/penumbra


text:
Implement AssetMetadataByIds endpoint of ShieldedPool service

https://github.com/penumbra-zone/penumbra/blob/64f3399aa9eb6df8d02ed6c91628945976cbf046/crates/core/component/shielded-pool/src/component/rpc.rs#L67-L72
any client using the web block processor will be ratelimited immediately when attempting genesis block sync. this is due to the massive number of requests issued during initial validator discovery (currently, there are 437 validators).
PR exists at https://github.com/penumbra-zone/web/pull/1392 in web to avoid the behavior, but most of these requests could become a single request if this batch request endpoint were implemented.

This is a duplicate of https://github.com/penumbra-zone/penumbra/issues/4162 that was closed in favor of https://github.com/penumbra-zone/web/issues/1189


text:
Save Fetched Object

How can I save fetched object ? In example with source code nothing sollution for change object.
I fetch object
let mUsers: [QeUser] = try! self.db.fetch(Request<QeUser>())
globalUser = mUsers[0]

Later I changed some property
globalUser.firstName = "Some different name"
And how can I save the object ? Next code, into to DB writes nothing.
if (self.db.mainContext as! NSManagedObjectContext) {
    //condition is true and context has changes
    try! (self.db.mainContext as! NSManagedObjectContext).save()
   //context some work, and hasn't changes
}

Same result is with this code
try! globalUser.managedObjectContext?.save()
Correct solution is only through operation ? Fetch same object, edit and call save ?

I think the right way is through the use of operations, fetch the same object. After the operation, save (), these changes take effect for the previous fetched object.
It is an ideal solution because it overwrites the original object after successful update.

repo: pepibumur/SugarRecord


text:
Add cluster5 stage for running the tests

CHANGE DESCRIPTION
Problem:
Short explanation of the problem.
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira

[ ] Is the Jira ticket created and referenced properly?
[ ] Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
[ ] Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

[ ] Is an E2E test/test case added for the new feature/change?
[ ] Are unit tests added where appropriate?

Config/Logging/Testability

[ ] Are all needed new/changed options added to default YAML files?
[ ] Are the manifests (crd/bundle) regenerated if needed?
[ ] Did we add proper logging messages for operator actions?
[ ] Did we ensure compatibility with the previous version or cluster upgrade process?
[ ] Does the change support oldest and newest supported PS version?
[ ] Does the change support oldest and newest supported Kubernetes version?

Test name
Status

async-ignore-annotations
passed

auto-config
passed

config
passed

config-router
passed

demand-backup
passed

gr-demand-backup
failure

gr-ignore-annotations
passed

gr-init-deploy
passed

gr-one-pod
passed

gr-scaling
passed

gr-tls-cert-manager
passed

haproxy
passed

init-deploy
passed

limits
passed

monitoring
passed

one-pod
passed

scaling
passed

semi-sync
passed

service-per-pod
passed

sidecars
passed

tls-cert-manager
passed

users
passed

version-service
passed

We run 23 out of 23

commit: https://github.com/percona/percona-server-mysql-operator/pull/355/commits/ad3ed46a3603922c296a8036361e71021e7f02ea
image: perconalab/percona-server-mysql-operator:PR-355-ad3ed46

Test name
Status

async-ignore-annotations
passed

auto-config
passed

config
passed

config-router
passed

demand-backup
passed

gr-demand-backup
passed

gr-ignore-annotations
passed

gr-init-deploy
passed

gr-one-pod
passed

gr-scaling
passed

gr-tls-cert-manager
passed

haproxy
passed

init-deploy
passed

limits
passed

monitoring
passed

one-pod
passed

scaling
passed

semi-sync
passed

service-per-pod
passed

sidecars
passed

tls-cert-manager
passed

users
passed

version-service
passed

We run 23 out of 23

commit: https://github.com/percona/percona-server-mysql-operator/pull/355/commits/ad3ed46a3603922c296a8036361e71021e7f02ea
image: perconalab/percona-server-mysql-operator:PR-355-ad3ed46

Test name
Status

async-ignore-annotations
passed

auto-config
passed

config
passed

config-router
failure

demand-backup
passed

gr-demand-backup
failure

gr-ignore-annotations
passed

gr-init-deploy
passed

gr-one-pod
failure

gr-scaling
passed

gr-tls-cert-manager
passed

haproxy
passed

init-deploy
passed

limits
passed

monitoring
passed

one-pod
passed

scaling
passed

semi-sync
passed

service-per-pod
passed

sidecars
passed

tls-cert-manager
passed

users
passed

version-service
passed

We run 23 out of 23

commit: https://github.com/percona/percona-server-mysql-operator/pull/355/commits/d52369739a77b4e00c9bf6c04c6b9d7d94942461
image: perconalab/percona-server-mysql-operator:PR-355-d523697

Test name
Status

async-ignore-annotations
passed

auto-config
passed

config
passed

config-router
passed

demand-backup
passed

gr-demand-backup
failure

gr-ignore-annotations
passed

gr-init-deploy
passed

gr-one-pod
passed

gr-scaling
passed

gr-tls-cert-manager
passed

haproxy
passed

init-deploy
passed

limits
passed

monitoring
passed

one-pod
passed

scaling
passed

semi-sync
passed

service-per-pod
passed

sidecars
passed

tls-cert-manager
passed

users
passed

version-service
passed

We run 23 out of 23

commit: https://github.com/percona/percona-server-mysql-operator/pull/355/commits/dff419eb9ec72ff9bbc5f9c54be818041619e139
image: perconalab/percona-server-mysql-operator:PR-355-dff419e

Test name
Status

async-ignore-annotations
passed

auto-config
passed

config
passed

config-router
passed

demand-backup
passed

gr-demand-backup
failure

gr-ignore-annotations
passed

gr-init-deploy
passed

gr-one-pod
failure

gr-scaling
passed

gr-tls-cert-manager
passed

haproxy
passed

init-deploy
passed

limits
passed

monitoring
passed

one-pod
passed

scaling
passed

semi-sync
passed

service-per-pod
passed

sidecars
passed

tls-cert-manager
passed

users
passed

version-service
passed

We run 23 out of 23

commit: https://github.com/percona/percona-server-mysql-operator/pull/355/commits/06b30cff0321842053e3e3b9cb0957fa4f74d688
image: perconalab/percona-server-mysql-operator:PR-355-06b30cf

authors: JNKPercona tplavcic

repo: percona/percona-server-mysql-operator


text:
The cronjobs (monitor_metrics*) get stuck and keep spawning when replica is taking a checkpoint

I have to remove the p4prom installation and the cron jobs from replica because of this.
I have a quite a huge environment where taking a checkpoint would take 12h +
During that time, all perforce command would stuck, including the cron jobs.
Any work around for this?

Which version of the server are you running?
If it is p4d 2021.1 or later then we can turn on Realtime Monitoring for the server:
https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_monitor.html
The value of 'rtv.db.ckp.active' could be read by the script to detect checkpoint. If that's an option for you I am happy to look at putting detection for this situation in place.
Please note that we usually recommend doing offline checkpoints, as done by SDP. This avoids locking live database, even on a replica.

We have p4d 2015.2.  the size of db.* are huge (over 100G).
We have p4prometheus installed on master, and runs without any issue.  However when installing it on replica, we realized that everything is frozen when checkpoint is running.  (somewhat expected)
If monitor_metrics* script could detect the locking and stop spawning new job, that'd work.

Do you have lslocks installed?

yes I do.

authors: hueyvle rcowham


text:
Page Not Found on .: https://docs.perl6.org/routine/.:<prefix>

the link to .: can be found in the search box, which direct to a 404 page.
does we really have a subroutine &prefix:<.>? when i try to find it in REPL, i get:
> &prefix:<.>
===SORRY!=== Error while compiling:
Undeclared routine:
prefix:<.> used at line 1. Did you mean 'prefix:<!>', 'prefix:<+>', 'prefix:<−>', 'prefix:<->', 'prefix:<~>'?

then i find #1592 with quite similar problem
it seems like in the dir doc we don't have a folder named routine
so where is the source code of page https://docs.perl6.org/routine/*

i found someone mention similar but more common problem in #1542
so i close this issue and will keep track in #1542


text:
travis build installing modules it doesn't need

I see in the travis builds that IO::String is being installed with zef.
IO::String is only used in xt/examples-compilation.t, which is not part of the travis test run.
It's listed as a hard dep in META6.json ; it should be optional. (and we should check all the other deps there to make sure they are used outside of xt/)

I didn't research this, which is why I opened a ticket instead of just removing it, but isn't there a way to specify optional deps so a developer can still use zef to do the install of the deps?

isn't there a way to specify optional deps so a developer can still use zef to do the install of the deps

None that I know of, other than manual instructions.
It looks like all that module was used for is to ignore some output, right? I just used core way of doing that in https://github.com/perl6/doc/commit/45ce3b6a17aec2aeb07514c10bda99b64f089e7e and we no longer need that module.

authors: coke zoffixznet


text:
Infix + doesn't show up in documentation

http://doc.perl6.org/+ and http://doc.perl6.org/routine/+ list the prefix version and the regex version, but not the infix operator.

Neither does the -

I started debugging this a while ago (but got sidetracked) and IIRC, the items directly after a '=head1' were being skipped by the code which selects the items to go into index.js as well as the list of routines.  For instance, if you edit lib/Language/operators.pod and move the entry for infix C«+|» to directly after =head1 Additive Precedence (line 561 atm) and rebuild the docs (e.g. with make html-nohiglight (so it builds a bit faster)), then you'll find that the entry Infix: +| disappears from the search box and it disappears from the list of routines in routine.html.  Strangely enough, infix - does currently show up under http://doc.perl6.org/routine/-, so I don't know why you're not seeing it at present (it doesn't turn up in the search box, but that's probably a separate, however related, issue).
After moving infix +| directly under the =head1 heading in my local build (and thus putting infix + and infix - at second and third places after the heading) made infix + and infix - then appear under routine/+.html and routine/-.html respectively.  Hopefully this information helps in debugging/investigating this issue further.

Thanks @zoffixznet for the extra info @paultcochrane for the excellent debugging! That leads me to believe that it's most likely a bug in &find-definitions, which is a little bit scary at the moment and really probably wants a refactor anyway. If no one gets to this earlier, I'll try to take it up this weekend.

infix + now shows up in both places -- does that just mean the symptom was relieved or that the problem is fixed?

Seems to have been fixed some time ago. According to Zoffix this can be closed.

authors: Mouq awwaiid dogbert17 paultcochrane zoffixznet


text:
Integrating Persephone into a production ML pipeline

I am trying to integrate models built with Persephone into my ML pipeline. I started by developing models using the corpus.Corpus(...) and experiment.train_ready(...) functions. Is there an API available for me to apply the preprocessing steps in corpus.Corpus(...) to a single wav file and then use something similar to experiment.transcribe(...) to get the predicted model transcription for that same wav file?
cc: @oadams

Hi, did you face issues with this approach?

Yes I did. I was able to add a flag to support a custom behavior of loading a corpus with no train/test/valid data only untranscribed data for inference.

@toonday were you able to make progress? It would be good to know what you tried and what issues you encountered.

authors: oadams shuttle1987 toonday

repo: persephone-tools/persephone


text:
Const changes to support new VFP Planner API refactor.

This PR has const changes to support the upcoming VFP refactor onto the new Planner API. https://github.com/personalrobotics/aikido/pull/426 is currently blocking on this PR. Once this PR has been merged, I will rebase https://github.com/personalrobotics/aikido/pull/426, and we can tackle that PR.
Because the new Problem derivate classes from the new Planner API (https://github.com/personalrobotics/aikido/pull/314) make most members const, this requires shoving a bunch of const variables through AIKIDO (we probably don't want to cast the const-ness away, since this would break a promise to the user).
These changes are necessary to make planToEndEffectorOffset possible with the new Planner API. planToEndEffectorPose may require more changes- my plan is to get planToEndEffectorOffset refactored first, then tackle planToEndEffectorPose.
Summary of changes

Const all the things.

Update old planToEndEffectorOffset  with the signature it needs to have in https://github.com/personalrobotics/aikido/pull/426.

Before creating a pull request

[x] Document new methods and classes
[x] Format code with make format

Before merging a pull request

[ ] Set version target by selecting a milestone on the right side
[ ] Summarize this change in CHANGELOG.md
[ ] Add unit test(s) for this change

Responded to @brianhou's comments- @jslee02, could you take a look when you have the chance?

repo: personalrobotics/aikido


text:
Can we just adapt e.g. log15 or logrus instead of building and maintaining our own package log?

https://github.com/inconshreveable/log15
https://github.com/Sirupsen/logrus

@ChrisHines @tsenart

That doesn't change much for me. I'm already one of the two maintainers for log15. I see the gokit/log package as an opportunity to address some issues with the current log15 API that we have discussed, but require breaking changes and thus bumping the API version from 2 to 3, which make it difficult to justify doing in an established project. In my mind gokit/log is basically log15.v3.

Thanks for your clarification. I don't have super strong opinions on the change, I'm just noticing that we're spending some nontrivial effort, and wondering if it's justified. But I defer to your domain expertise. I'm also happy to encode the strong opinions I do have about structured logging :)
Thanks for the response!

authors: ChrisHines peterbourgon

repo: peterbourgon/gokit