what is the recommended way of testing pyclip?

I've recently added pyclip to a cli app, and would love to write a unit test to check that it's called when I expect. I couldn't find anything in the docs or the source code that would let me register a mock clipboard to inspect during pytest testing.

I agree with you
pyclip has a unittest covering the core features.
Lacks:

separate module and unittest which deals solely with usage / integration

a testable module to turn pyclip into an optional feature.

Calling, for example, pyclip.copy wrapper should do nothing if pyclip or the dependency are not installed. Assume nothing!

a unittest that covers pyclip as an optional feature integrated into an UI app

Can answer both how to make pyclip an optional feature and how to unittest it at the same time. And i've done it, so drawing snippets from working code base.
urpackage.ui.util_screen.py (aka one of many possible screen features. pyclip being just one screen feature)
# Optional import
try:
    import pyclip
    is_pyclip_import = True
except (ImportError, pyclip.base.ClipboardSetupException):  # pragma: no cover
    is_pyclip_import = False

If import pyclip fails, take note, hidden within pyclip codebase, will check whether the dependency is installed. So there are two things occurring here. Which is inconvenient, but unavoidable.
In the unittest, both is_pyclip_import and pyclip can be patched, to pretend failures occurred.
urpackage.ui.util_screen.py
import sys
is_pyclip = "pyclip" in sys.modules

is_pyclip indicates pyclip import and dependency exists; both were successful. Module level variable so can be patched during test.
def _is_clipboard() -> bool:
    if not is_pyclip or not is_pyclip_import:
        ret = False
    else:
        # distro package dependency is installed
        try:
            pyclip.util.detect_clipboard()
        except (
            pyclip.base.ClipboardSetupException,
        ):  # pragma: no cover already checked for
            ret = False
        else:
            ret = True

    return ret

Also patchable. Check for both situations: pyclip not installed and dependency not installed.
Possible to test why it failed. But within an UI app, we actually don't care why. We care whether the pyclip command will work or not.
import os
is_wayland = os.environ.get("WAYLAND_DISPLAY", "") != ""

Pulling this code out as a patchable module level variable.
Next is one wrapper function per pyclip command. The wrapper function should log issues and display passive notification to user, indicating what the problem is and how to fix the issue. Not just what the problem is.
Each wrapper function can return a boolean. Either the command was successful or it wasn't
Unittest
The unittest would be UI package specific. Will show all the patch blocks, so irregardless of UI framework can build the unittests!
import unittest
from unittest.mock import patch
from urpackage.ui.util_screen import (
    _is_clipboard,
    is_pyclip,
)

class ImportPyclipFail(unittest.TestCase):
    @unittest.skipIf(
        is_clipboard is False,
        "",
    )
    def test_works_or_doesnt(self):
        """Check _is_clipboard works irregardless of actual situation"""
        with (
            patch("urpackage.ui.util_screen.is_pyclip", False)
        ):
            self.assertFalse(_is_clipboard())

        with patch(
            "urpackage.ui.util_screen.pyclip.util.detect_clipboard",
            return_value=True,
        ):
            self.assertTrue(_is_clipboard())

        """Can't patch "urpackage.ui.util_screen.pyclip.util.detect_clipboard"
        affects import pyclip
        """
        pass

async tests patches

with (
    patch("urpackage.ui.util_screen.is_pyclip", False),
    patch("urpackage.ui.util_screen._is_clipboard", return_value=False),
):

@unittest.skipIf(
    is_clipboard is True,
    "",
)

import os
from ur_ui_framework import Label
gui_component = Label()
with patch("os.environ.get", return_value="1"):
    self.assertFalse(copy_result(gui_component))
#    xclip
with patch("os.environ.get", return_value=""):
    self.assertFalse(copy_result(gui_component))

^^ is not the complete unittest, but has all the patches, so anything else filling in the UI framework specific bits should not be in the least bit challenging.
Finally
if __name__ == "__main__":  # pragma: no cover
    unittest.main(tb_locals=True)

Then run your test, from package base folder, python -m tests.ui.test_util_screen
unittest was used rather than pytest cuz pytest is an unnecessary dependency. There are no important pytest features present in the existing pyclip test.

@spyoungtech Please let me know whether or not you'd accept as an optional feature module
Cuz you haven't yet accepted the pull request, #25
so i'm reluctant to create a pull request until #25 is accepted.

write a unit test to check that it's called when I expect

I'm not sure what difficulty you're having or what interfaced you'd expect to be provided specifically,  but for testing your own code, it is possible to test with mocks, just like you might mock out any component of any library.
Suppose you have a module like something.py that you expect to call pyclip.copy.
# something.py
def something(foo: str):
    pyclip.copy(foo)

Then in a test, you can use a mock pyclip.copy and assert that it has been called.
from unittest import mock
from something import something

def test_something():
    with mock.patch('pyclip.copy') as mock_copy:
        something('hello world')
        mock_copy.assert_called_with('hello world')

The unittest.mock docs should be helpful for other uses.

Seems like you've got what you need. Feel free to open another issue if you need any more help.


New Update Tibia 10 Client

Since I can't play on Tibia 11 due to double steps and delay when using potions I need to use 10. But somehow Tibialyzer only works with Client 11 for now after I Updated.

THIS PROJECT IS DEAD!!!!!!! THE OWNER IS NOT UPDATING ANYMORE SINCE MONTHS AGO

Have you changed the selection of the Tibia Client?
And you tried to select the Tibia process?

Yes I did change it.

its not working for me also, same problem :/

Should be fixed now, the memory addresses are updated.

Hey Mark (if that's okay to call you that, that is) thanks so much for the quick reply and fixing your program you do really great work and I showed an ex tibia player your program and he was some impressed with what you did, he is a simple programmer I suppose you could say but anyways thanks so much for your help if you could link me a paypal or donation link I would love to help out wit the cause
also
I just was honestly only popping on here to email tibia as
I just received a from them "Statements that imply a rule violation are a violation of Tibia Rule 2g" and now have a code of conduct record.. i have had a clean record my whole career, so now i need to email them and find out if this is justifiable, because to my acknowledgment this program is user friendly anyways let me know what you think
"item@dwarven leg" (Feb 08 2017, 09:09:34 CET, in Say)
ps don't for get about that donation link

From: Mark<EMAIL_ADDRESS>Sent: February 9, 2017 3:39 AM
To: Mytherin/Tibialyzer
Cc: Subscribed
Subject: Re: [Mytherin/Tibialyzer] New Update Tibia 10 Client (#305)
Should be fixed now, the memory addresses are updated.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/Mytherin/Tibialyzer/issues/305#issuecomment-278579445, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AYcDJi0m8qINsYVA4G36Iv2JrqGqLzZsks5ratC1gaJpZM4L57NA.


Hadle 404 issue in saaskit

Hello All,
How can I handle 404 error using saaskit ?
I have tried with several way, but still I am getting the white screen if my url is not matched.
Below code I have added in Startup.cs to handle the session time out issue

app.Use(async (ctx, next) =>
            {
                if (ctx.GetTenantContext<AppTenant>() == null && !ctx.Request.Path.ToString().Contains("/Home/Redirect"))
                {

                    string redirect = Configuration["RedirectUrlSettings:RedirectUrl"];
                    string appTye = ctx.Request.Headers["Referer"];
                    bool logoff = ctx.Request.Path.ToString().Contains("/Account/LogOff") ? true : false;

                    if (appTye != null)
                    {
                        redirect += appTye.Contains("Admin") ? "/Home/Redirect/Admin/" + logoff : "/Home/Redirect/Trainee/" + logoff;

                        ctx.Response.Redirect(redirect);
                    }

                }
                else
                {
                    if (ctx.Response.StatusCode == Convert.ToInt32(HttpStatusCode.NotFound))
                    {
                        ctx.Response.Redirect("/Home/Error/{0}");
                    }
                    await next();
                }
            });

I am looking for this urgently !
Thanks for the help.
Regards,
Rohit

Can you explain what it is you're trying to achieve? Looking at the above, I'm not sure you should be calling await next() when the tenant isn't found.


UP031: ruff 0.4.2 generated invalid fix it code

                msg="\n".join(
                    [
                        "alpha = alpha_c + %.2g" % shift,
                        "expected_grad: %.5g" % expected_grad,
                        "actual_grad: %.5g" % actual_grad,
                        "error = %.2g" % torch.abs(expected_grad - actual_grad).max(),
                    ]

became
                msg="\n".join(
                    [
                        f"alpha = alpha_c + {shift:.2g}",
                        f"expected_grad: {expected_grad:.5g}",
                        f"actual_grad: {actual_grad:.5g}",
                        f"error = {torch.abs(expected_grad - actual_grad).max():.2g}",
                    ]

which throws an error. I know it's an unsafe fix, but unsafe fixes should not generate invalid code. Specifically:
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/distributions/test_distributions.py", line 4658, in test_dirichlet_multivariate
    f"expected_grad: {expected_grad:.5g}",
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_tensor.py", line 989, in __format__
    return object.__format__(self, format_spec)
TypeError: unsupported format string passed to Tensor.__format__

from this PR: https://github.com/pytorch/pytorch/pull/125031/

Guessing this is due to the recent change to UP031? Cc. @plredmond

Why can't tensors be passed-in there, but can be formatted with % formatting?

@charliermarsh I think it's related to classes overriding the __format__ magic method. Does the '%' method cast it to a string before calling __format__ on it or something?

@charliermarsh Ah, apparently in the first code, it's implicitly converted before: "Here, you're using the old-style string formatting (%-formatting), where shift, a PyTorch tensor, is implicitly converted to a numeric type (float or integer) when it's formatted. This conversion happens before the formatting is applied, so the process doesn't raise any issues."
import torch
x = torch.tensor([1.0])
print("Value: %.2f" % x)  # Works because x is cast as a float before __format__ is called
print(f"Value: f{x:.5g}") # fails because Tensor.__format__ is called

I think explicitly casting to float in all float specific __format__ string fixits could solve this issue?

I think that makes sense. E.g., when there's a :.5g specifier?

There are probably other specifies that do this casting f (or maybe some to int for d) etc.

@charliermarsh perhaps we could add this kind of explicit-conversion to the UP031 rule after we can infer the types of the expressions? alternatively, since we parse the format string we could use that information to select an explicit-conversion function?


Example showing how to use jaq as a library is incomplete

I would like to use the crate as a library.  The example in the code comments of jaq-core/lib.rs does not compile.
15 |     let (f, errs) = jaq_parse::parse(filter, jaq_parse::main());
   |                     ^^^^^^^^^ use of undeclared crate or module `jaq_parse`

Also, the jaq crate combines the component crates into a workspace.  It is not clear what I should put in my Cargo.toml file to use this crate as a library.

Happy to hear that you want to use jaq as a library.
The code that you are referring to is from the current development version on Git, which has a quite different API than the latest stable release (0.10.1).
Code for using the stable release can be found at: https://docs.rs/jaq-core/latest/jaq_core/
You can browse the source code for the stable release at: https://github.com/01mf02/jaq/tree/v0.10
And finally, your Cargo.toml should include the following entries to use jaq:
jaq-core = { version = "0.10.1" }
jaq-std  = { version = "0.10.0" }

I hope that this works for you.

Thank you for your guidance.  I was able to get the example code in jaq-core/lib.rs to run.  I checked out the jaq master branch.  I added the path to these crates to my Cargo.toml file.
Cargo.toml
[dependencies]
serde_json = "1.0"
jaq-core = { path = "../jaq/jaq-core" }
jaq-parse = { path = "../jaq/jaq-parse" }

src/main.rs
use jaq_core::{Ctx, FilterT, ParseCtx, RcIter, Val};
use serde_json::{json};

fn main() {

    let input = json!(["Hello", "world"]);
    let filter = ".[]";

    // start out only from core filters,
    // which do not include filters in the standard library
    // such as `map`, `select` etc.
    let mut defs = ParseCtx::new(Vec::new());

    // parse the filter
    let (f, errs) = jaq_parse::parse(filter, jaq_parse::main());
    assert_eq!(errs, Vec::new());

    // compile the filter in the context of the given definitions
    let f = defs.compile(f.unwrap());
    assert!(defs.errs.is_empty());

    let inputs = RcIter::new(core::iter::empty());

    // iterator over the output values
    let mut out = f.run((Ctx::new([], &inputs), Val::from(input)));

    assert_eq!(out.next(), Some(Ok(Val::from(json!("Hello")))));
    assert_eq!(out.next(), Some(Ok(Val::from(json!("world")))));
    assert_eq!(out.next(), None);
}

@kimjarvis For anyone else viewing this thread it's now like this:
extern crate jaq_core;
extern crate jaq_interpret;
extern crate serde;

fn jq() {
    let input = serde_json::json!(["Hello", "world"]);
    let filter = ".[]";

    // start out only from core filters,
    // which do not include filters in the standard library
    // such as `map`, `select` etc.
    let mut defs = jaq_interpret::ParseCtx::new(Vec::new());

    // parse the filter
    let (f, errs) = jaq_parse::parse(filter, jaq_parse::main());
    assert_eq!(errs, Vec::new());

    // compile the filter in the context of the given definitions
    let f = defs.compile(f.unwrap());
    assert!(defs.errs.is_empty());

    let inputs = jaq_interpret::RcIter::new(core::iter::empty());

    // iterator over the output values
    let mut out = f.run((jaq_interpret::Ctx::new([], &inputs), jaq_interpret::Val::from(input)));

    assert_eq!(
        out.next(),
        Some(Ok(jaq_interpret::Val::from(serde_json::json!("Hello"))))
    );
    assert_eq!(
        out.next(),
        Some(Ok(jaq_interpret::Val::from(serde_json::json!("world"))))
    );
    assert_eq!(out.next(), None);
}

Given Cargo.toml with:
[dependencies]
serde = { version = "1.0.199", features = ["serde_derive"] }
serde_json = "1.0.116"
jaq-core = "1.2.1"
jaq-parse = "1.0.2"
jaq-std = "1.2.1"
jaq-interpret = "1.2.1"

With the #202 rewrite you can do this, stealing code from this https://github.com/01mf02/jaq/blob/7b9ce5b/jaq-core/tests/common/mod.rs
You can simply do:
#[test]
fn jaq_internals_test() {
    give(serde_json::json!([0, 1, 2]), ".[ 2]", serde_json::json!(2));
    give(serde_json::json!({"foo": {"bar": {"can": 5}}}), ".foo.bar.can", serde_json::json!(5));
}

With a Cargo.toml dependency of:
jaq-core = { git = "https://github.com/01mf02/jaq", version = "2.0.0-alpha.1" }
jaq-std = { git = "https://github.com/01mf02/jaq", version = "2.0.0-alpha.1" }
jaq-json = { git = "https://github.com/01mf02/jaq", version = "1.0.0-alpha", features = ["serde_json"] }

Yes, you can do that, but be careful --- this does not give you access to functions like length, add, and many others. For that, you have to give jaq_std::{defs, funs} and jaq_json::{defs, funs} to the Loader/Compiler, as it's done in jaq.

@01mf02 Ok I think I figured it out? - How about something like this:
fn jaq_runner(filter: &jaq_core::Filter<jaq_core::Native<jaq_json::Val>>,
              vars: Vec<jaq_json::Val>,
              null_input: bool,
              iter: impl Iterator<Item = std::io::Result<jaq_json::Val>>,
              mut f: impl FnMut(jaq_json::Val) -> std::io::Result<()>) -> std::io::Result<Option<bool>> {
    let mut last = None;
    let iter = iter.map(|r| r.map_err(|e| e.to_string()));

    let iter = Box::new(iter) as Box<dyn Iterator<Item = _>>;
    let null = Box::new(core::iter::once(Ok(jaq_json::Val::Null))) as Box<dyn Iterator<Item = _>>;

    let iter = jaq_core::RcIter::new(iter);
    let null = jaq_core::RcIter::new(null);

    let ctx = jaq_core::Ctx::new(vars, &iter);

    for item in if null_input { &null } else { &iter } {
        let input = item.map_err(|e| std::io::Error::other(e))?;
        //println!("Got {:?}", input);
        for output in filter.run((ctx.clone(), input)) {
            use jaq_core::ValT;
            let output = output.map_err(|e| std::io::Error::other(jaq_core::Error::<jaq_json::Val>::from(e).to_string()))?;
            last = Some(output.as_bool());
            f(output)?;
        }
    }
    Ok(last)
}
/* This example^ doesn't use my custom error type `enum`
  and is modified from https://github.com/01mf02/jaq/blob/b8f8e4f/jaq/src/main.rs#L476-L505
 */

Which can be tested like:
use std::io::{Read, Seek, Write};

#[test]
fn test_jaq_runner() {
    let filter = jaq_core::Filter::<jaq_core::Native<jaq_json::Val>>::default();
    let vars = vec![jaq_json::Val::Null, jaq_json::Val::Arr(std::rc::Rc::new(vec![jaq_json::Val::Bool(true), jaq_json::Val::Null])), jaq_json::Val::Int(5)];
    let inputs = Box::new(std::iter::once(Ok(jaq_json::Val::Str(std::rc::Rc::new(String::from(".[0]"))))));

    let mut buf = std::io::Cursor::new(Vec::<u8>::new());
    assert_eq!(jaq_runner(&filter, vars, true, inputs, |v| buf.write_all(v.to_string().as_bytes())).unwrap(), Some(false));
    buf.seek(std::io::SeekFrom::Start(0)).unwrap();
    let mut out = String::new();
    buf.read_to_string(&mut out).unwrap();
    assert_eq!(out, "null");
}

Your function jaq_runner looks fine. Your Cursor approach in test_jaq_runner seems a bit complicated, though; why not just write output values to a mutable Vec? And why do you initialise vars to these particular values?

Extracting your internals, I was able to make this work:
fn jaq_runner(
    filter: &jaq_core::Filter<jaq_core::Native<jaq_json::Val>>,
    vars: Vec<jaq_json::Val>,
    null_input: bool,
    iter: impl Iterator<Item = std::io::Result<jaq_json::Val>>,
    mut f: impl FnMut(jaq_json::Val) -> std::io::Result<()>,
) -> std::io::Result<Option<bool>> {
    let mut last = None;
    let iter = iter.map(|r| r.map_err(|e| e.to_string()));

    let iter = Box::new(iter) as Box<dyn Iterator<Item = _>>;
    let null = Box::new(core::iter::once(Ok(jaq_json::Val::Null))) as Box<dyn Iterator<Item = _>>;

    let iter = jaq_core::RcIter::new(iter);
    let null = jaq_core::RcIter::new(null);

    let ctx = jaq_core::Ctx::new(vars, &iter);

    for item in if null_input { &null } else { &iter } {
        let input = item.map_err(|e| std::io::Error::other(e))?;
        //println!("Got {:?}", input);
        for output in filter.run((ctx.clone(), input)) {
            use jaq_core::ValT;
            let output = output.map_err(|e| {
                std::io::Error::other(jaq_core::Error::<jaq_json::Val>::from(e).to_string())
            })?;
            last = Some(output.as_bool());
            f(output)?;
        }
    }
    Ok(last)
}

fn vars_filter_from_code(
    code: &str,
) -> std::io::Result<(
    Vec<jaq_json::Val>,
    jaq_core::Filter<jaq_core::Native<jaq_json::Val>>,
)> {
    parse(
        &"<inline>",
        &code,
        &[String::from("ARGS"), String::from("ENV")],
        &[],
    )
        .map_err(|e| {
            let mut tmp = Vec::<u8>::with_capacity(e.len());
            e.iter().for_each(
                /* fold kept trying to make it a `&[u8]` */
                |elem| tmp.extend(format!("{:?}", elem).as_bytes()),
            );
            std::io::Error::other(std::str::from_utf8(tmp.as_slice()).unwrap())
        })
}

#[derive(Clone, Debug)]
enum Color {
    Yellow,
    Red,
}

type StringColors = Vec<(String, Option<Color>)>;

#[derive(Debug)]
struct Report {
    message: String,
    labels: Vec<(core::ops::Range<usize>, StringColors, Color)>,
}

type FileReports = (jaq_core::load::File<String>, Vec<Report>);

fn report_io(code: &str, (path, error): (&str, String)) -> Report {
    let path_range = jaq_core::load::span(code, path);
    Report {
        message: format!("could not load file {}: {}", path, error),
        labels: [(path_range, [(error, None)].into(), Color::Red)].into(),
    }
}

fn report_lex(code: &str, (expected, found): jaq_core::load::lex::Error<&str>) -> Report {
    // truncate found string to its first character
    let found = &found[..found.char_indices().nth(1).map_or(found.len(), |(i, _)| i)];

    let found_range = jaq_core::load::span(code, found);
    let found = match found {
        "" => [("unexpected end of input".to_string(), None)].into(),
        c => [("unexpected character ", None), (c, Some(Color::Red))]
            .map(|(s, c)| (s.into(), c))
            .into(),
    };
    let label = (found_range, found, Color::Red);

    let labels = match expected {
        jaq_core::load::lex::Expect::Delim(open) => {
            let text = [("unclosed delimiter ", None), (open, Some(Color::Yellow))]
                .map(|(s, c)| (s.into(), c));
            Vec::from([
                (jaq_core::load::span(code, open), text.into(), Color::Yellow),
                label,
            ])
        }
        _ => Vec::from([label]),
    };

    Report {
        message: format!("expected {}", expected.as_str()),
        labels,
    }
}

fn report_parse(code: &str, (expected, found): jaq_core::load::parse::Error<&str>) -> Report {
    let found_range = jaq_core::load::span(code, found);

    let found = if found.is_empty() {
        "unexpected end of input"
    } else {
        "unexpected token"
    };
    let found = [(found.to_string(), None)].into();

    Report {
        message: format!("expected {}", expected.as_str()),
        labels: Vec::from([(found_range, found, Color::Red)]),
    }
}

fn load_errors(errs: jaq_core::load::Errors<&str>) -> Vec<FileReports> {
    use jaq_core::load::Error;

    let errs = errs.into_iter().map(|(file, err)| {
        let code = file.code;
        let err = match err {
            Error::Io(errs) => errs.into_iter().map(|e| report_io(code, e)).collect(),
            Error::Lex(errs) => errs.into_iter().map(|e| report_lex(code, e)).collect(),
            Error::Parse(errs) => errs.into_iter().map(|e| report_parse(code, e)).collect(),
        };
        (file.map_code(|s| s.into()), err)
    });
    errs.collect()
}

fn report_compile(code: &str, (found, undefined): jaq_core::compile::Error<&str>) -> Report {
    let found_range = jaq_core::load::span(code, found);
    let message = format!("undefined {}", undefined.as_str());
    let found = [(message.clone(), None)].into();

    Report {
        message,
        labels: Vec::from([(found_range, found, Color::Red)]),
    }
}

fn compile_errors(errs: jaq_core::compile::Errors<&str>) -> Vec<FileReports> {
    let errs = errs.into_iter().map(|(file, errs)| {
        let code = file.code;
        let errs = errs.into_iter().map(|e| report_compile(code, e)).collect();
        (file.map_code(|s| s.into()), errs)
    });
    errs.collect()
}

fn invalid_data(e: impl std::error::Error + Send + Sync + 'static) -> std::io::Error {
    std::io::Error::new(std::io::ErrorKind::InvalidData, e)
}

fn json_slice(slice: &[u8]) -> impl Iterator<Item = std::io::Result<jaq_json::Val>> + '_ {
    let mut lexer = hifijson::SliceLexer::new(slice);
    core::iter::from_fn(move || {
        use hifijson::token::Lex;
        Some(jaq_json::Val::parse(lexer.ws_token()?, &mut lexer).map_err(invalid_data))
    })
}

/// Try to load file by memory mapping and fall back to regular loading if it fails.
fn load_file(
    path: impl AsRef<std::path::Path>,
) -> std::io::Result<Box<dyn core::ops::Deref<Target = [u8]>>> {
    let file = std::fs::File::open(path.as_ref())?;
    match unsafe { memmap2::Mmap::map(&file) } {
        Ok(mmap) => Ok(Box::new(mmap)),
        Err(_) => Ok(Box::new(std::fs::read(path)?)),
    }
}

fn json_array(path: impl AsRef<std::path::Path>) -> std::io::Result<jaq_json::Val> {
    json_slice(&load_file(path.as_ref())?).collect()
}

fn parse(
    path: &str,
    code: &str,
    vars: &[String],
    paths: &[std::path::PathBuf],
) -> Result<
    (
        Vec<jaq_json::Val>,
        jaq_core::Filter<jaq_core::Native<jaq_json::Val>>,
    ),
    Vec<FileReports>,
> {
    use jaq_core::compile::Compiler;
    use jaq_core::load::{import, Arena, File, Loader};

    let vars: Vec<_> = vars.iter().map(|v| format!("${v}")).collect();
    let arena = Arena::default();
    let loader = Loader::new(jaq_std::defs().chain(jaq_json::defs())).with_std_read(paths);
    let path = path.into();
    let modules = loader
        .load(&arena, File { path, code })
        .map_err(load_errors)?;

    let mut vals = Vec::new();
    import(&modules, |p| {
        let path = p.find(paths, "json")?;
        vals.push(json_array(path).map_err(|e| e.to_string())?);
        Ok(())
    })
    .map_err(load_errors)?;

    let compiler = Compiler::default()
        .with_funs(jaq_std::funs().chain(jaq_json::funs()))
        .with_global_vars(vars.iter().map(|v| &**v));
    let filter = compiler.compile(modules).map_err(compile_errors)?;
    Ok((vals, filter))
}

use std::io::{Write};

#[test]
fn test_jaq_runner() {
    [(".[0]", "null"), (".[1]", "[true,null]"), (".[2]", "5")]
        .iter()
        .for_each(|(input, expect)| {
            let inputs = Box::new(std::iter::once(Ok(jaq_json::Val::Arr(std::rc::Rc::new(
                vec![
                    jaq_json::Val::Null,
                    jaq_json::Val::Arr(std::rc::Rc::new(vec![
                        jaq_json::Val::Bool(true),
                        jaq_json::Val::Null,
                    ])),
                    jaq_json::Val::Int(5),
                ],
            )))));

            let (vars, filter) = vars_filter_from_code(input).unwrap();

            let mut buf = Vec::<u8>::new();
            let _result: bool = jaq_runner(&filter, vars.clone(), false, inputs, |v|
                buf.write_all(v.to_string().as_bytes())
            )
            .unwrap()
            .unwrap();
            /*assert!(_result);*/
            assert_eq!(std::str::from_utf8(buf.as_slice()).unwrap(), *expect);
        });
}

@01mf02 The test is reasonably readable, but can the rest of the code I'm using be exposed so that jaq can be used as a library? - Obviously I can maintain this code on my end, but every major jaq change will require a comparable change to my codebase to retain compatibility…
(happy to send a PR)

The test is reasonably readable, but can the rest of the code I'm using be exposed so that jaq can be used as a library?

I suppose you're asking whether the functions you posted (such as report_lex etc.) can be exposed by some jaq crate? If so, then my stance on it is as follows:
There are currently two "official" front-ends for the jaq library, namely jaq (the CLI) and jaq-play.
You can find a lot of similar code in jaq/src/main.rs and jaq-play/src/lib.rs, but there are also subtile differences between the two.
Much of the code that you posted, @SamuelMarks, is shared already today by jaq and jaq-play, but not all of it: For example, nearly everything related to creating Reports is quite similar in jaq and jaq-play, but load_file, for example, is not part of jaq-play, because memory-mapping does not make sense in its context.
I think that a sensible way to progress is to first expose those parts that jaq and jaq-play share. The Report-related code would be a big, yet low-hanging fruit, IMO.
However, the Report type also needs some rewriting before I would be comfortable to expose it in a public (and thus stable!) API: In particular, the Report type currently stores information about colors which can be inferred from the rest of the data. I believe that we can introduce a better Report type as follows:
struct Report {
    message: String,
//  labels: Vec<(core::ops::Range<usize>, StringColors, Color)>, // before
    labels: Vec<(core::ops::Range<usize>, Vec<String>)>,
}

Note that I removed the Color type from it, because I think that can be inferred just by analysing the length of the Vec<String> in labels. If you are motivated to adapt the code such that it uses this new Report type, that it can be used by both jaq and jaq-play, and that it doesn't introduce new dependencies, then such a PR would be very welcome. I believe that a natural place for it to live at would be jaq-core/src/load/report.rs.

Can anyone point me to an example of using a library, but with standard filters? I basically want to execute some user provided strings as jq filters in a Rust program. I'm looking at main.rs and there's tons of extra stuff there (some Loaders etc.) and it seems to me all I want is to add jaq_std::defs() to ParseCtx, but can't figure out how to convert them to the right type...

@dpc - Sure there's mine https://github.com/verman-io/verman-schema-rs/tree/master/src/commands/jaq
(it's an unfinished project, needs documentation, examples, &etc.; but might prove useful to you/others)

BTW. Some good faith feedback - a bit more of docstrings on main structs and functions would go a long way to help new developers figuring out what goes where. :)

After gluing it together, the filter seems to always return the original value (event if I compiled .somefile to filter a particular value). The code is short: https://github.com/fedimint/fedimint/pull/6512/files#diff-3d67e53622e77dcae37d4bd65e66f73d744321bd96cc040ff4dd331158515927R90
I must have some fundamental misconception about something here.
@SamuelMarks Thanks, but this looks very much like the jaq source code with Loaders and Areanas. In my code I didn't find a need for them. Do I need to use them, or are these some performance optimizations only?

FWIW @dpc - Honestly I just hacked out what jaq officially does until it worked with jaq-core, jaq-json and jaq-std dependencies.

I eventually figured it out. Thanks!

RE: docstrings! - yeah I know I generally go for 100% test coverage and 100% doc coverage; but as I said this one is very unfinished and I haven't even uploaded to crates.io | docs.rs
Great that you figured it out; feel free to share sample code for others who come to this GitHub issue.

@dpc, motivated by your question, I adapted the main example in jaq-core to include standard filters, see 8eb49d8. Is that what you were looking for?

What actually happened for me was confusion about major jaq-* versions.


A command line copy dataset utility

A command line utility that copies a dataset while selecting a subset of columns/rows.

Codecov Report

Merging #182 into master will increase coverage by 0.24%.
The diff coverage is 96.34%.

@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
+ Coverage    81.5%   81.74%   +0.24%
==========================================
  Files          63       65       +2
  Lines        3384     3456      +72
  Branches      514      527      +13
==========================================
+ Hits         2758     2825      +67
- Misses        531      535       +4
- Partials       95       96       +1

Impacted Files
Coverage Δ

setup.py
0% <ø> (ø)
:arrow_up:

petastorm/unischema.py
97.61% <100%> (+0.25%)
:arrow_up:

petastorm/benchmark/throughput.py
84.84% <100%> (-0.77%)
:arrow_down:

petastorm/tools/spark_session_cli.py
91.3% <91.3%> (ø)

petastorm/tools/copy_dataset.py
97.91% <97.91%> (ø)

petastorm/reader_impl/worker_loop.py
94.31% <0%> (-2.28%)
:arrow_down:

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 3b2a876...2429e1b. Read the comment docs.


Assess test target execution time & define test schedule

We have nightly and weekly targets defined in the build pipelines.  We eventually want to enable the entire 'grid' of test levels x groups at the project for all platforms that we release.  We will embrace some notion of graduated testing to conserve machines, as we can not run all testing every night.

This issue will gather test duration times for all top-level test targets on all platforms for all versions to attempt to develop a schedule that works with the current machine capacity (and/or advice where we are needing to augment capacity), ideally creating a script where this can be rerun/revisited on a quarterly cadence.
Average Duration for Nightly test targets:

version
target
xlinux avgDuration (mins)
mac avgDuration (mins)
aix avgDuration (mins)
aarch64
win64
s390x

jdk8
sanity.openjdk
22.78
41.04
101
21
85
120

sanity.system
135.49
158.79
135
76
66
210

extended.system
91.29
128.88
75
14
95
150

sanity.perf
47.02
33.08
8
14
55
127

sanity.functional
81.5
83
120
223
83
128

extended.functional
221
112
270
120
141
174

~599 min (~10hrs)
~557 min (~9.2hrs)
~694 (~11.5hrs)
~468 (~7.8hrs)
~525 (~8.75hrs)
~909 (~15hrs)

Average Duration for Weekly test targets: (TBD)

version
target
xlinux avgDuration (TRSS query)

jdk8
extended.openjdk
TBD query

special.functional
TBD query

extended.perf
TBD query

sanity.external

fyi: https://github.com/AdoptOpenJDK/openjdk-tests/issues/2050

https://github.com/AdoptOpenJDK/openjdk-tests/issues/2051

Updated average nightly test execution times for xlinux and mac.  Currently if all top-level targets were run serially on a machine... should complete at around 10hrs for jdk8.  Note: the execution time varies across platforms (for example, based on information shared earlier in this issue, on mac shows a 9.2hr average execution time).  This exercise needs to eventually take that into account, but for a spitball initial estimate, we will assume ~10hr execution time .
We do not run test targets serially, but rather try to divide and queue the top-level targets up across the machines we have.   (and multiplied by 4 impls, hotspot, dragonwell, openj9, openj9XL and for jdk11 x 5 impls with addition of corretto on xlinux).  40/50/30 hrs of test execution time nightly per each version respectively.
Now to look at machine resources, execution time has to be shared across 19 xlinux machines and across 7 mac machines.  If all test targets were granularly divided in 1hr segments, and if no other jobs utilize test machines and all machines are online, the shortest completion time for a nightly build is execution time % number of machines.  In reality, the queuing/scheduling across Jenkins resources is never entirely optimal, nonetheless, if the execution time % num of machines is too large we will need to consider a different schedule or more machines or not using the default set of tests on that platform, but rather a reduced set of tests.

Version
Platform/Spec
Nightly Execution Time (hrs)
Num of Test Machines
Execution Time / Machines (shortest completion time possible)

jdk8
xlinux
40

jdk11
xlinux
50

jdk15
xlinux
30

all
xlinux
120 hrs
19
6.31 hrs

jdk8
mac
30

jdk11
mac
30

jdk15
mac
30

all
mac
90 hrs
7
12.86 hrs

In the middle of this assessment, I have also managed to locate a similar assessment done in April 2019, adding it for completeness.

Closing this as stale and no longer relevant.
The queries linked in the table above (which call an API in TRSS) are still valid and could be used to tabulate data in the future should it be needed, example:
https://trss.adoptopenjdk.net/api/getTestAvgDuration?level=sanity&jdkVersion=8&group=openjdk&platform=x86-64_linux


global: fix compatibility with erlang < 18

Signed-off-by: Leonardo Rossi<EMAIL_ADDRESS>

I'd like this PR to be merged :+1: +1

Hi, thanks for the fix, I solved this with a compile time macro instead in 998df2a2eb169fda13fae7f4739d46e2809ff7a2


Update dependancies

Because I cannot install the package, I have updated the dependencies. Please inform me if flutter_open_weather_package can run and support these new versions

Thanks @ariv797
PR is merged and the new version is already released. Enjoy open weathering ;)


Feat: Use URL-slugs for navigation instead of IDs

Related #200

Note-to-self: Make sure to measure Before&After state, see #95


Feat/update to FSRS-4.5

Ref:https://github.com/open-spaced-repetition/fsrs4anki/wiki/The-Algorithm#fsrs-45

Oh, don't forget to bump up the version.

Oh, don't forget to bump up the version.

ok, I have already updated the version to 1.2.0


Fix Danger::DangerfileGitLabPlugin spec

Failures:

  1) Danger::DangerfileGitLabPlugin repository_web_url should request the project
     Failure/Error: project = Gitlab::ObjectifiedHash.new({:web_url => "https://gitlab.com/k0nserv/danger-test"})

     NameError:
       uninitialized constant Gitlab
     # ./spec/lib/danger/danger_core/plugins/dangerfile_gitlab_plugin_spec.rb:104:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:125:in `block (2 levels) in with_git_repo'
     # ./spec/spec_helper.rb:113:in `chdir'
     # ./spec/spec_helper.rb:113:in `block in with_git_repo'
     # ./spec/spec_helper.rb:112:in `with_git_repo'
     # ./spec/lib/danger/danger_core/plugins/dangerfile_gitlab_plugin_spec.rb:99:in `block (3 levels) in <top (required)>'

not executed require "gitlab"
require "gitlab" is only here ↓
https://github.com/danger/danger/blob/597529b42e99eea06730a87137e6f3e3f009508a/lib/danger/request_sources/gitlab.rb#L31
and actually executed require 'gitlab' when calling Danger::RequestSources::GitLab#client for the first time.
If you look at the spec, you can see that it may not be executed require "gitlab" depending on the execution order.
https://github.com/danger/danger/blob/597529b42e99eea06730a87137e6f3e3f009508a/spec/lib/danger/danger_core/plugins/dangerfile_gitlab_plugin_spec.rb#L98-L105
sorry my poor English

Works for me - thanks @naari3
merge on green

Cool, I can live with that


bump schema dependency

What is the context of this PR?
Trello card
Adds dependency on generated fragment types from eq-author-graphql-schema version 0.8.
Dependent on https://github.com/ONSdigital/eq-author-graphql-schema/pull/29
How to review

yarn
app should compile/run

 Create build step for generating IntrospectionFragmentMatcher


Not working on 1.08.1

I'm using er-patcher-1.06-3. I've not played the game in awhile, but it worked before. CMD window appears briefly with no text, then disappear and the game doesn't launch.
python er-patcher --all  -- %command%

I figured it out. The er-patcher-tmp directory isn't getting cleaned up. If I delete it manually each time then it works.

Just tested on 1.08.1 and cannot reproduce your issue as everything is working fince, including tmp dir removal.

In any case, it would help getting an error log. Replace your er-patcher file with the attached one and rerun the game. It will create a logfile called er-patcher-log.txt which you can then post here.
er-patcher-with-logging.zip

Windows 10 Pro 22H2.
It's easy to fix so it's not a big deal, but I'll get you logs when I can. Might be a couple days before I have a chance to play, or potentially even be at my PC with the game.

I couldn't get it to happen again. It was happening all day before. The only difference is I added mods where before it was vanilla except for er-patcher. 🤷♂
If it happens again, and in a consistently reproducible manner, I'll reopen.


[stable/coredns] Version bump to 1.4.0

What this PR does / why we need it:
https://github.com/coredns/coredns/wiki/CoreDNS-1.4.0-Release-Notes
https://github.com/helm/charts/pull/9865 (see also https://github.com/coredns/coredns/wiki/CoreDNS-1.4.0-Release-Notes )
https://github.com/helm/charts/pull/10230
Which issue this PR fixes
(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

fixes #10191

Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Variables are documented in the README.md

/assign acaleph

/ok-to-test

/lgtm
Thanks @mrueg


Throw TypeError when the module is not of the expected type

Update our base component to check the type of the element received as $module and throw if it's not the right type.
Due to the type of $module being potentially set by the child class, it was tricky to get TypeScript to follow. Two options, both requiring some type setting and some methods overriding in the Child class:

overriding $module to set its type in the child class, as well as the whole checkModuleType to test for the relevant type and have a custom message (2nd commit)
use generic types to define the type for $module and redefine a moduleType getter providing what to instanceof against (3rd commit)

Both are prone to human errors:

TypeScript doesn't complain if checkModuleType is not redefined
TypeScript doesn't complain if the moduleType getter is not redefined

Given the situation, I pushed for the generic types, as they have a much smaller surface for errors (one simple getter, which can live close to the class definition) and systemise the text of the errors being thrown.
Closes #4035.

@colinrotherham Ready for re-review, simplified implementation by replacing the return this with throwing errors 😊

Actually no, let me drop that first commit that's not relevant anymore. Sorry 😔

Thanks @romaricpascal, would you mind updating the description please?
I'm really keen to make sure we tell users why an error has been thrown
That could mean:

Using the initAll() try/catch to log the selector that was used
Logging $module.constructor.name where available (e.g. Character count on <button>)

Differentiated between the two errors 😊 Didn't try to factor in a createModuleError function to avoid spending time figuring types to make TypeScript happy as I wasn't quite sure what to put for the HTMLElement that would need passing.


[:lang cc] Fix list in call for cpu count command

I should find some way to test on Mac OS I guess, or test in CI or something at least. That would make those small errors easier to catch than trying to review it 1000 times

Thanks!


Add support to Ledger Hardware Wallets

It would really good if NeoLine supports Ledger Hardware Wallets.

@hactrox this is super needed. When is it coming?

Already planned

Already planned

When do you think it would be released? Any estimate?

A thousand years at a glance. Yeah, we have supported it now 🎉🎉🎉.


Has anyone used UI Testing with react native?

Has anyone used UI Testing with react native?    I asked the question here:
http://stackoverflow.com/questions/34302710/has-anyone-used-ui-testing-with-react-native

Have you tried changing upper case U to lower case?
like \ue00e Getting Started \ue00c

@ultrabook Thanks for the idea.  I tried that just now and unfortunately it didn't help.


[6.2.0] Handler functions cause re-rendering

Hi,
been experimenting with this addon. I noticed that functions created as handlers cause re-rendering:

This is my minimal setup:
const TextInput = props => (
  <TextField
    name={props.name}
    value={props.input.value}
    onChange={props.input.onChange}
    onFocus={props.input.onFocus}
    onBlur={props.input.onBlur}
  />
);

const Form = props => (
  <form onSubmit={props.handleSubmit}>
    <Field
      name="test"
      component={TextInput}
    />
  </form>
);

export default reduxForm({
  form: 'test',
})(Form);

You can see in the screenshot that onChange, onFocus and onBlur's identities change.
Am I wrong, or is it possible to be adjusted?

I was digging through the code and found this. I suspect it's because the arrow function creates a new identity every time the props change.
I will try to submit a PR, although it may take some time 😄  never contributed before and it's one hell of a codebase.

Created a PR: https://github.com/erikras/redux-form/pull/2161
TODO:

[ ] separate handler logic
[ ] write tests

Let me know if you require any adjustments regarding codestyle and such. 😄

Help needed: the PR has broken a whole bunch of tests. I can fix them, however, I'd prefer if a core maintainer reviewed the changes so I don't do redundant work

PR progress:

fixed tests
fixed coverage

https://github.com/erikras/redux-form/pull/2161

Yep, #2161 did it, closing! And thanks @oreqizer!


Add more contributors!!!

@all-contributors please add aikarjal for fundingFinding

@all-contributors please add IsNoGood for fundingFinding

@all-contributors please add yanne for coding

@all-contributors please add xylix for coding

@all-contributors please add robocorp for support

@all-contributors please add robocorp for financial

@all-contributors please add Snooz82 for ideas and testing

@all-contributors please add boakley for ideas

@all-contributors please add maaretp for userTesting

@all-contributors please add karlosmid for userTesting

@all-contributors please add Aspargillus for userTesting


Reproducable crash - Downloading WiiTDB first launch

On a fresh install, the first time you launch, if you try to view the Database tab while it is downloading, it throws a cross thread error. Because this functionality lives in a different form. Either we need to migrate this functionality to frmMain, or disable the Database tab until it is finished downloading.

On a fresh install, the first time you launch, if you try to view the Database tab while it is downloading, it throws a cross thread error. Because this functionality lives in a different form. Either we need to migrate this functionality to frmMain, or disable the Database tab until it is finished downloading.

The best option at the moment is to disable the Database tab until the download is complete.
Another option would be to return the warning indicating the need to download the XML file via WiiTDB, giving the user the option of downloading or not at that moment.
It is also interesting to return the progress indicator for the file download via WiiTDB.

This has been addressed with https://github.com/AxionDrak/GameCube-Backup-Manager/commit/4065b05ed044af215b8281df1c950fdeb9fe91cd.
Expected behavior:

Program checks for WiiTDB file && Network Connection
if not connected, move on
If connected, and no file, spawn a new frmWiiTDBDownload , download file, move on
If connected and file, move on


Switch debian 12+sid to systemd-timesyncd

Remove chrony config for 12+sid (configs for 10+11 are upstream)

Add systemd-timesyncd config for GCE

Select the fai classes appropriately

Test for this change is here: https://github.com/GoogleCloudPlatform/guest-test-infra/pull/753

/lgtm


Ignore node_modules and other gitignore'd items in subdirs

Reproduce by running first couple of steps in ./examples/k8s/README.md:

Something to squeeze in please when there's a moment @degrammer.


UserPreferences issues with translation and hotkeys

Bug Report
A couple of bugs were found and they will be described below:
Issue 1: Translation not cancelled
On UserPreferences modal, if user selects another language (i.e. Spanish) and clicks on Cancel, the toolbar and some of the other page elements will be translated into the selected language, even though the user cancelled the language selection. This is happening on StudyList page and on Viewer page.
Steps to Reproduce:

Open Preferences modal
Go to General tab
Select Spanish language
Verify that the header and toolbar gets translated behind the modal
Click on Cancel button
Verify that the header and toolbar remain in Spanish, even though the user cancelled the language selection.

Issue 2: Options overlay not being translated

On StudyList page, if user selects another language on the Preferences modal, the Options overlay is not being translated. After selecting Spanish and navigating to Viewer page, the Options overlay gets partially translated to Spanish and won't change back to English, even if user selects English on Preferences modal.

The option Preferences is being displayed only in English and is not being translated.

Study List page

Viewer page

Issue 3: "Reset to Defaults" button closes the modal
If user clicks on "Reset to Defaults" button, the Preferences modal is closed and the user has to open it again to make sure it restored default values.
Acceptance Criteria:

After user clicks on "Reset to Defaults" button, the values should be restored and the modal should remain open.
a) If user clicks on "Save" button, then the default values are saved and the modal is closed.
b) If user clicks on "Cancel" button, then the default values are not saved, the previous values are kept and the modal is closed.

Issue 4: No Zoom In limit for hotkeys
When user is zooming in through the mouse he/she can reach a limit of zoom. When user is zooming in by using hotkeys, there is no zooming limit.
Expected result
The hotkey zooming in should respect the same limit as the mouse zooming.

Issue 5: Hotkeys with "shift" not being detected on viewport
On Preferences modal, if user tries to add hotkey + without using a Numpad, the Preferences modal will recognize the pressed hotkeys as shift+ +, but if the user tries using the same key combination on the viewport, the hotkey detected is + and not shift+ +.
The same happens when user adds any hotkey that is a combination of shift + <secondary symbol>, where a secondary symbol can be considered as: +, _, ), (, *, &, %, $, #, @, !. For example:
Preference modal hotkey detected: Shift+(
Hotkey detected on viewport: (
Issue 6: "Reset to Defaults" button doesn't reset selected language
On Preferences modal, if user selects another language (Spanish) and clicks on "Reset to Defaults", the language is not restored to English.
Steps to Reproduce:

Open User Preferences modal
Click on General tab and select language "Spanish"
Click on Save button
Open User Preferences modal again
Go to General tab and click on "Restore to Defaults" button

Actual Result:

Verify that the content still in Spanish.
Verify that the selected language in the dropdown still as Spanish

Expected Result:

The content of the application should be changed back to English
The selected language in the dropdown should be changed back to English

Acceptance Criteria:

After user clicks on "Reset to Defaults" button, the values in the active tab should be restored and the modal should remain open.
a) If user clicks on "Save" button, then the default values are saved and the modal is closed.
b) If user clicks on "Cancel" button, then the default values are not saved, the previous values are kept and the modal is closed.

Issue 7: "Save" button doesn't save changes on both tabs
On User Preferences modal, if user makes changes on both tabs (Hotkeys and General) and clicks on "Save" button, only the content of the active tab is being saved.
In this scenario, if the user wants to make changes on both tabs, he/she has to go to Hotkeys tab update it and save. Then open the User Preferences again, go to General tab, update it and save.
Acceptance Criteria:
To improve user experience:

"Save" button should save all changes made in both tabs and close the Preferences modal
"Reset to Defaults" button should reset the values only on the active tab and the Preferences modal should stay open.
a) If user clicks on "Save" button, all changes made in both tabs should be saved and Preferences modal should be closed.
b) If user clicks on "Cancel" button, all changes will be ignored (default values won't be saved), and Preferences modal should be closed.
"Cancel" button should ignore all changes made in both tabs and close the Preferences modal.

Assigning @rodrigolabs for at least the first issue of this ticket.

@rodrigolabs to help you out..
please use the following branches:
https://github.com/OHIF/Viewers/pull/1203
https://github.com/OHIF/Viewers/pull/1150
Branches above will partial fix some of the issues. (I`m about to finish its reviews)
also I found out an issue on language configuration based on changing language from userpreference modal.
Looks like there is something missing on i18n set up.
See the image below. There is no resource for given lng ('eng'). But if instead I hack this object doing something like: this.options.resources["en"] = this.options.resources["en-US"]

The bulk of these issues have been addressed in a recent merge. We intend to do some clean-up on 12/2 that will create related issues. If anyone notices a regression, please reference this issue in your new ticket/issue ^_^


is there away to find incoming and

Is there any helper function to find number  of incoming and outgoing edges?

Hey. There is a helper function getOutgoers. You can find it in the Readme. Unfortunately there is no getIncomers. We will add it soon

thank you
On Wed, Aug 26, 2020 at 1:32 PM Moritz<EMAIL_ADDRESS>wrote:

Hey. There is a helper function getOutgoers. You can find it in the
Readme. Unfortunately there is no getIncomers. We will add it soon
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/wbkd/react-flow/issues/461#issuecomment-680725381,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHDSHBVNB456PKMV4EHNBQDSCS6RDANCNFSM4QLL6M3Q
.

added in v5.9.0

Hey @moklick
I'm getting that getIncomers doesn't exist and I'm using 5.9.2.
Also looks like the docs are using the same messaging as getOutgoers.

getOutgoers = (node: Node, elements: Elements): Node[]

Oh! I will correct that. The function should work with v5.9.3.


Feature Request : Please add option to prevent bruteforce from dictionary

I tried to add option that ignores collection from dictionary file but since I have no prior knowledge of coding in ruby I could accomplish it.

Aquatone has option to disable certain collectors. One can disable brute forcing by disabling dictionary collector as
aquatone-discover --disable-collectors dictionary


feat: add jdxcode/rtx

jdxcode/rtx: Runtime Executor (asdf rust clone)
$ aqua g -i jdxcode/rtx

How to confirm if this package works well
Reviewers aren't necessarily familiar with this package, so please describe how to confirm if this package works well.
Please confirm if this package works well yourself as much as possible.
Command and output
$ rtx --help
rtx is a tool for managing runtime versions. https://github.com/jdxcode/rtx

It's a replacement for tools like nvm, nodenv, rbenv, rvm, chruby, pyenv, etc.
that works for any language. It's also great for managing linters/tools like
jq and shellcheck.

It is inspired by asdf and uses asdf's plugin ecosystem under the hood:
https://asdf-vm.com/

Usage: rtx [OPTIONS] <COMMAND>

Commands:
  activate
          Initializes rtx in the current shell
  alias
          Manage aliases [aliases: a]
  bin-paths
          List all the active runtime bin paths
  cache
          Manage the rtx cache
  complete
          Generate shell completions
  current
          Shows current active and installed runtime versions
  deactivate
          Disable rtx for current shell session
  direnv
          Output direnv function to use rtx inside direnv
  doctor
          Check rtx installation for possible problems.
  env
          Exports env vars to activate rtx a single time [aliases: e]
  exec
          Execute a command with runtime(s) set [aliases: x]
  global
          Sets/gets the global runtime version(s) [aliases: g]
  implode
          Removes rtx CLI and all related data
  install
          Install a runtime [aliases: i]
  latest
          Gets the latest available version for a plugin
  local
          Sets/gets tool version in local .tool-versions or .rtx.toml [aliases: l]
  ls
          List installed runtime versions [aliases: list]
  ls-remote
          List runtime versions available for install
  plugins
          Manage plugins [aliases: p]
  prune
          Delete unused versions of tools
  reshim
          [experimental] rebuilds the shim farm
  self-update
          Updates rtx itself
  settings
          Manage settings
  shell
          Sets a tool version for the current shell session
  uninstall
          Removes runtime versions
  version
          Show rtx version
  where
          Display the installation path for a runtime
  which
          Shows the path that a bin name points to
  help
          Print this message or the help of the given subcommand(s)

Options:
      --install-missing
          Automatically install missing tools

  -j, --jobs <jobs>
          Number of plugins and runtimes to install in parallel
          default: 4

      --log-level <LEVEL>
          Set the log output verbosity

          [default: info]

  -r, --raw
          Directly pipe stdin/stdout/stderr to user.
          Sets --jobs=1

  -v, --verbose...
          Show installation output

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Examples:
  rtx install<EMAIL_ADDRESS>     Install a specific node version
  rtx install<EMAIL_ADDRESS>       Install a version matching a prefix
  rtx local nodejs@18             Use node-18.x in current project
  rtx global nodejs@18            Use node-18.x as default

  rtx install nodejs              Install the .tool-versions node version
  rtx local nodejs                Use latest node in current directory
  rtx global system               Use system node everywhere unless overridden

  rtx x nodejs@18 -- node app.js  Run `node app.js` with PATH pointing to
                                  node-18.x

Thanks!

Released. https://github.com/aquaproj/aqua-registry/releases/tag/v3.147.0


GLRIDB-416 and GLRIDB-410

Does not seem to address 410

We need to pull out all of the items  tags, not just 'Description of Work'.


App cannot find any network

I forgot my own wifi connection and when i clicked on scan button it said that scan completed 0 networks found

What device are you using and the version of android? The app doesnt work the best with newer devices :( I need to update to work new connectivity libs and protocols that have been changed.
After you install the application, you may need to go into settings and grant the location permission as the application will be unable to access wifi capabilities.

My device is quite old. Moto G5s plus

That should work then. Did you enable location permissions in the settings for the application?

Yes

I forgot my own wifi connection and when i clicked on scan button it said that scan completed 0 networks found

just go to app info and give the application location permission

@Shockshwat @brian404 I found a flutter library to manage wifi connections. I will be writing a flutter application this week to try and replace this application as I wrote it years ago. If you guys have any feature requests or such please reply to this thread or feel free to pm me.

Probably make it work on Android 11 ?
Because i just upgraded my phone via custom rom and i am in Android 11 now


⚠ Bofrost.de has degraded performance

In f73ff97, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 1804 ms

Resolved: Bofrost.de performance has improved in f4a78bb after 1 hour, 31 minutes.


How did you make the iOS shortcut open up in a new app?

Something I've noticed with this app is that unlike traditional ios emulators, which run via some kind of jailbreak app, this app is installed via Safari's "home button" feature. This is a pretty common strategy, I know, but what separated this app from other apps like this was that

It opened as its own app, completely separate from Safari.

It's clearly running on Safari, but it has the address bar minimized/hidden, something that I can't seem to accomplish on my own website.

How do you do this? It's almost like it's a separate app, but it's clearly running in Safari. How can I do this myself?

It's called a Progressive Web App (PWA).
More info here: https://developers.google.com/web/progressive-web-apps/

@IoIxDButStronger If I remember correctly, the key is to add something similar to the following to the HTML head of your page:
    <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

This will prevent scaling, and allow it to open as a separate app (rather than a link in Safari).
Closing this issue as 'invalid' as it's not actually a problem with Game Play. 🙃

I vaguely remember being told this back then by somebody else as well, and for whatever reason I could never get it to work. It's been so long that I don't remember why it didn't work, it just...didn't work. A month later, I got fed up with the ability to do anything cool with my iPhone without jailbreaking and I switched to Android.
Ironically, last month my Android broke and I was forced to go back to an iPhone until I can fix my other phone, and I ended up just jailbreaking my phone. It's not really as damaging or hard as I once thought it was, and/or as it probably once was.


Possible Memory Consumption

I am planning on using this to open and import thousands of DXF's per week. This will run as a service. I will be loading the DXF's to extract the MText objects and then no longer need the DXFDocument. How do I dispose of the document in this scenario?
Any code examples?
I do not see an IDisposable implementation.

There is no need for the DxfDocument class to implement the IDisposable interface. It is only required for types that need to release unmanaged resources, and this is not the case. The Net's garbage collector takes care of the allocation and release of memory for your application.
The only available examples can be found in the TestDxfDocument project.

Thanks for the response. I will check out the test examples.


Do not recursively call itself from bsf/bsr bodies if pointers are 64 bits.

It didn't cause tester failure because dmd uses intrinsic even if there is a function implementation.
This is a fixup for pull #1452.

Both would work. I'd prefer version on a module level b/c it doesn't require semantic analysis or interpretation (which isn't a problem for the size_t check but can cause forward reference issues for more complex stuff).

Fixed DDoc failure.

Inspired by our discussion: DMD PR #5377 and dlang.org PR #1220.

Another question that occurred to me while looking into the version issue - what is size_t on version(D_X32)?
I expect that size_t.sizeof == uint.sizeof, but that would mean that all the core.bitop intrinsics that take size_t need to be changed to take ulong on version(D_X32), since registers are still 64-bit.

All compilers that support X32 (one) overrides uses of all core.bitop functions and 'just does the right thing depending on input size'

I can't see why there aren't two distinct overloads. One for uint and the other for ulong.   If the compiler can treat either as a builtin then great!  Otherwise have soft implementations for both.

Then again, I don't treat any of these functions as functions for assembler opcodes, so my opinion is biased.

Ping, the docs are still broken.

Ping, the docs are still broken.

Added dmd bug 15818 workaround.

Isn't the problem overloading size_t against ulong on 64-bit?

Isn't the problem overloading size_t against ulong on 64-bit?

The problem is documenting both size_t and ulong functions. As size_t is documented as size_t, not as ulong, ulong declaration should also be documented. Also there is no overloading on 64-bit, just two equal declarations.

The problem is documenting both size_t and ulong functions.

Will the compiler still recognize the intrinsics, if you just drop the use of size_t in favor of separate uint and ulong overloads, like ibuclaw suggested earlier?
(The body of the uint version would just forward to the ulong one on 64-bit.)

Auto-merge toggled on

Will the compiler still recognize the intrinsics, if you just drop the use of size_t in favor of separate uint and ulong overloads, like ibuclaw suggested earlier?

Yes it will

@MartinNowak

Yes it will.

That sounds like a much cleaner solution to me, then.
(Although I'm still OK with merging this as is, if everyone would rather just move on.)

Will the compiler still recognize the intrinsics, if you just drop the use of size_t in favor of separate uint and ulong overloads, like ibuclaw suggested earlier?

Yes it will, that would be the cleaner solution.

So basically, this:
/**
 * Scans the bits in v starting with bit 0, looking
 * for the first set bit.
 * Returns:
 *      The bit number of the first bit set.
 *      The return value is undefined if v is zero.
 */
int bsf(uint v) pure
{
    version(D_LP64)
        bsf(cast(ulong)v);
    else
    {
		for(int b = 0; b < 32; ++b)
		{
			if(v & (1u << b))
				return b;
		}

		return -1;
    }
}
/// ditto
int bsf(ulong v) pure
{
    const sv = Split64(v);
    return (sv.lo == 0)?
        bsf(sv.hi) + 32 :
        bsf(sv.lo);
}

/**
 * Scans the bits in v from the most significant bit
 * to the least significant bit, looking
 * for the first set bit.
 * Returns:
 *      The bit number of the first bit set.
 *      The return value is undefined if v is zero.
 */
int bsr(uint v) pure
{
	version(D_LP64)
		bsr(cast(ulong)v);
	else
	{
		for(int b = 31; b >= 0; --b)
		{
			if(v & (1u << b))
				return b;
		}

		return -1;
	}
}
/// ditto
int bsr(ulong v) pure
{
    const sv = Split64(v);
    return (sv.hi == 0)?
        bsr(sv.lo) :
        bsr(sv.hi) + 32;
}

But with a more efficient fall-back implementation for uint than I wrote just now?
Should I just submit a new pull request, or does @denis-sh want to update this one?

Yes it will, that would be the cleaner solution.

IMO, no.

Should I just submit a new pull request, or does @denis-sh want to update this one?

Submit a new pull request, I'm against this solution as for me it is clearly useless. There is no reason for uint overload in 64 bit mode as it gives us nothing and may waste performance on cropping its argument.

There is no reason for uint overload in 64 bit mode as it gives us nothing and may waste performance on cropping its argument.

Why would it have to "crop its argument", given that the uint overload would only be selected when the input is already 32-bit?

Why would it have to "crop its argument", given that the uint overload would only be selected when the input is already 32-bit?

I was thinking about some imaginary uint operation sequence which can be optimized as ulong operation sequence on 64 bit machines. I'm not sure it's really possible, but also I can't proof it is impossible.

That seems like a weak reason to reject the more straightforward solution that the rest of us favour. I really doubt that would be a problem, as long as the uint overload inlines properly - which I can verify with pragma(inline, true).

I have submitted an alternative pull request.
When I thought about it more, I realized that it makes no sense to fix the recursive call issue - which can cause practical problems only if the intrinsic is not available - without also providing a working non-intrinsic code path to follow. So, I added a proper software fallback implementation of the bit scan algorithm, too.

That seems like a weak reason to reject the more straightforward solution that the rest of us favour.

Yes, lets add needless uint overload which has no reason to exist. I probably need to visit some psychiatrist as I definitely loose connection with reality as I still sure there must be a reason for function to exist in a library.


FDBM on GPU

Just opening this issue to say that I'm working on making an OpenCL implementation of the full density-based model (FDBM) according to https://doi.org/10.1021/acsnano.8b08209 and https://doi.org/10.1021/acs.jcim.1c01323. The CPU-only version already exists via the scripts conv_rho.py and relaxed_scan_PVE.py. I will make pull request when it's ready.

Formulas for damping: https://manual.q-chem.com/5.2/Ch5.S7.SS2.html if necessary.

So the odd vdW term was for damping. It is not very ideal, so a new issue was created for fixing that at #48 .


Refactor current comparators to lombok

Less code to maintain with shorthands like Comparator.comparing.

For later.


Add the ability to get WFS attribute option list via a script

Geomoose v2.6 had an "ajax_select" to get a list for feature editing service combo box via a URL:
  <input type="ajax_select" name="feature:featuretype_id"  title=" Type: " value="1">         <url>php/getFeatureTypes.php</url>   </input>
And I see that Jim has added combo box ability to the new Geomoose v2.8 WFS mapsource definition: so we can do things like:
  <attribute name="featuretype_id"  type="select" label=" Type: " default-value="1">             <option value="1">Iceberg</option>             <option value="2">Tabular Iceberg</option>
But it would be nice to get the list via an ajax script.  Something like:
  <attribute name="featuretype_id"  type="ajax_select" label=" Type: " default-value="1">             <url>php/getFeatureTypes.php</url>   </attribute>

Added support.

Failed testing.  For testing, I added the following to the mapbook for mapsource census_cities:
	<attribute name="lsad10"     type="ajax_select" label=" Type: ">
		<url>php/getFeatureTypes.php</url>
	</attribute>

and created php/getFeatureTypes.php:
';
  print 'City';
  print 'Place';
  print '';
  ?>
While the list renders properly in the attribute dialog, GeoMOOSE sends TinyOWS  invalid(-ish)  XML (note the blank wfs:name at the bottom):
wfs:Propertywfs:Namelsad10</wfs:Name>wfs:Value25</wfs:Value></wfs:Property>
:
wfs:Propertywfs:Nameintptlon10</wfs:Name>wfs:Value-093.0321235</wfs:Value></wfs:Property>
wfs:Propertywfs:Name</wfs:Name>wfs:Value25</wfs:Value
Even if the blank name was filled in, it would conflict with the other value in the list with the identical name, so that needs to be fixed too.

I found the booger.  The ajax_select was setting "this.options =... this options list" instead of "this.options['options'] = this options list".
The situation should now be mended.

Tested, fixed!


if batch loader sepcified as symbol, user should define it before usage

This way we can find error about not existing batch loader earlier.
Most of the time user will not reuse loaders, as they are quite unique by nature. But if they want to reuse it, they will probably define it in parent serializer, so it should not be a problem

Merged in v0.18.0


Dark Theme?

Could you add a dark them please.

Feature added in the new release! https://github.com/Astropilot/ValheimTooler/releases/tag/v1.9.0


Allow client to specify whether or not to filter Thread control traffic.

Resolves #419.

LGTM :+1:

This definitely gets the job done, but I'm curious why you opted to make this a new parameter to an existing function rather than just make a new function for setting or clearing the value?

I'm open to either approach and wavered on which way to go.  I updating the existing function to explicitly tie the option to setting up the callback itself.  I figured any change to the filter parameter could be done by calling otSetReceiveIp6DatagramCallback() again.
If you prefer, we could go with something like otSetReceiveIp6DatagramCallbackFilter().  Open to less verbose naming options.

I think that would be cleaner. I was planning on adding it as a spinel property that could be turned on or off for debugging purposes. Would be convenient to not have to specify the callback every time.

@darconeous @nibanks, updated to address your comments.

LGTM 👍

👍

Thanks! LGTM :+1:


Support @JsonTypeInfo(visible=true)

which allows for the deserializer to set the type discriminator as an ordinary property

ive modified it slightly, internally it's very similar (still JsonNode) but i've moved the "duplication logic" to the demuxing decoder and only apply it to the property where it's necessary. In other cases I still use normal decodeBuffer.
The reason for this change is that I want to avoid expanding the contract for decodeBuffer. Right now, decodeBuffer does not permit "aliasing": It does not allow two decodeXYZ calls to the same value, even if it's been buffered at some point. This guarantee may be helpful in the future for efficiency improvements such as lazy decoding, jackson TokenBuffer etc.

@dstepanov when you planned release these changes? Want also add fix in micronaut-openapi for version 5.2.0

Probably with 4.2 platform release next week


Creating duplicate files in cache with unique file names

As it seems when I try to load an PDF from assets. The Widget creates an copy of the file with unique file name as a cache in app folder.
But as I can see if we reopen the same PDF it creates the duplicate of that same file with new file name. Which results in unnecessary feeling of memory in the cache.
I did not found any inbuilt way in the library itself to get rid of that cache or to validate if that file already present in the cache.
I am attaching detailed Screen shots what I am trying to explain

As you can see I am trying to open this image two times.
D/PDF_RENDER(10331): OpenAssetDocument. Created file: /data/user/0/com.mahayoga.user/cache/59abc52f7cbe4e0fae57c6f6e25d744d.pdf
D/PDF_RENDER(10331): OpenFileDocument. File: /data/user/0/com.mahayoga.user/cache/59abc52f7cbe4e0fae57c6f6e25d744d.pdf
D/PDF_RENDER(10331): OpenAssetDocument. Created file: /data/user/0/com.mahayoga.user/cache/ee6e681802fa426cbb236c7d8b632a18.pdf
D/PDF_RENDER(10331): OpenFileDocument. File: /data/user/0/com.mahayoga.user/cache/ee6e681802fa426cbb236c7d8b632a18.pdf

Which results in creation of this much duplication if we don't handle cache manually

So If there some issue from side to understand the documentation please show me the right direction else. Please provide an inbuilt method to manage duplication.

Any replies on this ?

I need to be sure cached documents are disposed when disposing the pdf-renderer.
Any news here?

@nachikamod  Did you find any solution? I'm facing the same problem.

Not in the library @Firas-Amin but I implemented a crude (Brute force approach) solution. Which basically reads the cache and clears all the pdf files. Now since we can't know the file name saved in the cache, because the library saves this file in the cache with randomly generated names, I delete all the cache pdf files instead.

// Run this two lines before opening any pdf file
String _cacheDir = (await getTemporaryDirectory()).path;
new Directory(_cacheDir).delete(recursive: true);

// Open pdf file here

So, this is simple implementation you can employ with path_provider package which basically reads application's cache directory and delete all the contents. But you can modify this by reading the directory and only deleting the pdf files unlike I am clearing out all the cache (Cause, my application didn't required file caching so only thing was caching was of from this library).

Thank you for the code @nachikamod. For some reasons, it seems it doesn't clear the cache while navigating between pages.
For example, I have a PDF file with 80mb size. When the user starts the application, 80mb cache added to the application and when they go to the index and pick different page from the PDF and navigate to it another 80mb added .

Let's connect on discord

Let's connect on discord

FirasXD#1193

Check my request as 4RB1TR4RY#1264

Any updates on this? This is important

Any updates on this? This is important

No updates yet from the maintainer.


Warning status not propagated correctly to Kyma CR

Description
Module in the warning status is listed as processing in Kyma CR.
Expected result
Module in Kyma CR and Kyma CR itself has state: Warning
Actual result
Module in Kyma CR and Kyma CR itself has state: Processing
Steps to reproduce

provision k3d cluster
deploy KLM
deploy the BTP Manager module template and enable it
BTP Manager is in a Warning state due to the missing secret
Kyma CR lists BTP Manager as Processing, Kyma status is Processing as well

ok, some summary. This is a blocker where btp-manager cannot be promoted to production where some customers awaiting btp-operator bugfixes.
PR blocked, fast: https://github.tools.sap/kyma/kyma-modules/pull/148
PR blocked, regular: https://github.tools.sap/kyma/kyma-modules/pull/149
To help customers I will merge those two PRs with admin mode.

@janmedrek ok issue is much bigger than we thought. We merged our btp-mansger on fast, and it is in processing even if btp-operator is in READY state.


Allow wildcard value for namespaces in Alert eventSources

Allow wildcard value for namespaces in Alert eventSources.
Fix: https://github.com/fluxcd/notification-controller/issues/71
At the moment we have to create a list of all HelmRelease objects, for example, in the eventSources section to be able to get notifications about them. We also need to update the list whenever a new object is added. That requires lots of effort. It seems that the best way is to allow wildcards for namespaces.
How the Alert eventSources definition looks now:
  eventSources:
    - kind: HelmRelease
      name: '*'
      namespace: 'service1'
    - kind: HelmRelease
      name: '*'
      namespace: 'service2'
...
    - kind: HelmRelease
      name: '*'
      namespace: 'service99'

How it would be after the change:
  eventSources:
    - kind: HelmRelease
      name: '*'
      namespace: '*'

There are security concerns related to this feature that were articulated in #71 (e.g. https://github.com/fluxcd/notification-controller/issues/71#issuecomment-991049078). Given the mentioned RFC has never been merged, we need to think this over.
In any case this will need to be held until notification-controller 1.0.0 has been released. Let's please take the time to completely discuss the threat model and potential mitigations here.

I thought that disabling cross-namespace references should solve the security concern as was said there:
https://github.com/fluxcd/notification-controller/issues/71#issuecomment-1374690404. I agree that using ReferenceGrant should improve the security boundaries. Still, it seems to be orthogonal to the Alerts setup. notification-controller can listen to events in any namespace anyway if the cross-namespace references flag is enabled. If this is inappropriate cluster admin can disable cross-namespace references.
Are there any ongoing discussions about the threat model? I see that https://github.com/fluxcd/flux2/pull/2092 and https://github.com/fluxcd/flux2/pull/2093 were closed both to wait for https://github.com/kubernetes/enhancements/blob/master/keps/sig-auth/3766-referencegrant/README.md

any update on this?

Hi! Is it correct to say that this PR is still on hold and we are waiting?

Hi! Is it correct to say that this PR is still on hold and we are waiting?

Yes, pretty much. Current consensus is that we want to wait for the Kubernetes ReferenceGrant API to become GA which will definitely take a couple of Kubernetes releases to come.

This feature request seems irrelevant to ReferenceGrant API; what ReferenceGrant will affect is all of the cross-namespace references filtering - but that'd have to work at a different level. I see no point in holding on with this PR.
The current model is pretty secure - this PR does not make it weaker.

Hi, any update on this PR?


Treesitter - invalid items recognized inside type cast

Describe the bug
Items/tokens are not recognized correctly inside type cast operator in both neovim and vscode
Expected Behavior
Correct items/tokens inside type cast
Current Behavior

enum is recognized as namespace
function call is recognized as type

for Operation:
Treesitter
  - @variable.v links to @variable v
Semantic Tokens
  - @lsp.type.namespace.v priority: 125

for from_string:
Treesitter
  - @variable.v links to @variable v
  - @type.v links to @type v

Reproduction Steps
enum Operation {
	get_area
	get_sector
}

fn main() {
	operation_name := ''
	operation := ?Operation(Operation.from_string(operation_name))   // issue with tokens
}

Possible Solution
No response
Additional Information/Context
observed on both neovim and vscode
Environment details (v doctor output)
V full version: V 0.4.4 f603035.215ab13
OS: linux, "EndeavourOS Linux"
Processor: 8 cpus, 64bit, little endian, 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
getwd: /H/_nobackup/Projects/v_sandbox
vexe: /H/daily/mh/.local/share/v/v
vexe mtime: 2024-02-10 13:18:28
vroot: OK, value: /H/daily/mh/.local/share/v
VMODULES: OK, value: /home/mh/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.43.1
Git vroot status: weekly.2024.06-33-g215ab130 (6 commit(s) behind V master)
.git/config present: true
CC version: cc (GCC) 13.2.1 20230801
thirdparty/tcc status: thirdparty-linux-amd64 99683af0
Editor name
neovim and vscode
v-analyzer Version
0.0.4-beta.1.56d7905
VS Code Extension Version
No response

It also messes up following lines, ex:
fn main() {
	operation_name := ''
	operation := ?Operation(Operation.from_string(operation_name))   // issue with tokens

	return Input{operation, parameters, body, metaparams}     // this line highlight is messed up completely
}


HL-838: Use language for strong identification

Description :sparkles:
Issues :bug:
Testing :alembic:
Screenshots :camera_flash:
Additional notes :spiral_notepad:

Codecov Report

Merging #2152 (4f2e0e7) into develop (36b198d) will decrease coverage by 9.00%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #2152      +/-   ##
===========================================
- Coverage    27.00%   18.00%   -9.00%
===========================================
  Files          722      122     -600
  Lines        14701     2904   -11797
  Branches      3336      729    -2607
===========================================
- Hits          3970      523    -3447
+ Misses       10206     2270    -7936
+ Partials       525      111     -414

Impacted Files
Coverage Δ

frontend/benefit/applicant/src/hooks/useLogin.ts
0.00% <0.00%> (ø)

... and 600 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


GitHub bmihelac -> django-import-export Account Update

Updating both the CONTRIBUTING documentation as well as the url defined
in setup tools for the package.

merged, thanks!


Repo sync for protected CLA branch

The pull request is created from main638017094809749646sync_temp to main to fix git push error for protected CLA branch

Learn Build status updates of commit 4b825f9:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the learn.microsoft.com contributor guidesPost your question in the Learn support channel


Value of type 'ModelConfiguration' has no member 'prepare'

Problem
Value of type 'ModelConfiguration' has no member 'prepare'
let prompt = modelConfiguration.prepare(prompt: formattedChat)
Solution
Fix it so that it compiles.
Additional context
No response
Code of Conduct

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

Thank you @bryan1anderson! Thank you for making the contribution and let us know how you are using the package for your project. We always welcome contributions and improvements; let us know if you are interested in contributing beyond this PR 👍

Bug fixed in: https://github.com/StanfordSpezi/SpeziLLM/pull/80


java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;

Hello.
Recently I have this java.lang.NoSuchMethodError  on:
at com.eatthepath.otp.HmacOneTimePasswordGenerator.generateOneTimePassword(HmacOneTimePasswordGenerator.java:140)
	at com.eatthepath.otp.TimeBasedOneTimePasswordGenerator.generateOneTimePassword(TimeBasedOneTimePasswordGenerator.java:143)

I guess this is something related to the latest Java 1.8 updated version. Currently I am using:
openjdk version "**1.8.0_312**"
OpenJDK Runtime Environment (Temurin)(**build 1.8.0_312-b07**)
OpenJDK 64-Bit Server VM (Temurin)(build 25.312-b07, mixed mode)

Downloaded on https://adoptium.net/?variant=openjdk8 .
Curiously this wasn't happening on previous Java 1.8 update version.
I am trying to get more information about it and will update this issue as soon as I have, however could you please take a look on this? Perhaps we have more people facing same issue.
This is the version I am using, which I believe is the latest one:
<dependency>
	<groupId>com.eatthepath</groupId>
	<artifactId>java-otp</artifactId>
	<version>0.3.0</version>
</dependency>

Thanks in advance.

I also have tried with IBM Semeru Runtime as follows:
OpenJDK 8u312-b07
OpenJ9 0.29.0

And got the same:
java.lang.NoSuchMethodError: java/nio/ByteBuffer.clear()Ljava/nio/ByteBuffer; (loaded from C:\Program Files\Semeru\jdk-8.0.312.7-openj9\jre\lib\rt.jar by <Bootstrap Loader>) called from class com.eatthepath.otp.HmacOneTimePasswordGenerator (loaded from file:/C:/Users/tcoelho1/.m2/repository/com/eatthepath/java-otp/0.3.0/java-otp-0.3.0.jar by sun.misc.Launcher$AppClassLoader@6e1a46c1).
	at com.eatthepath.otp.HmacOneTimePasswordGenerator.generateOneTimePassword(HmacOneTimePasswordGenerator.java:140)
	at com.eatthepath.otp.TimeBasedOneTimePasswordGenerator.generateOneTimePassword(TimeBasedOneTimePasswordGenerator.java:143)

Hopefully it could be solved.

This sounds like the same thing as https://github.com/jchambers/java-otp/discussions/26. I'll see what I can work out.

That exact the same thing. I believe if you compile this jar using JDK 1.8, it would work as expected.

Agreed, but I think something else is wrong; JDK versions after 8 should still be able to target JDK 8, and I'm not sure why that's not happening. In any event, I'll be able to investigate in depth this weekend.

Alright, for now I have compiled sources using JDK 1.8 and worked fine. Let me know once you have an update about it and then I can use it as an artefact dependency.
Thank you @jchambers !

There's something very fishy going on here. I pulled the .jar directly from Maven Central and inspected the contents:
$ javap -verbose HmacOneTimePasswordGenerator.class | fgrep major
  major version: 52

$ javap -verbose TimeBasedOneTimePasswordGenerator.class| fgrep major
  major version: 52

…and major version 52 is definitely Java 8. So I don't think that's the problem. I'll continue to dig.

Ah—here's the problem: https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/

I believe this should be fixed in #28 (so much for waiting for the weekend). Could you please check out that branch and let me know if things still build as expected for you under Java 8? All of the automated tests pass under Java 8, but given the circumstances, first-hand confirmation would be great, too.
Thanks kindly!

Hi @jchambers , have checked out branch release_8, run mvn clean install, and then imported the generated jar under target/java-otp-0.3.1-SNAPSHOT and it did work.
Here's the Java version that I used to achieve this result and also use on projects:
$ java -version
openjdk version "1.8.0_312"
IBM Semeru Runtime Open Edition (build 1.8.0_312-b07)
Eclipse OpenJ9 VM (build openj9-0.29.0, JRE 1.8.0 Windows 10 amd64-64-Bit Compressed References 20211022_236 (JIT enabled, AOT enabled)
OpenJ9   - e1e72c497
OMR      - 299b6a2d2
JCL      - 8860d39588 based on jdk8u312-b07)

Also the Maven version:
$ mvn -version
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: C:\apache-maven-3.8.3
Java version: 1.8.0_312, vendor: International Business Machines Corporation, runtime: C:\Program Files\Semeru\jdk-8.0.312.7-openj9\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Could you please let me know once you upload this new version to maven repository so I can use it directly on my pom.xml?
Thanks in advance.

A new release is on its way to Maven Central right now.

Have imported the new artefact 0.3.1 from maven central and successfully worked! Thank you @jchambers !


Skip rounding up cost for compute and storage cards

Added a usageFormatOptions property to format cost and usage values separately. This allows the compute and storage cards to show 2 decimal places for cost, while the usage value continues to have zero decimal places.
Fixes https://github.com/project-koku/koku-ui/issues/1087

Codecov Report

Merging #1092 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #1092      +/-   ##
==========================================
- Coverage    75.6%   75.51%   -0.09%
==========================================
  Files         228      228
  Lines        4374     4379       +5
  Branches      817      822       +5
==========================================
  Hits         3307     3307
- Misses        954      956       +2
- Partials      113      116       +3

Impacted Files
Coverage Δ

src/store/awsDashboard/awsDashboardWidgets.ts
100% <ø> (ø)
:arrow_up:

...portSummary/ocpOnAwsReportSummaryDetails.styles.ts
100% <ø> (ø)
:arrow_up:

src/store/awsDashboard/awsDashboardCommon.ts
84.37% <ø> (ø)
:arrow_up:

src/store/azureDashboard/azureDashboardCommon.ts
84.37% <ø> (ø)
:arrow_up:

src/pages/azureDashboard/azureDashboardWidget.tsx
74.81% <ø> (ø)
:arrow_up:

...store/ocpOnAwsDashboard/ocpOnAwsDashboardCommon.ts
95.65% <ø> (ø)
:arrow_up:

...eReportSummary/azureReportSummaryDetails.styles.ts
100% <ø> (ø)
:arrow_up:

...ages/ocpOnAwsDashboard/ocpOnAwsDashboardWidget.tsx
72.6% <ø> (ø)
:arrow_up:

src/pages/awsDashboard/awsDashboardWidget.tsx
74.62% <ø> (ø)
:arrow_up:

src/store/azureDashboard/azureDashboardWidgets.ts
100% <ø> (ø)
:arrow_up:

... and 5 more

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 1e36263...38a1993. Read the comment docs.


Multistage artifact download doesn't work

Hi,
I have a multi-stage pipeline:
Stage 1: Build
Stage 2: Deploy into AKS
Stage 1 produces correct artifacts. I can verify that by downloading them via Azure DevOps UI.
Stage 2 downloads artifacts by name (or at least it should), but instead it downloads the source which is used in the Stage 1. According to the docs, specifying download as current along with artifact name should suffice, but this is not the case.
Stage 1 publish snippet:
    - publish: $(System.DefaultWorkingDirectory)/artefacts/ci       artifact: bob
Stage 2 download snippet:
strategy:       runOnce:         deploy:           steps:           - download: current  # refers to artifacts published by current pipeline             artifact: bob
Artifacts should contain files from Stage, but instead they contain source. It also appears that the download happens regardless of whether I have that task or not. Is there some hidden/not documented behaviour here?
Thank you,
Viktor

Hi!
Not sure what you exactly mean by:

instead it downloads the source which is used in the Stage 1

Do you mean the source code (the repository)? This should be expected when you have a non-deployment job in the pipeline. You can disable that behavior by adding the keyword checkout: none to the job steps:
jobs:
- job: Build
  steps:
  - script: echo "doing my build and publishing my artifacts here..."

- job: Deploy
  steps:
  - checkout: none
  - script: echo "nothing will be downloaded now from your repository..."

You can read more about it here.
Unfortunately it's hard to me to say what's really happening without the YAML pipeline, so I'm just guessing 😄
Anyway, it seems to me that you are trying to use the "deployment job", so I expect your pipeline to be done similarly to this one:
jobs:
- job: Build
  steps:
  - script: echo "doing my build and publishing my artifacts here..."

- deployment: Deploy
  environment: demo
  strategy:
    runOnce:
      deploy:
        steps:
        - script: echo "all the artifacts will be downloaded automatically..."

In this scenario source code shouldn't be checked out, instead all the artifacts produced by previous jobs are automatically downloaded because a download step is injected in your pipeline. That's why:

It also appears that the download happens regardless of whether I have that task or not.

The documentation is available here.
If you want to prevent this from happening, you need to slightly change the pipeline to first disable the automatic behavior, then to select the artifacts you need to download. For example:
- deployment: Deploy
  environment: demo
  strategy:
    runOnce:
      deploy:
        steps:
        - download: none #disable the behavior
        - script: echo "nothing will be downloaded now..."
        - download: current
          artifact: bob
        - script: echo "only the artifact named bob will be downloaded..."

You can read more about how artifacts work from this page.


How to set acceptedResourceRoles?

This might be a documentation ticket. In Marathon, you can set the roles that an application can deploy to when posting an application via the REST API. In Chronos, there doesn't appear to be a way to do this.
Does this functionality exist? If so, it should be documented.

Closing this as duplicated of "#530 - support multiple roles".


gradle build error - prepublish 'jspm install'

The gradlew build exits with the exception :sagan-client:npmInstall FAILED
sagan-client/npm-debug.log states the following errors:
808 info sagan@ Failed to exec prepublish script
809 verbose stack Error: sagan@ prepublish: jspm install
809 verbose stack Exit status 1
809 verbose stack     at EventEmitter. (/home/vaclav/sagan/sagan-client/node_modules/npm/lib/utils/lifecycle.js:214:16)
809 verbose stack     at emitTwo (events.js:87:13)
809 verbose stack     at EventEmitter.emit (events.js:172:7)
809 verbose stack     at ChildProcess. (/home/vaclav/sagan/sagan-client/node_modules/npm/lib/utils/spawn.js:24:14)
809 verbose stack     at emitTwo (events.js:87:13)
809 verbose stack     at ChildProcess.emit (events.js:172:7)
809 verbose stack     at maybeClose (internal/child_process.js:818:16)
809 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
810 verbose pkgid sagan@
811 verbose cwd /home/vaclav/sagan/sagan-client
812 error Linux 3.13.0-67-generic
813 error argv "/home/vaclav/sagan/sagan-client/.gradle/nodejs/node-v4.2.2-linux-x86/bin/node" "/home/vaclav/sagan/sagan-client/node_modules/npm/bin/npm-cli.js" "install"
814 error node v4.2.2
815 error npm  v2.14.7
816 error code ELIFECYCLE
817 error sagan@ prepublish: jspm install
817 error Exit status 1
818 error Failed at the sagan@ prepublish script 'jspm install'.
818 error This is most likely a problem with the sagan package,
818 error not with npm itself.
818 error Tell the author that this fails on your system:
818 error     jspm install
818 error You can get their info via:
818 error     npm owner ls sagan
818 error There is likely additional logging output above.
Would you reccomend me next steps to take to resolve the issue? Thank you. Vaclav

I have encountered this problem on mac, and maybe it triggered by jspm.

I have solved this problem by npm install & npm build in the sagan-client directory and then run ./gradlew build in the sagan directory, hope this will help you.

@satansk I don't run npm install & npm build in sagan-client directory.

@satansk I don't run npm install & npm build in sagan-client directory.

We've moved away from JSPM and now we're using webpack with a different (hopefully more resilient setup). I'm closing this issue as a result. Thanks!


MultiTenancy: Publish-AzureStackApplicationsToARM is broken

When try to onboard directory tenant, Publish-AzureStackApplicationsToARM is broken. I showed it to Shri, but before I could capture log/error, environment is gone. I will try on another environment to provide exact error, but repro is fairly simple. just follow the doc here and this is the first call we make to publish and it fails.
Here is the error:
VERBOSE: GET https://login.windows.net/azurestackci10.onmicrosoft.com/.well-known/openid-configuration with 0-byte payload
VERBOSE: received 1365-byte response of content type application/json; charset=utf-8
Loading identity application data...
WARNING: Skipping registration of Admin application: AdminResourceManager.Azure Stack - Administration
WARNING: Skipping registration of Admin application: AdminPortal.Azure Stack - Portal Administration
WARNING: Skipping registration of Admin application: AdminPolicy.Azure Stack - Policy Administration
WARNING: Skipping registration of Admin application: AdminMonitoring.Azure Stack - Monitoring Administration
VERBOSE: Performing the operation "Creating the resource..." on target "/subscriptions/689b4909-7937-4787-b194-2e142df57d5b/r
esourceGroups/system/providers/Microsoft.Subscriptions.Providers/applicationRegistrations/ResourceManager.Azure%20Stack".
New-AzureRmResource : InvalidRequestContent : The request content was invalid and could not be deserialized: 'Could not
find member 'directoryRoles' on object of type 'ApplicationRegistrationPropertiesDefinition'. Path 'directoryRoles'.'.
At C:\AzureStack-Tools\AzureStack-Tools-master\Identity\AzureStack.Identity.psm1:394 char:34

... plication = New-AzureRmResource @params -Force -Verbose -ErrorAction  ...

            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : CloseError: (:) [New-AzureRmResource], ErrorResponseMessageException
FullyQualifiedErrorId : InvalidRequestContent,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzur
eResourceCmdlet

PS C:\AzureStack-Tools\AzureStack-Tools-master>

This should no-longer be required, this was an old temporary workaround from an earlier azure stack build.


Add support for Rails 5.1

Thank you, but closing in favor of #185, because of additional tests added to the build matrix there.