text:
XPath get fails if root node has xmlns definition

I am attempting to use libxmljs to update some variables in my Cordova Project's config.xml, however I have determined that due to Cordova's inclusion of an xmlns attribute on the widget root node, XPath always fails no matter if I include the definition again.
I have included a default Cordova project config.xml as follows:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.parse.issue" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>ParseIssue</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
</widget>

The following code returns undefined:
var xml = fs.readFileSync('./config.xml');
var doc = libxml.parseXmlString(xml);

var platforms = doc.get('//name', {'widget': "http://www.w3.org/ns/widgets"});
console.log(platforms);

Unless I remove the xmlns, in which case it returns the expected node: <name>ParseIssue</name>.
I have looked at a number of issues here but none offer a working solution.
Ultimately I could remove the xmlns from the root node, but this seems like a bug that ought to be addressed nonetheless.
Thanks

Workaround: you must define a namespace and use in the xpath. For example:
gulp.src("config.xml")         .pipe(xmlTransformer([             { path: '//n:name', text: 'app name' },             { path: '//n:description', text: 'app description' },             { path: '//n:widget', attr: { 'id': 'app.com' } },             { path: '//n:widget', attr: { 'version': '1.0.0' } }         ], {n: 'http://www.w3.org/ns/widgets'} ))         .pipe(gulp.dest("./"));
note "n" before each xpath and " n" defined as namespace (http://www.w3.org/ns/widgets) as a object in second argument.

Or in terms of the libxmljs software:
            const xmlns = doc.root().namespace().href();
            const identifier = doc.get('//xmlns:Identifier', xmlns);

authors: Smashman correaignacio jeff-bonevich

repo: libxmljs/libxmljs


text:
🛑 Backend - US is down

In 8675c7e, Backend - US (https://api.us.licenseware.io/licenseware/) was down:

HTTP code: 503
Response time: 9449 ms

Resolved: Backend - US is back up in 283de8b after 5 minutes.

source: gharchive/issue

repo: licenseware/uptime

license: MIT

license_type: permissive

license_source: github-api


text:
🛑 Backend - US is down

In ff19f7c, Backend - US (https://api.us.licenseware.io/licenseware/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Backend - US is back up in ffe598a after 10 minutes.


text:
WxMsg增加receiver接收者wxid字段, 解决私聊场景下无消息接受者的问题

fixbug: #51

这个还没想好要不要加，比较别扭。

感觉接收者有必要加， 就看怎么加了

接收者不是自自己就是对方

Fix since v39.2.x

source: gharchive/pull-request

authors: lich0821 rehiy zsjinwei


text:
replace S3 Archive with Google Cloud Storage

resolves #15

Coverage increased (+0.5%) to 31.25% when pulling d643b59e23fa6f507b482ce9738506df037ef682 on cv/dl_from_gcs into 5785d24622172ee67ac3130b6676354fd757ecef on master.

authors: chrisvaughn coveralls

repo: lifechurch/dnaquery


text:
Multiple Slides at once

How can i modify this to have say 3 items in the carousel at once? then cycle + or - one item when i click prev / next?

Could you please clarify your issue? What do you mean by "at once"? You can specify multiple slides, see Demo.

Sorry for the confusion. I am trying to show multiple items at once.
I am trying to show 3 slides at once on the page and cycle back and forth by one slide at a time instead of just cycling and displaying one slide at a time.

I think I know what you mean. A possible workaround is by adjusting the CSS I think

authors: jessedvrs paulchill

repo: lifelynl/angular-carousel

license: mit

license_source: bigquery


text:
As a Designer, I'd like to be able to quickly get the Lexicon font families

Is your feature request related to a problem? Please describe.
I don't have some of the fonts on the typography page installed — yes I could google them, but I am lazy.
Describe the solution you'd like
I'd like to be able to click the typeface names in the grid and either download them directly, or go to a site to get them.
Describe alternatives you've considered
Could also have a zip file with all the fonts, but this could be more work to maintain.

Some
https://developer.apple.com/fonts/
https://design.ubuntu.com/font/
https://docs.microsoft.com/en-us/typography/font-list/segoe-ui

authors: plhnk victorvalle


text:
Fix accessibility issues created by unnecessarily restricting scroll events

Because I am a very smart person™ I thought it would be a great idea to hide everything that was outside of the horizontal viewport at the body selector level.
Turns out, this is not a good idea — which, had I thought about it for more than a second, I would have realized. Because, when you do something like this at such a high level, you cannot possibly forsee the situations when...you actually would not want this in a lower level template or component.
So, the lesson here is — take the time to write clean code in the first place, if something is giving you horizontal scroll and you don't want it, then fix it at that level...don't go so high up in the tree.
This should solve #660 — it will probably create more issues, so as you see them, please report. I've already fixed one in the Articles template.

@chrberndt and @jacobcerda please check out the deploy preview and let me know if this solves #660 — thanks!

cc @victorvalle @drakonux

Hi @plhnk !
I believe one of these changes introduces the following bug

A dark stripe after the main article image.

ahhh thanks @victorvalle — I didn't check that in the preview...looks fine in my local, but yes I see that now... sending a fix

@plhnk There's still no scrollbar but I am able to scroll using arrow keys now! :+1:

authors: jacobcerda plhnk victorvalle


text:
Works with Rust 1.43

I just checked if hexf 0.2.1 can compile with Rust 1.43 and it seems to work just fine. Was there any particular reason for the MSRV of 1.45? If possible I'd appreciate it if the MSRV could be lowered to 1.43 (at least for versions 0.2.x), as this would allow me to use hexf-parse for gfx-rs/naga#1184.

That change came from #9, so I just thought its minimal requirement was 1.45. I don't think there was concrete background to decide it. Would you make a PR to change README and CI configuraiton to change the rust version?

Sure, thanks for being open to this ^^

authors: hcsch youknowone

repo: lifthrasiir/hexf


text:
长按后弹出的UIMenuController,点击删除会闪退，因为没有实现delete方法

长按后弹出的UIMenuController,点击删除会闪退，因为没有实现delete方法

UITextView 的 UIMenuController 貌似没有 delete 的选项吧 ?

有，这是测试给我提的BUG

有，这是测试给我提的bug
在- (BOOL)canPerformAction:(SEL)action withSender:(id)sender 里面加了判断
if(action ==@selector(delete:))
{
return NO;
}
这样就把删除隐藏了

判断弹出 UIMenuController 的选项, 我是这样判断的, 如果 [super canPerformAction:action withSender:sender] 返回的是 YES 我才根据 FSTextView 的属性 canPerformAction 来判断是否需要弹出 UIMenuController 选项. 如果基类 UITextView 都无法实现的 action 是会返回 NO 的. 可能你用的是以前的 FSTextView 版本, 如果你是使用 Cocoapods 引入 FSTextView 的话, 那应该是上一个版本的遗留问题, 最新的版本我还没有更新到 Cocoapods 上, 因为我最新正在修改 FSTextView, 准备下个版本再更新到 Cocoapods 上, 你看看你项目里的 FSTextView 的下面这个函数是否和这里的一致.
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
    BOOL result = [super canPerformAction:action withSender:sender];
    if (result) {
        result = _canPerformAction;
    }

    return result;
}

写法是和这里一致的，但是很奇怪，我能看到删除，但是点击删除就闪退
-[FSTextView delete:]: unrecognized selector sent to instance

我更新了一下代码, 同时也把最新版本更新到 Cocoapods 了, 你更新最新的版本试试, 感谢你的反馈. 🙂

authors: lifution luckyzd

repo: lifution/FSTextView


text:
Broken link to cert file

SSL Support section -> Install the ca-certificate-rsa.cer file in your browser ....
Looks like this file is located at https://github.com/lightbody/browsermob-proxy/blob/master/browsermob-core/src/main/resources/sslSupport/ca-certificate-rsa.cer

It is broken! Sorry about that, thank you for noticing it. I've updated the link!

authors: jekh madoni

repo: lightbody/browsermob-proxy


text:
[feature]: Support asset script reuse during minting

Currenlty the mintin process does not allow for explicitly creating multiple assets from different asset IDs with the same script key. During MarkBatchConfirmed we use the script key as the unique identifier for the asset. We should add the actual 32-byte asset ID into that query to support asset script reuse over different Asset IDs.
https://github.com/lightninglabs/taproot-assets/blob/1083cf1dd0cc32ab70fbda1e758ffec87435636b/tapdb/asset_minting.go#L1617

Now that users can provide external script keys, many of the assumptions about per-batch script key uniqueness are now invalid. The only enforced-unique field for batches is the asset name.
We could use TapCommitmentKey() + AssetCommitmentKey() as the unique ID here.

authors: gijswijs jharveyb

repo: lightninglabs/taproot-assets


text:
Add total number of payments in REST GET /v1/payments API

Currently, LND's payments API returns the last_index_offset field, but it cannot be used as total number of payments due to missing deleted payments from the list. Please add total payments for easier & faster pagination implementation for the UI.

version of lnd: 0.12.1-beta
which operating system (uname -a on *Nix): Windows
version of btcd, bitcoind, or other backend: v0.19.0.1 (64-bit)

Steps to reproduce

Call GET /v1/payments API with max_payments=10 & index_offset=0 & reversed=true

Expected behaviour
The API should also include the total number of records for complete and incomplete payments.
Actual behaviour

It will return first and last offset indices but not total number of records.

Digging in on this ... should have an analysis update within 24 hrs.

Hello @ShahanaFarooqui - clarifying question please... does the include_incomplete=true parameter meet your needs?  Per your example:
 v1/payments?include_incomplete=true&max_payments=10&index_offset=0&reversed=true

@de6df1re We need ‘total_payments’ count for both the cases. For example, if the include_incomplete is true then the total_payments count should return total number of complete + incomplete payments. If it is false then the API should return the total number of completed payments.

OK thanks... will work through some options and present them here in the next day or two.

Analysis Update:
Most of the logic for the API/CLI call to get a list of payments lives in lnd/rpcserver.go ListPayments() and  lnd/channeldb/payments.go QueryPayments().  In ListPayments(), the query parameters for a 'slice' of payments as provided by consumer are formulated and then passed to QueryPayments().  In QueryPayments(), a connection to the channeldb (boltdb) is made, and the slice is returned.  The logic for "IncludeIncomplete" also lives in QueryPayments().  QueryPayments() return a PaymentResponse which includes the payments, firstindexoffset, and lastindexoffset.  ListPayments() returns a similar object with similar attributes called ListPaymentsResponse.
Intention Update:
I think we could  add a total_payments to the API/CLI response at the same level as first_index_offset and last_index_offset.  It may not always be clear to the consumer that total_payments would  not be the same as the total payments actually being returned based on the query parameters, and could differ depending on the IncludeIncomplete flag as mentioned in the request.  Another option would be to add additional response elements, something like total_returned_payments, total_complete_payments, total_incomplete_payments, and total_payments.  This logic would be a bit more complicated and maybe unnecessary?
I'm also intending to determine the best place to add this logic.  It could live in QueryPayments() as a separate chunk of logic, which is where the DB is being queried, and simply count the various payments and set them as new elements in the response.  However QueryPayments is currently  focused on a slice of detailed payment information as determined by the query parameters (and not total counts)... so it may make sense to isolate this logic in another function in channeldb/payments.go like QueryPaymentsTotals() that could be used elsewhere as needed and called by ListPayments when invoked by API/CLI.   However, that would introduce two calls to the database (instead of one) in a single API/CLI request and which may not be desirable?
I will keep working based on intentions above, but welcome all feedback.

An additional option I will try is to call QueryPayments twice from ListPayments.  Once to get the total counts, and once to get the smaller slice requested.

Code changes and testing in progress. Should have PR for evaluation this week.

@guggero this was fixed by #6463 right?

Yes, thanks for noticing @tvolk131!
Fixed by https://github.com/lightningnetwork/lnd/pull/6463.

repo: lightningnetwork/lnd


text:
build: add PR stats to github workflow

In this PR, we introduce a new Github work flow tool that should help us keep better track fo reviewer load across the proejct. Ideally this can also be used as a tool to help new PRs find a reviewer, and also for us to better balance out review load, and keep track of how long it takes to do PR turnaround.

Finally working in https://github.com/lightningnetwork/lnd/pull/6993
Turns out it can't be run for the first time in a fork


text:
Add AWS Codeartifact contrib module

This allows Mill projects to deploy to AWS Codeartifact. It functions similarly to the Artifactory PublishModule. Its credentials value is a Codeartifact auth token.

Ah of course! Just added it

Thank you for this contribution!

authors: lefou realbrianstern

repo: lihaoyi/mill


text:
Mysql role: Use become to create database and user. Fix problem on xenial.

:arrow_up: Ensure you have put a meaningful title in the box up there. :arrow_up:
This PR fixes an error when using the mysql role on xenial64-base. Using become when creating the database and database user will fix this problem. Tested on jessie64-base and xenial64-base.

This PR is a : Bugfix

[x] Changelog was updated

This shouldn't be necessary: according to the ansible docs:

Both login_password and login_user are required when you are passing credentials. If none are present, the module will attempt to read the credentials from ~/.my.cnf, and finally fall back to using the MySQL default login of ‘root’ with no password.

This file is created by the mysql role, so Ansible should be able to create the database and the user. Could you please check the file is present on your system? I couldn't reproduce on the jessie box.

Tested in playground
Always with vagrant destroy / up to have a really clean test basis.
Without the proposed fix
drifter/jessie64-base: works
drifter/trusty64-base: works
drifter/wheezy64-base: not testable, metadata problems with box names (vagrant)
drifter/xenial64-base:  fails
error message:
fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "unable to connect to database, check login_user and login_password are correct or /home/vagrant/.my.cnf has the credentials. Exception message: (1698, "Access denied for user 'root'@'localhost'")"}
With the proposed fix
drifter/jessie64-base: works
drifter/trusty64-base: works
drifter/wheezy64-base: not testable, metadata problems with box names (vagrant)
drifter/xenial64-base: works
Further analysis
Inspecting the differences between trusty64 and xenial64:
.my.cnf is available in both /root/ and /home/vagrant/
trusty64: executing "mysql" (without any params) as user vagrant gives you a full root access to the database without a password prompt for mysql access
xenial64: executing "mysql" (without any params) as user vagrant gives you an access error: ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Further analysis of differences:
There are some differences in the 'user' table of the 'mysql" db on mysql, namely that root@localhost may only connect over auth_socket and not "mysql_native_password" on xenial64, so I assume the security with newer versions of Ubuntu has been beefed up. A thread on stackoverflow seems to go in the same direction: https://stackoverflow.com/questions/37533685/how-to-install-mysql-5-7-using-ansible-and-vagrant
My fix just works around that limitation by falling back to the root user (become) for the connection to mysql.

Thanks for taking the time to do this detailed analysis. :)

authors: devste sephii

repo: liip/drifter

license: WTFPL


text:
Extensions API: A way for users to broaden supported types

API
interface Extension<T> {
    when   : (x      : unknown)     => x is T
    encode : (x      : T)           => ArrayBuffer
    decode : (buffer : ArrayBuffer) => T
}

function createCodec(extensions : Extension[]): { encode : typeof EsCodec.encode, decode : typeof EsCodec.decode }

Usage
import * as EsCodec from "es-codec"

const { encode, decode } = EsCodec.createCodec([
    {
        when  (x : unknown)        : x is URL    { return x.constructor === URL },
        encode(x : URL)            : ArrayBuffer { return EsCodec.encode(x.href) },
        decode(buffer: ArrayBuffer): URL         { return new URL(EsCodec.decode(buffer) as string) }
    }
])

createCodec accepts an array of extensions, and returns encode and decode functions that support the corresponding types.
The same codec must be created on both the receiving side and sending side. The order of the array matters.
The custom codec can introduce a maximum of 128 types.

@jeff-hykin I want to know what you think about this

I was actually thinking about this earlier this morning.
This feature seems like a good way to avoid the complexity of having a class-method based encoding/decoding.
There are few problems I see though.

I think the ordering being important is really painful. Imagine running experiments and saving them to disk using es_serial because the results are too large to save in a json file. Code bases change, types come and go frequently. So now imagine having this O(n^2) list of lists, where the first element is all the encoder/decoders in the order the were two weeks ago, the second element is the all the encoder/decoders in they order they were in one week ago, and the third element is all the encoder/decoders in the current/latest order. All that boilerplate (and dangling old-versions of classes/encoders-decoders) just so that experimental results from two weeks can still be loaded/analyzed. I analyze results from 8-months-old 120Mb serialized files. It could quickly get gruesome. Instead of a list, its possible to just expose the tag mapping as an enumeration of some kind, like literally an object with numbers as keys, so that the same encoder/decoder can keep the same number over time, and allow new types come and go. I think a better approach is to just expand the tag size, have named encoder/decoders and hash the name to a UUID, which is directly used as a 64 or 128bit tag.
I don't think this is too hard to solve, but I think the 128 types limit is too strict because people would have to fork the repo to solve the limit. I don't mean this in a negative way but It feels less like an "extension" and more like a hack to fit some extra types in. I'd probably rather have a "pure" serialization than one that supports a hard limit of 128 types. Now, what I'm about to propose is separate from my UUID recommendation, but I think an easy backwards-compatible solution is to create a setTag and getTag. For getTag, do getUint8, and if the last bit of the uint8 equals 1 then, get another uint8 and keep repeating until the last bit isn't 1. Then it's easy to combine the other bits into a number; I've got a handy function in my deno binaryify module that does this in both directions. E.g. It can take a uint8 and return an "escaped" uint8, where every 7 bits, a "spare" bit is added for encoding reasons.  (e.g. 11111111_11111111 => 11111110_11111110_11000000 as well as the "unescape" direction 11111110_11111110_11000000 =>11111111_11111111)
The order of "when" checks could be a problem, as well as the error handling for a "when" check that throws an error. I have a similar encoding API for a custom encoding for python json but I exposed them by having the "when" functions be a key in an override table (https://github.com/jeff-hykin/json_fix#override-table). I think it is important to expose the list of how many checks there are, and what order they're being executed in, so that devs aren't surprised by the behavior. And I think the most intuitive default is to have the most recent "when" be the first one that is checked.

...have named encoder/decoders and hash...

@jeff-hykin That's a great idea! We could check when `createCodec` that all names/IDs are unique, and maybe use the strings directly as tags so we don't have to worry about hashing or hash collisions.

...if the last bit of the uint8 equals 1 then, get another uint8...
(regarding longer than one byte type tags)

Varint encoding is how array/string lengths are encoded now, and I'm considering it for numbers as well: #17. I guess numbers and other primitives could be allowed as the ID of the extension for cases where strings are seen as too wasteful.

...as well as the error handling for a "when" check that throws an error...

I'm not sure if recovering from an error there should be `es-codec`'s responsibility.

...expose the list of how many checks there are...

Unlike json.override_table in json_fix, the entire extensions array is provided by the user. They should have complete control over it (and no control over how base types are processed.)

This is the revised API:
const { encode, decode } =
    EsCodec.createCodec([
        {
            name: "URL",
            when  (x    : unknown) : x is URL         { return x.constructor === URL },
            encode(url  : URL    ) : BaseSerializable { return url.href },
            decode(href : string ) : URL              { return new URL(href) }
        }
    ])

name is used as the type tag: order does not matter anymore
when is still a function: this allows an extension to add support for only a subsection of a type. For example, a symbol extension can only support registered symbols (Symbol.for("xyz")), leaving well-known symbols (Symbol.toPrimitive) up for grabs by another extension.
encode returns a type that is natively supported, instead of an ArrayBuffer. The alternative would mean exposing too many implementation details.

After having used this API, I believe effectful encoding/decoding needs to be made easier. The use case I'm concerned with is where I need to "register" a virtual ReadableStream within a websocket.
It is trivial to create effects in the global scope, but to use a websocket connection in an encode/decode function, I had to call createCodec for each connection such that it captures the websocket in scope and becomes a closure.
Inspired by the official msgpack javascript package, context for extensions might look like this:
const { encode, decode } =
    EsCodec.createCodec<{ socket : WebSocket }>([
        {
            name: "URL",
            when  (x    : unknown, context) : x is URL         { return x.constructor === URL },
            encode(url  : URL    , context) : BaseSerializable { console.log(context.socket); return url.href },
            decode(href : string , context) : URL              { console.log(context.socket); return new URL(href) }
        }
    ])

const buffer = encode(data, { socket : new WebSocket(url) })
const data = decode(buffer, { socket : new WebSocket(url) })

Sorry I've been gone for a bit. I think the new proposed API looks good. There is still ambiguity on when the "when" clauses are run (are the in-order top to bottom or bottom to top?)
I don't quite understand the websocket issue (why do the console logs need to be in the encode/decode?)

There is still ambiguity on when the "when" clauses are run (are the in-order top to bottom or bottom to top?)

@jeff-hykin They are top to bottom. If the 1st extension's when returns true, 2nd extension's when is not executed.
In practical terms, this means that more "specific" extensions should be placed near the start of the array you pass to createCodec.

I don't quite understand the websocket issue (why do the console logs need to be in the encode/decode?)

The console.log serves as an example for how you would affect the outside world.
The MessagePack readme provides a longer example where the context is something that keeps track of everything being encoded/decoded.
It's for cases where the object you're serializing is not an unchanging static object (ReadableStream, for my use case).
It's needed because it's easy to affect a variable declared at the top-level, but it gets tricky when you need to affect something that's passed in as an argument somewhere (a WebSocket connection, for my use case).

In practical terms, this means that more "specific" extensions should be placed near the start of the array you pass to createCodec.

Great, so long as this is mentioned prominently in the docs, I don't see any problem with the API.
Even better, this design makes it easy to define a codec in a standalone file, publish it on Deno.land, and then import it wherever it is needed (e.g. sending someone a serlized file along with a import codec from "somewhere on deno.land")

It's for cases where the object you're serializing is not an unchanging static object (ReadableStream, for my use case).

Hmm I'm still not understanding when it would be desireable to seralize with side effects. If I were to seralize a websocket I'd imagine it something like:
// sorry I'm simplifying to JS, I think its a bit easier
const { encode, decode } =
    EsCodec.createCodec([
        {
            name: "Websocket",
            when: (x)=> x instanceof WebSocket,
            encode: (websocket) => websocket.url,
            decode: (websocketUrl) => new WebSocket(websocketUrl)
        }
    ])

So I don't really know what kind of logic would go into a context.track() function. For a readable stream I would imagine maybe saving/loading an index, but I don't really understand why there would need be side effects.

Actually I think I see what you mean. If encode is partially-encoding (e.g. iterably encoding) a value, it would be nice for it to pick up where it leaves off:
const socket = new WebSocket("stuff")
const localFileStream = new ReadableStream("local stuff")

const { encode, decode } = /* ... */

// server.js: normal way
for await (const chunk of localFileStream) {
    socket.send(encode(chunk))
}

// client.js: normal way
let chunks = []
while () {
    chunks.push(
        decode(await socket.recv())
    )
}

// ^ kind of having to manually write encode/decode logic

There is a lot of value in the pure-function encoder/decoder, so I feel like a streaming encoder/decoder is a different problem (e.g. seems like beyond a 1.0.0 es-codec to me and/or deserves its own stream-encoding API that utilizes the pure-function encode/decode).
In terms of the streaming API, I think iterables might cover all cases and mean that manually managing a context might not be needed. I think iterables can be summed up as a streamID & metadata plus individually seralizable chunks (even if chunks themselves are iterables; e.g. needing recursive seralization). Lets say there are two async readable streams stream1 and stream2. The chunks of stream1 and stream2 won't necessairly be sent in a strict way (e.g. it might be stream1.chunk1, stream1.chunk2, stream2.chunk1, stream1.chunk3 instead of stream1.chunk1, stream2.chunk1, stream1.chunk2, stream2.chunk2) so the deseralizer will need to handle processing the ID, while making sure all the chunks end up back in the right stream.
I think that encode/decode logic (encoder labelling chunks with a streamID, then decoder sorting chunks using that streamID) is very general, so having each dev re-implement it with their own custom Context object seems suboptimal.
I'll need more time to think about this though, I will be facing this problem myself soon enough.

authors: jeff-hykin lilnasy

repo: lilnasy/es-codec

license: Unlicense


text:
Make sure to install podman package from repo

Newer versions of Fedora come with an older pre-installed Podman,
make sure to install the package from the repository like before.
Closes #2978

Fixes the issue on my machine:
INFO[0019] READY. Run `limactl shell podman` to open the shell.
INFO[0019] Message from the instance "podman":
To run `podman` on the host (assumes podman-remote is installed), run the following commands:
------
podman system connection add lima-podman "unix:///home/anders/.lima/podman/sock/podman.sock"
podman system connection default lima-podman
podman --remote run quay.io/podman/hello
------
$ podman.lima version
Client:       Podman Engine
Version:      4.9.3
API Version:  4.9.3
Go Version:   go1.21.7
Git Commit:   8d2b55ddde1bc81f43d018dfc1ac027c06b26a7f
Built:        Fri Feb 16 11:30:23 2024
OS/Arch:      linux/amd64

Server:       Podman Engine
Version:      5.3.1
API Version:  5.3.1
Go Version:   go1.23.3
Built:        Thu Nov 21 01:00:00 2024
OS/Arch:      linux/amd64

It needed --best too, or it would exit:
Package "podman-5:5.2.5-1.fc41.x86_64" is already installed.

I thought we could put something in boot.sh to export a LIMA_IS_FIRST_BOOT variable, so templates don't have to implement it themselves, but this is probably good enough for now.

install the package from the repository like before.

What do you mean by "like before"? Did dnf upgrade it before, but now it is broken?

I'm not sure if /var/tmp/lima-podman is the right location for this flag; it is not unconceivable that the user wants to clean that directory, and now this would implicitly trigger an update of podman.
I would suggest /etc/lima-podman instead.

What do you mean by "like before"? Did dnf upgrade it before, but now it is broken?

Ok, I just realized that the issue is that Fedora comes with podman already installed, which disables our code that used to install the latest version on first boot.
So this PR does restore the old behaviour; the only reason I'm not merging is because I think the sentinel file should be in /etc instead of /var/tmp.

install the package from the repository like before.

What do you mean by "like before"? Did dnf upgrade it before, but now it is broken?

Like with older versions of Fedora, what was I referring to (but that info was only in issue)

location

My concern was not about the location.
I'm not sure we really need the /etc/lima-podman or whatever else.
Probably just running dnf install --best podman once is enough for now?

Probably just running dnf install --best podman once is enough for now?

That's what this is all about: how do you make sure that we are not running dnf install --best podman again at some random point in the future when the user did not intend to change their podman version?
Before we relied on Fedora not including podman, so we ran the install only when podman was not available via the PATH. This mechanism has been broken since Fedora started shipping with an older version of podman pre-installed.
So we want to upgrade to the latest podman on first-boot, but from then on leave it alone. So we need some kind of marker that says "we already did upgrade podman once". This marker would be the existence of the /etc/lima-podman file or /var/lib/lima directory, as neither of them exist on a pristine Fedora image.
How would you solve the issue of running dnf install --best podman only once?

What do you mean by "like before"? Did dnf upgrade it before, but now it is broken?

Ok, I just realized that the issue is that Fedora comes with podman already installed, which disables our code that used to install the latest version on first boot.

So old podman is installed by default and dnf install podman installs a newer version?! This sounds like a packaging bug. Do we have a Fedora bug for this?

So old podman is installed by default and dnf install podman installs a newer version?! This sounds like a packaging bug.

Unless I misunderstand, this is simply due to the latest Fedora 41 1.4 image being from Oct 24 containing podman 5.2.5 released on Oct 23.
Since then there have been podman releases 5.3.0 (Nov 13) and 5.3.1 (Nov 21) that you can install via dnf. It's not like the bundled version is massively out of date.

authors: AkihiroSuda afbjorklund jandubois nirs

repo: lima-vm/lima


text:
Add example script to export webknossos volume annotations

Hi @jingjingwu1225, here is an example script to export Webknossos annotations based on their documentation.   I have tested this on the LINC Jupyter Hub for the magnification level of 8-8-1 and all lower resolutions.  Please let me know if it crashes for higher resolution levels.
In order to run:

Install the following Python packages: webknossos, tifffile, and numpy==1.26.1
The WK_TOKEN can be found under the main menu under Auth Token:

Use the command:WK_URL="https://webknossos.lincbrain.org" WK_TOKEN="<add_token>" python export_annotation.py

Please update the script to include the following changes:

Export to a single Zarr instead of TIFF files
Export all z slices to the same Zarr
Export all segment_ids to the same Zarr
Export all resolution levels to the same Zarr
Review the annotations to ensure a 1-1 mapping between the annotations in the exported Zarrs and the annotations on webknossos.lincbrain.org.

cc @aaronkanzer @balbasty

Upon quick review of some of the TIFFs generated, the annotations are visible in the images.

I added points 4 and 5 above.

Drafting this pull request since it shouldn't be merged as is, but it is here for reference.

Perhaps using a smaller buffer_size for the get_buffered_slice_reader() method would reduce the risk for filling up the JupyterHub node memory at higher resolution levels.
Also, get_buffered_slice_writer() seems to write data to disk as soon as the buffer is full.  Will have to explore more to see what formats can be written to disk.

Hi @jingjingwu1225 @balbasty @aaronkanzer, I am still testing but the following seems to be working for me without putting a stress on the Webknossos server or the JupyterHub instance.  Please let me know what you think.
annotation_zarr_link = 'https://webknossos.lincbrain.org/data/annotations/zarr/v2yszt4hvDxpIXKK/Volume/'
annotation_name = 'JW_MR243_20240927'
local_path = '/home/jovyan'

source_group = zarr.convenience.open(store=annotation_zarr_link)
dest_group = zarr.hierarchy.group(store=local_path)
zarr.convenience.copy(source=source_group, dest=dest_group, name=f'{annotation_name}.zarr')

That's very neat! Do you know if it's possible to specify the chunking options for the output array in the copy operation?

It does look like we can pass any keyword arguments to zarr.convenience.copy that would then get passed to create_dataset when copying the array.  But we may only be able to use single chunk size for all resolution levels.  I am still exploring but would we want different chunk sizes for the different resolution levels?

We've used the same chunk size across levels so far, so I don't see this as too much of a problem.

Great.  I am now testing for chunks=(1,128,128,1).  Will let you know how it goes.
If we do need different chunk sizes, we could loop through the resolution levels (see code snippet below) and write them individually to the destination group.
Input
for array_name, array in source_group.arrays(): print(array_name, array)

Output
1 <zarr.core.Array '/1' (1, 126976, 99630, 73) uint32>
128-128-1 <zarr.core.Array '/128-128-1' (1, 992, 778, 73) uint32>
16-16-1 <zarr.core.Array '/16-16-1' (1, 7936, 6226, 73) uint32>
2-2-1 <zarr.core.Array '/2-2-1' (1, 63488, 49815, 73) uint32>
256-256-1 <zarr.core.Array '/256-256-1' (1, 496, 389, 73) uint32>
32-32-1 <zarr.core.Array '/32-32-1' (1, 3968, 3113, 73) uint32>
4-4-1 <zarr.core.Array '/4-4-1' (1, 31744, 24907, 73) uint32>
64-64-1 <zarr.core.Array '/64-64-1' (1, 1984, 1556, 73) uint32>
8-8-1 <zarr.core.Array '/8-8-1' (1, 15872, 12453, 73) uint32>

Hi team, it looks like we also need to pass the arguments fill_value=0 and write_empty_chunks=False to ensure that only chunks with non-zero values are stored.  See Zarr API docs.
Webknossos is offline right now so will finish up testing tomorrow.

Also, I switched to a chunk size of (1, 4096, 4096, 1) since that was previously decided upon.

authors: balbasty kabilar

repo: lincbrain/linc-convert


text:
Add Support for Sorting Lightcurves by Time

[ ] My PR includes a link to the issue that I am addressing

Introduces Ensemble.sort_lightcurves which sorts lightcurves by their timestamp in ascending order.
This PR closes https://github.com/lincc-frameworks/tape/issues/316 though we opt to provide a separate function for sorting lightcurves by their timestamp rather than adding additional functionality to the batch function. This also makes it easier for the user to only sort when needed rather than worrying about the arguments specified over repeated batch calls.
Solution Description
Ideally we would use a multi-index of Object ID and timestamp for the Source table, but Dask lacks support for this. Instead, we use the Object ID as the sorted index for both Source and Object tables, and a call to Ensemble.sort_lightcurves perform a per-partition Pandas sort_values for sorting the underlying Pandas dataframe by {Object ID, timestamp}  (Note that Dask [sort_values](https://docs.dask.org/en/latest/generated/dask.dataframe.DataFrame.sort_values.html) supports only sorting a single column).
Because we aim for lightcurve cohesion, where the rows for each lightcurve are only on a single partition in the Source table, this per-partition sorting is all we need allowing us to escape some of the constraints of sorting entire Dask dataframes, especially allowing us to sort lightcurves on a lazy basis for only the partitions that we need.
Code Quality

[x] My code builds (or compiles) cleanly without any errors or warnings
[x] My code contains relevant comments and necessary documentation

Project-Specific Pull Request Checklists

[x] I have added a function that requires a sync_tables command, and have added the necessary sync_tables call

New Feature Checklist

[x] I have added or updated the docstrings associated with my feature using the NumPy docstring format
[ ] I have updated the tutorial to highlight my new feature (if appropriate)
[x] I have added unit/End-to-End (E2E) test cases to cover my new feature
[x] My change includes a breaking change

[x] My change includes backwards compatibility and deprecation warnings (if possible)

Looks great!
What would actually happen if the condition of lightcurve cohesion is not met? Do we need a docstring telling something about that?

Added a note that this would fail to globally sort the table in the docstring.

repo: lincc-frameworks/tape


text:
How to use it in realtime audio Data?

I was working on realtime audioProcessing changing pitch, speed and adding effects. I checked various libraries like ffmpeg but all of them work on a save file, instead of realtime byteArray or ShortArray. I checked examples in readme. Can this be used directly on the ByteArray audioData?
Thank you

you can use a temp audio file and use it as live processing.

repo: lincollincol/AudioTool


text:
Improve the performance of string validation

We are currently using BitSet as a lookup table in many places, such as:

Cookie name, value and attribute validation
Header name and value validation
Path validation in PathAndQuery
CountingSampler

Although BitSet is compact, accessing it requires fair amount of shift operations and range checks, yielding relatively large penalty. We could:

Use byte[] instead of BitSet.
Use PlatformDependent.getByte() to reduce range checks.

.. as we did in #2307 and #2333

@anuraaga Do you have any other places in mind?

Hexadecimal conversion is also a good candidate.

repo: line/armeria


text:
DocService gRPC repeated fields are not collapsible

The childFieldInfos are not correctly populated in repeated fields, I think it would be useful to see child fields of the repeated fields instead of needing to click and visit another page.

@ikhoon regarding the table becoming too large, how about lazy loading child properties? Maybe not in the scope of this change. I haven't seen such big endpoints in my use-case yet.
Also assuming fields in map can be a little tricky because maps have two parameters. Maybe it is best to keep it this way. My motivation was using the debugForm without needing to navigate through lots of different pages. Beceause I suppose you loose your debug form template when you navigate to a different page.

My motivation was using the debugForm without needing to navigate through lots of different pages.

I agree with your opinion. But I heard @chris-ryan-square manages large protos.
https://line-armeria.slack.com/archives/C1NGPBUH2/p1665528225754379?thread_ts=1665526584.427749&cid=C1NGPBUH2
As you said, lazy loading could be a possible solution.

@ikhoon Is there a community slack channel for armeria? I thought link you sent was a community channel but I can't really get in 😆

authors: Dogacel ikhoon


text:
Specify a client TLS key pair without ClientFactory

A TLS key pair is used to authenticate a client's access. If a client needs several endpoints that use different client certificate authentications, ClientFactory should be created as many as the number of certificates.
ClientFactory has its own connection pool. If many ClientFactorys are made, it would be connection leaks. It's not a scalable implementation pattern.
I proposed to specify a TLS key pair on the client side with ClientOption so that users can set a new certification when creating a new WebClient without a new ClientFactory.

Hi, @ikhoon . I have a question about this Issue.
I consider implementing new APIs to specify a client TLS key pair in ClientOption for several endpoints.
What should we use to distinguish which client TLS key pair corresponds to which endpoint, URI or anything else?

Good question. I realized that this issue is more complex than I thought at first. The two main changes for this issue will be:

Design a new API for TLS key pair and their provider.public interface TlsProvider {
  TlsKeyPair provide(String hostname);

  default TlsKeyPair orElse(TlsProvider other) {
    /* compose two TlsKeyPairs */
  }
}

public class TlsKeyPair {
  private PrivateKey privateKey;
  private List<X509Certificate> keyCertChain;
}

public class ClientOptions {
  public static final ClientOption<TlsProvider> TLS_PROVIDER =
    ClientOption.define("TLS_PROVIDER", ..TlsProvider.empty());
}

Refactor HttpChannelPool and related low-level classes to dynamically choose a TLS key pair when establishing a connection. Currently a SslContext is statically bound when a ClientFactory is created.
https://github.com/line/armeria/blob/7375dda034934eb5e3b937db18770caccb858b6b/core/src/main/java/com/linecorp/armeria/client/HttpChannelPool.java#L95-L99


text:
Add MediaTypeNames

Motivation:
As described in #2421, armeria currently does not provide String type
constants for MediaType
Modifications:
Introduce new class for String Constants in MediaType, MediaTypeNames
Result:
Implement MediaTypeNames class and its test (MediaTypeNamesTest)

@JunoJunho Could you merge the master branch? 😉

@ikhoon merged :)

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.1 out of 2 committers have signed the CLA.:white_check_mark: JunoJunho:x: == seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

Let me check in local

Thanks a lot, @JunoJunho !

:+1::+1::+1:

authors: JunoJunho claassistantio ikhoon minwoox trustin


text:
Deprecate ArmeriaSettings.ip and add ArmeriaSettings.address

Motivation:
Spring allows Users to specify a hostname because Spring converts the input to an InetAddress.
So we need to also allow users to specify a hostname.
Modifications:

adding ArmeriaSettings.address whose type is InetAddress
deprecating ArmeriaSettings.ip

Result:

Closes #4597

Thanks a lot, @kojilin! 😄

authors: kojilin minwoox


text:
Replaced 'icon-' by the 'icon-[package name]'

I have replaced 'icon-' by the 'icon-[package name]' in each package folder's style.css. Changes are made on 28th and 29th line in style.css file in each package folder.

谢谢

authors: Suyash-Purwar yellowinggate

repo: linea-io/Linea-Iconset


text:
README example won't compile on Windows 10 in fresh project

Steps to reproduce

cargo init druid-test
Paste the sample from README in to main.rs
Set dependency in Cargo.toml as druid = "0.7.0"
cargo run
Errors at the bottom of post.

use druid::widget::{Button, Flex, Label};
use druid::{AppLauncher, LocalizedString, PlatformError, Widget, WidgetExt, WindowDesc};

fn main() -> Result<(), PlatformError> {
    let main_window = WindowDesc::new(ui_builder());
    let data = 0_u32;
    AppLauncher::with_window(main_window)
        .use_env_tracing()
        .launch(data)
}

fn ui_builder() -> impl Widget<u32> {
    // The label text will be computed dynamically based on the current locale and count
    let text =
        LocalizedString::new("hello-counter").with_arg("count", |data: &u32, _env| (*data).into());
    let label = Label::new(text).padding(5.0).center();
    let button = Button::new("increment")
        .on_click(|_ctx, data, _env| *data += 1)
        .padding(5.0);

    Flex::column().with_child(label).with_child(button)
}

ERRORS:
λ cargo run
   Compiling druid-test v0.1.0 (D:\Projects\rust-gui-survey\druid-test)
error[E0277]: expected a `FnOnce<()>` closure, found `impl druid::Widget<u32>`
   --> src\main.rs:17:39
    |
17  |     let main_window = WindowDesc::new(ui_builder());
    |                                       ^^^^^^^^^^^^ expected an `FnOnce<()>` closure, found `impl druid::Widget<u32>`
    |
   ::: C:\Users\JR\.cargo\registry\src\github.com-1ecc6299db9ec823\druid-0.7.0\src\app.rs:347:28
    |
347 |         F: FnOnce() -> W + 'static,
    |                            ------- required by this bound in `WindowDesc::<T>::new`
    |
    = help: the trait `FnOnce<()>` is not implemented for `impl druid::Widget<u32>`
    = note: wrap the `impl druid::Widget<u32>` in a closure with no arguments: `|| { /* code */ }`

error[E0599]: no method named `use_env_tracing` found for struct `AppLauncher<_>` in the current scope
  --> src\main.rs:20:10
   |
20 |         .use_env_tracing()
   |          ^^^^^^^^^^^^^^^ method not found in `AppLauncher<_>`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `druid-test`

To learn more, run the command again with --verbose.

There is a small difference between github and 0.7's readmes on crates.io / docs.rs. 0.7 uses WindowDesc::new(ui_builder) while master branch usesWindowDesc::new(ui_builder()) (changed in  #1559), and 0.7 doesn't have the use_env_tracing method.
For other examples with 0.7, check them out using the git tag or on docs.rs:
https://github.com/linebender/druid/tree/v0.7.0
https://docs.rs/crate/druid/0.7.0/source/examples/

Closing, feel free to reopen if you still have issues.

repo: linebender/druid


text:
下载文件时 在任务列表中关闭应用 状态栏里面的下载通知就永远不能cancel了

我是在服务中开启的下载并会在通知栏显示notification  帮忙看下有没有解决方法

NotificationService在另外一个进程，根据不同定制ROM的不同，关闭应用是否会连带把NOTIFICATION一起关掉的机制也略有差异

不过NOTIFICATION显示与否，与你的应用有没有关闭没有必然关系。

你有几种方式Cancel Notification ( 这个不属于FileDownloader的范畴):

非ongoing Notification，用户可以主动划掉对应通知，Ref NotificationCompat.Builder#setOngoing(Boolean)
存储对应Notification的Id，通过 NotificationManager#cancel 进行清除。Ref ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).cancelAll();
通过 ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).cancelAll(); 将所有 与该应用包名相同的 并且正在显示的所有的 NOTIFICATION。

P.S: DEMO PORJECT中的通知这块的bug是，我在暂停的时候就将 notification Id（downloadId）置位了0，导致，返回时，在cancel的时候，提供的并非正在显示的notification的ID。

repo: lingochamp/FileDownloader


text:
Added NetBeans to the list of code editors.

Added NetBeans to the list of code editors.
Added name and Github link to the contributors.html file.

👍

authors: BennyCarlsson misterdabu

repo: lingonsaft/hacktoberfest


text:
Update contributors.html

👍 :octocat: 🎉 Added my name to the list of contributors 🚀

To be on the contribution list you actually have to contribute with something :)
Closing this but you can make a new pull request when you contributed.

authors: BennyCarlsson hashDanChibueze


text:
#571 - added new FAQ

Added new FAQ question

hehe will ad an answer soon ;)


text:
Use PlatformInfo to better compose browse paths

Is your feature request related to a problem? Please describe.
Dataset names that have . in them are split by the browse endpoint regardless of the Platform delimiter. See the bread crumbs in the image below:

I didn't expect to see the last two crumbs to be a and test. Instead I expected to see one unified crumb a.test.
Describe the solution you'd like
It seems like we always split on . here but perhaps we can use the the Platform delimiter to be smarter about this?
The desired end result would be to treat . in dataset names as any other alphanumeric character for platforms that use a different delimiter.
Describe alternatives you've considered
No alternatives have been considered
Additional context
Using . in names is not very uncommon. Supporting them properly would facilitate DataHub adoption.

Makes sense. Internally we do use Platform delimiter to build the browse path. Somehow it didn't flow into OSS correctly.

Hey there @jsotelo - you can emit a custom BrowsePaths aspect to avoid the splitting on .

Yep, this is what we did. I'll close this.

authors: gabe-lyons jsotelo mars-lan

repo: linkedin/datahub


text:
Support for HDFS HA

While fetching spark event logs in HDFS, dr. elephant just get the namenode address by dfs.namenode.http-address in startup. This property may be empty when using HDFS HA.
Anyone have time to add this feature?

Just in case you are not aware, there is a mailing list  for Dr. Elephant. I think it is worth adding it there.

Thanks, I will add it there or do it myself later :)

Hi @akshayrai , I'm confused why SparkFSFetcher use WebHdfsFileSystem to connect to HDFS.
Instead, use FileSystem.get(conf) can utilize the namenode HA automatically.
I just send a simple PR
It works fine in my cluster :)
By the way, the event_log_dir of spark fetcher should be set to [nameservice ID]/path...

@stiga-huang, thanks for this patch. I'll review it later today.

Closing this as it has been fixed in https://github.com/linkedin/dr-elephant/commit/2364c2627c0c0291a374067db454084be60a2be9.

authors: akshayrai stiga-huang

repo: linkedin/dr-elephant


text:
Use jobState to get JobMetrics in TaskRunner

@ibuenros can you review this?
This will make sure tags get populated from mapper tasks.

LGTM

authors: ibuenros pcadabam

repo: linkedin/gobblin


text:
TE: disabling chart from anomaly email

disabling chart from anomaly email for merged anomalies.

LGTM

authors: puneetjaiswal raviarin

repo: linkedin/pinot


text:
Optimize logic to refresh watches for realtime table and fix error handling

During refresh watches, check if a table is realtime based on zn record id
before converting the record to table configuration. Also, handle all possible
exceptions to continue with as many tables as it can. This reduces the
impact of bad configurations of a table on other tables

Current coverage is 66.60% (diff: 54.54%)

No coverage report found for master at 57dac2b.

Powered by Codecov. Last update 57dac2b...e0975c8

authors: antumbde codecov-io


text:
Substitution

Note: This replaces the previous PR #20 (which was from my master branch).
Adds substitution capability suggested in #13.
Now you can do:
var sepia = require('sepia');

sepia.substitute('<MYSECRET>', function () { return process.env.MY_ACCESS_TOKEN; });
sepia.substitute('<MYSECRET2>', function () { return process.env.MY_ACCESS_TOKEN2; });
// etc.

And the fixtures will contain <MYSECRET> and <MYSECRET2>, while the requests will contain the value of MY_ACCESS_TOKEN and MY_ACCESS_TOKEN2.
I added tests, but couldn't quite figure out how to test the fixture files themselves.  I did check that they look right, though.
@avik-das - Could you take a look?

I like this idea a lot.  Trying to understand the code.  Does it have limits to how many secrets you can set up?  Or limits on how many secrets can be in a single response?

@jimmyeisenhauer No limits.  Just call sepia.substitute(...) with a new key and function.

thanks for the info!  I got your PR working.  I think it will be really helpful for my needs and my guess others as well.  Not just secrets but any kind of replacement you want to do.  I am working on DateTime values to be relative instead of hard coded.
I did notice it is only 1 replacement per secret per response.   For example if you had actual_value multiple times in the api response that you wanted to sub you would need to create two secret_values with the same actual_value.
I was looking at maybe looping the substituteWithRealValues but curious if you tried this and if performance takes too big of a hit?

Thanks for catching that, @jimmyeisenhauer.  I pushed a fix which uses text.split(key).replace(value) to do the substitution in a single pass per substituteWith* call.

Is anyone still maintaining this repo? There are a couple of other PRs that would be nice to get merged.
Ping @vslosh @egoldblum @ethankao @deepankgupta @salvipriyanka @ashimaatul

@aneilbaboo I'm not at LinkedIn anymore, but I'm trying to track down someone there to get the ball rolling.  Thanks for your patience.

Awesome.  Thanks.

@egoldblum - any luck finding the maintainers?

@aneilbaboo I'll try to find you a maintainer

@egoldblum This seems like a nice fix.  It would be really good to get this and other PR's (like my bug fix for Windows) merged.  Collecting too many good fixes spread across forks for now.

authors: aneilbaboo asakusuma egoldblum jimmyeisenhauer mseminatore

repo: linkedin/sepia


text:
[admin-tool] Add support for dumping messages within a specified time range

[admin-tool] Add support for dumping messages within a specified time range
This commit adds support to the admin tool for dumping messages from a PubSub topic within a specified time range, using start and end date-time in the format "yyyy-MM-dd HH:mm:ss" (PST). Previously, the admin tool could not consume messages based on time ranges. This code change allows targeted message dumping to streamline troubleshooting.
How was this PR tested?

CI and PROD
Does this PR introduce any user-facing changes?

[x] No. You can skip the rest of this section.
[ ] Yes. Make sure to explain your proposed changes and call out the behavior change.

Thanks, @nisargthakkar!

repo: linkedin/venice


text:
M3-4679: Upgrade Ada Support bot from Chaperone to Embed2

Description
Upgrade the Ada Support bot from Ada Chaperone to Embed2.
Ada simplified their implementation with Embed2, obviating our need for some of the logic we had in AdaLink.tsx, but they seem to have also deprecated some functionality and methods like show() that we were relying on for our custom implementation.
While things still work, my main two concerns at this time are 1) losing some ARIA accessibility and 2) losing the disabled button when there's an Ada error (example, if you block *ada* in DevTools, the button disappears completely instead of being disabled like before).
Being that I didn't see anything in the Embed2 docs regarding accessibility or a disabled state, I'm going to reach out to Ada for insight and if the script indeed doesn't support those currently, I'll try opening a Github issue. I'll experiment more to see if we can make any tweaks addressing these (please share any ideas if you have some on this), but if these tradeoffs are judged to be too unfavorable, we can Do Not Merge this PR for now until they address these issues sometime in the future.
Type of Change

Non breaking change ('update', 'change')

@DevDW can this PR be closed since Ada was removed?

authors: DevDW codyfinn

repo: linode/manager


text:
Dokumentasi

Adakah dokumentasi resmi terkait API OVO? Mungkin nisa dibagikan, untuk memudahkan kontributor nantinya kalau mau membantu mengembangkan repo ini.

tidak ada dokumentasi resmi, yang ada hanya di README.md. Dokumentasi yang ada juga berdasarkan hasil snif

cara sniff nya pake tools apa boskuu

repo: lintangtimur/ovoid


text:
Refactor TestRunner: move jobID/runID/testAttempt from TestRunner

Fix: https://github.com/linuxboot/contest/issues/40

Codecov Report

Merging #45 (b4c849d) into main (4de747d) will decrease coverage by 1.44%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   66.27%   64.82%   -1.45%
==========================================
  Files         155      150       -5
  Lines        9274     8708     -566
==========================================
- Hits         6146     5645     -501
- Misses       2476     2479       +3
+ Partials      652      584      -68

Flag
Coverage Δ

e2e
?

integration
57.43% <100.00%> (+0.04%)
:arrow_up:

unittests
47.19% <100.00%> (+0.08%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

pkg/runner/job_runner.go
78.83% <100.00%> (+2.06%)
:arrow_up:

pkg/runner/test_runner.go
89.09% <100.00%> (-3.55%)
:arrow_down:

pkg/xcontext/logger/log_level.go
0.00% <0.00%> (-100.00%)
:arrow_down:

plugins/reporters/noop/noop.go
12.50% <0.00%> (-87.50%)
:arrow_down:

plugins/teststeps/sleep/sleep.go
4.08% <0.00%> (-69.39%)
:arrow_down:

pkg/config/jobdescriptor.go
0.00% <0.00%> (-53.34%)
:arrow_down:

pkg/transport/http/http.go
0.00% <0.00%> (-50.48%)
:arrow_down:

pkg/jobmanager/options.go
68.42% <0.00%> (-31.58%)
:arrow_down:

tests/common/get_events.go
56.66% <0.00%> (-20.00%)
:arrow_down:

plugins/storage/rdbms/report.go
51.48% <0.00%> (-16.84%)
:arrow_down:

... and 16 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 4de747d...b4c849d. Read the comment docs.

Rebase and also refactored some unit tests to get rid of global storage variable

accepting but there's still an open question above

Merged PR is it doesn't contain destructive changes.
Remaining open question will fix in a separate PR

authors: codecov-commenter mimir-d rihter007

repo: linuxboot/contest


text:
Try to re-add New Relic

We earlier disabled New Relic because it required us to disable our CSP security (to allow them to arbitrarily inject JavaScript):

https://github.com/linuxfoundation/cii-best-practices-badge/issues/228

Someone else noted on 2017-04-10 that requiring injection of arbitrary JavaScript is a positively archaic method.
We may be able to re-enable New Relic; it appears they now have a way to manually insert the JavaScript:

https://docs.newrelic.com/docs/browser/new-relic-browser/installation-configuration/add-apps-new-relic-browser#copy-paste-app

I tried various suggested approaches, but New Relic still seems incompatible with secure CSP settings.
I posted a new branch "newrelic", but it still fails.  Browser message:

Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src http://localhost:3000 https://js-agent.newrelic.com https://bam.nr-data.net”). Source: onfocusin attribute on DIV element.

If someone seems something obvious, that'd be great, but otherwise I'm going to close this issue out (again).

Just turn off the browser injection. Everything we need to see will be done
by the Ruby Gem examining memory and SQL calls on the server.
https://docs.newrelic.com/docs/browser/new-relic-browser/getting-started/compatibility-requirements-new-relic-browser#csp
On Mon, Jun 5, 2017 at 3:51 PM, David A. Wheeler notifications@github.com
wrote:

I tried various suggested approaches, but New Relic still seems
incompatible with secure CSP settings.
I posted a new branch "newrelic", but it still fails. Browser message:
Content Security Policy: The page’s settings blocked the loading of a
resource at self (“script-src http://localhost:3000
https://js-agent.newrelic.com https://bam.nr-data.net”). Source:
onfocusin attribute on DIV element.
If someone seems something obvious, that'd be great, but otherwise I'm
going to close this issue out (again).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/linuxfoundation/cii-best-practices-badge/issues/773#issuecomment-306284949,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC8MBg-AmPnBDoAEmGBtV8CpmInEH3jcks5sBFw-gaJpZM4NwRgD
.

--
Dan Kohn mailto:dan@linuxfoundation.org
Executive Director, Cloud Native Computing Foundation https://cncf.io/
tel:+1-415-233-1000

I modified "config/newrelic.yml" so that common.browser_monitoring.auto_instrument: false.  It doesn't seem to do any good.
I did post some fixes on the newrelic branch, but I don't think that's enough to get this running.

When I run the newrelic branch, I'm not seeing any Javascript injected in the browser (when I do view source and search for relic). That's true for both running in development and doing rake fake_production.
To test it's working correctly, I think you need to do heroku addons:create newrelic:wayne and then push to master. Then do heroku addons:open newrelic --app master-bestpractices to login to the dashboard.

Okay, let's give this a whirl!

I did hm addons:create newrelic:wayne and now I can open the dashboard with hm addons:open newrelic and am seeing data.
I use this alias:
function hm { heroku "$@" --app master-bestpractices; }
export -f hm

When you merge to production, I'll sign up for New Relic Pro there so we can see the slow transactions graph and decide if we want to keep paying.

Okay.  I'm merging to staging, and plan to merge to production soon.  I specially enabled profiling the garbage collection process, that may be useful.

Seems to be working on production!

authors: dankohn david-a-wheeler


text:
Add a few additional dgn and decoders

WATER_PUMP_STATUS
WATER_PUMP_COMMAND
WATERHEATER_COMMAND2
CIRCULATION_PUMP_STATUS
CIRCULATION_PUMP_COMMAND

@linuxkidd  - Do you add these manually or did you write some sort of script to parse the rv-c spec?

Hi @spbrogan  Thanks!
The ones I've done were all by hand.  @greendog99 did a bunch of this work initially, and I'm not sure if he hand wrote them, or created them programmatically.
I'll merge this in.  Thanks again!

If you mean converting the rv-c PDF file into the yaml file, yeah, that was all by hand. Sometimes traumatically so :-)

If you mean converting the rv-c PDF file into the yaml file, yeah, that was all by hand. Sometimes traumatically so :-)

Thanks for the info.

authors: greendog99 linuxkidd spbrogan

repo: linuxkidd/rvc-monitor-py


text:
Improve performance of bde-file-formatter

Keep it simple and focus on performance
Investigate a few libraries, potentially replace shapely?
Previously named WKT file formatted

Removed Shapely from code and using DMS/postgres to import data. Significantly improved performance.

authors: billgeo mfwightman

repo: linz/bde-processor


text:
Please update for Django 1.11.1

Hey,
Would be great if this package would be compatible with the latest version of Django (right now at 1.11.1)
Thanks!

Hey guys, just wondering what the status is of this ticket?

Hey team, I'm looking to start a new Django 1.11.4 project and am also wondering when this package will be updated. Thanks for all the hard work! :)

Just my 2 cents: I've been using michiya/django-pyodbc-azure for odbc on Sql Server, but I also just filed michiya/django-pyodbc-azure#125 asking whether that project is still maintained. Also, in this SO answer I tried to summarize the current status of django with odbc/sql server, but it seems like a dead end ATM

See #151. We just need tests for that PR and we’re good to go on 1.11.

As of right now, I'd like to suggest testing and working with alpha release 2.0.0a1 and using Django 2.0.  I am closing this issue, but if this is an unacceptable outcome, please re-open the ticket.

authors: Meloncon RossRogers bartmika dlo hakanw shadiakiki1986

repo: lionheart/django-pyodbc


text:
ViewPager嵌套视频播放器始终会记住之前的进度播放

退出当前页面或者退出当前APP，下次进入Viewpager页面会默认记住之前的播放进度，希望是下次进来是播放视频从0s开始的。

http://weibo.com/tv/v/FogTl6ymb?fid=1034:a2cad5217ab35856e8c173fc5984fedc
这个视频有答案。

这个变量改成false不记录播放位置

authors: lipangit sunkeding

repo: lipangit/JiaoZiVideoPlayer


text:
建议

希望作者下一版：1、能优化加载进度样式以及拉动进度条无法显示加载中进度条；2、锁屏播放竖屏返回按钮

我觉得你的建议非常靠谱，给你1000Jzt  加我微信  https://github.com/Jzvd/JZT

锁屏播放竖屏返回按钮   是啥意思

authors: lipangit lzjin


text:
Network: NodePort Service support

Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #(issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

[ ] Test A
[ ] Test B

/merge

repo: liqotech/liqo


text:
Static cache in AbstractUpdateCommandStep avoid independent runs of two Liquibase instances

Search first

[X] I searched and no similar issues were found

Description
We develop a Spring Boot application which is a compilation of different jar files which are independently developed by different departments. Each of them has it's own Liquibase instance using the same DataSource autowired by Spring Boot. This works fine on applying all the changesets of all jars. Only in case of updates, in one jar or several jars change-sets are added, the changes are not applied but reported as applied.
2023-07-31 19:33:20.677  INFO 62776 --- [           main] liquibase.database                       : Set default schema name to public
2023-07-31 19:33:20.845  INFO 62776 --- [           main] liquibase.lockservice                    : Successfully acquired change log lock
2023-07-31 19:33:21.301  INFO 62776 --- [           main] liquibase.changelog                      : Reading from public.service_changelog
Database is up to date, no changesets to execute
2023-07-31 19:33:21.359  INFO 62776 --- [           main] liquibase.changelog                      : Reading from public.service_changelog

Based on the log-line Database is up to date, no changesets to execute I could nail it down and finally figure out that the class AbstractUpdateCommandStep uses a static cache:
https://github.com/liquibase/liquibase/blob/8f11e1963d9957be8cb1ae16d1ec233bae9b573d/liquibase-standard/src/main/java/liquibase/command/core/AbstractUpdateCommandStep.java#L201
This upToDateFastCheck causes any subsequent Liquibase instance to get cache hits of it's precedents.
The cacheKey is based on contexts and a labelExpression. Although if I don't need them I will try to set different contexts to get different cache hits. But even if that works I think there must not be any interdependence between Liquibase instances.
Steps To Reproduce
In Spring Boot create two Liquibase instances like this:
@Configuration
public class ServiceLiquibaseConfiguration {
    @Bean
    @ConfigurationProperties(prefix = "spring.liquibase.service")
    public LiquibaseProperties serviceLiquibaseProperties() {
        return new LiquibaseProperties();
    }

    @Bean("liquibase")
    public SpringLiquibase serviceLiquibase(
            final DataSource dataSource) {
        final var properties = serviceLiquibaseProperties();
        final var liquibase = new SpringLiquibase();
        liquibase.setDataSource(dataSource);
        liquibase.setChangeLog(properties.getChangeLog());
        liquibase.setDatabaseChangeLogTable(properties.getDatabaseChangeLogTable());
        liquibase.setDatabaseChangeLogLockTable(properties.getDatabaseChangeLogLockTable());
        liquibase.setContexts(properties.getContexts());
        liquibase.setDefaultSchema(properties.getDefaultSchema());
        liquibase.setLiquibaseSchema(properties.getLiquibaseSchema());
        liquibase.setDropFirst(properties.isDropFirst());
        liquibase.setShouldRun(properties.isEnabled());
        liquibase.setLabels(properties.getLabels());
        liquibase.setChangeLogParameters(properties.getParameters());
        liquibase.setRollbackFile(properties.getRollbackFile());
        return liquibase;
    }
}

Expected/Desired Behavior
For both Liquibase instances all changesets are applied independently.
Liquibase Version
4.21.1
Database Vendor & Version
PostgreSQL 15
Liquibase Integration
spring boot
Liquibase Extensions
none
OS and/or Infrastructure Type/Provider
Ubuntu
Additional Context
No response
Are you willing to submit a PR?

[ ] I'm willing to submit a PR (Thank you!)

Hi - the cache key has been changed and upgraded a lot since 4.21.0 so I expect this issue to be resolved by now.

authors: filipelautert stephanpelikan

repo: liquibase/liquibase


text:
Generators result in fatal error

Let's say you have two classes in separate files:
<?php

class GeneratorTest extends GeneratorTestParent {}

<?php

class AOPTestParent {
    protected function generator()
    {
        yield 'foo';
    }
}

Then, it is being internally converted to:
<?php

class AOPTestParent {
    protected function generator()
    { if (($__am_res = __amock_before($this, __CLASS__, __FUNCTION__, array(), false)) !== __AM_CONTINUE__) return $__am_res;
        yield 'foo';
    }
}

And any inclusion of AOPTest results in PHP Fatal error:  Generators cannot return values using "return", since return was added to that method.

I think, that this issue is related to the AspectMock due to return $__am_res;. Go! AOP uses another approach for creating proxies for methods, so this should work.
I have tested this now, everything is OK:
Ttl is: 10
Take 1.452ms to call method Demo\Example\CacheableDemo:getReport
Result is:
object(Generator)[54]

Take 0.030ms to call method Demo\Example\CacheableDemo:getReport
Result is:
object(Generator)[54]

Code of the method was changed to the following:
    public function getReport($from)
    {
        // long calculation for 100ms
        usleep(0.1*1e6);

        yield 100;
    }

Please notice, that generator instance was cached correctly (id: 54) :)

authors: TiGR lisachenko

repo: lisachenko/go-aop-php


text:
所有音乐 qq音乐搜索显示圈圈其他没问题

借个楼，有解决办法了通知我

fixed in 2.26

authors: 12ms mikelxk starsfaith


text:
ci: do not hit the default branch protection by generating docs on pull requests

…

[x] I have read the contributing guidelines
[x] I have followed the coding guidelines
[x] I have written unit tests
[x] I have made sure that the pull request is of reasonable size and can be easily reviewed

The automatic commit is not triggering the CI because GitHub understands the push event has been generated from its actions.
Theoretically, we should checkout the repo with a PAT to make that work (not sure we want that at the moment). Read more here.

repo: listendev/lstn


text:
Video capture yuv420 to rgb

Hey folks, stoked to see this project here. I have a use case for which I would like to start using this project, instead of directly using libcamera-raw/libcamera-vid.
In essence, I would like to capture video off of my picamera 2, and convert that data to rgb format. Out of the box, libcamera-vid supports few formats and yuv420 seems to be the base format coming out of the ISP.
Do folks have an recommended way of handling this using this library? Perhaps the mjpeg video example which is already in the repo is the best place to start, and:

instead of mjpeg, use yuv420,
when a frame is received, manually convert from yuv420 to rgb,
emit convert rgb output from there.

Thoughts?

Hi,
If I remember correctly, raspberry ISP should support RGB output. You can use list_cameras example from this repository and it will print all supported formats. I think the official libcamera-apps also have an option to print supported formats.
If RGB is supported, then you can just set the format to RGB instead of MJPEG in video example and it should work. Although I haven't done much testing on formats with multiple data planes (MJPEG has just one, while RGB has 3), so report if you encounter any issues.
If RGB is not supported then yes, I think you can just capture YUV420 and convert it yourself. This will be slower than with ISP, but it should still be much faster than encoding/compressing.

Hey folks, stoked to see this project here. I have a use case for which I would like to start using this project, instead of directly using libcamera-raw/libcamera-vid.
In essence, I would like to capture video off of my picamera 2, and convert that data to rgb format. Out of the box, libcamera-vid supports few formats and yuv420 seems to be the base format coming out of the ISP.
Do folks have an recommended way of handling this using this library? Perhaps the mjpeg video example which is already in the repo is the best place to start, and:

instead of mjpeg, use yuv420,
when a frame is received, manually convert from yuv420 to rgb,
emit convert rgb output from there.

Thoughts?

I am using the Raspberry Pi Camera Module 2 (8MP) [IMX219] on a Raspberry Pi 4 with 8GB RAM. I was unable to get MJPEG working with the camera and found RGB888 to be the best alternative for my use case. However, I did find the following formats available for this camera:

NV21
YUV420
NV12
XRGB8888
BGR888
RGB888
XRGB8888
RGB565
YVYU
YUYV
VYUY
UYVY

To get the camera working with RGB888, I modified the jpeg_capture.rs example to utilize RGB888 instead of MJPEG.
use drm_fourcc::DrmFourcc;

use image::RgbImage;
use image::ColorType;
use image::ImageBuffer;

use std::time::Duration;

use libcamera::{
    camera::CameraConfigurationStatus,
    camera_manager::CameraManager,
    framebuffer::AsFrameBuffer,
    framebuffer_allocator::{FrameBuffer, FrameBufferAllocator},
    framebuffer_map::MemoryMappedFrameBuffer,
    pixel_format::PixelFormat,
    properties,
    stream::StreamRole,
    geometry::Size,
};

const PIXEL_FORMAT_RGB888: PixelFormat = PixelFormat::new(DrmFourcc::Rgb888 as u32, 0);

fn main() {
    let filename = "rgb888_capture.png";

    // Set size.
    let size = Size { width: 800, height: 600 };

    // Initialize the camera manager and select the first camera.
    let mgr = CameraManager::new().unwrap();
    let cameras = mgr.cameras();
    let cam = cameras.get(0).expect("No cameras found");
    println!(
        "Using camera: {}",
        *cam.properties().get::<properties::Model>().unwrap()
    );

    // Acquire the camera.
    let mut cam = cam.acquire().expect("Unable to acquire camera");

    // This will generate default configuration for each specified role.
    let mut cfgs = cam.generate_configuration(&[StreamRole::ViewFinder]).unwrap();

    // Set the desired pixel format and size for the configuration.
    cfgs.get_mut(0).unwrap().set_pixel_format(PIXEL_FORMAT_RGB888);
    cfgs.get_mut(0).unwrap().set_size(size);

    // Print the generated configuration.
    println!("Generated config: {:#?}", cfgs);

    // Validate the generated configuration.
    match cfgs.validate() {
        CameraConfigurationStatus::Valid => println!("Camera configuration valid!"),
        CameraConfigurationStatus::Adjusted => println!("Camera configuration was adjusted: {:#?}", cfgs),
        CameraConfigurationStatus::Invalid => panic!("Error validating camera configuration"),
    }
    cam.configure(&mut cfgs).expect("Unable to configure camera");

    // Allocate frame buffers for the stream.
    let mut alloc = FrameBufferAllocator::new(&cam);
    let stream = cfgs.get(0).expect("Failed to get stream configuration").stream().expect("Failed to get stream");
    let buffers = alloc.alloc(&stream).expect("Failed to allocate buffers");
    println!("Allocated {} buffers", buffers.len());

    // Convert FrameBuffer to MemoryMappedFrameBuffer, which allows reading &[u8]
    let buffers = buffers
        .into_iter()
        .map(|buf| MemoryMappedFrameBuffer::new(buf).expect("Failed to map framebuffer"))
        .collect::<Vec<_>>();

    // Create capture requests and attach buffers.
    let mut reqs = buffers.into_iter().map(|buf| {
        let mut req = cam.create_request(None).expect("Failed to create request");
        req.add_buffer(&stream, buf).expect("Failed to add buffer to request");
        req
    }).collect::<Vec<_>>();

    // Completed capture requests are returned as a callback.
    let (tx, rx) = std::sync::mpsc::channel();
    cam.on_request_completed(move |req| {
        tx.send(req).expect("Failed to send completed request");
    });

    // Start the camera and queue a single capture request.
    cam.start(None).expect("Failed to start camera");
    cam.queue_request(reqs.pop().expect("Failed to pop request")).expect("Failed to queue request");

    println!("Waiting for camera request execution");
    let req = rx.recv_timeout(Duration::from_secs(2)).expect("Camera request failed");

    println!("Camera request {:?} completed!", req);
    println!("Metadata: {:#?}", req.metadata());

    // Retrieve and process the framebuffer data from the completed request.
    let framebuffer: &MemoryMappedFrameBuffer<FrameBuffer> = req.buffer(&stream).expect("Failed to get framebuffer");
    println!("FrameBuffer metadata: {:#?}", framebuffer.metadata());

    // RGB data is interleaved as a single plane.
    let planes = framebuffer.data();
    let rgb_plane = match planes.get(0) {
        Some(plane) => plane,
        None => {
            eprintln!("RGB data is not available");
            return;
        }
    };

    // Create an ImageBuffer from the raw RGB data
    let img: RgbImage = ImageBuffer::from_raw(size.width, size.height, rgb_plane.to_vec()).expect("Unable to form the image buffer");

    // Save the buffer to a PNG file.
    image::save_buffer(&filename, &img, size.width, size.height, ColorType::Rgb8).unwrap();

    println!("PNG file saved to {}", &filename);

    // Everything is cleaned up automatically by Drop implementations.
}

Make sure to include drm-fourcc, image, and, lastly, libcamera manually via Git (for the Raspberry Pi, see issue #33) in the Cargo.toml file.
[package]
name = "app"
version = "0.1.0"
edition = "2021"

[dependencies]
drm-fourcc = "2.2"
image = "0.24.7"
libcamera = { git = "https://github.com/lit-robotics/libcamera-rs.git" }

What threw me off at first was that the RGB data is interleaved as a single plane, rather than being split into three separate planes for each color channel, as @chemicstry hinted. For more insight, see here (archive).
P.S. @thedodd, I'm aware that you were referring to video, but I haven't reached that part of my project yet. Nevertheless, I thought sharing my findings might be helpful, as they could also apply to the video implementation.

Hi, I am using the camera module2 and raspberry pi and converting the NV12 format via dcv-color-primitives. NV12 is a YUV format so this might help.
Code example:
use dcv_color_primitives as dcp;
use dcp::{convert_image, ColorSpace, ImageFormat, PixelFormat};
use image::{ColorType, ImageEncoder};

pub(crate) fn nv12_to_rgb(planes: &Vec<&[u8]>, width: u32, height: u32) -> Result<Vec<u8>, &'static str> {
    let src_format = ImageFormat {
        pixel_format: PixelFormat::Nv12,
        color_space: ColorSpace::Bt601,
        num_planes: 2, // NV12 has two planes: Y (luminance) and UV (chrominance)
    };

    let dst_format = ImageFormat {
        pixel_format: PixelFormat::Rgb,
        color_space: ColorSpace::Rgb,
        num_planes: 1,
    };

    let mut dst_data = vec![0u8; (3 * width * height) as usize]; // RGB output

    convert_image(
        width,
        height,
        &src_format,
        None,
        &[planes[0], planes[1]], // Y and UV planes
        &dst_format,
        None,
        &mut [&mut dst_data],
    ).map_err(|_| "Failed to convert NV12 to RGB")?;

    Ok(dst_data)
}

Which you can use by just passing the buffer data, taking the example from the repo:
    // For NV12, we expect two data planes: Y (luminance) and UV (chrominance)
    let planes = framebuffer.data();

    // Convert NV12 to RGB
    let rgb_data = nv12_to_rgb(&planes, width, height).unwrap();

Its my first time writing rust so take this code carefully.

authors: alexisgaziello chemicstry frederikstroem thedodd

repo: lit-robotics/libcamera-rs


text:
Handle Response return with DTO (WIP)

Pull Request Checklist

[ ] New code has 100% test coverage
[ ] (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
[ ] (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR

Description
Integrates DTO with handlers that return Response  (and others ....) (WIP)
Close Issue(s)
#1631

Closed in favor of #1782

authors: abdulhaq-e peterschutt

repo: litestar-org/litestar


text:
Unable to call LithnetRMA from MA executor -  System.TypeInitializationException: The type initializer for 'Lithnet.ResourceManagement.Client.ResourceManagementClient' threw an exception

When I invoke Lithnet Resource Management PS from MA executor, it would fail on
Set-ResourceManagementClient -BaseAddress "http://localhost:5725";
there is error in the application eventlog about System.TypeInitializationException: The type initializer for 'Lithnet.ResourceManagement.Client.ResourceManagementClient' threw an exception.
Seems it is not able to access the configure file when executed from the MA executor.
The code I executed as follow:
function ExecutionComplete
{
	param([Lithnet.Miiserver.Client.RunDetails]$lastRunDetails)

	# If the run was an import an a change was made, create the MACD report
	foreach ($step in $lastRunDetails.StepDetails)
	{
		if ($step.StepDefinition.Type -eq 'FullImport'){
			Set-ResourceManagementClient -BaseAddress "http://localhost:5725";

			$terminatedPortalUsers = Search-Resources -Xpath "/Person[(EmployeeEndDate > op:subtract-dayTimeDuration-from-dateTime(fn:current-dateTime(), xs:dayTimeDuration('P1D'))) and (EmployeeEndDate < fn:current-dateTime())]" -AttributesToGet @("AccountName","EmployeeEndDate","EmployeeID")

			$terminatedPortalUsers | Export-Csv "C:\temp\test1.txt" -notype

			$psons = Get-MVObject -ObjectType person
			$psons | Export-Csv "C:\temp\test2.txt" -notype
		}
	}
}

The error in the eventlog as below:

Ascender SQL MA: ExecutionComplete handler threw an exception
System.ApplicationException: The PowerShell script encountered an error
at ExecutionComplete, : line 20
System.TypeInitializationException: The type initializer for 'Lithnet.ResourceManagement.Client.ResourceManagementClient' threw an exception. ---> System.InvalidCastException: [A]Lithnet.ResourceManagement.Client.ClientConfigurationSection cannot be cast to [B]Lithnet.ResourceManagement.Client.ClientConfigurationSection. Type A originates from 'Lithnet.ResourceManagement.Client, Version=1.0.6297.14599, Culture=neutral, PublicKeyToken=bd0636700c1e2538' in the context 'LoadNeither' in a byte array. Type B originates from 'Lithnet.ResourceManagement.Client, Version=1.0.6435.24336, Culture=neutral, PublicKeyToken=bd0636700c1e2538' in the context 'LoadFrom' at location 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\LithnetRMA\Lithnet.ResourceManagement.Client.dll'.
at Lithnet.ResourceManagement.Client.ClientConfigurationSection.GetConfiguration()
at Lithnet.ResourceManagement.Client.ResourceManagementClient..cctor()

what is the proper way to execute Lithnet Resource Management PS from MA executor from the Executor MA?
I have tried to wrap around the call inside a script block, it works but the Get-MVObject would fail, it would return

The Synchronization Service Manager service has stopped.

when the Synchronization Service Manager service is actually running.

@johnyukloud this is definitely a bug, but a complex one to solve. I'll look to resolve this in v2. In the mean time, the workaround would be to launch a new instance of PowerShell to run the fim service query such as shown in this example https://stackoverflow.com/questions/23237473/powershell-launch-script-in-new-instance
You seem to be referencing another issue with Get-MVObject. That is from a different PowerShell module. Can you provide more information about the context of the issue you are having there?

@johnyukloud I'm working on the fix for this, but I've got a cleaner workaround you can use in the mean time. Edit the Lithnet.Miiserver.AutoSync.exe.config file and remove the following two lines
<section name="lithnetResourceManagementClient" type="Lithnet.ResourceManagement.Client.ClientConfigurationSection, Lithnet.ResourceManagement.Client"/>

and
<lithnetResourceManagementClient resourceManagementServiceBaseAddress="http://localhost:5725"/>

This will prevent the error you are seeing. These lines are not needed for AutoSync or the PowerShell module to work.

@johnyukloud i'm marking this issue as done. You can apply the workaround above, or install the latest version of LithnetRMA from https://github.com/lithnet/resourcemanagement-powershell/releases/tag/v1.0.6623
If you are still having issues with Get-MVObject, please open a new issue, and we work on that one separately, as it is unrelated to what is going on here.

Great! Thanks Ryan

authors: johnyukloud ryannewington

repo: lithnet/miis-autosync