khal: add setuptools_scm to dependencies

Things done:

[x] Tested using sandboxing (nix-build --option build-use-chroot true or nix.useChroot on NixOS)
[x] Built on platform(s): NixOS
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[x] Fits CONTRIBUTING.md.

cc @matthiasbeyer @jgeerds

Why?

@matthiasbeyer  The commit message explains the PR. I should have specified the content in the PR as well (I guess I forgot because of the PR template)

khal: add setuptools_scm to dependencies. This is required because vdirsyncer does not depend on it at runtime anymore.

Hm.
Okay, just for understanding: What does setuptools_scm and why do we need it? How is this related to vdirsyncer?

AFAIU, setuptools_scm lets upstream developers use their version control system to assign numbers to releases without changing their setup.py. khal uses that so setuptools_scm is a build-time dependency of khal. Before my change to vdirsyncer, things were working fine because vdirsyncer had setuptools_scm as a runtime dependency. But I fixed that because setuptools_scm is not needed at runtime, only when building vdirsyncer. This PR, re-adds setuptools_scm as dependency to khal, but this time only at build-time, not at runtime.


release does not fetch plugins

If running release in a freshly cloned repository it fetches the deps and compiles them however unlike compile it does not fetch plugins.

the error presented is this:
===> Unable to run post hooks for 'compile', command 'compile' in namespace 'pc' not found.

after closing this code:
git cline https://github.com/project-fifo/sniffle/tree/dd9ccba1fed3dc6f6386edd46061c87f5a4908e8
cd sniffle
./rebar3 release

I can't reproduce. Can you check if this is still an issue with current rebar3 and if not close it?

Looks good, could not reproduce it any more!

I think I've to re-open this, I get the same behaviour now even with compile -.-

Do you have an example I use to replicate?

Works fine here in my project:
/home/cpaula/projects/dcca-server-OTP [git::rebar3] [cpaula@NTSP052387] [11:45]
> ./rebar3 release
===> Fetching rebar3_diameter_compiler ({git,
                                                "https://github.com/carlosedp/rebar3_diameter_compiler.git",
                                                {branch,"master"}})
===> Compiling rebar3_diameter_compiler
===> Verifying dependencies...
===> Fetching lager ({git,"https://github.com/basho/lager.git",
                                 {ref,"d33ccf3b69de09a628fe38b4d7981bb8671b8a4f"}})
===> Fetching goldrush ({git,"git://github.com/DeadZen/goldrush.git",
                                   {ref,
                                       "71e63212f12c25827e0c1b4198d37d5d018a7fec"}})
===> Compiling goldrush
===> Compiling lager
===> Compiling diameter files...
===> Compiling ocsgateway
===> Compiling dccaserver

Sorry for the late reply, the sniffle repository, when pc is not part of the plugins but only included by the overlay for eleveldb.

I can't reproduce. Can you please try again and close if it is working.

aaaand gone again :( heisenbug sorry

I'm getting this.

Same issue here and I've discovered the way to reproduce it. Honestly, I do not have any idea why this happens. I am using OTP 18.2.1

The project uses eleveldb and following overlay is defined at rebar.config (rebar3 is part of the project version rebar 3.0.0-beta.3+build.302.refc1bde20)

{overrides, [
   %%
   %% required to assemble native library
   {override, eleveldb, [
      {plugins, [pc]},
      {artifacts, ["priv/eleveldb.so"]},

      {provider_hooks, [
         {post, [
            {compile, {pc, compile}},
            {clean, {pc, clean}}
         ]}
      ]}
   ]}
]}.

project is build-able at MacOS no issue priv/eleveldb.so is linked

project is copied as-is to Linux host and _build dir is nuked. Compilation is failed with following error.

===> Unable to run post hooks for 'compile', command 'compile' in namespace 'pc' not found.
make: *** [compile] Error 1

remove rebar3 and download it again, version rebar 3.0.0-beta.3+build.311.ref4fd77ef. the build is succeeded.

If I get a latest rebar3 to project and repeat (step 1 - 3) the build is successful.

I'm confused at the end. Are you saying upgrading rebar3 resolved
your issue?
--
Tristan Sloughter
<EMAIL_ADDRESS>On Mon, Feb 29, 2016, at 09:25 AM, fogfish wrote:

Same issue here and I've discovered the way to reproduce it. Honestly, I do not have any idea why this happens. I am using OTP 18.2.1

The project uses eleveldb and following overlay is defined at rebar.config (rebar3 is part of the project version rebar 3.0.0-beta.3+build.302.refc1bde20)
{overrides, [
%%
%% required to assemble native library
{override, eleveldb, [
{plugins, [pc]},
{artifacts, ["priv/eleveldb.so"]},

  {provider_hooks, [
     {post, [
        {compile, {pc, compile}},
        {clean, {pc, clean}}
     ]}
  ]}

]}
]}.

project is build-able at MacOS no issue priv/eleveldb.so is linked

project is copied as-is to Linux host and _build dir is nuked. Compilation is failed with following error.

===> Unable to run post hooks for 'compile', command 'compile' in namespace 'pc' not found.
make: *** [compile] Error 1

remove rebar3 and download it again, version rebar 3.0.0-beta.3+build.311.ref4fd77ef. the build is succeeded.

If I get a latest rebar3 to project and repeat (step 1 - 3) the build is successful.

—
Reply to this email directly or view it on GitHub[1].

Links:

https://github.com/rebar/rebar3/issues/597#issuecomment-190256012

Yeah,it solves. but ...
I do not have any intent to upgrade rebar3 before making a new build of my application.
May be you should also clarify in the documentation that 'old' rebar cannot discover and download plug-in. At least, as user I'd like to know how often I should upgrade rebar3: every week, every day, etc.

I'd rather not tie docs to versions before we are stable.
We plan to go stabe before next week and then these things will be
hammered out and more consistent and tied to versions.
--
Tristan Sloughter
<EMAIL_ADDRESS>On Mon, Feb 29, 2016, at 10:46 AM, fogfish wrote:

Yeah,it solves. but ...

I do not have any intent to upgrade rebar3 before making a new build of my application.

May be you should also clarify in the documentation that 'old' rebar cannot discover and download plug-in. At least, as user I'd like to know how often I should upgrade rebar3: every week, every day, etc.

—
Reply to this email directly or view it on GitHub[1].

Links:

https://github.com/rebar/rebar3/issues/597#issuecomment-190283608

:+1:
at least, you know a root causes of this type of errors!


Stock information data

Dear, I am very interested by the Investpy library and I would like to know if it could be possible to improve the equivalent of investpy.get_funds_information but for stock as investpy.get_stock_information for instance in order to get stock fundamental data such as market cap...
Thanks in advance,
Best regards,
Reynald

Hi @rdoktor!
The new investpy release 0.9.11 is out! In this release all the issues have been fixed, including the one you described here. So you can now update the package via pip using: pip install investpy==0.9.11.
Thank you! ⭐ :octocat:

Thanks a lot Alvaro ! !
Le dim. 15 déc. 2019 11:22, Álvaro Bartolomé del Canto <
<EMAIL_ADDRESS>a écrit :

Hi @rdoktor https://github.com/rdoktor!
The new investpy release 0.9.11 is out! In this release all the issues
have been fixed, including the one you described here. So you can now
update the package via pip using: pip install investpy==0.9.11.
Thank you! ⭐ [image: :octocat:]
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/alvarob96/investpy/issues/77?email_source=notifications&email_token=AK2VTLSQRVNO4EWPNLNOTDDQYYAOZA5CNFSM4JTZENVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4VZ6Q#issuecomment-565796090,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AK2VTLVPJ3OYVAOT7LBTNEDQYYAOZANCNFSM4JTZENVA
.


Review recommended best practices in the repo

I believe it makes a lot of sense. If so, we're changing all notebooks name in this PR, right?


Does this tool support keypoint detection?

as an example， just like this：

if not，then how should I develop that based on your code?
as an newer of QT, could you give me some suggestions? thinks !

Not yet. In fact, the canvas.py is the core file in this rep  to do interaction， you can set a list of points  to be labeled in order, then get the position of each point by adding some code in the canvas.py. Some task manage code also needs to be added to the labelImg.py, PRs are welcome!

ok，thanks for your reply


Get complete status of a consumer

Thanks for contributing to PyKafka. You can provide useful information that will
make root cause analysis easier and get your issue fixed more quickly.
Please provide runnable code that replicates the issue if possible.
If using a consumer or producer, please include code that indicates how it was
instantiated, including keyword arguments.
Detailed step-by-step instructions on how to replicate the issue make diagnosing the
root cause easier. If possible, please include these as well.
When linking to specific lines of code in pykafka or other projects, please use
github permalinks. You can do this by pressing "y" on any github file view and then
creating a line link.
PyKafka version: If using the latest version of pykafka, please paste the commit hash
Kafka version:

I need to get a complete status about the topic partition ie, whether the consumers consumed all messages of that partition or not.
Here is my producer.py

        with topic.get_producer() as producer:
            for file in list_files:
                url = file.geturl()
                producer.produce(str({'path':url}))

Here is my consumer code
while(1):
       	consumer_a = topic_obj.get_balanced_consumer(consumer_group=b"charlie",zookeeper_connect="localhost:2181")
	msg=consumer_a.consume()
	while(msg):
        /* Use msg*/
          msg=consumer_a.consume()

Along with this i need to check something like topic.iscompleted()
How can i do that using pykafka?

Hi @Akhilvis. You can get the latest available offset for a given partition with
consumer.partitions[0].latest_available_offset()

and you can check the offset of the last message consumed for a partition by accessing a private attribute:
consumer._partitions[consumer.partitions[0]].last_offset_consumed

An implementation of is_completed based on these calls might look like this
def is_completed(consumer):
    for partition in consumer.partitions:
        if consumer._partitions[partition].last_offset_consumed < partition.latest_available_offset():
            return False
    return True

We don't expose _partitions in the public API because the particular partition that a given message came from is a detail that Kafka clients prefer to obfuscate. If you're concerned about having consumed all messages from a given partition, your use case probably lends itself to using a single partition, at which point you'd be better off simply comparing consumer.consume().offset to topic_obj.latest_available_offsets().


refactor(sbb-option, sbb-optgroup, sbb-autocomplete, sbb-select): lit migration

Codecov Report

:exclamation: No coverage uploaded for pull request base (lit-migration@73ab56a). Click here to learn what that means.
The diff coverage is n/a.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
@@               Coverage Diff                @@
##             lit-migration    #2062   +/-   ##
================================================
  Coverage                 ?   91.30%
================================================
  Files                    ?      143
  Lines                    ?    19000
  Branches                 ?      938
================================================
  Hits                     ?    17347
  Misses                   ?     1642
  Partials                 ?       11

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Add token based auth

Allow tokens stored in a secret to be used to control access to a group of cipools

/lgtm


Invalid license in Ignition Edge

Hi
I have installed the ignition node-red  module in ignition edge but after the installation it showing status as Faulted (Not eligible for use with Ignition Edge, unless licensed) and License is invalid
is there anything i am missing here while installing
ignition edge version i am using  is 8.1.16
can anybody help me with this ?

If you have a valid license (not a trial) ask your technical account representative to add Node-RED to your license. I believe that being a third party module from Travis and Wes that it is not included in a standard Edge license but could be wrong about that.
CLINT GUILLORY
Automation Project Specialist
P<PHONE_NUMBER>tel:337-280-8368
From: rj187 @.>
Sent: Thursday, April 21, 2022 7:26 AM
To: IgnitionModuleDevelopmentCommunity/IgnitionNode-RED @.>
Cc: Subscribed @.***>
Subject: [IgnitionModuleDevelopmentCommunity/IgnitionNode-RED] Invalid license in Ignition Edge (Issue #22)
Hi
I have installed the ignition node-red module in ignition edge but after the installation it showing status as Faulted (Not eligible for use with Ignition Edge, unless licensed) and License is invalid
is there anything i am missing here while installing
ignition edge version i am using is 8.1.16
can anybody help me with this ?
—
Reply to this email directly, view it on GitHubhttps://github.com/IgnitionModuleDevelopmentCommunity/IgnitionNode-RED/issues/22, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AU3O7GTP44RZEFXIH23SVQDVGFCL5ANCNFSM5T7CQNGA.
You are receiving this because you are subscribed to this thread.Message ID<EMAIL_ADDRESS>

Is it a trial given to you by an Ignition Representative or are you just using the two hour resettable trial, if the latter I don’t think it will run Node -Red in the standard two hour trial mode. If you are testing, talk to an Ignition Representative to find out if they would be willing to give you a limited time trial license for testing / development purposes.
CLINT GUILLORY
Automation Project Specialist
P<PHONE_NUMBER>tel:337-280-8368
From: rj187 @.>
Sent: Thursday, April 21, 2022 9:08 AM
To: IgnitionModuleDevelopmentCommunity/IgnitionNode-RED @.>
Cc: Clint Guillory @.>; Mention @.>
Subject: Re: [IgnitionModuleDevelopmentCommunity/IgnitionNode-RED] Invalid license in Ignition Edge (Issue #22)
Hi
@cguillory7280https://github.com/cguillory7280
I don't have a valid license , I am using trail license
—
Reply to this email directly, view it on GitHubhttps://github.com/IgnitionModuleDevelopmentCommunity/IgnitionNode-RED/issues/22#issuecomment-1105261080, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AU3O7GTMRTHIBGQT2ZESDDDVGFOKVANCNFSM5T7CQNGA.
You are receiving this because you were mentioned.Message ID<EMAIL_ADDRESS>

Can you send to me (via email) your trial license key?

HI
I am using the two-hour resettable trial, so I don't have a license key, as @cguillory7280  mentioned I guess I need a license to make it work, Or is there any way?
Thanks & Regrades

Unfortunately, the module will be only allowed to run on Edge (since it is 3rd party) when the Gateway is licensed. We can provide a trial license. You can either email me directly or contact your account representative.


Don't fail on violations

This was enabled on Hound itself in order to vet the feature before
releasing it to the world. The Hound team treats violations as
suggestions and sometimes decides to ignore them. In these cases,
failing the PR does not make sense. The feature has been working well
for quite awhile now, so it can be disabled here.
Am I correct in thinking no one else wants this enabled? @thoughtbot/hound

I have a somewhat biased opinion that we should keep this on because we should drink our own cool-aid. But I would like to be swayed otherwise.

I remember everyone being a little hesitant before adding the feature. If that's changed we can definitely leave it enabled.

I enjoy having it enabled. And haven't felt a pain in having it so.

Ok, let's keep it!


TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Hi,
I have just attempted to use this script to run against my library.
I downloaded the 'master' .zip file, extracted it and move ibroadcast-uploader.py to my music directory.
I am on Windows 11 and I installed Python 3.12
I open PowerShell with regular permissions and run the below line.
python ibroadcast-uploader.py "login_token"
It then proceeds to build the file list and give me the option to list 'L' or upload 'U'
When I select 'L' it lists all the files and asks me to upload 'U'
When I type 'U' the below is printed
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
If you need more information please let me know, and I hope I am asking in the right area.

Hi. Never tested it on WIndows before :)
Is that everything that is being printed? Maybe there's also some information about the line of code that triggers this error?

The below is all I see
PS Z:\musicdir> python ibroadcast-uploader.py "token"
Building file list...
Found 120642 files.  Press 'L' to list, or 'U' to start the upload.
--> U

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
PS Z:\musicdir>

So have you run it on Linux? I could try spooling up a VM, Ubuntu or Debian, and give it a test.
Will do that and post results
Thank you for your time with this, not that knowledgeable with coding :)

Ran up a Debian 11 VM
Was able to run the script perfectly well
I will keep in mind to run it on Debian next time and steer clear of Windows for this purpose
One other thing, it seems one of my directories had ".flac" at the end and it closed with an error. Once I fixed the directory name it ran perfectly well.
Thank you so much for your time

Glad that you figured it out! However, I'm willing to try to make it work on Windows as well, so I'm reopening it for.

Not a problem, happy to help with testing if you need


Sir Syed University of Engineering & Technology

Added sir syed university

@aliansari180 I am sorry, the domain ssuet.edu.pk is removed from our trusted domains list because it was abused in the past. If you are the student of this school, please enroll to GitHub Student Developer Program. Then apply for JetBrains educational subscription with your GitHub account (GitHub tab at https://www.jetbrains.com/shop/eform/students).

Okay
On Sun, Nov 24, 2024, 8:34 PM Philip Torchinsky @.***>
wrote:

Closed #25413 https://github.com/JetBrains/swot/pull/25413.
—
Reply to this email directly, view it on GitHub
https://github.com/JetBrains/swot/pull/25413#event-15410860466, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/A3NSOLWLIXNFUHMFOHOC2UT2CHWY7AVCNFSM6AAAAABSMDJNQWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVGQYTAOBWGA2DMNQ
.
You are receiving this because you were mentioned.Message ID:
@.***>


Possible divergence from Chrome?

Thanks for Stretch!
Here's a very basic flexbox layout with five divs, where the yellow top-row div is 24px high in Chrome.
Below is (supposed to be) a purely mechanical translation of that into Stretch, which outputs the size of that top-row node:
size: Size {
    width: 20000.0,
    height: 0.0,
},

So the height from Stretch is 0px, not 24px (and the width a bit squiffy too).
It seems Stretch thinks that the 100% high other_node should win almost all the available 73.0 points of height. Adding a flex_shrink: 0.0 to top_row, or specifying the height of other_node in points rather than 100%, both work around the issue.
Any ideas as to the divergence welcome - apologies if this is just user error somehow.
use std::default::Default;
use stretch::{geometry::*, node::Stretch, style::*, Error};

fn main() -> Result<(), Error> {
    let mut stretch = Stretch::new();

    // top-row (yellow)
    let top_row = stretch.new_node(
        Style {
            size: Size {
                width: Dimension::Percent(100.0),
                height: Dimension::Points(24.0),
            },
            // one way to fix the issue:
            // flex_shrink: 0.0,
            ..Default::default()
        },
        vec![],
    )?;

    // lower-row (cyan)
    let lower_row_1 = stretch.new_node(
        Style {
            size: Size {
                width: Dimension::Percent(100.0),
                height: Dimension::Points(20.0),
            },
            ..Default::default()
        },
        vec![],
    )?;
    let lower_row_2 = lower_row_1.clone();

    // other-rows (red)
    let other_rows = stretch.new_node(
        Style {
            flex_direction: FlexDirection::Column,
            justify_content: JustifyContent::Center,
            size: Size {
                width: Dimension::Percent(100.0),
                height: Dimension::Percent(100.0),
            },
            margin: Rect {
                top: Dimension::Points(5.0),
                ..Default::default()
            },
            ..Default::default()
        },
        vec![lower_row_1, lower_row_2],
    )?;

    // outer (blue)
    let outer = stretch.new_node(
        Style {
            size: Size {
                width: Dimension::Points(200.0),
                height: Dimension::Points(73.0),
            },
            flex_direction: FlexDirection::Column,
            padding: Rect {
                top: Dimension::Points(5.0),
                ..Default::default()
            },
            ..Default::default()
        },
        vec![top_row, other_rows],
    )?;
    stretch.compute_layout(outer, Size::undefined())?;
    dbg!(stretch.layout(top_row)?);
    Ok(())
}

I have noticed this too, and flex_shrink = 0 fixes the issue. I'll see if I can fix this in an active fork. Might be incorrect handling of flex-shrink.
Expected from chrome:

Returned from stretch:

I have noticed this too, and flex_shrink = 0 fixes the issue. I'll see if I can fix this in an active fork. Might be incorrect handling of flex-shrink.
Expected from chrome:

Returned from stretch:


coin bitcoin
Set active coin to: bitcoin    Use 'coin' to change.  (name: 'bitcoin'  symbol: btc  numericalid: 0)
newKey
Result:  4e8c1773ce1ca447594fa23a445d9952236c7a15e96802b880aab4d918bdcfd9
addrPri #
Result:  bc1qvjf93nc80f3fu7j2ehqv6xw6zqa5cny32hl90y
fileW btcaddr.txt #
Written to file 'btcaddr.txt', 21 bytes.

import { Chain } from "@defillama/sdk/build/general";
import { BaseAdapter, BreakdownAdapter, DISABLED_ADAPTER_KEY, FetchResultVolume, IJSON } from "../../adapters/types";
import { CHAIN } from "../../helpers/chains";
import disabledAdapter from "../../helpers/disabledAdapter";
import { getGraphDimensions } from "../../helpers/getUniSubgraph"
import axios from "axios";
import { getPrices } from "../../utils/prices";
const endpoints = {
[CHAIN.BSC]: "https://proxy-worker.pancake-swap.workers.dev/bsc-exchange",
[CHAIN.ETHEREUM]: "https://api.thegraph.com/subgraphs/name/pancakeswap/exhange-eth",
[CHAIN.POLYGON_ZKEVM]: "https://api.studio.thegraph.com/query/45376/exchange-v2-polygon-zkevm/version/latest",
[CHAIN.ERA]: "https://api.studio.thegraph.com/query/45376/exchange-v2-zksync/version/latest",
[CHAIN.ARBITRUM]: "https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v2-arb",
[CHAIN.LINEA]: "https://graph-query.linea.build/subgraphs/name/pancakeswap/exhange-v2",
[CHAIN.BASE]: "https://api.studio.thegraph.com/query/45376/exchange-v2-base/version/latest",
[CHAIN.OP_BNB]: ${process.env.PANCAKESWAP_OPBNB_SUBGRAPH}/subgraphs/name/pancakeswap/exchange-v2
};
const stablesSwapEndpoints = {
[CHAIN.BSC]: "https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-stableswap"
}
const v3Endpoint = {
[CHAIN.BSC]: "https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-bsc",
[CHAIN.ETHEREUM]: "https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-eth",
[CHAIN.POLYGON_ZKEVM]: "https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest",
[CHAIN.ERA]: "https://api.studio.thegraph.com/query/45376/exchange-v3-zksync/version/latest",
[CHAIN.ARBITRUM]: "https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v3-arb",
[CHAIN.LINEA]: "https://graph-query.linea.build/subgraphs/name/pancakeswap/exchange-v3-linea",
[CHAIN.BASE]: "https://api.studio.thegraph.com/query/45376/exchange-v3-base/version/latest",
[CHAIN.OP_BNB]: ${process.env.PANCAKESWAP_OPBNB_SUBGRAPH}/subgraphs/name/pancakeswap/exchange-v3
}
const VOLUME_USD = "volumeUSD";
const graphs = getGraphDimensions({
graphUrls: endpoints,
graphRequestHeaders: {
[CHAIN.BSC]: {
"origin": "https://pancakeswap.finance",
},
},
totalVolume: {
factory: "pancakeFactories"
},
dailyVolume: {
factory: "pancakeDayData"
},
feesPercent: {
type: "volume",
Fees: 0.25,
ProtocolRevenue: 0.0225,
HoldersRevenue: 0.0575,
UserFees: 0.25,
SupplySideRevenue: 0.17,
Revenue: 0.08
}
});
const graphsStableSwap = getGraphDimensions({
graphUrls: stablesSwapEndpoints,
totalVolume: {
factory: "factories"
},
dailyVolume: {
factory: "pancakeDayData"
},
feesPercent: {
type: "volume",
Fees: 0.25, // 0.25% volume
ProtocolRevenue: 0.025, // 10% fees
HoldersRevenue: 0.1, // 40% fees
UserFees: 0.25, // 25% volume
SupplySideRevenue: 0.125, // 50% fees
Revenue: 0.0225 // 50% fees
}
});
const v3Graph = getGraphDimensions({
graphUrls: v3Endpoint,
totalVolume: {
factory: "factories",
},
dailyVolume: {
factory: "pancakeDayData",
field: VOLUME_USD
},
totalFees:{
factory: "factories",
},
dailyFees: {
factory: "pancakeDayData",
field: "feesUSD"
},
});
const startTimes = {
[CHAIN.ETHEREUM]:<PHONE_NUMBER>,
[CHAIN.BSC]:<PHONE_NUMBER>,
[CHAIN.POLYGON_ZKEVM]:<PHONE_NUMBER>,
[CHAIN.ERA]:<PHONE_NUMBER>,
[CHAIN.ARBITRUM]:<PHONE_NUMBER>,
[CHAIN.LINEA]:<PHONE_NUMBER>,
[CHAIN.BASE]:<PHONE_NUMBER>,
[CHAIN.OP_BNB]:<PHONE_NUMBER>
} as IJSON
const stableTimes = {
[CHAIN.BSC]:<PHONE_NUMBER>
} as IJSON
const v3StartTimes = {
[CHAIN.BSC]:<PHONE_NUMBER>,
[CHAIN.ETHEREUM]:<PHONE_NUMBER>,
[CHAIN.POLYGON_ZKEVM]:<PHONE_NUMBER>,
[CHAIN.ERA]:<PHONE_NUMBER>,
[CHAIN.ARBITRUM]:<PHONE_NUMBER>,
[CHAIN.LINEA]:<PHONE_NUMBER>,
[CHAIN.BASE]:<PHONE_NUMBER>,
[CHAIN.OP_BNB]:<PHONE_NUMBER>
} as IJSON
const methodology = {
UserFees: "User pays 0.25% fees on each swap.",
ProtocolRevenue: "Treasury receives 0.0225% of each swap.",
SupplySideRevenue: "LPs receive 0.17% of the fees.",
HoldersRevenue: "0.0575% is used to facilitate CAKE buyback and burn.",
Revenue: "All revenue generated comes from user fees.",
Fees: "All fees comes from the user."
}
interface ISwapEventData {
type: string;
amount_x_in: string;
amount_x_out: string;
amount_y_in: string;
amount_y_out: string;
user: string;
}
const account = '0xc7efb4076dbe143cbcd98cfaaa929ecfc8f299203dfff63b95ccb6bfe19850fa';
const getToken = (i: string) => i.split('<')[1].replace('>', '').split(', ');
const APTOS_PRC = 'https://aptos-mainnet.pontem.network';
const  getResources = async (account: string): Promise<any[]> => {
const data: any = []
let lastData: any;
let cursor
do {
let url = ${APTOS_PRC}/v1/accounts/${account}/resources?limit=9999
if (cursor) url += '&start=' + cursor
const res = await axios.get(url)
lastData = res.data
data.push(...lastData)
cursor = res.headers['x-aptos-cursor']
} while (lastData.length === 9999)
return data
}
const fetchVolume = async (timestamp: number) => {
const fromTimestamp = timestamp - 86400;
const toTimestamp = timestamp;
const account_resource: any[] = (await getResources(account))
const pools = account_resource.filter(e => e.type?.includes('swap::PairEventHolder'))
.map((e: any) => {
const [token0, token1] = getToken(e.type);
return {
type: e.type,
token0,
token1,
swap_events: {
counter: e.data.swap.counter,
creation_num: e.data.swap.guid.id.creation_num,
},
timestamp: e.data.timestamp,
counter: Number(e.data.swap.counter),
}
}).sort((a, b) => b.counter - a.counter)
const creation_num =  [14,767, 702, 12, 622, 757, 1077, 1092]
const exlude_user = [
'0x81f06fb536d97a8dc17b216aceeeab9e2d348347dcecf3601404710b85299921',
'0x4bec62452ff79010d9d248dc6961d77db00cbedbf690c22a30d923c825c7ac00',
'0xaab5c469f7f827337d80fb63fe89235f484a252898dc34931096e3c480f4adf5',
'0x0',
'0x8b6f920db09391aa521751a10b9225d5ae7b789dc73e270b9b1483c95ada0588',
'0xa383105db9c9032848c23236fb812d3e990569c658ca60b4e9adb72d1daf4ec6',
'0x6fe8d6a9c2bae15c093a82cb767fa26e73d1766b75a0eb03394b0cd3c80d1816',
'0xbdb4fc5a262d5b82d5e4f0a60b88fe04b34518943caf5972ee6a65e86895492c',
'0x70d2d370d4f17ccb70e4047e4f327550f2bda6c3d20c23225dec4e1005ab8dc1',
'0x5fbfe849d110feecd7cfbe7529fda2ce691a3ecea08af66851d793180ea01a92',
'0x67c928210094bec6f61849175ec986e514d5c2dab5ad6c00e0561d0706b0a9d5',
'0x2389a6fccfb39fff5d07dfe02fe69ea94306b6fc50afb5e6391237ae48f09043',
'0xd53b715700748751ce6944839fc64fb059ec949b66c3831e037813dd5a4caf5a',
]
const logs_swap: ISwapEventData[] = (await Promise.all(pools.filter(e => creation_num.includes(Number(e.swap_events.creation_num))).map(p => getSwapEvent(p, fromTimestamp, toTimestamp)))).flat()
const numberOfTrade: any = {};
// debugger
[...new Set(logs_swap.map(e => e.user))].forEach(e => {
numberOfTrade[e] = {};
numberOfTrade[e]['user'] = e;
numberOfTrade[e]['count'] = 0;
numberOfTrade[e]['volume'] = 0;
})
const coins = [...new Set([...logs_swap.map(p => getToken(p.type)).flat().map((e: string) => ${CHAIN.APTOS}:${e})])]
const price = (await getPrices(coins, timestamp));
const untrackVolume: number[] = logs_swap.filter(e => !exlude_user.includes(e.user)).map((e: ISwapEventData) => {
const [token0, token1] = getToken(e.type);
const token0Price = price[${CHAIN.APTOS}:${token0}]?.price || 0;
const token1Price = price[${CHAIN.APTOS}:${token1}]?.price || 0;
const token0Decimals = price[${CHAIN.APTOS}:${token0}]?.decimals || 0;
const token1Decimals = price[${CHAIN.APTOS}:${token1}]?.decimals || 0;
if (token0Decimals === 0 || token1Decimals === 0) return 0;
const in_au = ((Number(e.amount_x_in) + Number(e.amount_x_out)) / 10 ** token0Decimals) * token0Price;
const out_au = ((Number(e.amount_y_in) + Number(e.amount_y_out)) / 10 ** token1Decimals) * token1Price;
numberOfTrade[e.user]['count'] += 1
numberOfTrade[e.user]['volume'] += token0Price ? in_au : out_au;
return token0Price ? in_au : out_au;
})
const dailyVolume = [...new Set(untrackVolume)].reduce((a: number, b: number) => a + b, 0)
// console.log(Object.values(numberOfTrade).sort((a: any, b: any) => b.volume - a.volume))
return {
timestamp,
dailyVolume: dailyVolume.toString(),
dailyFees: "0",
}
}
const getSwapEvent = async (pool: any, fromTimestamp: number, toTimestamp: number): Promise<ISwapEventData[]> => {
const limit = 100;
const swap_events: any[] = [];
let start = (pool.swap_events.counter - limit) < 0 ? 0 : pool.swap_events.counter - limit;
while (true) {
if (start < 0) break;
const getEventByCreation = ${APTOS_PRC}/v1/accounts/${account}/events/${pool.swap_events.creation_num}?start=${start}&limit=${limit};
try {
const event: any[] = (await axios.get(getEventByCreation)).data;
const listSequence: number[] = event.map(e =>  Number(e.sequence_number))
const lastMin = Math.min(...listSequence)
if (lastMin >= Infinity || lastMin <= -Infinity) break;
const lastVision = event.find(e => Number(e.sequence_number) === lastMin)?.version;
const urlBlock = ${APTOS_PRC}/v1/blocks/by_version/${lastVision};
const block = (await axios.get(urlBlock)).data;
const lastTimestamp = toUnixTime(block.block_timestamp);
const lastTimestampNumber = lastTimestamp
if (lastTimestampNumber >= fromTimestamp && lastTimestampNumber <= toTimestamp)  {
swap_events.push(...event)
}
if (lastTimestampNumber < fromTimestamp) {
break;
}
if (start === 0) break;
start = lastMin - (limit + 1) > 0 ? lastMin - (limit + 1) : 0;
} catch (e: any) {
break;
// start = start - 26 > 0 ? start - 26 : 0;
}
}
return swap_events.map(e => {
return {
...e,
type: e.type,
...e.data
}
})
}
const toUnixTime = (timestamp: string) => Number((Number(timestamp)/1e6).toString().split('.')[0])
const adapter: BreakdownAdapter = {
breakdown: {
v1: {
[DISABLED_ADAPTER_KEY]: disabledAdapter,
[CHAIN.BSC]: {
fetch: async (timestamp: number) => {
const totalVolume =<PHONE_NUMBER>00;
return {
totalVolume: ${totalVolume},
timestamp: timestamp
}
},
start: async () =><PHONE_NUMBER>,
}
},
v2: Object.keys(endpoints).reduce((acc, chain) => {
acc[chain] = {
fetch: graphs(chain as Chain),
start: async () => startTimes[chain],
meta: {
methodology
}
}
return acc
}, {} as BaseAdapter),
v3: Object.keys(v3Endpoint).reduce((acc, chain) => {
acc[chain] = {
fetch:  async (timestamp: number) => {
const v3stats = await v3Graph(chain)(timestamp, {})
if (chain === CHAIN.ETHEREUM) v3stats.totalVolume = (Number(v3stats.totalVolume) -<PHONE_NUMBER>).toString()
return {
...v3stats,
timestamp
}
    },
    start: async () => v3StartTimes[chain],
  }
  return acc
}, {} as BaseAdapter),
stableswap: Object.keys(stablesSwapEndpoints).reduce((acc, chain) => {
  acc[chain] = {
    fetch: graphsStableSwap(chain as Chain),
    start: async () => stableTimes[chain],
    meta: {
      methodology : {
        UserFees: "User pays 0.25% fees on each swap.",
        ProtocolRevenue: "Treasury receives 10% of the fees.",
        SupplySideRevenue: "LPs receive 50% of the fees.",
        HoldersRevenue: "A 40% of the fees is used to facilitate CAKE buyback and burn.",
        Revenue: "Revenue is 50% of the fees paid by users.",
        Fees: "All fees comes from the user fees, which is 025% of each trade."
      }
    }
  }
  return acc
}, {} as BaseAdapter),

},
};
adapter.breakdown.v2[CHAIN.APTOS] = {
fetch: fetchVolume,
start: async () =><PHONE_NUMBER>,
// runAtCurrTime: true,
}
export default adapter;


sum of n numerical added

Please merge the pull request then only our response will be accepted thank you


[Feature]: Add 'Animate icon when active' configuration variable to template card

Is your feature request related to a problem?
I like the animation* option available in the fan card, but need the customization that the template card provides for setting custom icons, colors, actions, etc. The one thing I currently cannot do easily with a template card is spin the icon.
*Should this be changed to 'spin' as a specific type of animation (unless planning to add other animation options)?
Describe the solution you'd like
Add an 'Animate icon when active' configuration variable to the template card.
Describe alternatives you've considered
I’ve tried to animate the rotation of only the icon in a Mushroom Template Card, but I cannot seem to find the right element to target…ha-card gets the entire template strip, ha-icon doesn’t work at all.
Additional context
No response

I would like to have Animated icon also for all cards. I try to do it on the mushroom-entity-card with no luck. but the default entity-card work fine. I was using card-mod to make icon spin on a default entity-card.

@GitHubGoody  just figured out how to do it in card-mod!! 🎉

code:
type: custom:mushroom-entity-card
entity: input_boolean.test_switch_card
card_mod:
  style: |
    mushroom-shape-icon {
      --shape-animation: spin 1.5s linear infinite;
    }

it took me a couple days to figure it out lol

I have used pulse animation which I think works well for devices that you want to highlight when they are active charging/diverting.
card_mod:   style:       mushroom-shape-icon$: |       ha-icon {         {{ '--icon-animation: pulse 3s linear infinite;' if is_state('sensor.myenergi_zappi_SERIAL_plug_status', 'Charging') }}       }


Can't get rid of unwanted folders using ignoreFolders env var

Hi,
I tried to exclude some folders from crawler but still they shows up in search results.
I run the official docker-compose bundle. In order to ignore folders named "old" I wrote the docker-compose.yml crawler section this way:

documenti:
    depends_on:
      serviceapi:
        condition: service_healthy
    image: repo.ambar.cloud:443/ambar-local-crawler:2.1
    restart: always
    networks:
      - internal_network
    expose:
      - "8082"
    environment:
      - name=documenti
      - ignoreFolders=**/old/**
    volumes:
      - /opt/ambar/mounts/Documenti:/usr/data

The "docker inspect" output looks consistent with the above config. Am I miiss something?
Also, there's a way to ignore multiple folders? Are folder names passed by env vars case insensitive?
Thanks in advance.
Fabio

Hello Fabio!
Did you add ignoreFolders vars on empty index? Or you already crawled some docs and want to ignore them later on?

Sorry, forgot to properly quote the wildcards: the relevant env var is ignoreFolders=**/old/**

At first I added the env var to an existing crawler with documents already... crawled, and it didn't worked. Then I suddenly realized that the variable is in the crawler scope and if a document has already been indexed there's no way for the api to know I don't want it :-) Thus I destroyed containers, rm -fr on the data es/mongo/rabbit dirs (external mount) and rebuilt the whole thing from scratch, but it didn't worked either.
Is there  a way to enable some sort of debug logging in crawler?
I attached the whole docker-compose.yml. I made a couple of fix to frontend, so we use a local image.
docker-compose.yml.txt

Hi guys,
I had a look at the code and turned out that the issue is due to dots and/or dashes in the path (the minimatch globstar implementation is rather simplycistic, isn't it?). I implemented a new ignoreFoldersRe criteria based on regexp.
Cheers


Decompose components before interpolation to avoid rounding differences

As @schriftgestalt writes at https://github.com/googlei18n/noto-fonts/issues/1012

The solution is to not round any coordinates (the nodes and the position of the components) until the components are decomposed.

@moyogo added a --no-round option to fontmake (and glyphsLib) that makes it so that when mutatorMath interpolates instances it keeps float values and does not round to integers.
https://github.com/googlei18n/fontmake/pull/358
I wonder if that could help with the above mentioned issue?
(note that this is only available on master branch -- I still haven't tagged a new fontmake release, as there's some unfinished stuff in the interaction between fontmake and ufo2ft. I plan to do it very soon)

I haven't been following these discussions, but is there a need for the --no-round option?  If that's the only useful option maybe that should be the default?  Or is that what goes into glyf table's composite glyph flags?


Anyone have sourcemaps working for karma stack traces?

I'm submitting a ...
[ ] bug report
[X] feature request
[ ] question about the decisions made in the repository
What is the current behavior?

Currently when karma runs jasmine and a test fails, the stack trace will show the line number in the spec-bundle file instead of the original source.  The source maps exist that it should be possible to trace back.

What is the motivation / use case for changing the behavior?

I think that the karma framework package: karma-source-map-support (https://www.npmjs.com/package/karma-source-map-support) should help with this but I can't get it up and running.
Has anyone else had any luck?

I have the same issue, when using a breakpoint to debug tests we are only presented the compiled source and not the typescript source. Sourcemaps is enabled in chrome.

Having the same problem. It seems like angualr-cli team have maanged to figure it out, would be great to know how


Added GUI based calculator

It is GUI based calculator made using python inbuilt library Tkinter. For the time, it performs essential functions but new operations can be added easily, if required.

Pls add a project description

Inside python script?

Merging, Star the repo if you like it.


Add resources and expose JobManager on a public IP

The resource requests are somewhat arbitrary but better than none - otherwise my pods (both taskmanager and jobmanager) kept getting evicted on K8s Engine due to exceeding the requested memory.
A public IP is needed to be able to submit jobs from my machine to the Flink cluster running on k8s engine. I confirmed that with this change, I am able to open the job manager UI by that IP, and that a Flink job can be submitted to it.

Thanks!


OpenStack support

Hello Leftovers friends!
Are there any plans to add support to Leftovers for cleaning up environments on OpenStack?

@rowanjacobs is very excited to add openstack support.

What OpenStack resources in particular are you looking to clean up? Ports have been our major problem when cleaning up environments manually or after failed terraform destroy, so I was thinking of prioritizing that first, but Terraform can create a lot more resources than that.

I'll be honest; I'm not sure exactly what would need to be cleaned up yet.  I'm very early in the planning stages for an environment paving tool that would eventually need to encapsulate OpenStack paves.  We currently use Leftovers to clean up on AWS, Azure, and GCP.  We're doing vSphere NSX-T next and OpenStack is planned for sometime after that.  This issue is mostly here to find out if you were planning on support OpenStack at some point and it sounds like the answer is "definitely maybe!"

I added in the wiring for an openstack leftovers object and the first resource: floatingips v2. Let me know if that helps y'all get started on adding resources as you need to delete them! Also reach out if you want to xtm pair or open up separate github issues as you discover resources you want leftovers to delete :-)


change requirements to point to latest nipype master

I just ran into this old issue because the version in our requirements is old: https://github.com/nipy/nipype/issues/1395

This is weird, does it happen inside the docker image?

This is now necessary for sure. We are using fsl.AvScale from the master branch.

the current requirements.txt points to the latest release of nipype on pypi.
just checking to make sure: we want it to point to the latest development version of nipype, not the latest release?

yep, basically replace the entry nipype by -e https://github.com/nipy/nipype.git#egg=nipype

https://github.com/poldracklab/preprocessing-workflow/pull/118


Fix escaped exception during peer connecting

What is wrong?
This exception escapes during regular mode syncing.
   ERROR  11-08 15:54:11     service  Unexpected error in <p2p.discovery.DiscoveryService object at 0x7fe6b183bfd0>, exiting
Traceback (most recent call last):
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/service.py", line 60, in run
    await self._run()
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/discovery.py", line 339, in _run
    await self.maybe_connect_to_more_peers()
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/discovery.py", line 351, in maybe_connect_to_more_peers
    self.proto.get_nodes_to_connect(self.peer_pool.max_peers))
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/peer.py", line 817, in connect_to_nodes
    await self.start_peer(peer)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/peer.py", line 732, in start_peer
    msgs = await self.ensure_same_side_on_dao_fork(peer)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/peer.py", line 847, in ensure_same_side_on_dao_fork
    peer.read_msg(), timeout=remaining_timeout)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/cancel_token.py", line 102, in wait
    return await self.wait_first(awaitable, token=token, timeout=timeout)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/cancel_token.py", line 124, in wait_first
    return await wait_with_token(*awaitables, token=token_chain, timeout=timeout)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/cancel_token.py", line 161, in wait_with_token
    return done.pop().result()
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/peer.py", line 348, in read_msg
    decoded_msg = cast(Dict[str, Any], cmd.decode(msg))
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/protocol.py", line 97, in decode
    return self.decode_payload(data[1:])
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/p2p/protocol.py", line 84, in decode_payload
    data = rlp.decode(rlp_data, sedes=decoder)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/rlp/codec.py", line 228, in decode
    item, per_item_rlp, end = consume_item(rlp, 0)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/rlp/codec.py", line 204, in consume_item
    return consume_payload(rlp, p, s, t, l)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/rlp/codec.py", line 179, in consume_payload
    item, item_rlp, next_item_start = consume_payload(rlp, p, s, t, l)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/rlp/codec.py", line 179, in consume_payload
    item, item_rlp, next_item_start = consume_payload(rlp, p, s, t, l)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/rlp/codec.py", line 178, in consume_payload
    p, t, l, s = consume_length_prefix(rlp, next_item_start)
  File "/home/ubuntu/py-evm/venv/lib/python3.6/site-packages/rlp/codec.py", line 132, in consume_length_prefix
    raise DecodingError('Encoded as short string although single byte was possible', rlp)
rlp.exceptions.DecodingError: Encoded as short string although single byte was possible

How can it be fixed
:see_no_evil: :hear_no_evil:

Ok, there's something weird about this. The code doesn't seem to match latest master. Investigating.

Ok, the box where this error comes from does not run on latest master. Closing.


For optimization of extracting text page by page

Questions:

StringIO.seek and StringIO.truncate seems not efficient enough, any better way?
parser will not be close on exception, but with PDFParser(fp) as parser not work, any good way?

from io import StringIO
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfpage import PDFTextExtractionNotAllowed
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfinterp import PDFPageInterpreter
from pdfminer.pdfdevice import PDFDevice
from pdfminer.converter import TextConverter

path = 'sample.PDF'

with open(path, 'rb') as fp:
    parser = PDFParser(fp)
    doc = PDFDocument(parser)

    if not doc.is_extractable:
        raise PDFTextExtractionNotAllowed

    resource_manager = PDFResourceManager()

    with StringIO() as string_io:
        with TextConverter(resource_manager, string_io) as device:
            interpreter = PDFPageInterpreter(resource_manager, device)
            for page in PDFPage.create_pages(doc):
                interpreter.process_page(page)
                string_io.seek(0)
                t = string_io.read()
                string_io.seek(0)
                string_io.truncate()
                print(t)

    parser.close()

Hi @playgithub,
Thanks for your question! Unfortunately I don't think I totally understand what your asking for. Could you be more specific on what you want, and why you need StringIO?

camelot is slow on parsing all the pages to find some table, so I'l like to use pdfminer to find pages as candidates to be parsed by camelot, the finding based on text matching. When the text on a page matches the condidion as a condidate, the page index should be saved.

So I assume you want to extract all the text from a page, inspect the result and save the page number if the result has some property.
If you don't want to use StringIO.seek and StringIO.truncate maybe reinitialize the StringIO for every page like this:
from io import StringIO

from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.utils import open_filename

laparams = LAParams()

with open_filename('your.pdf', "rb") as fp:
    rsrcmgr = PDFResourceManager(caching=True)

    for page in PDFPage.get_pages(fp, caching=True):
        with StringIO() as output_string:
            device = TextConverter(rsrcmgr, output_string, laparams=laparams)
            interpreter = PDFPageInterpreter(rsrcmgr, device)
            interpreter.process_page(page)
            print(output_string.getvalue())

What do you mean by the following?

parser will not be close on exception

As far as I know the parser has no connections that it manages. It gets a file-like object, but that is managed outside the parser.

So I assume you want to extract all the text from a page, inspect the result and save the page number if the result has some property.
If you don't want to use StringIO.seek and StringIO.truncate maybe reinitialize the StringIO for every page like this:
from io import StringIO

from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.utils import open_filename

laparams = LAParams()

with open_filename('your.pdf', "rb") as fp:
    rsrcmgr = PDFResourceManager(caching=True)

    for page in PDFPage.get_pages(fp, caching=True):
        with StringIO() as output_string:
            device = TextConverter(rsrcmgr, output_string, laparams=laparams)
            interpreter = PDFPageInterpreter(rsrcmgr, device)
            interpreter.process_page(page)
            print(output_string.getvalue())

Less code, I've tested it, same performance.

About the other question:

parser will not be close on exception

What do you mean by this? As far as I know the parser has no connections that it manages. It gets a file-like object, but that is managed outside the parser.

From the view of api, parse.close() should be called when parser is not used anymore.
Maybe I have to use try ... finally .. to make sure parse.close() will be called.

Less code, I've tested it, same performance.

On second thought, I think the speed of StringIO is neglectable compared to the speed of pdfminer itself.
A try, except, finally indeed makes sense.

On second thought, I think the speed of StringIO is neglectable compared to the speed of pdfminer itself.

But pdfminer has no api to extract text page by page, so StringIO is used, any better way is appreciated.

Yes, I get that using StringIO is a bit cumbersome. But using input and output streams in the way it was setup and its difficult to change. Anyway, besides being cumbersome it doesn't give any performance penalty.


Handle exception of get_by_aliasname method in certificates_server resource and return resource object

In hpeOneView-5.1.0, "get_by_aliasName" method of certificates_server resource is throwing an exception when certificate with specified aliasname is not found. And also change the naming convention of that method to "get_by_alias_name"

Issue is fixed in python SDK version v5.1.1


Feature: CPU temperature sensor

The availability of sensors in the project is great but I'm missing the CPU temp sensor. Anyway we could get this in the future?

Hey @ikrowni,
Absolutely, they're on my shortlist. Those type of hardware sensors require elevated privileges, so they're only possible since the satellite service was introduced last month.
I'll add them to the next release!

Awesome this has already allowed me to drop 3 add-ons with cpu temp I'll be able to drop the open hardware monitor component.

I'm closing most feature requests from github's issue list. They're not ignored, just moved to the HASS.Agent Issue Tracker (you can find your link in a comment above).
That tracker allows me to organise better through what's pending, being done, being released, etc. - instead of one long list, which is beginning to stress me out :p
I will however post a reply here when I've implemented your request, and feel free to still post here when you have any questions/additions.


Container restarted with -v, but no database from prior start

Here is the command:
docker run -d -p 8080:8080 -p 1521:1521 -v /Users/MAngelo/oracle-forecast:/u01/app/oracle  --name oracle sath89/oracle-12c
I spent hours setting up good test data. Had to reboot my computer. After running the command above, I am not seeing my previous database.

What are the contents of /Users/MAngelo/oracle-forecast ?

It is the same contents that the previous docker container created. I just rebooted my machine and when I tried to restart the container, the db is gone. The contents are still there. It just does not seem to be using the external directory.

What's the status of this? Is this fixed or could you not recreate it?

Unable to reproduce this issue


On certain query failures, we don't receive an error from the Go client

Bug Report

azure-kusto-go : sdk/resourcemanager/kusto/armkusto
go version: 1.23.0
SDK version: v1.0.0-preview-5 (which seems to be the latest)

What happened?
On certain query failures, we don't receive an error from the Go client (azure-kusto-go). For example, when running (c *Client) Mgmt, we get an error if the query fails due to a 429 Too Many Requests response, but we don’t get one if it fails due to UpdatePolicy_FailedDescendantTransaction.
Do you know what could cause this?

What did you expect or want to happen?
We expect that in the relevant case, UpdatePolicy_FailedDescendantTransaction will fail on 429 Too Many Requests as well

How can we reproduce it?
Run (c *Client) Mgmt on azure kusto for go's client

Hello! This looks to be an issue with the Kusto SDK. Can you please move this issue to their repo? It's owned by a separate team.
CC @sandeep-sen

I don't have the permission to transfer this issue to https://github.com/Azure/azure-kusto-go
@yogilad and @AsafMah could you please transfer this issue to your repo.

Thanks all for the prompt response and connections, I've opened a new bug report at what seems to be the right repo, thanks(:
https://github.com/Azure/azure-kusto-go/issues/271


Incremental extraction

When the current .upspert() is used, the ETL has in the moment read the full source delta table.
This is ineffective. We need an incremental extractor.
When working with delta tables the incremental logic can be introduced as a transformer.
class IncrementalETLTransformer(Transformer):
     def __init__(target_dh: DeltaHandle, timeCol: str):
         self.target_dh=target_dh

    def process(self, df: DataFrame) -> DataFrame:
        target_df = self.target_dh.read()

        # for incremental load, get the latest (max) record from target table
        maxdate = target_df.groupBy().agg(f.max(timeCol)).collect()[0][0]
        # if the target is empty, this will be None
        if maxdate:
            # if it is > or >= should be investigated due to e.g. capture file readings....
            df = df.filter(f.col(timeCol) > maxdate)

     return df

It could also be introduced as a IncrementalExtractor:
class IncrementalExtractor(Extractor):
    """This extractor will extract from any object that has a .read() method.
         Furthermore, it will use a target table for enabling incremental extraction.
    """

    def __init__(self, handleSource: Readable, handleTarget: Readable, timeCol: str,dataset_key: str):
        super().__init__(dataset_key=dataset_key)
        self.handle_source = handleSource
       self.handle_target = handleTarget

    def read(self) -> DataFrame:
         df = self.handle_source .read()
         df_target = self.handle_target .read()
         # for incremental load, get the latest (max) record from target table
        maxdate = target_df.groupBy().agg(f.max(timeCol)).collect()[0][0]
        # if the target is empty, this will be None
        if maxdate:
            # if it is > or >= should be investigated due to e.g. capture file readings....
            df = df.filter(f.col(timeCol) > maxdate)

        return df

This is unneccesary since the streaming can be used.

I still think this could be relevant in a non streaming setup.
we could also consider creating a ‘.read_from()’ method to the handle classes. This can then be used in the above mentioned classes.


test(dm): fix datarace for testSyncerSuite.TestRun

What problem does this PR solve?

Issue Number: close #4280
What is changed and how it works?
wait last goroutine go syncer.Process(ctx, resultCh) exit befroe start a new one
Check List
Tests

Unit test

Code changes
Side effects
Related changes

Need to update the documentation

Release note
`None`.

/merge

/run-kafka-integration-test
/run-leak-test

/run-kafka-integration-test
/run-leak-test

/run-dm-integration-test


ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug

Checklist

[x] I'm reporting a broken site support issue
[x] I've verified that I'm running youtube-dl version 2021.12.17
[x] I've checked that all provided URLs are alive and playable in a browser
[x] I've checked that all URLs and arguments with special characters are properly quoted or escaped
[x] I've searched the bugtracker for similar bug reports including closed ones
[x] I've read bugs section in FAQ

Verbose log

D:\YTBA>youtube-dl.exe --verbose  -f "best" "https://www.youtube.com/watch?v=c7LOfY-RE9w"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '-f best', 'https://www.youtube.com/watch?v=c7LOfY-RE9w']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2021.12.17
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19041
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] c7LOfY-RE9w: Downloading webpage
ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 534, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\youtube.py", line 1794, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 1012, in _search_regex
youtube_dl.utils.RegexNotFoundError: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

## Description

<!--
Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

WRITE DESCRIPTION HERE
Recently, with updated youtube-dl, specific youtube URLs like these 2 =

https://www.youtube.com/watch?v=c7LOfY-RE9w
https://www.youtube.com/watch?v=NPXUPNvg98g

have produced the following error =
"ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug".

This is unlike previous and other URLs that worked OK with this youtube-dl on Windows 10 64 bit. Other than the above log from the CMD console, I can't think of other details. Sorry if my text does not conform exactly to your instructions, which I have done my best to understand and follow.  Please help?

[x] I've searched the bugtracker for similar bug reports including closed ones
...
ERROR: Unable to extract uploader id; please report this issue on https://yt-dl.org/bug ....

Try #30839 again.


pkg/chann(ticdc): prevent unbounded channel may causing cpu spin

What problem does this PR solve?

Issue Number: close https://github.com/pingcap/tiflow/issues/5748
What is changed and how it works?
prevent unbounded channel may causing cpu spin. When there are no consumers, block the loop.
Check List
Tests

Unit test

Questions
Will it cause performance regression or break compatibility?
No
Do you need to update user documentation, design documentation or monitoring documentation?
No
Release note
None

/run-all-tests

/run-all-tests

/run-all-tests

Could you feedback your changes to upstream?

Could you feedback your changes to upstream?

In fact, I'm merging upstream changes.

Codecov Report

Merging #5749 (86e2d59) into master (fcea4d5) will increase coverage by 0.5527%.
The diff coverage is 62.1925%.

Flag
Coverage Δ

cdc
61.8373% <62.1925%> (+0.6892%)
:arrow_up:

dm
51.9966% <ø> (-0.0461%)
:arrow_down:

engine
58.9767% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
@@               Coverage Diff                @@
##             master      #5749        +/-   ##
================================================
+ Coverage   56.0768%   56.6296%   +0.5527%
================================================
  Files           535        680       +145
  Lines         70143      79333      +9190
================================================
+ Hits          39334      44926      +5592
- Misses        27078      30196      +3118
- Partials       3731       4211       +480

/merge

/run-all-tests

/run-verify
/run-dm-integration-test

/run-verify


Fix missing signal.h include

[ ] Did you create an Apache Jira ticket?  (not required for trivial changes)
[ ] If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
[ ] Did you squash your changes to a single commit?  (not required, but preferred)
[ ] Did you do your best to avoid breaking changes?  If one was needed, did you label the Jira ticket with "Breaking-Change"?
[ ] If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

Thanks for the PR! However I fear its a duplicate of #2016
Its still very valuable because it confirms the use of the earlier PR.


Is there any way to display filename at the center of statusline ?

No, there isn't (and unlikely to be implemented).


[BUG] min graphic = max, game lags.

Acknowledgement of preliminary instructions

[X] I have read the preliminary instructions, and I am certain that my problem has not already been addressed.
[X] I have thoroughly looked through the available Wiki articles and could not find a solution to my problem.
[X] I am using the latest version of Bloxstrap.
[ ] I did not answer truthfully to all the above checkboxes.

Bloxstrap Version
v2.8.0
What problem did you encounter?
i cant make graphic in game to lowest, its always maxed, Even if it says its minimum its just visual, i have shadows on minimum graphic and lags.
Bloxstrap Log
N/A

i've heard that it's a roblox issue

I got this issue today too

Duplicate of #3426


boards: qemu_cortex_r5: Add board documentation

This commit adds the board documentation to the qemu_cortex_r5
platform.
Signed-off-by: Stephanos Ioannidis<EMAIL_ADDRESS>

@ioannisg @jhedberg I wonder if we can get this in for 2.2; qemu_cortex_r5 was completely missing board documentation up until now.

@ioannisg @jhedberg I wonder if we can get this in for 2.2; qemu_cortex_r5 was completely missing board documentation up until now.

Documentation improvements are always welcome, thanks!


Increment version for storage releases

Increment package version after release of azure-storage-file-share

Will do manually.


Clean up kube configs

Clean up some of the redundant kube config. We can't clean up the annotations nor labels because they are map-based keys. See quarkusio/quarkus#35608 for details & discussion on that.
Fixes #300

@holly-cummins this is a start to clean up some of the redundant kube config. Unfortunately because of quarkusio/quarkus#35608 we can't clean up everything.


Car assembly: Escape $ in instructions.md

In markdown with math mode enabled the dollar sign enables this mode and results in italic text with a different font that is hard to read. Escaping with \ fixes this.
With math mode disabled this should not make a difference.

Thanks for bringing this to our attention.
Just for a little bit more context, I've never heard of markdown math mode, can you tell us an example where It is used?
If we are going making this change, we should also make it in all places the $ is used. I've found that $ is also used in the book store exercise, where it is unescaped too.

Hi,
I installed this VS code extension and it had the math mode enabled by default for side-by-side previews. I am not too much into markdown so I don't know how common it is.
If that's enough for you to merge the change, I'll see if my grep/sed-foo is sufficient to find all occurances.

@dirkkul I did a global search in the repository and the book-store also has some instances of $ that need escaping. Would you like to update this PR with the needed changes escaping the $ on that exercise too?

@andrerfcsantos Book store originates from the problem spec repo and I don't think we have a good case getting this change through there.
My opinion on the whole issue here would be to not apply any change. The markdown extension is not needed to work on Exercism exercises so if it is causing an issue it can be disabled. VSCode allows to disable an extension just for a certain workspace (click on the extensions icon, select the extension, then click on the down arrow next to "disable" and select "disable (workspace)"). Without that extension, dollar signs are rendered just fine in the markdown preview pane as far as I can see.

alright, I don't care too much :)


Steps to bootstrap CPC and new Foundation

Issue to build list of checkboxed items we need to work on/progress

Bootstrapping

[x] New GitHub organization
[x] Update all governance docs to reflect the name selected for the Foundation. (https://github.com/openjs-foundation/bootstrap/pull/126)
[x] Initial email lists - #134
[x] Confirm list of initial Impact projects and land as PROJECTS.md
[x] Land Common Code of Conduct in OpenJS Foundation org - PR https://github.com/openjs-foundation/bootstrap/pull/147
[ ] New Zoom, Youtube etc.
[x] Target for Initial CPC meeting (collaborator summit) #125
[x] Checklist for projects (refs to OpenJS Foundation, changes for moderation etc.) #121
[ ] Work with projects to identify initial CPC representatives (deadline May 1?) #152
[ ] Document/define initial process for handling reports to<EMAIL_ADDRESS>(Manil has volunteered to make a first draft)
[x] Create admin repo and land initial governance docs there [155] (https://github.com/openjs-foundation/bootstrap/issues/155) (Task done, deemed unnecessary, renaming the bootstrap repo to CPC and landing docs there)
[ ] Add entry point for projects wanting to join on README.md and review project progression (Jory will help with this one)
[ ] draft initial process for electing voting members from the non-impact projects.  Nick/Michael to
work on that together.

[ ]  Ask projects to start updating references to docs in admin repo (ex coc etc.)

Post-bootstrap

[ ] Review Foundation infrastructure and rethink how we manage it.
[ ] Move/update JSF cla-bot (see #124)
[ ] Project Directed Funding (https://github.com/nodejs/bootstrap/issues/90)
[ ] Complete language for project exit clause (https://github.com/nodejs/bootstrap/issues/96)

Attempted to document this in a board
--> https://github.com/openjs-foundation/bootstrap/projects/2
LMK if this should be close or if it makes sense to keep both

I'm ok with using the board, but I think we might want to keep an open issue that points to the board so that we get an issue added to the agenda as a reminder that we should go through it.

@mhdawson lets just keep this issue open then

@mhdawson updated your admin repo task definition to reflect priority changes. 👍

@mhdawson also this is as good a place as any to ask: I'm not sure how acceptable it is to edit another member's issue definition (as a matter of principal) – it just seemed easier in this case to update it to reflect current changes. Lmk if that's not ok. Thanks Michael! 👍

Updating is good with me :) Thanks for keeping it up to date.

The CPC is officially boostraped !!!
Renaming issue to keep it for tracking

@MylesBorins WAHOO! So amazing to see this come together! Fantastic work everyone! 👏👏👏


Commented out the renormalization section from rk4.c file

normalization condition is guaranteed in the calculation and the extra renormalization step is thus redundant

OK

Looks good


(Github) Update repository structure

Update the repository structure
Remove some empty lines.
Delete unnecessary files

Thanks :)


Mayhem - GH actions integrated

I was facing issues with the fuzzing directory not getting picked up by the cargo-fuzz build with a custom name before.
Now resolved with the updated version.

LGTM!


Why should I ever use stateless widgets instead of functional widgets?

Dart 2 shorthand makes writing functional widgets super nice, especially for a React/Javascript heathen like myself.
Why should I ever use Stateless Widgets?

My simple answer would be.
It doesn't change its state, it only builds the widget. I'm not familiar with react native but I find Stateless widget very useful.
https://docs.flutter.io/flutter/widgets/StatelessWidget-class.html

Stateless Widget doesn't change its state either, right?
My best argument for using Stateless Widgets are to create a widget that can be used to build tons of widgets that inherit its properties.
But this brings up another question. In react there are Functional components and Class based components. Functional components just build a component, like I have done with my functional widget above.
Class based components can be extended and they have state.
So why would Flutter have a class based component for both Stateless and Stateful widgets? What benefit does this provide over Functional and Class based being the two methods of constructing widgets? (Where class based always has state)

There is nothing wrong with functions, but Widgets can be const and can have keys.  Those are both very important features

You also don't have the associated Element with the function. i.e. how would you put a button that navigates in the function if you don't have the BuildContext.

That's a good point. What stops someone from passing context as an argument, though?

There's no Element associated with a function so you're passing in someone else's BuildContext. Then you have to manually make sure you get the right BuildContext. If you had:
class SomeWidget
Widget build(BuildContext context)
a Navigator
your function
And your function tries to push onto that navigator, it'd fail or get the wrong one. Then you'd have to manually wrap your function in a Builder and you're more or less back to having a StatelessWidget.

So functional components for breaking out big trees but that's about it, it sounds like. Or fast prototyping.

Ya, the main difference is in how it links to the Element tree (in that functions don't get linked themselves and won't get triggered to rebuild themselves via the Element tree).
Some other examples:

If your subtree depends on an InheritedWidget, a StatelessWidget will get surgically be marked to rebuild itself. If you used a function, the widget that gave the function its BuildContext will get rebuilt.
A function itself won't get called to rebuild during hot reload. Someone else will have to bring it along. If you just passed a function into runApp at the root of your application, nothing will be rebuilt during hot reload.

A few other things :

You force other components to behaves differently
Loose dart named and factory constructors
Loose refactoring options. Such as convert to stateful widget or Swap widget with child/parent

In the end your only gain is 2-3 lines of code. Lines which can be generated fairly easily with a code snippet.
For instance in vscode, just write stless and press tab.

Oh and another one :
Widgets shouldn't have to care how other widgets are implemented. So if you add to do new MyStatefulClass but then do myStatelessFunction() then it would be inconsistent
Which means that if you ever need to convert your stateless widget into a stateful or the opposite then it is a breaking change.

Thanks for your input Rémi, it is much appreciated.  It seems like there are a lot of very valid reasons indeed to use Stateless & Stateful and not use a 'functional widget'.
I think the breaking change issue is very significant and I think I'm mostly convinced to always use a Stateless or a Stateful widget.
However, I think the number of lines problem is significant, writing code using a code snipet is not the problem here, it is reading those lines back.  Also, if the 'functional widget' requires one parameter we go from five lines of code to one line of code, this is really significant when looking back through code and trying to work out what my code does (83% fewer lines of code, 54 chars vs 169, 68% fewer chars, again this is significant when looking back through code).
Widget MyFunctionalWidget(String text) => Text(text);

class MyWidgetComposition extends StatelessWidget {
  final String text;
  MyWidgetComposition(this.text);

  Widget build(BuildContext context) => Text('hello');
}

Flipping the question a little bit more (by the way I do love Flutter have dropped React Native for it!), is it ever ok to use a 'functional widget'?  As a starter I would say it is ok privately inside a stateless or stateful widget.

Well, if you really dislike the class syntax; it should be fairly straightforward to fix most of the previous downsides using a code generator
You could write the following :
// foo.dart
part 'foo.g.dart`

@stateless
Widget _MyStateless({String foo}) => Text(foo);

which then generates the following
// foo.g.dart
part of `foo.dart

class MyStateless extends StatelessWidget {
  final String foo;

  MyStateless({this.foo, Key key}): super(key: key);

  @override
  Widget build(BuildContext context) {
    return _MyStateless(foo: foo);
  }
}

That would be a much more reasonable approach to functional widgets.
The downside is that IDE shortcuts such as Jump to definition would land on the generated. And you'd still break convert to stateful widget. But you could add a support for it in the IDE
Would that be fine with you?

Thanks Remi, I'll have a play, that looks promising :-)

That would seem like a huge step in the right direction without going full JSX/DSX and is basically what I was trying to brainstorm in https://github.com/flutter/flutter/issues/19811

@twistedinferno @rrousselGit did either of you get the @stateless / @stateful shorthand working? I would absolutely love to try it.

@stateful doesn't make sense. In 99% of the situations we need a hook for initState or other lifecycles of State.
But I can make a package for the @stateless.
I'll try to make it compatible with multiple syntaxes simultaneously :
@stateless
Widget _Foo(BuildContext context, String prop);

@stateless
Widget _Foo(String prop);

@stateless
Widget _Foo({ BuildContext context, String prop } );

@stateless
Widget _Foo({ String prop } );

Just out of curiosity, why do you say stateless doesn't make sense? Just want to make sure I am understanding this fully.
And that would be fantastic and I would love to try it out and see what your solution is.

Sorry for the delay.
Here it is: https://github.com/rrousselGit/functional_widget
From
@widget
Widget foo(BuildContext context, { int value, int value2 }) {
  return Text('$value $value2');
}

it generates the following class for you to use:
class Foo extends StatelessWidget {
  final int value;
  final int value2;

  const Foo({Key key, this.value, this.value2}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return foo(context, value: value, value2: value2)
  }
}

I think this is solved and I'm going to close.
Please add a comment to have it reopened if you disagree.

Does using stateful widget break functionality, because in my own opinion rather thinking if, either to use stateless or stateful, one can use stateful but expect additional lines of code

https://stackoverflow.com/questions/53234825/what-is-the-difference-between-functions-and-classes-to-create-widgets
https://stackoverflow.com/questions/51689435/what-scenarios-is-it-reasonable-to-use-a-function-to-define-a-widget-composition

So I'm not trying to beat a dead horse or anything, but I'd just like to confirm that using functional widgets in all cases are bad practice?
Because I found this example, from the Flutter.dev layout tutorial example: on line 18 you'll find Widget buildHomePage(String title) {...} which is a functional widget which also contains widget as variables.
And I know this is just a tutorial on building layouts, but if these examples are where someone, like myself, with no experience, is supposed to learn good coding practices/ patterns, shouldn't it be written correctly, without the use of functional/ variable widgets? Because it's been very confusing to figure out what the best practices are.

Because I found this example, from the Flutter.dev layout tutorial

There are some merged commits that did nothing but refactor these methods into widgets.
https://github.com/zwliew/Senor/commit/f8d62c63cb190b5e93591a9227474b2593d8476f
I don't think there's a broad announcement about this though. But that's definitely a bad idea

@rrousselGit thank you for clarifying this for me!

Guys, I get confused.
Should I really avoid to do something like this?
return ListView(
  children: <Widget>[
    _buildMyStatelessWidget(), // a simple Text widget
    _buildMyStatelessWidget2(context), // a widget that reads some properties from context.theme
    _buildMyStatefulWidget(),
   ]
);

@SaeedMasoumi can you show the rest of the code for _buildMyStatelessWidget and _buildMyStatefulWidget

@WantMoreCookies
_buildMyStatelessWidget() => ImageIcon(AssetImage("example.png"));

_buildMyStatelessWidget2(context) => Text(
      S.of(context).some_text,
      style: Theme.of(context).textTheme.title,
    );

_buildMyStatefulWidget() => MyScreen();

@SaeedMasoumi yea so this is exactly what you want to avoid doing. Instead you will want to do this:
`
class Foo extends StatelessWidget {
const Foo(): super(key: key);
class _Text extends StatelessWidget {
	const _Text(): super(key: key);

	Widget build(BuildContext context){
		return Text(
				S.of(context).some_text,
				style: Theme.of(context).textTheme.title,
			);

	}
}

Widget build(BuildContext context){
	return ListView(
		children: <Widget>[
			ImageIcon(
				AssetImage("example.png")
			),
			_Text,
			MyScreen(),
		]
	);
}

}
`

@SaeedMasoumi yea so this is exactly what you want to avoid doing. Instead you will want to do this:
class _Text extends StatelessWidget {
	const _Text(): super(key: key);

	Widget build(BuildContext context){
		return Text(
				S.of(context).some_text,
				style: Theme.of(context).textTheme.title,
			);

	}
}

class MainWidget extends StatelessWidget {
	const MainWidget(): super(key: key);

	Widget build(BuildContext context){
		return ListView(
			children: <Widget>[
				ImageIcon(
					AssetImage("example.png")
				),
				_Text,
				MyScreen(),
			]
		);
	}
}

@WantMoreCookies I don't know what are the downsides of my approach and why should I use classes instead, I can even achieve hot reloading with functional widgets.

Could somebody answer @SaeedMasoumi 's last comment? I'm also wondering why it's a bad approach. It seems way too much to create a StatelessWidget just for a SizedBox

@SaeedMasoumi  @sergiuiacob1 - This and this written by @rrousselGit should help you understand why.
tldr; "The framework [Flutter] is unaware of functions, but can see classes. Functions are not inserted in the Widget tree and therefore are never associated to an Element. This causes a whole new set of problems, including performance issues or state not properly disposed."

@WantMoreCookies

This causes a whole new set of problems, including performance issues or state not properly disposed.

Is there any example to show these performance issues?
For example, what are the performance issues of the below function?
SizedBox vGap4() => const SizedBox(height: 4);

Maybe @rrousselGit can help.

Honestly, the performance aspect barely matters.
The real deal-breaker is that using functions can have a very undesired behavior.
Consider:
bool condition;

Widget _foo();
Widget _bar();

Widget build(BuildContext context) {
  return condition
    ? _foo()
    : _bar();
}

With that code, flutter is unable to understand when we switch between _foo and _bar.
This can have heavy consequences that I described a bit in the previous links.
While classes require a bit more code, there are a lot safer.

I know I am coming late to the party. But, that question always pops up again. I think an important aspect is that Flutter stops rebuilding if encounters the same widget at the same position in the tree.
Hence, by overriding operator== in a stateless widget you can make Flutter stop rebuilding. That's impossible with functions. Flutter will always "expand" them.
I opened a ticket to ask the Flutter team to clarify that in the docs:
https://github.com/flutter/flutter/issues/38740

I have often wished for a shouldRebuild() method a la react, but it sounds like overriding operator gets something similar?

While classes require a bit more code, they are a lot safer.

@rrousselGit Would you please provide equivalent code for the Class paradigm? I thought I had this concept cleared up until reading that last comment 😓

TD;DR: misused functions are a lot more dangerous than misused classes. So use classes
Honestly, the performance aspect barely matters.
The real deal-breaker is that using functions can have a very undesired behavior.
Consider:
bool condition;

Widget _foo();
Widget _bar();

Widget build(BuildContext context) {
  return condition
    ? _foo()
    : _bar();
}

With that code, flutter is unable to understand when we switch between _foo and _bar.
This can have heavy consequences that I described a bit in the previous links.
While classes require a bit more code, they are a lot safer.

I'm not sure this is the case. Wouldn't the same problem apply to classes as well? If that build function is used as the build method of any Widget Flutter finds the same uncertainty... The problem here is with dynamic behavior in general, and neither classes nor functions can fix that.

Classes will dispose the element and state when they are switched.
With widgets it might happen that state leaks between succeeding trees. A password might suddenly appear somewhere else.

So is there any difference between using a function that returns a Widget and just inlining the Widget? For (a very contrived) example:
class Toggler extends StatelessWidget {
  final VoidCallback onToggle;
  final VoidCallback onAdvancedToggle;
  const Toggler({Key key, this.onToggle, this.onAdvancedToggle}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[
        FlatButton(onPressed: onToggle, onLongPress: onAdvancedToggle, child: Text('On')),
        FlatButton(onPressed: onToggle, onLongPress: onAdvancedToggle, child: Text('Off')),
      ],
    );
  }
}

Here I'm using a couple of member variables while building the FlatButton, and it looks like a candidate for DRYing up. However making it a stateless widget doesn't help at all, since then I still lose the member variables and just have to pass the same values. So my instinct is:
  //...

  Widget _toggleButton(String text) =>
        FlatButton(onPressed: onToggle, onLongPress: onAdvancedToggle, child: Text(text));

  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[
        _toggleButton('On'),
        _toggleButton('Off'),
      ],
    );
  }

Is that bad? For at least some of the points made elsewhere, I think that using a function that returns a Widget should be the same as inlining code? But then again @rrousselGit's comment that

The real deal-breaker is that using functions can have a very undesired behavior.

makes me question whether I actually understand it. So I get that there are important differences between extracting a StatelessWidget and using a function. But is using a function different from inlining the code directly in the build method?

@hmayer00 inlining and using a function is exactly the same.
The difference is between inlining/function and a proper widget-class.
In the first case, Flutter aggressively tries to reuse the elements and state. In the second keys Flutter will only reuse the element and state iff the runtimeType and the key match.
Consider two forms with text edits and switching between the forms. Do you want the edited text to survive or reset when you switch between the forms? The first is achieved with inlining/function, the later with proper subclasses or different keys.

@derolf  is on point
If that wasn't clear enough, here's a concrete example:
Widget functionA() => Container()

@override
Widget build() {
  return functionA()
}

is equivalent to:
@override
Widget build() {
  return Container();
}

whereas
class ClassA extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

@override
Widget build() {
  return ClassA()
}

is equivalent to:
@override
Widget build() {
  return KeyedSubtree(
    key: ObjectKey(ClassA),
    child: Container(),
  );
}

Btw https://flutter.dev/docs/development/ui/widgets-intro#responding-to-widget-lifecycle-events explains it all...

Thanks @derolf and @rrousselGit. That's what I had thought, but things seemed tricky enough that I wanted to make sure I hadn't missed something. And you and others have in previous comments certainly convinced me of the value of widget classes (also it helps that functional_widget_annotation takes away some of the boilerplate when convenient - thanks @rrousselGit!).
Btw, to @derolf's point about keys, I'm generally averse to learning by video, but I found the intro video about keys to be extremely helpful.

@hmayer00 To understand how Flutter works, it's quite helpful to:

Always consider that Flutter doesn't contain any black magic. It follows clear rules (like the frame-by-frame widget matching).
Even if you don't need to write your own RenderObjects, just write some out of curiosity. That way you learn a lot about Flutter's rendering pipeline.

For those who don't want to use code-generators/functional_widget, there are other alternatives.
We can use "higher order functions".
TD;DR instead of:
Widget myWidget(String title) {
  return Text(title);
}

Builder(
  key: ValueKey(42),
  builder: (context) {
    return myWidget('hello world');
  },
)

you do:
final myWidget = functionalWidget((BuildContext context, String title) {
  return Text(title);
});

myWidget('hello world', key: ValueKey(42));

Here's the functionalWidget function's source code:
Widget Function(T props, {Key key}) functionalWidget<T>(
    Widget value(BuildContext c, T props)) {
  final uniqueWidgetIdentifier = UniqueKey();
  return (props, {Key key}) {
    var child = Builder(
      key: uniqueWidgetIdentifier,
      builder: (context) {
        return value(context, props);
      },
    );
    if (key != null) {
      return KeyedSubtree(
        key: key,
        child: child,
      );
    }
    return child;
  };
}

I just use on my app Stateless widgets. What I use is a global provider that I share within my pages.
This provider updates the UI if it's needed. For example, if I want to change some UI values I do something like this from my Stateless widget:
Provider.of<Game>(context).addTeams();
and inside my provider I have this:
class Game extends ChangeNotifier {
  List teams = [];
  String something = '';

  addTeams() {
    Map newTeam = {
       name: 'New Team'
    }
   this.teams.add(newTeam);
   // and now this is the trick. I if need to update the UI I call this method
   notifyListeners();
  }
}

I find the Stateful widget not too easy to use/understand so I prefer to have something like this.
There are some specific scenarios that require me to update the UI without modifying the global provider. For this I just use StateFulBuilder: https://api.flutter.dev/flutter/widgets/StatefulBuilder-class.html

Here is the hard and fast logic again:

@hmayer00 inlining and using a function is exactly the same.
The difference is between inlining/function and a proper widget-class.
In the first case, Flutter aggressively tries to reuse the elements and state. In the, second case Flutter will only reuse the element and state iff the runtimeType and the key match.

I read whole topic and I can't understand WHY?! Why Flutter aggressively tries to reuse the elements and state?
Could somebody correct me:
if I write a function, for example:
Widget functionA() => Container()

And assign it to constructor parameter.
the first would created widget "Container() and then this Container would insert in widget Center and then inside widget Scaffold (for example):
Widget home(BuildContext context) {
  return Scaffold(
    body: Center(
         child: functionA(),
    ),
  );
}

The first of all compiler initialise all objects and executes all methods/functions and create all widgets and after that Flutter will check elements and states. Then will make a decision to reuse element and render objects.
And I think the same will be when I use StatelessWidget.
But you say NO. Not the same. Could you describe step by step what difference? May be Flutter start check runtimeType and the key in different order? But how?!


TMFS: Add S: prime tokens information to tunes and settings

Downloading the ABC of the original tune https://themachinefolksession.org/tune/147 I find it does not have the S: prime token text, etc.
Currently, the top of the ABC for the above is
X:147
T:The Silver Keyboard
S:Tune #147 archived at The Machine Folk Session
F://themachinefolksession.org/tune/147
but it should be
X:147
T:The Silver Keyboard
S:Tune #147 archived at The Machine Folk Session (http://themachinefolksession.org/tune/147)
S:Generated at http://folkrnn.org using the thesession_with_repeats model with RNN seed = 238743; temperature = 1.0; prime tokens = M:6/8 K:Cmaj |: E D C E C C | G A G c F F |

ABC downloads with
S - MachineFolk slug
F - MachineFolk URL
which are the appropriate uses of those fields, as per spec. If there were any information fields in the submitted ABC, these become N fields, for notes.
I can add an N field for the folkrnn parameters. I hadn't as it's redundant given the MachineFolk page has that info, but it could be included.

Yes, they need to be preserved in the ABC because people will download that material.

FYI The code is here: https://github.com/tobyspark/folk-rnn-webapp/blob/5c67814fd47ebf3136a312987ba043dff88538b4/folk_rnn_site/archiver/models.py#L94

Fixed in #119


problem in path in examples/kg2instruction/download_en.bash

line 33: wget -O model/text_classification_en.zip https://huggingface.co/datasets/ghh001/InstructIE_tool/resolve/main/text_classification_en.zip?download=true
correct:
wget -O model/text_classification_en.zip https://huggingface.co/datasets/ghh001/InstructIE_tool/resolve/main/text_classification_en.zip
no this error in Chinese version of script btw

yes. may be you should correct it so other people won't face with this problem
thank you for your job

We have updated the repo, thank you very much for your helpful suggestions.


[Feature Request] Option to show delivered for only a configurable amout of day's

It would be nice to have an option to only show delivered packages for a configurable amount of day's.  Currently you can only show all delivered packages or none. (as far as I understand)
I would like to have delivered packages shown for one day, to see whether a packages scheduled to arrive today has been delivered.
I would like to only have the most upper one shown (today), even when it is delivered.
without filtering

with filtering

PS. Don't look at the second line, this is a return package which I already deleted from mijn.postnl.nl as it was wrongly shown.

Good suggestion. Will look into this!

I believe it's solved with this update:
https://community.home-assistant.io/t/lovelace-postnl/112433/66


Fix API.Server.main not defined bug

Hi, I use this repository very well :)
But I got an error that is API.Server.main not defined.
So I fixed this issue if you think some points are strange please let me know
Thank you
related issue: https://github.com/yonaskolb/SwagGen/issues/197

@yonaskolb I updated it!


Custom verification function for Log entries

[x] small refactor of how entry verification is done to allow multiple different verifications (for now signature verification and custom verification)
[x] setter to allow setting a custom verification function in the log
[x] updated existing tests. I had to switch all join calls to await because before these changes, if the log was not signed there were no async operations in the join. However, the way I structured the code now there is always an async call to verifyEntries that makes join always happen asynchroniously. This broke many tests
[x] docs
[x] tests to see that the custom verification is invoked correctly

@haadcode I'm not good at naming stuff at all, so tell me if you want me to rename anything or change the way the custom verification function is passed.
I also saw some TODOs about moving verification stuff from the Log to the Entry. Maybe I can fit that in this PR

Updated with a test and docs. I noticed the replication test is failing for me even without my edits

Thank you @fazo96 for the PR. Looks great and sounds like all tests are passing as expected. I quickly ran the tests yesterday against OrbitDB and they're all green.
Will try to give some feedback on the code later this week but by the quick looks, it's fine.

Added one  more comment. Looking very good and close being able to merge. Regarding your other comments:

replication tests aren't passing for me, is this a known issue? They don't pass even without this PR's commits so it's not introduced here

Tests on mater seem to run, so not sure why they're not running for you. I'll take a look and see what I can find.

I agree that using an options object for optional arguments would be best, but is not in scope here

Let's put that on the long list of "to-refactor at some point" :) 👍

It'd be great to get this into orbit-db 0.20

Yup, agreed! Will hold off releasing 0.20.0 until this is finished and we can pull it in.

replication tests aren't passing for me, is this a known issue? They don't pass even without this PR's commits so it's not introduced here

Tests on mater seem to run, so not sure why they're not running for you. I'll take a look and see what I can find.

I just ran the tests locally and they seem to run fine. I also noticed that we don't have CI on for forked PRs which I enabled now and I believe if you commit to this branch again, CI will run automatically and let you know if the tests run.
If you're seeing some error for the tests locally, can you pass the errors/log and we'll take a look at what's going on?

Oh, one more thing before merge: can you squash the commit into one and add the individual commit descriptions into that one commit?

@haadcode squashed the commits, but circle failed the tests. Looks like it failed with the same identical problem I get on my machine
If you can, try triggering a build on master by circle. It should fail the replication test with the same error, like on my machine

@fazo96 thanks for squashing it! One more thing to change (see the comment re. the setter function) and we're ready to merge :)
As for the tests, I re-triggered CI for this PR and it's now passing. Same for master. However, from the previous failed build, I can see how it fails:
replicates logs deterministically
Waiting for peers...
Found peers, running tests...

> Buffer1: 127 - Buffer2: 128
All messages sent
Waiting for all to process

> Buffer1: 128 - Buffer2: 129
1) replicates logs

Which sounds to me like a possible race condition in pubsub. Buffer1 and Buffer2 should both be 128, so there's one extra message sent... Really not sure how to catch this (and not something we need to figure out for this PR). @fazo96 does this fail on your computer on every run or just some times?

Removed the setter and moved the docs into the constructor :+1:
The replication test always failed for me, but the numbers change so it's probably some kind of nasty race condition

Closing the PR as obsolete.
The custom sorting function was implemented and can be passed in to a log through the constructor as the sortFn parameter. See usage examples in https://github.com/orbitdb/ipfs-log/blob/ba2ec2d1c1b07728fab851efe431aa62c95fe8b1/test/log-load.spec.js#L651.
If you feel this PR was not addressed and solved, feel free to re-open it 👍