Using setState to update state

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/44830
PROPOSAL: https://github.com/Expensify/App/issues/44830#issuecomment-2209293460
Tests

[User A] Send an invoice to user B.
[User B] Go to invoice chat.
[User B] Click Pay button.
[User B] Click Pay as individual
[User B] Click on the back button
"Choose a payment method below" in the payment method selection page will persist

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

Offline tests

QA Steps

[User A] Send an invoice to user B.
[User B] Go to invoice chat.
[User B] Click Pay button.
[User B] Click Pay as individual
[User B] Click on the back button
"Choose a payment method below" in the payment method selection page will persist

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

PR Author Checklist

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

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

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

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

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

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

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

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

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

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

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

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

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

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

[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
https://github.com/user-attachments/assets/6349c277-4ed5-4872-9e4a-ee1efc32e7c9

Android: mWeb Chrome

https://github.com/Expensify/App/assets/168617111/0f58179b-5791-4642-adcc-f3cbf27e0c9f

iOS: Native

https://github.com/user-attachments/assets/495a5cf6-8fce-4591-a6bb-4d5d09be2ed7

iOS: mWeb Safari

https://github.com/Expensify/App/assets/168617111/8c0f0704-bb2e-499a-b7d0-c5bdd25d41b0

MacOS: Chrome / Safari

https://github.com/Expensify/App/assets/168617111/f495f454-44c4-42b9-a7a2-af74b5cd1c19

MacOS: Desktop
https://github.com/Expensify/App/assets/168617111/bdd08a63-2f42-4213-a963-be51e0dc0e89

Yeah, I can reproduce the issue on main too. Let's wait for the fix, we need to make sure that it works on all platforms.

Reviewer Checklist

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Screenshots/Videos

Android: Native

Android: mWeb Chrome

iOS: Native

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

Oops, sorry for the delay, @cretadn22 can you please fix the conflicts? I can review if after that.

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

🚀 Deployed to staging by https://github.com/techievivek in version: 9.0.9-1 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.0.9-2 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

🚀 Deployed to production by https://github.com/mountiny in version: 9.0.9-5 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/mountiny in version: 9.0.10-7 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
failure ❌

🕸 web 🕸
success ✅


Date in the zip filename and in the dicom header

DPACC is depending on the date inserted into the run sheet or the filename when finding missing scans, BIDS conversion, etc. However, we need to start using the date in the dicom headers as the true date of the scan and flag any run sheets and zip files that have mismatching dates.

Beginning to build framework that creates a report comparing dicom information against zip file names and runsheet information. One difficulty is that some subjects are missing values or have unexpected values for "PatientID" (participant id), "PatientName" (subject id), or "StudyDate" (acquisition date) in their dicoms. In other words, for example, it is not safe to assume that all dicoms have information about acquisition date.
Please see /PHShome/nk582/dicom_id_info_dict.csv.

`import random
from pathlib import Path
import pydicom
def get_random_dicom_path_per_session(dicom_root):
dicom_root = Path(dicom_root)
random_dicom_path_per_session = []
# /data/predict1/data_from_nda/MRI_ROOT/sourcedata/AB12345
dicom_subject_directories = [
    d for d in dicom_root.glob("[A-Za-z][A-Za-z]?????") if d.is_dir()
]

if not dicom_subject_directories:
    print(f"Warning: No dicom_subject_directories found in {dicom_root}.")
    return []

for dicom_subject_directory in dicom_subject_directories:
    # /data/predict1/data_from_nda/MRI_ROOT/sourcedata/AB12345/ses-190001011
    dicom_session_directories = [d for d in dicom_subject_directory.glob("ses-*")]

    if not dicom_session_directories:
        print(
            f"Warning: No dicom_session_directories found in {dicom_root}/{dicom_subject_directory}."
        )
        continue

    for dicom_session_directory in dicom_session_directories:
        # /data/predict1/data_from_nda/MRI_ROOT/sourcedata/AB12345/ses-190001011/*
        dicom_directories = [
            d for d in dicom_session_directory.glob("*") if d.is_dir()
        ]

        if not dicom_directories:
            print(
                f"Warning: No dicom_directories found in {dicom_root}/{dicom_subject_directory}/{dicom_session_directory}."
            )
            continue

        at_least_one_file_found = False
        while not at_least_one_file_found and dicom_directories:
            # /data/predict1/data_from_nda/MRI_ROOT/sourcedata/AB12345/ses-190001011/*
            random_dicom_directory = random.choice(dicom_directories)

            # /data/predict1/data_from_nda/MRI_ROOT/sourcedata/AB12345/ses-190001011/*/*
            files_in_random_dicom_directory = [
                f for f in random_dicom_directory.iterdir() if f.is_file()
            ]

            if not files_in_random_dicom_directory:
                print(
                    f"Warning: No files found in {dicom_root}/{dicom_subject_directory}/{dicom_session_directory}/{random_dicom_directory}."
                )
                dicom_directories.remove(random_dicom_directory)
            else:
                at_least_one_file_found = True
                random_file_in_random_dicom_directory = random.choice(
                    files_in_random_dicom_directory
                )
                random_dicom_path_per_session.append(
                    random_file_in_random_dicom_directory
                )

return random_dicom_path_per_session

def get_id_info_from_dicom(path_to_dicom):
# Load DICOM
ds = pydicom.dcmread(path_to_dicom)
# Extract Participant ID
patient_id = ds.get("PatientID", None)
# Extract Subject ID
subject_id = ds.get("PatientName", None)
# Extract Session ID
session_id = ds.get("StudyDate", None)
return {
    patient_id: {
        "Subject": subject_id,
        "Session": session_id,
        "Path": str(path_to_dicom),  # Added the path of the DICOM file
    }
}

def get_dicom_id_info_dict(dicom_root):
random_dicom_path_per_session = get_random_dicom_path_per_session(dicom_root)
dicom_id_info_dict = {}
for path in random_dicom_path_per_session:
    info = get_id_info_from_dicom(path)
    dicom_id_info_dict.update(info)

return dicom_id_info_dict`

import csv

dicom_id_info_dict = get_dicom_id_info_dict(
    "/data/predict1/data_from_nda/MRI_ROOT/sourcedata"
)

def save_to_csv(data, filename):
    with open(filename, "w", newline="") as csv_file:
        writer = csv.writer(csv_file)
        writer.writerow(["PatientID", "Subject", "Session", "Path"])
        for patient_id, info in data.items():
            writer.writerow(
                [patient_id, info["Subject"], info["Session"], info["Path"]]
            )

save_to_csv(dicom_id_info_dict, "dicom_id_info_dict.csv")


New built-in --version switch and version verb not listed in help screen

Exactly what in subject.

Fixed! :triumph:


error with hostname and cache

Hello,
if we submit host.domain.tld uwhoisd tries to get the whois entry for this host, but when we scan for domain.tld is reuse the cache.
It should be nice to exclude the host and only scan the registered domain.
BR,

Fixed: https://github.com/Lookyloo/uwhoisd/commit/fc23392e4e861e6f2d7d491707fbf68c95b68a3f


Send error response according to Backend response

Hello,
I'm finding difficult to get an working example for getting error responses according to backend response  and not the default 500 error response.
I've implemented my Gateway according to your Gin example and, at the moment, it is like this:
package main

import (
	"flag"
	"log"
	"os"
	"time"

	"github.com/gin-gonic/gin"
	"gopkg.in/gin-contrib/cors.v1"

	"api_gateway_admin/middleware"

	"github.com/devopsfaith/krakend/config"
	"github.com/devopsfaith/krakend/logging"
	"github.com/devopsfaith/krakend/proxy"
	krakendgin "github.com/devopsfaith/krakend/router/gin"
)

func main() {
	port := flag.Int("p", 0, "Port of the service")
	logLevel := flag.String("l", "ERROR", "Logging level")
	debug := flag.Bool("d", false, "Enable the debug")
	configFile := flag.String("c", "{{path to file}}/configuration.json", "Path to the configuration filename")
	flag.Parse()

	parser := config.NewParser()
	serviceConfig, err := parser.Parse(*configFile)
	if err != nil {
		log.Fatal("ERROR:", err.Error())
	}
	serviceConfig.Debug = serviceConfig.Debug || *debug
	if *port != 0 {
		serviceConfig.Port = *port
	}

	logger, err := logging.NewLogger(*logLevel, os.Stdout, "[KRAKEND]")
	if err != nil {
		log.Println("ERROR:", err.Error())
		return
	}

	routerFactory := krakendgin.NewFactory(krakendgin.Config{
		Engine:         gin.Default(),
		ProxyFactory:   customProxyFactory{logger, proxy.DefaultFactory(logger)},
		Logger:         logger,
		HandlerFactory: krakendgin.EndpointHandler,
		Middlewares: []gin.HandlerFunc{
			cors.New(cors.Config{
				AllowOrigins: []string{"http://localhost:4200", "http://<IP_ADDRESS>:4200", "http://localhost:8089", "http://localhost:8069", "http://localhost:8080", "http://localhost:8099"},
				AllowMethods: []string{"PUT", "PATCH", "POST", "GET", "DELETE", "OPTIONS"},
				AllowHeaders: []string{"Accept",
					"Accept-Encoding",
					"Accept-Language",
					"access-control-allow-origin",
					"Access-Control-Request-Headers",
					"Access-Control-Request-Method",
					"authorization",
					"Cache-Control",
					"Connection",
					"Content-Type",
					"Host",
					"If-Modified-Since",
					"Keep-Alive",
					"Key",
					"Origin",
					"Pragma",
					"User-Agent",
					"X-Custom-Header"},
				ExposeHeaders:    []string{"Content-Length", "Content-Type"},
				AllowCredentials: true,
				MaxAge:           48 * time.Hour,
			}),
			middleware.JwtCheck(),
		},
	})

	routerFactory.New().Run(serviceConfig)
}

// customProxyFactory adds a logging middleware wrapping the internal factory
type customProxyFactory struct {
	logger  logging.Logger
	factory proxy.Factory
}

// New implements the Factory interface
func (cf customProxyFactory) New(cfg *config.EndpointConfig) (p proxy.Proxy, err error) {
	p, err = cf.factory.New(cfg)
	if err == nil {
		p = proxy.NewLoggingMiddleware(cf.logger, cfg.Endpoint)(p)
	}
	return
}

Could you please help me out on what should I change here?
Thank you.

Hi @ricmoreira
Check this link for information about this behaviour:
http://www.krakend.io/docs/faq/#i-am-getting-a-500-status-when-the-backend-returns-anything-but-200-201-or-redirects.
Although now you can use the NoOpHTTPStatusHandler to send the same response of the backend.

Thank you for the quick response.
I've been through that documentation and I've understood that I've to inject my "own HTTPStatusHandler". In this case, as you said, the "NoOpHTTPStatusHandler" would solve my issue.
But where do I put it?

You need to add your own custom BackendFactory if you are not using the default Factories.
NewHTTPProxyDetailed will allow you to add your custom status handler.
Check this link for an example:
https://github.com/devopsfaith/krakend/issues/102#issuecomment-373657911

This is what I've done now:

(...)
	backendFactory := func(backendCfg *config.Backend) proxy.Proxy {

		ns := proxy.NoOpHTTPStatusHandler

		// the default request executor
		re := proxy.DefaultHTTPRequestExecutor(proxy. NewHTTPClient)

		// default entity formatter for the given backend
		ef := proxy.NewEntityFormatter(backendCfg)

		// the default response parser with the required config
		rp := proxy.DefaultHTTPResponseParserFactory(proxy.HTTPResponseParserConfig{backendCfg.Decoder, ef})

		// build and return the new backend proxy
		return proxy.NewHTTPProxyDetailed(backendCfg, re, ns, rp)
	}

	// build the pipes on top of the custom backend factory
	proxyFactory := proxy.NewDefaultFactory(backendFactory, logger)

	routerFactory := krakendgin.NewFactory(krakendgin.Config{
		Engine:         gin.Default(),
		ProxyFactory:   proxyFactory,

(...)

I've managed to get the response body but now an error response (e.g. 400) is transformed to a 200 response.

hi, @ricmoreira
the renders are responsible for the behaviour you're describing (as you can see here: https://github.com/devopsfaith/krakend/blob/master/router/gin/render.go#L90) but you can inject your own render at the router level by registering it with gin.RegisterRender and adding its name in the endpoint configuration (config.EndpointConfig.OutputEncoding).
your implementation should copy the proxy.Response.Metadata.StatusCode like in https://github.com/devopsfaith/krakend/blob/master/router/gin/render.go#L124
on the other hand, please notice you can use the CORS module already available in the master branch. the JOSE package is not ready yet, but we expect to finish it in a couple of weeks.
cheers!

Hello,
I have finally a working example:
package main

import (
	"flag"
	"io"
	"log"
	"net/http"
	"os"
	"time"

	"github.com/gin-gonic/gin"
	"gopkg.in/gin-contrib/cors.v1"

	"api_gateway_admin/middleware"

	"github.com/devopsfaith/krakend/config"
	"github.com/devopsfaith/krakend/logging"
	"github.com/devopsfaith/krakend/proxy"
	krakendgin "github.com/devopsfaith/krakend/router/gin"
)

func main() {
	port := flag.Int("p", 0, "Port of the service")
	logLevel := flag.String("l", "ERROR", "Logging level")
	debug := flag.Bool("d", false, "Enable the debug")
	configFile := flag.String("c", "{{path to file}}/configuration.json", "Path to the configuration filename")
	flag.Parse()

	parser := config.NewParser()
	serviceConfig, err := parser.Parse(*configFile)
	if err != nil {
		log.Fatal("ERROR:", err.Error())
	}

	// render that does not change response
	noTransformRender := func(c *gin.Context, response *proxy.Response) {
		if response == nil {
			c.Status(http.StatusInternalServerError)
			return
		}
		c.Status(response.Metadata.StatusCode)
		for k, v := range response.Metadata.Headers {
			c.Header(k, v[0])
		}
		io.Copy(c.Writer, response.Io)
	}

	// register the render at the router level
	krakendgin.RegisterRender("NoTransformRender", noTransformRender)

	// assign NoTransformRender to all endpoints loaded from config file
	for _, v := range serviceConfig.Endpoints {
		v.OutputEncoding = "NoTransformRender"
	}

	serviceConfig.Debug = serviceConfig.Debug || *debug
	if *port != 0 {
		serviceConfig.Port = *port
	}

	logger, err := logging.NewLogger(*logLevel, os.Stdout, "[KRAKEND]")
	if err != nil {
		log.Println("ERROR:", err.Error())
		return
	}

	backendFactory := func(backendCfg *config.Backend) proxy.Proxy {

		// status handler that does change status
		ns := proxy.NoOpHTTPStatusHandler

		// the default request executor
		re := proxy.DefaultHTTPRequestExecutor(proxy.NewHTTPClient)

		// response parser that copies Backend response body to proxy Response IO reader
		rp := proxy.NoOpHTTPResponseParser

		// build and return the new backend proxy
		return proxy.NewHTTPProxyDetailed(backendCfg, re, ns, rp)
	}

	// build the pipes on top of the custom backend factory
	proxyFactory := proxy.NewDefaultFactory(backendFactory, logger)

	engine := gin.Default()

	routerConfig := krakendgin.Config{
		Engine:         engine,
		ProxyFactory:   proxyFactory,
		Logger:         logger,
		HandlerFactory: krakendgin.EndpointHandler,
		Middlewares: []gin.HandlerFunc{
			cors.New(cors.Config{
				AllowOrigins: []string{"http://localhost:4200", "http://<IP_ADDRESS>:4200", "http://localhost:8089", "http://localhost:8069", "http://localhost:8080", "http://localhost:8099"},
				AllowMethods: []string{"PUT", "PATCH", "POST", "GET", "DELETE", "OPTIONS"},
				AllowHeaders: []string{"Accept",
					"Accept-Encoding",
					"Accept-Language",
					"access-control-allow-origin",
					"Access-Control-Request-Headers",
					"Access-Control-Request-Method",
					"authorization",
					"Cache-Control",
					"Connection",
					"Content-Type",
					"Host",
					"If-Modified-Since",
					"Keep-Alive",
					"Key",
					"Origin",
					"Pragma",
					"User-Agent",
					"X-Custom-Header"},
				ExposeHeaders:    []string{"Content-Length", "Content-Type"},
				AllowCredentials: true,
				MaxAge:           48 * time.Hour,
			}),
			middleware.JwtCheck(),
		},
	}

	routerFactory := krakendgin.NewFactory(routerConfig)

	routerFactory.New().Run(serviceConfig)
}

Thank you very much for your quick feedback.
Congrats for your great project.
Thanks!

@ricmoreira that's amazing!
remember you can avoid some of that code by just defining the extra_config for the CORS module like in this example: https://github.com/devopsfaith/krakend-cors#configuration-example
also, you can add "output_encoding": "NoTransformRender" to each endpoint definition in the same config file, so you'll have more control.
enjoy playing with the KrakenD!!!

Thank you very much!
Much better now.
I'll leave here my main and my config file for whoever needs an example.
main.go
package main

import (
	"flag"
	"io"
	"log"
	"net/http"
	"os"

	"github.com/gin-gonic/gin"

	"api_gateway_admin/middleware"

	"github.com/devopsfaith/krakend/config"
	"github.com/devopsfaith/krakend/logging"
	"github.com/devopsfaith/krakend/proxy"
	krakendgin "github.com/devopsfaith/krakend/router/gin"
)

func main() {
	port := flag.Int("p", 0, "Port of the service")
	logLevel := flag.String("l", "ERROR", "Logging level")
	debug := flag.Bool("d", false, "Enable the debug")
	configFile := flag.String("c", "{{path to file}}/configuration.json", "Path to the configuration filename")
	flag.Parse()

	parser := config.NewParser()
	serviceConfig, err := parser.Parse(*configFile)
	if err != nil {
		log.Fatal("ERROR:", err.Error())
	}

	// render that does not change response
	noTransformRender := func(c *gin.Context, response *proxy.Response) {
		if response == nil {
			c.Status(http.StatusInternalServerError)
			return
		}
		c.Status(response.Metadata.StatusCode)
		for k, v := range response.Metadata.Headers {
			c.Header(k, v[0])
		}
		io.Copy(c.Writer, response.Io)
	}

	// register the render at the router level
	krakendgin.RegisterRender("NoTransformRender", noTransformRender)

	serviceConfig.Debug = serviceConfig.Debug || *debug
	if *port != 0 {
		serviceConfig.Port = *port
	}

	logger, err := logging.NewLogger(*logLevel, os.Stdout, "[KRAKEND]")
	if err != nil {
		log.Println("ERROR:", err.Error())
		return
	}

	backendFactory := func(backendCfg *config.Backend) proxy.Proxy {

		// status handler that does change status
		ns := proxy.NoOpHTTPStatusHandler

		// the default request executor
		re := proxy.DefaultHTTPRequestExecutor(proxy.NewHTTPClient)

		// response parser that copies Backend response body to proxy Response IO reader
		rp := proxy.NoOpHTTPResponseParser

		// build and return the new backend proxy
		return proxy.NewHTTPProxyDetailed(backendCfg, re, ns, rp)
	}

	// build the pipes on top of the custom backend factory
	proxyFactory := proxy.NewDefaultFactory(backendFactory, logger)

	engine := gin.Default()

	routerConfig := krakendgin.Config{
		Engine:         engine,
		ProxyFactory:   proxyFactory,
		Logger:         logger,
		HandlerFactory: krakendgin.EndpointHandler,
		Middlewares: []gin.HandlerFunc{
			middleware.JwtCheck(),
		},
	}

	routerFactory := krakendgin.NewFactory(routerConfig)

	routerFactory.New().Run(serviceConfig)
}

configuration.json
{
  "version": 2,
  "name": "ecommerce-service",
  "port": 8080,
  "cache_ttl": "1s",
  "timeout": "10s",
  "host": [
    "http://localhost"
  ],
  "extra_config": {
    "github_com/devopsfaith/krakend-cors": {
      "allow_origins": [ "http://localhost:4200", "http://<IP_ADDRESS>:4200", "http://localhost:8089", "http://localhost:8069", "http://localhost:8080", "http://localhost:8099" ],
      "allow_methods": [ "PUT", "PATCH", "POST", "GET", "DELETE", "OPTIONS"],
      "allow_heathers": [ "Accept-Encoding",
        "Accept-Language",
        "access-control-allow-origin",
        "Access-Control-Request-Headers",
        "Access-Control-Request-Method",
        "authorization",
        "Cache-Control",
        "Connection",
        "Content-Type",
        "Host",
        "If-Modified-Since",
        "Keep-Alive",
        "Key",
        "Origin",
        "Pragma",
        "User-Agent",
        "X-Custom-Header"],
      "max_age": "48h",
      "allow_credentials": true,
      "expose_headers": ["Content-Length", "Content-Type"]
    }
  },
  "endpoints": [
    {
      "endpoint": "/api/v1/product",
      "timeout": "800ms",
      "method": "POST",
      "backend": [
        {
          "url_pattern": "/api/v1/product",
          "host": [
            "http://localhost:8069"
          ]
        }
      ],
      "output_encoding": "NoTransformRender"
    },
    {
      "endpoint": "/api/v1/product",
      "timeout": "800ms",
      "method": "GET",
      "querystring_params": [
        "page",
        "per_page"
      ],
      "backend": [
        {
          "url_pattern": "/api/v1/product",
          "host": [
            "http://localhost:8069"
          ]
        }
      ],
      "output_encoding": "NoTransformRender"
    },
    {
      "endpoint": "/api/v1/saft/upload",
      "timeout": "800ms",
      "method": "POST",
      "headers_to_pass": [
        "content-type",
        "Content-Type"
      ],
      "backend": [
        {
          "url_pattern": "/api/v1/saft/upload",
          "host": [
            "http://localhost:8099"
          ]
        }
      ],
      "output_encoding": "NoTransformRender"
    }
  ]
}

Hello,
I'm trying to modify default krakend-ce backendFactory to make it works with NoOpHTTPStatusHandler. Original backendFactory code is (backend_factory.go):
// NewBackendFactory creates a BackendFactory by stacking all the available middlewares:
// - oauth2 client credentials
// - martian
// - rate-limit
// - circuit breaker
// - metrics collector
// - opencensus collector
func NewBackendFactory(logger logging.Logger, metricCollector *metrics.Metrics) proxy.BackendFactory {
	requestExecutorFactory := func(cfg *config.Backend) client.HTTPRequestExecutor {
		var clientFactory client.HTTPClientFactory
		if _, ok := cfg.ExtraConfig[oauth2client.Namespace]; ok {
			clientFactory = oauth2client.NewHTTPClient(cfg)
		} else {
			clientFactory = httpcache.NewHTTPClient(cfg)
		}
		return opencensus.HTTPRequestExecutor(clientFactory)
	}
	backendFactory := martian.NewConfiguredBackendFactory(logger, requestExecutorFactory)
	backendFactory = juju.BackendFactory(backendFactory)
	backendFactory = cb.BackendFactory(backendFactory)
	backendFactory = metricCollector.BackendFactory("backend", backendFactory)
	backendFactory = opencensus.BackendFactory(backendFactory)
	return backendFactory
}

Is it possible to use NoOpHTTPStatusHandler together with all middlewares metioned in the NewBackendFactory function?
I'm a little confused about how krakend deals with middlewares listed in the krakend.json vs. middlewares "hardcoded" in the NewBackendFactory function. It is possible to use some middleware configured in the krakend.json even if it's not explicitly mentioned in the code of the NewBackendFactory function?
Thank you.

hi @dominiksimek

Is it possible to use NoOpHTTPStatusHandler together with all middlewares metioned in the NewBackendFactory function?

yes, it is. You can do it without touching the code by adding "output_encoding": "no-op" at the endpoint config and "encoding": "no-op" at the backend

I'm a little confused about how krakend deals with middlewares listed in the krakend.json vs. middlewares "hardcoded" in the NewBackendFactory function. It is possible to use some middleware configured in the krakend.json even if it's not explicitly mentioned in the code of the NewBackendFactory function?

The system loads all the factories required to support/enable the modules/middlewares included. Each factory looks for its configuration at some part of the config file. If it is not configured, the module/middleware is not added to the final pipe. That's why the config of a not included component is ignored.
cheers

Great, it works well.
However, I have an issue with endpoint used to sign JWT (github.com/devopsfaith/krakend-jose/signer). Signed token is not returned from Krakend when using Backend "encoding": "no-op" (it returns only empty JSON).
On the other hand, response from Krakend contains valid json with signed token when using Backend "encoding": "json". But StatusCode from Krakend response can be only 200 or 400. In the case of unsuccessful user authentication (e.g. wrong password), my backend sends 401 with additional JSON in the response body. Is it possible to proxy such response from backend through Krakend?
Thank you

@dominiksimek  in order to avoid polluting this issue, I'd suggest you to move the discussion to the slack

Hello.
I am using the example of ricomeira to return the original status and response of a request, which works well, but when doing a merge of three requests, it does not show any results

main.go
package main

import (
	"flag"
	"io"
	"log"
	"net/http"
	"os"

	limit "github.com/aviddiviner/gin-limit"
	"github.com/gin-gonic/gin"

	"github.com/devopsfaith/krakend/config"
	"github.com/devopsfaith/krakend/logging"
	"github.com/devopsfaith/krakend/proxy"
	"github.com/devopsfaith/krakend/router"
	krakendgin "github.com/devopsfaith/krakend/router/gin"
	"github.com/devopsfaith/krakend/transport/http/client"
)

func main() {
	port := flag.Int("p", 0, "Port of the service")
	logLevel := flag.String("l", "ERROR", "Logging level")
	debug := flag.Bool("d", false, "Enable the debug")
	configFile := flag.String("c", "./krakend.json", "Path to the configuration filename")
	flag.Parse()

	parser := config.NewParser()
	serviceConfig, err := parser.Parse(*configFile)
	if err != nil {
		log.Fatal("ERROR:", err.Error())
	}

	// render that does not change response
	noTransformRender := func(c *gin.Context, response *proxy.Response) {
		if response == nil {
			c.Status(http.StatusInternalServerError)
			return
		}
		c.Status(response.Metadata.StatusCode)
		for k, v := range response.Metadata.Headers {
			c.Header(k, v[0])
		}
		io.Copy(c.Writer, response.Io)
	}

	// register the render at the router level
	krakendgin.RegisterRender("NoTransformRender", noTransformRender)

	serviceConfig.Debug = serviceConfig.Debug || *debug
	if *port != 0 {
		serviceConfig.Port = *port
	}

	logger, err := logging.NewLogger(*logLevel, os.Stdout, "[KRAKEND]")
	if err != nil {
		log.Fatal("ERROR:", err.Error())
	}

	backendFactory := func(backendCfg *config.Backend) proxy.Proxy {

		// status handler that does change status
		ns := client.NoOpHTTPStatusHandler

		// the default request executor
		re := client.DefaultHTTPRequestExecutor(client.NewHTTPClient)

		// response parser that copies Backend response body to proxy Response IO reader
		rp := proxy.NoOpHTTPResponseParser

		// build and return the new backend proxy
		return proxy.NewHTTPProxyDetailed(backendCfg, re, ns, rp)
	}

	// build the pipes on top of the custom backend factory
	proxyFactory := proxy.NewDefaultFactory(backendFactory, logger)

	// store := cache.NewInMemoryStore(time.Minute)

	mws := []gin.HandlerFunc{
		limit.MaxAllowed(20),
	}

	// routerFactory := krakendgin.DefaultFactory(proxy.DefaultFactory(logger), logger)

	routerFactory := krakendgin.NewFactory(krakendgin.Config{
		Engine:         gin.Default(),
		ProxyFactory:   proxyFactory,
		Middlewares:    mws,
		Logger:         logger,
		HandlerFactory: krakendgin.EndpointHandler,
		RunServer:      router.RunServer,
	})

	routerFactory.New().Run(serviceConfig)
}

krakend.json
{
    "version": 2,
    "name": "kraken_test",
    "port": 8000,
    "cache_ttl": "3600s",
    "timeout": "3000ms",
    "extra_config": {
        "github_com/devopsfaith/krakend-gologging": {
            "level": "DEBUG",
            "prefix": "[KRAKEND]",
            "syslog": false,
            "stdout": true
        },
        "github_com/devopsfaith/krakend-metrics": {
            "collection_time": "60s",
            "proxy_disabled": false,
            "router_disabled": false,
            "backend_disabled": false,
            "endpoint_disabled": false,
            "listen_address": ":8090"
        },
        "github_com/devopsfaith/krakend-cors": {
            "allow_origins": [
                "http://<IP_ADDRESS>:3000",
                "http://localhost:8080"
            ],
            "allow_methods": [
                "POST",
                "GET"
            ],
            "allow_headers": [
                "Origin",
                "Authorization",
                "Content-Type"
            ],
            "expose_headers": [
                "Content-Length"
            ],
            "max_age": "12h"
        }
    },
    "endpoints": [
        {
            "endpoint": "/abc",
            "method": "GET",
            "headers_to_pass": [
                "Authorization",
                "Content-Type"
            ],
            "backend": [
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/a",
                    "encoding": "json"
                },
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/b",
                    "encoding": "json"
                },
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/c",
                    "encoding": "json"
                }
            ]
        },
        {
            "endpoint": "/200",
            "method": "GET",
            "headers_to_pass": [
                "Authorization",
                "Content-Type"
            ],
            "backend": [
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/200",
                    "encoding": "json",
                    "extra_config": {
                        "github.com/devopsfaith/krakend-ratelimit/juju/proxy": {
                            "maxRate": 1,
                            "capacity": 1
                        },
                        "github.com/devopsfaith/krakend-circuitbreaker/gobreaker": {
                            "interval": 60,
                            "timeout": 10,
                            "maxErrors": 1
                        }
                    }
                }
            ],
            "output_encoding": "NoTransformRender"
        },
        {
            "endpoint": "/201",
            "method": "GET",
            "headers_to_pass": [
                "Authorization",
                "Content-Type"
            ],
            "backend": [
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/201",
                    "encoding": "json",
                    "extra_config": {
                        "github.com/devopsfaith/krakend-ratelimit/juju/proxy": {
                            "maxRate": 1,
                            "capacity": 1
                        },
                        "github.com/devopsfaith/krakend-circuitbreaker/gobreaker": {
                            "interval": 60,
                            "timeout": 10,
                            "maxErrors": 1
                        }
                    }
                }
            ],
            "output_encoding": "NoTransformRender"
        },
        {
            "endpoint": "/400",
            "method": "GET",
            "headers_to_pass": [
                "Authorization",
                "Content-Type"
            ],
            "backend": [
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/400",
                    "encoding": "json",
                    "extra_config": {
                        "github.com/devopsfaith/krakend-ratelimit/juju/proxy": {
                            "maxRate": 1,
                            "capacity": 1
                        },
                        "github.com/devopsfaith/krakend-circuitbreaker/gobreaker": {
                            "interval": 60,
                            "timeout": 10,
                            "maxErrors": 1
                        }
                    }
                }
            ],
            "output_encoding": "NoTransformRender"
        },
        {
            "endpoint": "/401",
            "method": "GET",
            "headers_to_pass": [
                "Authorization",
                "Content-Type"
            ],
            "backend": [
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/401",
                    "encoding": "json",
                    "extra_config": {
                        "github.com/devopsfaith/krakend-ratelimit/juju/proxy": {
                            "maxRate": 1,
                            "capacity": 1
                        },
                        "github.com/devopsfaith/krakend-circuitbreaker/gobreaker": {
                            "interval": 60,
                            "timeout": 10,
                            "maxErrors": 1
                        }
                    }
                }
            ],
            "output_encoding": "NoTransformRender"
        },
        {
            "endpoint": "/404",
            "method": "GET",
            "headers_to_pass": [
                "Authorization",
                "Content-Type"
            ],
            "backend": [
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/404",
                    "encoding": "json",
                    "extra_config": {
                        "github.com/devopsfaith/krakend-ratelimit/juju/proxy": {
                            "maxRate": 1,
                            "capacity": 1
                        },
                        "github.com/devopsfaith/krakend-circuitbreaker/gobreaker": {
                            "interval": 60,
                            "timeout": 10,
                            "maxErrors": 1
                        }
                    }
                }
            ],
            "output_encoding": "NoTransformRender"
        },
        {
            "endpoint": "/500",
            "method": "GET",
            "headers_to_pass": [
                "Authorization",
                "Content-Type"
            ],
            "backend": [
                {
                    "host": [
                        "http://<IP_ADDRESS>:8080"
                    ],
                    "url_pattern": "/v1/test/500",
                    "encoding": "json",
                    "extra_config": {
                        "github.com/devopsfaith/krakend-ratelimit/juju/proxy": {
                            "maxRate": 1,
                            "capacity": 1
                        },
                        "github.com/devopsfaith/krakend-circuitbreaker/gobreaker": {
                            "interval": 60,
                            "timeout": 10,
                            "maxErrors": 1
                        }
                    }
                }
            ],
            "output_encoding": "NoTransformRender"
        }
    ]
}

This is my test server where I generate the APIs : webnode
Could you please help me?
Thank you.

@nadim500, notice the pipe of that example has two important customizations:

its backend proxy does not decode the response, keeping it as received into the Response.Io.
its response render function does not encode the response data. It just copies Response.Io into the output buffer

These two details are very important because they make the pipe behave like a no-op pipe, so no merging is supported because merging requires the data from the backends to be already decoded and it ignores the Response.Io.


Add formatting check to input

Background
Currently, it is assumed that all TLEs inputted are correctly formatted. This will not always be the case, and should fail gracefully
Procedure

Add formatted checking interface

Acceptance Criteria
Incorrectly formatted TLEs can be identified

Include checksum as well in this issue

Re work 'panic!()' to proper Rust error handling.


change http status codes

According to the rest api best practices change htttp status codes for put and delete requests

Review the PR and anything wrong please let me know


Drop Vk and VK_ prefixes?

I fully understand this can be considered a controversial idea. 😅
In the examples I see the following code used quite often:
import nvk from 'nvk';

Object.assign(global, nvk);

By dropping the Vk and VK_ prefixes the following code might be considered more clean to Javascript (and Typescript) users:
import * as vk from 'nvk';

const buffer = new vk.Buffer();

const bufferInfo = new vk.bufferCreateInfo();
bufferInfo.sType = vk.STRUCTURE_TYPE_BUFFER_CREATE_INFO;

The above code shares the same fashion as WebGL's often used terminology, where everything is housed under a gl namespace:
const buffer = gl.createBuffer(gl.ARRAY_BUFFER)

Not only that, this should also help IDEs (e.g. Visual Studio Code and Atom) with autocomplete and error checking, making the library more accessible to everyone.
--
Thanks for your time bringing Vulkan to the Javascript audience with nvk!

This project's goal is to be as close as possible to Vulkan. Any kind of abstraction can be done in a separate library

This project's goal is to be as close as possible to Vulkan. Any kind of abstraction can be done in a separate library


Minor ui improvement

Set execution time space fixed
Before

After

Fix bug that tooltip makes button group shift
Before

After

Add scrollbar on note list dropdown menu
Before

After

Awesome job! LGTM

I've tested and looks cool. @minahlee Is it ready to be merged?

Ready yo merge


Mark ESC as handled so that it doesn't come back in CharacterHandler

Fixes #1295.
Summary of the Pull Request
There are four places where we could possibly fix this.

mark it handled manually in KeyDownHandler (like Tab)
"handle it manually" in TerminalCore (like Ctrl+Space and friends)
ignore it in CharacterHandler (like Bksp and Del)
"handle it automatically" in TerminalCore by removing it from TerminalInput

i cannot figure out why it's in there -- it's in the keypad numeric and keypad application mappings, but it doesn't actually get remapped?

https://github.com/microsoft/terminal/blob/fad7638bb39d5c5107431605a1adf50010f8646a/src/terminal/input/terminalInput.cpp#L55
https://github.com/microsoft/terminal/blob/fad7638bb39d5c5107431605a1adf50010f8646a/src/terminal/input/terminalInput.cpp#L88
I just chose one. Why not here? We should document what each of those does and why they are they way they are.
PR Checklist

[x] Closes #1295
[x] I work here
[ ] I have not yet added tests, so the box to the left is as empty as can be

Follow up: why do we need to track manuallyHandled at all in TerminalCore's input translator? It was handled if and only if TerminalInput said it was; if we ever second-guess it, we risk double-sending something.
I guess we want to mark "manually handled" things that TerminalInput won't handle? But then we just won't send the character at all. Hmm.

I see. It's because when we have a character-producing key, it comes in as UNICODE_NULL because we synthesized the key event out of thin air oh my word

gfdi github's merge conflict resolver changed the line endings


Download As CSV

We have data in our system that certain users need access to in CSV format. Rather than building a very complicated export system, we thought: what if we taught these few people graphql?! Then they could build very powerful queries for the data that they need.
To make their experience seamless, though, ideally Altair would provide a CSV download option, just like it provides JSON download.
Describe the solution you'd like
We would like a "Download as CSV" button available, next to the current "Download" (as JSON) button. Alternatively, a single button could then give an option to select "CSV" or "JSON". (I suppose XML could also be interesting, but CSV is what we really need.)
There are json-to-csv node packages available.
Describe alternatives you've considered
One option we have is to just tell the users to paste the JSON into https://json-csv.com/. But we figured a download-as-CSV button in Altair would be more user-friendly, and might be an addition that would be useful for others.

Hey @benhutton, thanks for the issue. Indeed this could be a useful feature for other users. I'd consider extending the plugin system to allow adding actions to the server response. That should make it easy to create a plugin for that use case 🙂

@imolorhe that would be awesome!
Is there documentation somewhere on how to write plugins?

Current'y there's no documentation for the plugin system because it's still in beta. The only documentation that exists is in #1089 when I was explaining how to create one.

@imolorhe we love this idea. Any idea when you plan on releasing the plugin system for this use case?

Within the coming month.

I just realized, JSON isn't directly translatable to CSV. CSV format is more for managing a list of items. How would you expect to figure out how to parse a JSON object?

Check out https://json-csv.com/, or https://www.npmjs.com/package/json2csv

I already checked out json2csv and tried it out as well. The result was just data as heading and the whole json object as a single value as a string. Don't think that is what you would be expecting.
Anyway, the plugin capability for this has been released. A plugin can now be developed to add the button.

I believe @isaachvazquez has created a plugin for this, so I'd be closing this issue now.


global: invenio.config deprecation

@jirikuncar told me that it's there only for legacy code and should be deprecated.
But if you execute git grep "invenio.config", you can see that also many "normal" modules use it.
Can we deprecate it and substitute all invenio.config with invenio.base.config?

Can we deprecate it and substitute all invenio.config with invenio.base.config?

We can deprecate it but we should not replace it with invenio.base.config but with invenio.base.globals:cfg or current_app.config. Please note that we should do it only in invenio.modules as invenio.legacy requires UTF-8 values.

Invenio 3 modules are using standard Flask configuration (current_app.config). Additional configuration loading has been moved to Invenio-Config package.


API: Disable len() and indexing of Rotation instances with single rotation

Reference issue
Closes #12162
What does this implement/fix?
This weird bug in #12162 happens because we don't properly differentiate between single (scalar) and multiple rotations. If we have a single rotation we shouldn't be able to compute len of it or index it.
Adding __array__ method which raises an exception didn't work, this is another reasons why I decided to do it this way.
Overall it looks like more solid and reasonable design from an abstract point of view. It seems to interact correctly with numpy now. It sure created some other inconveniences in the existing code, but I believe it is the correct way to handle this situation.
@pmla @rgommers what do you think?

This change could break some user code - there is probably code out there which is calling len on a Rotation object. How should we deal with that?
If a function takes a Rotation object as input, what is the correct way to determine how many rotations it contains?
def count(rot);
    try:
        len(rot)
        single = True
    except:
        single = False
    return single

or
def count(rot):
    return rot.as_quat().ndim == 1

Neither of these is elegant. Should we expose Rotation._single as a public attribute instead?

This change could break some user code - there is probably code out there which is calling len on a Rotation object. How should we deal with that?

Yes, nothing good about that. I think we should declare that a backward incompatible change has been made for the release. And the users will have to adapt to that.

Neither of these is elegant. Should we expose Rotation._single as a public attribute instead?

Both are bad. I think we should indeed expose single as a public field or property. We can compare it to ndim of numpy arrays. Considering dynamic nature of Python, there is nothing wrong with such attributes.

This change doesn't seem necessary by the first glance, however without it we inevitably have an infinitely nested structure, which can be indexed as r[0][0][0].... This is strange by itself, and I couldn't find any workaround for numpy even utilizing __array__.
I suggest that we make this change anyway, even though it's not very practical. Having adequately behaving types is important.

@rgommers you have better understanding of the library maintenance. It isn't that terrible to make such change, is it?

@tylerjereddy could you check this PR please?

Thanks @nmayorov @pmla

This produces merge conflicts when I try to backport to 1.5.x maintenance branch, so tentatively removing the backport label. Feel free to clarify the route/connected changes to backporting cleanly if needed.


(HTTPS) angular-translate.github.io/docs/#/guide fails to load

Copy of https://github.com/angular-translate/angular-translate.github.io/issues/7

The guide on angular-translate website doesn't render, because the scripts messageformat.js/locale/de.js and messageformat.js/locale/fr.js are 404's. They have recently been removed from the messageformat.js repository.

Fixed in next


[Feature Request] - Minting Notifications

I would like to request that the bot could be enhanced to also include mints of new NFTs rather than just the sales from marketplaces.
eg: This is the minting site for OiKattes NFT Project (https://oikattes.com)
We are utalizing the NFT sales bot for our secondary NFT sales, however we fail to be able to get notifications for primary mints via our dApp: https://oikattoi.art/
The request is to support Minting as well from non central marketplaces

Interesting. Do you have examples of those minting transactions?

Authority wallet minting a token:
https://solscan.io/tx/5dJMoX7qWiUNQ8ZRd9kDrmKjJTeh2NCZxNieSvEsb3MyVP5x7d3PjZLfTUG5wTXD9Z4Vjn7CCrUssaVVmWHNFm5w
Other wallet minting a token:
https://solscan.io/tx/3keK5tqBABhrWnN28rnpFFyvUqiL1c32TFeDRRvGbR8LMgW84AXuG7nyJp3iqxzzSM3dcB7nWKaFmSKCtiS8YrVd

@kryptoj Is this enough info, or shall I provide anything more?

Thanks for the info. Sorry, I forgot to follow up here. I like the feature, and the new candy machine v2 makes it a bit easier.
I will look into it when I have some extra time.

Let me know if I can help implementation on this.


ERROR: Could not create directory

I havd changed the default home folder on my mbp(M3 Chip),when I try to install requirments, it shows:ERROR: Could not create directory.
didn't know how to fix it !
Pls help!
thx alot!

I also had to mount some hardrives on Ubuntu 23.10, by effect the home path changed. Now I'm not able to just change it or move to another folder without having to install everything all over again, dependencies are always missing even when moving the entire folder.
I still don't get it and I think there should be more documentation about cloning Pinokio installations ou moving them with lesser effort.
I thought Pinokio was some kind of containerized / portable for easily migration and duplication, not apparently it's not that easy.

I also had to mount some hardrives on Ubuntu 23.10, by effect the home path changed. Now I'm not able to just change it or move to another folder without having to install everything all over again, dependencies are always missing even when moving the entire folder.
I still don't get it and I think there should be more documentation about cloning Pinokio installations ou moving them with lesser effort.
I thought Pinokio was some kind of containerized / portable for easily migration and duplication, not apparently it's not that easy.

I tried moving home folder before installing anything, but the problem r still there.
if u find anyway to fix ur problem, pls leave ur feed back here too! I think macos might very similar with ubuntu system,maybe


Websites to download face image files

Is there an address where I can download face image files other than https://www.kaggle.com/datasets/shawon10/ckplus address for facial expression registration work? Are there any addresses available for download from Kaggle?

Here are additional datasets available on Kaggle for facial expression recognition, apart from the one you mentioned:

FER2013 Dataset

Description: This dataset includes seven emotions (happy, sad, surprise, anger, fear, disgust, neutral) and consists of 35,887 training images and 3,589 test images.
Link: FER2013 Dataset

RAF-DB (Real-world Affective Faces Database)

Description: This dataset contains facial images collected from the real world, including various emotions. It includes around 30,000 images.
Link: RAF-DB Dataset

AffectNet

Description: This dataset contains around 1,000,000 images collected from the internet, including eight basic emotions and neutral expressions.
Link: AffectNet Dataset

JAFFE (Japanese Female Facial Expression) Dataset

Description: This dataset includes facial expression images of Japanese females, containing seven emotions (happy, sad, surprise, anger, fear, disgust, neutral).
Link: JAFFE Dataset

FERG-DB (Facial Expression Research Group Database)

Description: This dataset includes facial expression images of six different characters, containing seven emotions (happy, sad, surprise, anger, fear, disgust, neutral).
Link: FERG-DB Dataset

These datasets can be very useful for facial expression recognition research and development.


Color picker does not work on mobile

The color picker that was imported does not work on safari mobile.
A fallback mode of canvas selection only may be needed if this cannot be fixed.

#165


Console.log is shown when using slider

Describe the bug
Console.log is shown when using slider
To Reproduce

Go to 'node_modules > hooper > dist'
Click on 'hooper_esm.js'
Scroll down to 'updateSlidesStatus(index)'
See 'console.log(lower, upper);'

Expected behavior
I hope to remove this code
Screenshots

Macbook Pro 15-inch:

OS: Mojave 10.14.3
Browser chrome
Version

Hey, remove 'console.log line 450' in 'hooper.em.js' file in 'hooper/dist' folder

This has been removed in 2fb9526

fixed in new release: https://github.com/baianat/hooper/releases/tag/v0.0.8

thx :)
나의 iPhone에서 보냄

20:27, Damien<EMAIL_ADDRESS>작성:

Hey, remove 'console.log line 450' in 'hooper.em.js' file in 'hooper/dist' folder
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.


Consider extrapolating the ringbuffer from the event bus and let it run in parallel with the rpc/event buses

There is little to gain from extrapolating the ringbuffer from the publisher as opposed to make the StreamListener calling Put in a goroutine.
Closing as the latter is carried out in #644


add email validation - regex

Added email validation using regex.
While this could be accomplished with apache commons, two things:

means adding a dependency
it uses valid TLD domains that could potentially change and will make the plugin obsolete there

Coverage increased (+0.8%) to 92.593% when pulling 23a486961a554d8a995781a549f6ddf7883eaf49 on rpalcolea:email-validation into 674dc1c3d007a3a0a44b1a84243a53d24feed1ae on nebula-plugins:master.

Hi @sghill ,
Sorry for the delay.
Added the tests for happy path and also expanded a bit on scenarios for both valid and invalid emails.

Thanks @rpalcolea!


fix: added required parameters in Email notifications channel

Description of changes
FromAddress and Identity are required parameters in UpdateEmailChannel() sdk call which were missing in current Implementation

Issue #7464

Description of how you validated changes

Tested manually

Checklist

[x] PR description included
[x] yarn test passes
[ ] Tests are changed or added
[ ] Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Codecov Report

Merging #7552 (486f46c) into master (312eec3) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #7552      +/-   ##
==========================================
- Coverage   52.76%   52.76%   -0.01%
==========================================
  Files         523      523
  Lines       26157    26158       +1
  Branches     5119     5119
==========================================
  Hits        13802    13802
- Misses      11385    11386       +1
  Partials      970      970

Impacted Files
Coverage Δ

...mplify-category-notifications/lib/channel-Email.js
0.00% <0.00%> (ø)

Continue to review full report at Codecov.

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


[hi] Localize term virtual-machine into Hindi

localization of virtual-machine.md into Hindi

https://glossary.cncf.io/virtual-machine/

@anubha-v-ardhan I would like to work on this. Please assign me.
Thank-you:)


New Payload: prduct_message

New Payload
product_message payload should be added.
See more info

Will be added by April 10th.


Investigte/Fix OOM Crashing of warden operator

Description
It looks like current implementation of warden operator crashes with OOM in case of high amount of workloads marked with verification failed
AC

[ ] in case there are multiple workloads labelled with verification=failed, the warden operator should not crash

Problem:
The Warden operator takes up a lot of memory on one of the clusters. This causes it to occasionally exceed the available memory limit and be restarted after an OOM error.
Suspicion:
There is a memory leak in the component or the component allocates too much memory.
Analysis:
Many tests have shown that the component's memory usage appears to be stable. It fluctuates during the component's life but does not exceed a certain level. This means that we are probably not dealing with a memory leak.
Warden's memory consumption depends on the size of Kubernetes resources (mainly pods) on the cluster. The component monitors (using the cache mechanism) the status of pods from all namespaces and therefore keeps a copy of data from all pods in the cluster (not only from protected namespaces) in the cache.
The result of image verification (e.g. verification=failed) has no impact on memory usage and component restarts.
Hypothetical possibilities and applied (or not) solutions to the problem:

Increasing the limit of available memory.
We have almost doubled this limit to 300MiB.
Disabling the cache of resources downloaded from Kubernetes.
We have two controllers in the Warden operator component - for namespaces and pods. We do not have the option to disable this cache only for the namespace controller because it is necessary for the operation of the pod operator. Something to consider is a possible change to the Warden architecture so that the operator does not have a pod operator.
We are not considering such a change at the moment.
Paging download of pod list in namespace controller.
Paging could reduce the temporary memory usage when loading the entire list of pods from protected namespaces. However, paging does not make sense when we use a cache, because all the data in the cache is already stored.
This change doesn't make sense, so we don't do it.

Possible minor improvements:

Removed unnecessary copying of pod data objects in the namespace controller.
Label the operator so that Istio sidecar is not added to it.


3438 (docs details), 3472 (minor version)

Fixes #3438
refer to pipeWith from andThen docs with egs

with examples to show the usage, two examples, one shows that a fn can easily be added to pipe, using  and the second shows the  being used independently, in both cases, the successful Promise resultis handled

improve pipeWith example

the example hadn't thought through, the edit should make it more sensible

Fixes #3472
actually did the upgrade, my master was only one minor version off
Wouldn't normally mix two

@kedashoe no problem,
Let me introduce myself, I've been using this library for some time, with a lot of success and really like it, it's in my high-bar tool-kit, it's used here on my demo site and you can find the Github for that here - I will read the comments carefully and sort the problems out.
I would like to contribute to the library regularly as well as learning how it works so I will take care to understand the comments. I will have questions and need some guidance too but in return, hopefully, I'll solve lots of problems.
I'll take a look at "good first issues" next.

@kedashoe I made the changes and understood more as a result, I hope,
Also, garden is the best term, I got rid of boy at one employer from the term boy-scouting as well, some of us weren't boys, but scouting still has that military feel about it which is all a bit meh. We were deployed in "squads" there lol.
garden ~just blows it out~ ...... is a great improvement.


Previous locations remain in the location filter when changing the account

Bug description
When switching to another account, the location filter displays locations from both the previous and current accounts
How to reproduce the bug

Navigate to a dashboard with account and location filters.
Select an account and choose a few locations.
Switch to a different account using the account filter.
The previous locations remain in the location filter

Screenshots/recordings
https://github.com/apache/superset/assets/173764651/25c4b986-dff1-439b-bdfe-e28dd8f0dfe8
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist

[X] I have searched Superset docs and Slack and didn't find a solution to my problem.
[X] I have searched the GitHub issue tracker and didn't find a similar bug report.
[X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

@dosu We are not maintaining the codebase. We are using the 3.1.1 Docker image

Something went wrong with the video upload, so I can't see it... but perhaps this'll help:
I'm assuming you have an account column and a location column, and have a top level filter for each.
If certain accounts have certain locations associated, you might want to use a "dependent filter" as seen here:

By design, changing one filter should not nuke another filter. That would be infuriating.

we had already given the 'Account' filter in the 'Values Dependent On' Field , for 'Location' Filter. Even after that, I am getting this issue.
If I select an Account and select all locations under that account , and after that if I change it to some other account, the location field will sustain all the previously populated records (Even though the data is not filtered).This is so confusing.

Oh, I think I follow. So when you select Account, it is showing you the correct Location values in the Select dropdown, right?
And then you select one or more Locations, and it works, right?
But then when you switch Accounts, you want it to clear the Location values, and it's not removing the selected values?


Special characters in path parameters not handled correctly

Hi,
Firstly - thanks for creating pyswagger!
I'm having issues using URL special characters (e.g. ?, / etc.) in path parameters with pyswagger.
Do you agree pyswagger should be URL quoting these parameters with e.g. this function before making requests?
As an example, if I try out the swagger UI here and try the GET /user/{username} operation with username asd?asd, the request made is: GET http://petstore.swagger.io/v2/user/asd%3Fasd.
Now try the same thing with pyswagger, e.g.:
from pyswagger import App, Security
from pyswagger.contrib.client.requests import Client
app = App.create("http://petstore.swagger.io/v2/swagger.json")
client = Client(Security(app))
client.request(app.s('/user/{username}').get(username='asd?asd'))

and pyswagger does exactly GET /v2/user/asd?asd which is really a GET for username asd with a query parameter.
Looking at the code, I think pyswagger should be doing some quoting of path parameters around here.
pyswagger does handle query parameters correctly (I think requests is actually encoding them because they are passed to it separately, but requests can't encode the path as it's provided as one string so relies on pyswagger encoding the right parts):
...
client.request(app.s('/user/login').get(username='asd?asd', password='asd/asd'))

Results in GET /v2/user/login?username=asd%3Fasd&password=asd%2Fasd the same as if you use the swagger UI for /user/login with the same parameters.

Thanks for the investigation, it's very clear. I think it's bug since every control characters in url should be escaped. The fix would be included in next release.

I saw that you made a fix here and release V0.8.28 - I took that version and the fix seems to work great.
Thanks for fixing and the quick turnaround!

I should update a comment in issue board directly.


new adquery adapter

Just noticed that you are indicating in the front matter that you are not in PBJS 5.x but your code is merged into PBJS 5.x, do you want to update that so you appear on the download page?

I updated


Dynamic PMs for list changes

Currently our PMs for list changes can contain only a single element. If several elements are added or replaced, we send one message per element. I believe, if we create just one PM with all affected elements at once, this can become much faster.

See https://github.com/canoo/dolphin-platform/issues/103


Inference using a DataArray

It might be nice to infer data using an array. Slicing the array into a vector in the model able to read it out
By which I mean that one would be able to use an array given the following:

@albertpod @wouterwln @Dhuige We may consider this improvement in the next iteration of the GraphPPL.jl, should be doable imo

ping @wouterwln

I think this is possible in RxInfer 3.0 onward, right?

I'm not entirely sure, better to add a test for it


Bazel: allow cc deps in go rules [phab:D337]

Created by schroederc at 2015-06-12 16:55:12:

schroederc wrote at 2015-06-12 17:02:34:
Remove libleveldb from deps

zarko wrote at 2015-06-12 17:03:41:
On both OS X and Linux, I see:
$ bazel build //...
ERROR: /Users/zarko/kythe/third_party/go/BUILD:45:15: in cc_deps attribute of go_library rule //third_party/go:levigo: '//third_party/leveldb:leveldb' does not have mandatory provider 'cc'.
ERROR: Analysis of target '//kythe/go/serving/search:search_test' failed; build aborted.

schroederc wrote at 2015-06-12 17:04:48:

! In (earlier comment), zarko wrote:
On both OS X and Linux, I see:

$ bazel build //...
ERROR: /Users/zarko/kythe/third_party/go/BUILD:45:15: in cc_deps attribute of go_library rule //third_party/go:levigo: '//third_party/leveldb:leveldb' does not have mandatory provider 'cc'.
ERROR: Analysis of target '//kythe/go/serving/search:search_test' failed; build aborted.

You likely need to update Bazel.

schroederc wrote at 2015-06-15 17:25:04:
Use absolute paths in include flags

zarko wrote at 2015-06-15 17:32:50:
Checked this on OS X too.

zarko accepted this revision at 2015-06-15 17:32:50

schroederc closed via commit 8be260e05f98710559d400a9bbdc07fde2d9cd61 at 2015-06-15 17:37:07


Port swift-lldb to Windows

This requires some CMake stuff, some upstream cherry-picking, and some modification of swift-specific source code.
Note: the changes in "Fix invalid namespace qualified UTF conversion helpers on Windows" changes lldb code. However: other actual lldb code was changed from llvm::UTF8 to UTF8 in swift-clang, swift-llvm and swift-lldb. This just manifests itself now, because we never built these files on non-Windows platforms.
/cc @compnerd @jrose-apple

I'm fairly sure I've found a bug in ExpressionSourceCode.cpp on non-Windows platforms.
Take a look at this code: https://github.com/hughbe/swift-lldb/blob/10d41feb230bf7c1c0137aef071aaddff0d9df8a/source/Expression/ExpressionSourceCode.cpp#L232-L251
Notice that we append .cpp or .swift to the end of the file template. However, this goes against the documentation for mkstemp

The last six characters of template must be "XXXXXX" and these are
replaced with a string that makes the filename unique.

However, surely if we append .cpp or .swift to the file path passed to mkstemp, then the last six characters won't be XXXXXX. Not sure what's going on here.

We need LLDB reviewers in here more than us. Calling @scallanan and @clayborg.

No harm in testing.
@swift-ci Please test

@swift-ci Please test

It looks like the expression parser changes are just cleanup that removes unused state.  I love it (assuming the tests succeed)!

I had to rebase to fix a merge conflict, but I recall the tests passing before. Probably a good idea to retest :D

Friendly ping!

@swift-ci please test

I get the feeling this is targeting the wrong branch... Which branch should I submit this PR to?

I believe you should just target the master branch.

Thanks! I know that trying to change the branch of this PR will end up notifying and sending emails to several hundred people as GitHub attempts to push their commits from the old branch to the new branch - see https://github.com/apple/swift-clang/pull/44
So unfortunately, I'll have to close this PR and create a new one: #125
Sorry for losing the discussion history


explanatory doc-a2c

Included example code to run the algo and showed hyperparameters which could be customised.
Issue #196

There are some parameters which are named incorrectly in the doc string of some of the functions, lr_a, lr_actor and lr_policy are three different names used for the same variable for example in the a2c agent : a2c class doc string.
Also there are some unused variables like steps_per_epoch in the OnPolicyTrainer class (rollout_size does the same thing in the on policy case)

You don't have to mention the redundant ones. We're using lr_policy and lr_value for uniformity. If you see any other instance, feel free to replace them.

@Darshan-ko are you done here? It looks good.

@Darshan-ko are you done here? It looks good.

Yes I'm done.

We can merge this @Sharad24

Great work! @Darshan-ko


Change obj_weight to sigma

Regarding JuliaOptimizers/AmplNLReader.jl#22

@abelsiqueira, I gave you commit access. Feel free to merge when ready.

Thanks Miles. Ended up chaning the other model.


Make README more helpful

Make clear that end users will rarely use this library directly.
Add license information and required Go version to README.
Fixes #38.

Current coverage is 81.65% (diff: 100%)

Merging #39 into master will not change coverage

@@             master        #39   diff @@
==========================================
  Files             4          4
  Lines           218        218
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
  Hits            178        178
  Misses           32         32
  Partials          8          8

Powered by Codecov. Last update 4f7da60...85595bf

I think by package-level he means in gax.go, so it shows up on GoDoc.
// gax is a set of modules which aids the development of APIs...
package gax

Hmm! That would also be helpful.

@saicheems PTAL

Sweet! lgtm
Maybe wait for @jba too

LGTM. Sorry, I somehow missed this when I made the PR for gax.go.


Upgrade containers to build with Rust 1.75.0

Filed #192 to hopefully automate these type of PRs (which I tend to drop) out of existence!


Add drupal9 project type, fixes #2119, fixes #2029

The Problem/Issue/Bug:
Drupal 9 beta 1 is out, it's time for explicit support of D9
How this PR Solves The Problem:
Add drupal9 support and tests
Manual Testing Instructions:
Create a drupal9 site and test its behavior
Automated Testing Overview:
Added a full stanza for d9 testing
Improved TestAppTypeDetection
Related Issue Link(s):
See linked issues.
Release/Deployment notes:

Great, @rfay
I've seen the changes in the commit https://github.com/drud/ddev/commit/1c1a287d8d391bd91189266dcda4c8db59459762
No need to add all the requirements for specific MariaDB version, etc.
Thanks!

I guess I don't understand your comment @alesrebec - Drupal 9 requires MariaDB 10.3, as you know, and the ddev default is 10.2. That's why if you use project type drupal9 it sets the default mariadb version to 10.3

Sorry for the ambiguity.
My point was exactly that. No need to specify mariadb version with this included in the commit. ;)


Add phpstan strict rules

In this PR:

[x] Added phpstan strict rules - fixed many bugs! thanks to @TomasVotruba for inspiration and @ondrejmirtes for creating phpstan. It is awesome! :clap:
[x] Added phpstan phpunit extension
[x] Fix travis coveralls commands

After this PR I plan to release 0.6.0 version :rocket:

:+1:

Nice 😊 FYI in some of the next versions I also plan to disallow empty because it does many loosely-typed things. It’s better to use something more specific - like count, or comparing against ’’, or isset, array_key_exists...

Eh, coveralls is doing something wrong. I will try codecov.io

@itcraftsmanpl Do you need help to fix it?
Could you share link?

It looks like it has fixed itself.

:+1:

FYI phpstan/phpstan-phpunit contains strictRules.neon that enforces using more specific assert methods like assertCount or assertInstanceof 😊 It might also find somethin here.

@ondrejmirtes empty - I found today that this caused error in this PR. There is a problem with SplObjectStorage and empty. In some cases count return 0 but empty return false. :disappointed:


support searching Github code, issues or users, not just repositories (which remains the default)

As per the request at https://github.com/Netflix/Scumblr/pull/40#issuecomment-155142446, this modifies the Github search provider to be capable of searching for 'users', 'issues', or 'code', not just 'repositories' (the default).
Note: I think this would look better as a combobox, but it seems Scumblr's hardcoded any Search Provider's options as a text field. Too much work for me to change this right now, so that's why the 'name' of the option is a bit longer than usual (to explain to the user what the valid options are).
Finally (can't think of a better place to say this), Github's 'code' search requires you to also specify a user, organization, or repository within which to do the code search. The Scumblr user will need to understand that the 'Query' has to be something like 'color+repo:jquery/jquery' as opposed to just 'color', in order to actually get any results.
In other words, it depends on some existing knowledge of the Github search API as defined at https://developer.github.com/v3/search/#search-code

Thanks @mig5


wrap unexpected to prevent compile errors with clang 16 & libc++ 16

template deduction is not supported for alias from the cpp standard
the error:
error: alias template 'unexpected' requires template arguments; argument deduction only allowed for class templates
                  return unexpected(error_code::unknown_key);
                         ^

Class template argument deduction for alias templates is part of the C++20 standard P1814R0 but is only implemented in MSVC 19.27, GCC 10, eccp 6.5, nvcc 12.0
and up https://en.cppreference.com/w/cpp/compiler_support.

damn it clang, always a bit behind.

this is supported in clang 19

I refactored this code recently for aliasing std::expected and it works for GCC, just check out the top of Glaze's expected header.


$.widget is not a function in ra.filtering-multiselect.source.js

Today, during development, I think after a bundle update, Chrome's console started to throw this error:
JQMIGRATE: Migrate is installed, version 3.3.3-pre
ra.filtering-multiselect.source.js:13 Uncaught TypeError: $.widget is not a function
    at ra.filtering-multiselect.source.js:13
    at ra.filtering-multiselect.source.js:331
(anonymous) @ ra.filtering-multiselect.source.js:13
(anonymous) @ ra.filtering-multiselect.source.js:331
(index):36 Uncaught ReferenceError: RailsAdmin is not defined
    at (index):36
(anonymous) @ (index):36
(index):258 Uncaught TypeError: $(...).dropdown is not a function
    at (index):258

Obviously all the other, custom, javascript in the page is not working anymore, what can be happened? How can I have the javascript working again?
Here is the bundle:
$ bundle
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching source index from https://gems.bancolini.com/
Fetching source index from https://gems.bancolini.com/
Fetching gem metadata from https://rubygems.org/..........
Fetching source index from https://rubygems.org/
Resolving dependencies....
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using i18n 1.8.10
Using minitest 5.14.4
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using zeitwerk 2.4.2
Using activesupport 6.0.4
Using builder 3.2.4
Using erubi 1.10.0
Using mini_portile2 2.5.3
Using racc 1.5.2
Using nokogiri 1.11.7 (x86_64-linux)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.10.0
Using rails-html-sanitizer 1.3.0
Using actionview 6.0.4
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.0.4
Using nio4r 2.5.7
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.5
Using actioncable 6.0.4
Using globalid 0.4.2
Using activejob 6.0.4
Using activemodel 6.0.4
Using activerecord 6.0.4
Using marcel 1.0.1
Using activestorage 6.0.4
Using mini_mime 1.1.0
Using mail 2.7.1
Using actionmailbox 6.0.4
Using actionmailer 6.0.4
Using actiontext 6.0.4
Using activemodel-serializers-xml 1.0.2
Using pg 1.2.3
Using activerecord-hierarchical_query 1.3.0
Using activerecord-nulldb-adapter 0.7.0
Using public_suffix 4.0.6
Using addressable 2.8.0
Using smart_kv <IP_ADDRESS>
Using apexcharts 0.1.10
Using execjs 2.8.1
Using autoprefixer-rails <IP_ADDRESS>
Using bcrypt 3.1.16
Using bindex 0.8.1
Using msgpack 1.4.2
Using bootsnap 1.7.6
Using ffi 1.15.3
Using sassc 2.4.0
Using bootstrap-sass 3.4.1
Using bundler 2.1.4
Using byebug 11.1.3
Using native-package-installer 1.1.1
Using pkg-config 1.4.6
Using matrix 0.4.2
Using red-colors 0.3.0
Using cairo 1.17.5
Using glib2 3.4.6
Using cairo-gobject 3.4.6
Using cancancan 3.3.0
Using regexp_parser 2.1.1
Using xpath 3.2.0
Using capybara 3.35.3
Using childprocess 3.0.0
Using choice 0.2.0
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using method_source 1.0.0
Using thor 1.1.0
Using railties 6.0.4
Using coffee-rails 5.0.0
Using connection_pool 2.2.5
Using deep_merge 1.2.1
Using orm_adapter 0.5.0
Using responders 3.0.1
Using warden 1.2.9
Using devise 4.8.0
Using devise-i18n 1.10.0
Using e2mmap 0.1.0
Using et-orbi 1.2.4
Using raabro 1.4.0
Using fugit 1.5.0
Using gobject-introspection 3.4.6
Using gio2 3.4.6
Using groupdate 5.2.2
Using temple 0.8.2
Using tilt 2.0.10
Using haml 5.2.1
Using http_accept_language 2.1.1
Using mini_magick 4.11.0
Using ruby-vips 2.1.2
Using image_processing 1.12.1
Using jbuilder 2.11.2
Using jquery-rails 4.4.0
Using jquery-ui-rails 6.0.1
Using jwt 2.2.3
Using kaminari-core 1.2.1
Using kaminari-actionview 1.2.1
Using kaminari-activerecord 1.2.1
Using kaminari 1.2.1
Using rb-fsevent 0.11.0
Using rb-inotify 0.10.1
Using listen 3.6.0
Using multi_json 1.15.0
Using rack-cors 1.1.1
Using ransack 2.4.2
Using simple_command 0.1.0
Using rails-i18n 6.0.0
Using rails_admin_settings 1.7.0
Using rubyzip 2.3.2
Using roo 2.8.3
Using ruby-ole <IP_ADDRESS>
Using spreadsheet 1.2.9
Using roo-xls 1.2.0
Using sprockets 4.0.2
Using sprockets-rails 3.2.2
Using rails 6.0.4
Using thecore_auth_commons 2.3.9
Using thecore_backend_commons 2.3.4
Using model_driven_api 2.4.0
Using nested_form 0.3.2
Using rack-pjax 1.1.0
Using remotipart 1.4.4
Using sassc-rails 2.1.2
Using rails_admin 2.2.0
Using rails_admin-i18n 1.16.1
Using rails_admin_rollincode 1.3
Using selectize-rails 0.12.6
Using rails_admin_selectize 2.0.8
Using rails_admin_toggleable 0.8.3
Using safe_yaml 1.0.5
Using poppler 3.4.6
Using serviceworker-rails 0.6.0
Using redis 4.3.1
Using sidekiq 6.2.1
Using sidekiq-failures 1.0.0
Using rufus-scheduler 3.8.0
Using thwait 0.2.0
Using sidekiq-scheduler 3.1.0
Using thecore_background_jobs 2.0.7
Using thecore_ui_commons 2.3.7
Using thecore_ui_rails_admin 2.4.1 from source at `../dependencies/thecore/thecore_ui_rails_admin`
Using thecore_spot_items_common 2.1.0
Using thecore_spot_projects_common 2.1.3
Using thecore_spot_suppliers 2.0.2 from source at `../dependencies/spot/thecore_spot_suppliers`
Using spot_delivery_commons 0.1.5 from source at `../dependencies/spot/spot_delivery_commons`
Using spot_employee_commons 0.1.5 from source at `../dependencies/spot/spot_employee_commons`
Using thecore_spot_items_importer 2.1.0
Using thecore_spot_locations_common 2.1.1 from source at `../dependencies/spot/thecore_spot_locations_common`
Using spot_delivery_receipts 0.1.11 from source at `../dependencies/spot/spot_delivery_receipts`
Using spot_delivery_shipments 0.1.6 from source at `../dependencies/spot/spot_delivery_shipments`
Using zpl_print 0.1.2 from source at `../dependencies/spot/zpl_print`
Using mydeli_models 0.1.2 from source at `../dependencies/spot/mydeli_models`
Using puma 4.3.8
Using rack-proxy 0.7.0
Using rexml 3.2.5
Using ruby-graphviz 1.2.5
Using rails-erd 1.6.1
Using sass-rails 6.0.0
Using selenium-webdriver 3.142.7
Using spring 2.1.1
Using spring-watcher-listen 2.0.1
Using thecore_spot_overrides 2.0.9
Using turbolinks-source 5.2.0
Using turbolinks 5.2.1
Using web-console 4.1.0
Using webdrivers 4.6.0
Using webpacker 4.3.0
Bundle complete! 28 Gemfile dependencies, 171 gems now installed.
Bundled gems are installed into `./vendor/bundle`

Thank you very much.

I have no idea, can you reproduce this by using a newly generated rails app?

Hi, thanks for the answer, no, on a newly generated app I cannot reproduce it. But if I use a wrapper gem I created, it does not work., I try to explain better: I think the point lies around the fact I use rails_admin gem in another gem I created (https://github.com/gabrieletassoni/thecore_ui_rails_admin) which I use as a collection of best practices I push in every project I start, and the main app's Gemfile includes my gem, not rails_admin directly.
This dependency chain worked well for many years now and on many different projects, but since one month ago the console started to spit out that error after a bundle update. I managed to silence off it by removing //= require rails_admin/rails_admin from my gem's app/assets/javascripts/thecore_ui_rails_admin/thecore_rails_admin.js, but this obviously has the problem of not loading rails admin specific javascripts at all. As soon as I add the  //= require rails_admin/rails_admin again, the error is thrown again and no javascript in the page works anymore.
I tried to give a glance on rails_admin code of commits around that time, but I'm unable to find what has changed.
Thanks

Ok, I'm resolving by adhering to the standard, I have had a lot of overridden layouts and partials, one of them enabling packs and this seems to conflict with rails_admin javascript management.
Can't see the time to have rails_admin properly integrated with webpacker ^_^

Well, it seems that at least version 3+ does not work with webpacker. Sample project of @gabrieletassoni seem to use sprockets, while original one (the one that has error) used webpacker.
I've just added RailsAdmin to my Rails and webpacker project, and here's what I'm getting:
filtering-multiselect.js:10 Uncaught TypeError: $.widget is not a function     at filtering-multiselect.js:10:1     at ./node_modules/rails_admin/src/rails_admin/filtering-multiselect.js (filtering-multiselect.js:352:1)     at __webpack_require__ (bootstrap:769:1)     at fn (bootstrap:129:1)     at ./node_modules/rails_admin/src/rails_admin/base.js (base.js:1:1)     at __webpack_require__ (bootstrap:769:1)     at fn (bootstrap:129:1)     at ./app/javascript/packs/rails_admin.js (bootstrap:907:1)     at __webpack_require__ (bootstrap:769:1)     at fn (bootstrap:129:1)
You can easily trace error to line import "jquery-ui/ui/widget" that actually does not do anything. It should look like jQuery.widget = require("jquery-ui/ui/widget.js");


Create a 'safety reaction' activity

Depends on
https://github.com/MayfieldRoboticsPublic/kuri_edu/issues/2
Desired Outcome
Provide enough guidance that a user can make the following modifications to the safety controller node:

When a bump occurs, twist messages from nav and keyboard teleop are stopped from going to the wheels
Kuri automatically backs up about one inch
After the safety conditions are cleared, teleop and nav messages are re-enabled

Possible test cases

Start kuri in a simulated empty world
Use the /sim_interface/kick service to trigger the bumper
Observe that kuri backs up
Observe that the safety statuses are cleared

The default safety node already does this - suggest simplifying the activity to "don't back up when docked"

Done in https://github.com/MayfieldRoboticsPublic/kuri_edu/pull/20


Timestamp passed via RedirectToAction loses precision in target action

Hello, I am facing a problem when calling RedirectToAction() method and passing a timestamp via parameter:
public IActionResult ActionOne()
{
   var timestamp = new DateTimeOffset(2018,7,25,14,16,18,120,new TimeSpan());
   return RedirectToAction("ActionTwo", new { Timestamp = timestamp });
}

public IActionResult ActionTwo(DateTimeOffset timestamp)
{
   ...
}

When I dump the timestamp variable inside the ActionOne:
Millisecond [int]: 120
Ticks [long]:<PHONE_NUMBER>81200000
When I dump the timestamp variable inside the ActionTwo:
Millisecond [int]: 0
Ticks [long]:<PHONE_NUMBER>80000000
The target variable has lost miliseconds precision.
Do I have to pass the timestamp in some different way or is it a bug?
Thanks, Martin

I solved this problem by passing the value in milliseconds [long] instead of DateTimeOffset.
public IActionResult ActionOne()
{
   var timestamp = new DateTimeOffset(2018,7,25,14,16,18,120,new TimeSpan());
   return RedirectToAction("ActionTwo", new { Timestamp = timestamp.ToUnixTimeMilliseconds() });
}

public IActionResult ActionTwo(long timestamp)
{
   var ts = DateTimeOffset.FromUnixTimeMilliseconds(timestamp);
   ...
}

This issue was moved to aspnet/Mvc#8383


alignment score and Evalue calculation?

I am skimming through the source code because the documentation (fasta_guide.pdf) does not give good explanations. However, it will be much more helpful if you @wrpearson could provide relevant code segments and formulae for the following:
Alignment score and Evalue calcuation for:

global-global alignment (GGSEARCH) Needleman-Wunsch algorithm
local alignment (SSEARCH) Smith-Waterman algorithm

Thanks

I am afraid that I do not understand what you would like to have.
The alignment score and E()-values are shown in the output.  For ggsearch36, the alignment score is calculated by the do_work() function in the dropnnw2.c file, for ssearch36, the score is calculated by do_work() in the dropgsw2.c file.
The E()-value calculation for local scores is done by functions in scaleswn.c.  ssearch and other local comparison methods use the extreme value distribution.  ggsearch uses a normal distribution to calculate the significance of global alignment scores.
Bill Pearson
Begin forwarded message:
From: Vang Le <notifications<EMAIL_ADDRESS>Subject: [wrpearson/fasta36] alignment score and Evalue calculation? (#8)
Date: May 8, 2018 at 4:55:00 PM EDT
To: wrpearson/fasta36 <fasta36<EMAIL_ADDRESS>Cc: William Pearson <wrp<EMAIL_ADDRESS>Mention <mention<EMAIL_ADDRESS>Reply-To: wrpearson/fasta36 <reply<EMAIL_ADDRESS>I am skimming through the source code because the documentation (fasta_guide.pdf) does not give good explanations. However, it will be much more helpful if you @wrpearsonhttps://github.com/wrpearson could provide relevant code segments and formulae for the following:
Alignment score and Evalue calcuation for:

global-global alignment (GGSEARCH) Needleman-Wunsch algorithm
local alignment (SSEARCH) Smith-Waterman algorithm

Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/wrpearson/fasta36/issues/8, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGGGv6VWRjHiPhprqce-dvN199IOS3WUks5twgYkgaJpZM4T3Uw5.

Thanks for the pointers, Bill. The filenames you gave are very helpful. In addition to that, what are recommended readings to understand about algorithms used in FASTA36 ?


Adapt to env var change for crowbar-backup

We now need to set CB_BACKUP_IGNOREWARNING to ignore the warning, as the
script is supported. We keep the old variable to keep working on old
versions of SUSE Cloud.
Needed by https://github.com/SUSE-Cloud/cloud-tools/pull/12

+1