Added the ability to call defer conditionally

With this proposal it is now possible to pass a boolean or a callback (evaluated at the end of the cycle) to defer. This way it is possible to validate later whether the defer should be executed or not.
This is especially useful for Laravel packages, as they do not have the same control over the application as the developer. They cannot call defer only when all possibilities where it should not be called have been evaluated, so the conditional gives the package developer the possibility to evaluate this after the developer flow.
Of course, it can be very useful for application developer flows as well. In some more complex logics, it can be used within a request class, or placed generically within a provider or middleware.
Some examples:
// Defer if none errors was emitted by validation
defer_if(fn($request) => $request->session()->missing('errors'), fn() => /*--*/);

// Defer if at the end of request an user is logger. It even works when logging in.
defer_if(fn($request) => $request->user(), fn() => /*--*/);
// the bellow works equal
defer(fn() => /*--*/)->if(fn($request) => $request->user());

Can this be achieved already like this?
defer(function () use ($request) {
    if (! $request->session()->missing('errors')) {
        return;
    }

    // Do stuff...
});

Can this be achieved already like this?

defer(function () use ($request) {

    if (! $request->session()->missing('errors')) {

        return;

    }

    // Do stuff...

});

Yes, this is a long way to do the same.

Thanks for your pull request to Laravel!
Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.
If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!


#603 multicloud-test

Checking that https://github.com/openshift/oadp-operator/pull/603 works on azure
/test operator-e2e-azure is only available on
    branches:
    - ^ci-multi-cloud$
    - ^ci-multi-cloud-

for now.

/test operator-e2e-azure

/test operator-e2e-gcp

Codecov Report

Merging #604 (a4ede2a) into ci-multi-cloud (572a5ff) will decrease coverage by 0.39%.
The diff coverage is 16.66%.

:exclamation: Current head a4ede2a differs from pull request most recent head 0f6c142. Consider uploading reports for the commit 0f6c142 to get more accurate results

@@                Coverage Diff                 @@
##           ci-multi-cloud     #604      +/-   ##
==================================================
- Coverage           37.60%   37.21%   -0.40%
==================================================
  Files                  14       14
  Lines                2917     2937      +20
==================================================
- Hits                 1097     1093       -4
- Misses               1737     1761      +24
  Partials               83       83

Impacted Files
Coverage Δ

controllers/bucket_controller.go
0.00% <0.00%> (ø)

pkg/credentials/credentials.go
25.54% <ø> (ø)

controllers/restic.go
53.29% <100.00%> (-0.24%)
:arrow_down:

controllers/velero.go
48.00% <100.00%> (-0.30%)
:arrow_down:

Continue to review full report at Codecov.

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

603 is merged


Install Command Line Tool

How to Ask Permission?
https://developer.apple.com/library/content/documentation/Security/Conceptual/authorization_concepts/01introduction/introduction.html#//apple_ref/doc/uid/TP30000995-CH204-TP1
How to create a symbolic link?
https://developer.apple.com/documentation/foundation/filemanager/1414652-createsymboliclink

http://www.danandcheryl.com/2010/10/how-to-launch-a-privileged-process-on-os-x
https://developer.apple.com/library/archive/samplecode/SMJobBless/Listings/SMJobBlessApp_SMJobBlessAppController_m.html#//apple_ref/doc/uid/DTS40010071-SMJobBlessApp_SMJobBlessAppController_m-DontLinkElementID_5
https://gist.github.com/saelo/091b1a92cc9b6ea9559d370990f888d7


Testing known github issue

https://github.com/golang/go/issues/45993#issuecomment-1427873850
Tested this by setting the following configs
MaxLifetime: 1000s MaxIdleTime: 3s
and following code
stats := env.DB.Stats()
fmt.Println("Open connections", stats.OpenConnections, "Idle connections", stats.Idle)

fmt.Println("Sleep")
// Should be long enough to clear idle connection
time.Sleep(5 * time.Second)

stats = env.DB.Stats()
fmt.Println("Open connections", stats.OpenConnections, "Idle connections", stats.Idle)

Before change:
Open connections 1 Idle connections 1
Sleep
Open connections 1 Idle connections 1

After change:
Open connections 1 Idle connections 1
Sleep
Open connections 0 Idle connections 0

This has been released in https://github.com/moov-io/base/releases/tag/v0.49.3


search

Table can be field search

@qlf123 .. ??? .. What do you mean???

Hello. I almost got it all working except on the search. Im getting this error when trying to search "Uncaught ReferenceError: n is not defined". I hope you can help me with this

@ojnavi32 You need to give me more information. If I have to guess, it probably be somewhere in your code that reference to variable n that is not defined.

I am using laravel 5.3 and I created a component for the vuetable. I used the twitter bootstrap codes of yours its working fine but the search is not working.  My api is based on the code on your sample data using laravel.

Do you know if the error happens on the client side or the server side? At least you need to know this first. The error might be in your javascript (client side) or in php (server side).
My example code does not contain any n variable.

Thank you for your help. I think the problem is in the client side in my js because I can filter in my api.
Can you explain sir how are you doing on setFilter method. Is there any other method to replace the codes in the function, any other methods?

It only appends filter parameter to the query string that will be appended to the api-url.
searchFor is a textbox that you enter the filter string. moreParams is bound to vuetable's append-params prop. vuetable:refresh is the event that asks vuetable to reload the data using the current parameters.
            setFilter: function() {
                this.moreParams = [
                    'filter=' + this.searchFor
                ]
                this.$nextTick(function() {
                    this.$broadcast('vuetable:refresh')
                })
            },

@ratiw I try to use
:append-params="$store.state.t.searchParams" to bind search criteria object but it doesn't work when executing event this.$refs.vuetable.refresh(). Is there any method to bind search criteria with store ( I use vuex)?

@diskman I don't use vuex myself, so I'm not sure. And, no, there is no method in vuetable that will bind search criteria with store. In my opinion, binding search criteria directly to vuex looks kind a weird.
But have you try using computed function instead of referencing the $store directly in your template?

@ratiw because I use vue 2.0 version I was not able to use
 this.$nextTick(function() {
                    this.$broadcast('vuetable:refresh')
                })

I have used
this.moreParams = this.$store.getters.searchParams
...
this.$refs.vuetable.refresh()

It is ok, but now I am not able to construct moreParams object with array eg
{
criteria1: 0
criteria2: [ 3, 4, 5 ]
}
because [] is encoded into 2%5B%5D

@diskman Ah, you're using vuetable-2. I'm a little bit confuse on what problem you're trying to solve then.
By the way, append-params is an object, you cannot assign an array to it.

@ratiw sorry for confusion, I try to get it more clear here - "supporting append-paramas object containing array type property"


Feature - Throwing Adapt Error Calls Retrier

This PR was created to allow errors thrown in the adapter to call the retrier before starting up the request's internal dispatch queue.
Problem
The reason this is necessary is if you want to be able to throw an ExpiredAccessToken type of Error in your RequestAdapter. This would allow you to do things like preemptively refresh you token before sending any requests to the server even though the public APIs had already started up the request. The adapter would be able to intervene.

See #1674 for the a more in-depth explanation of the issue.

Solution
Okay everyone (especially @jshier), I need a sanity check here. I don't think this is too hackish, but I want to make sure everyone else agrees. This was really tricky to implement since there are so many different things going on.
The biggest decision was whether or not to wrap the errors in the AdaptError or not. It all boils down to whether we should call the retrier for things like invalid URLs and parameter encoding failures. IMO, we should not. I feel like calling the retrier in those scenarios could cause all sorts of problems where people are accidentally getting themselves into endless retry scenarios without realizing it.
Instead, I created an AdaptError to wrap any Error that's thrown by the RequestAdapter. This is only used internally by Alamofire to figure out whether the encountered error was actually thrown by the adapter or not. If it is an AdaptError, extract the underlying Error and call the retrier. If it isn't an AdaptError, then the request isn't going to succeed and just start up the request queue.
We could instead actually expose an AFError.adaptError that people are required to throw to get this behavior, but that seems a bit odd and easy to misuse. Instead, I think people are going to want to throw all types of errors from the adapter and we should just wrap them up internally to figure out whether or not we should call the retrier. Once we make that decision, we extract the underlying error and continue on.
I haven't actually built any tests around this yet because I wanted to get everyone's thoughts first. I've dug into the download and upload requests a bit and this is definitely possible to support in a similar manner.
Thoughts?

cc @jshier and @kcharwood for a sanity check 😉

Looks pretty good, though I'm still worried about the growing complexity. I did have some questions about the error and the unwrapping, and how it was being used. I agree with the AdaptError solution, it's just the handling I'm concerned with.

This looks good to me. Agree with the AdaptError solution to avoid accidental retry loops, and it solves the promblem I posted in https://github.com/Alamofire/Alamofire/issues/1674.

This seems to properly address issue in #1674

👍 Looks good.


Metrics update

Allow configuring or overide metric base prefix name
Allow pass org name for metric name
Allow override client dependency for unit testing like mocking

FYI, this needs if your code base you need to override metric name or use the standard name in Coop by default, for example:
coop.my_api.users.online


Better Dart2js type inference with strong mode

Please close this and refer me to another issue if one exists
We are currently recommending a style guide for changes to Angular Dart (the package itself, not users of the package) that bans use of list and iterable comprehensions due to the fact they often emit lower-performing JS.
Specifically (would like to mark these resolved once dart2js can help):

[ ] Using a for ... in loop with a List datatype

I'd like to see for ... in always/or with some certainty emit for (var ... in dart2js.
Until then, we have the following recommendation as part of the style guide:
// AVOID
void processItems(List<String> items) {
  for (final item in items) {
    doThing(items);
  }
}

// PREFER
void processItems(List<String> items) {
  for (var i = 0; i < items.length; ++i) {
    doThing(items[i]);
  }
}

[ ] Using a where/map with an Iterable datatype

// AVOID
void processMammals(List<Animal> animals) {
  animals.where((a) => a.isMammal).map((a) => a.name).forEach(print);
}

// PREFER
void processMammals(List<Animal> animals) {
  for (var i = 0; i < animals.length; ++i) {
    final animal = animals[i];
    if (animal.isMammal) {
      print(animal.name);
    }
  }
}

Other potentially awful options:

Yet-another-flag, i.e. --trust-list-types that forces compilation for issue 1
Yet-another-flag, i.e. --flatten-iterable-comprehensions that forces for issue 2

I am not expecting this to be done with any sort of priority before strong mode/DDC/etc is finalized, but wanted to make sure to file it for posterity and long-term tracking.
/cc @rakudrama @jacob314 @hterkelsen @ferhatb

Use for-in.  If dart2js can tell the collection is a JavaScript array, it generates an indexing loop.  Indexing can be both faster and slower than Iterators.

There are two independent variables to consider here:

Indexing (a[i], i++) vs for-in
Can dart2js tell the Iterable must always be a JavaScript Array?

Consider the combinations:

Indexing + proven to be JSArray:
You get a JavaScript indexing loop.

For-in + proven to be JSArray:
You get a JavaScript indexing loop.

Indexing + possible non-JSArray:
You get calls to get$length and $index in each iteration.

For-in + possible non-JSArray:
You get a loop that uses an iterator - calls to get$current and moveNext in each iteration. When the list at runtime is a JSArray (it just cannot be proven to always be so) this should still be better than the alternative (3). The iterator is often customized to the collection, and JSArray has its own iterator. This can be better than (3) because calls to JSArray.$index type-check and bounds-check the index and that cannot be eliminated. ArrayIterator.moveNext has no such checks (they are built into the loop termination check).

Notice that the most important fact is can dart2js tell that the Iterable must be a JSArray. There is no way to declare that - JSArray is just one implementation of List, and it is private to the runtime library. The connection has to be proven by seeing what values flow to the use-site. Pay more attention to that - write code in a way that helps the type analysis, e.g. use final fields, use private fields etc.
I saw a CL some time ago where 13 loops were rewritten from for-in to indexing.  I studied the generated code. 10 loops generated nice JS, 3 had to fall back on $index and were probably slower as a result.
Where to go from here?

You can look at the results of type analysis in the dump-info viewer. I would start by looking at the types of fields.
If necessary, we could add an option to dart2js that printed hints for for-in loops.
If necessary, we could provide something that has the effect of (x as JSArray<T>) on dart2js while being a no-op on other implementations. We would like to avoid this since it would potentially break compatibility between VM, DDC and dart2js.

For 'comprehensions', we are still quite far from automatically optimizing these chains.
We do plan to add a few specialized iterables to speed up common cases, e.g a special case for a.where(f).map(g).toList() for when a is a JSArray.
In the light of the previous section I would tweak the advice as follows:
// PREFER
void processMammals(List<Animal> animals) {
  for (final animal in animals) {
    if (animal.isMammal) {
      print(animal.name);
    }
  }
}

/cc @floitschG who we chatted about today w/ this.

Thanks @rakudrama - I've CCd @ferhatb so we can see if we should make a change.

@rakudrama: The issue that @ferhatb has outlined though that allocating potentially 100s of iterators, even if they don't type/range/bounds check, allocates memory and garbage collection pressure - where the interceptor-backed $length is slower but without gc pressure.
Consider the following:
void doLotsOfThings(List<List> listOfLists) {
  for (var list in listOfLists) {
    for (var item in list) {
      doThingWith(item);
    }
  }
}

If I understand you correctly, the worst-case for for var ... is:
function doLotsOfThings(listOfLists) {
  var length = $length(listOfLists);
  for (var i = 0; i < length; ++i) {
    var list = $index(listOfLists, i);
    var length2 = $length(list);
    for (var i2 = 0; i2 < length2; ++i2) {
     var list2 = $index(list, i2);
     doThingWith($index(list2, i2));
   }
  }
}

While the worst-case for the for in is allocating O^2 iterators, which are potentially (but not always) JSArrayIterator. Is that correct?

@matanlurey You are mostly correct, but the for-in iterator is allocated once per for-loop, not once per element, so in your nested list example it would be O(N), not O(N^2).
The same is true of the getInterceptor cost in the indexing loop, since although that appears to be required for each indexing, the interceptor can be hoisted out of the loop since the interceptor is a function of the Iterable's type which does not change.  The index type+bounds check will still be per element.
I think it is reasonable for the most performance dependent code to be written whichever way you decide.
I don't think coding style is quite the right way to approach this, if performance is your primary goal you should measure. I expect much bigger differences for .map.where etc than for simple iteration. We have some micro-benchmarks that show for-in and indexing at the same speed but I don't trust micro-benchmarks very much. Many things happen in real code that make it hard to discover the optimization opportunities.
My goal has been to make the more productive "for-in" the obvious choice.


Add telemetry for "Python is not installed" prompt

For #10885

[x] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
[x] Title summarizes what is changing.
[x] Has a news entry file (remember to thank yourself!).
[ ] Appropriate comments and documentation strings in the code.
[ ] Has sufficient logging.
[x] Has telemetry for enhancements.
[x] Unit tests & system/integration tests are added/updated.
[ ] Test plan is updated as appropriate.
[ ] package-lock.json has been regenerated by running npm install (if dependencies have changed).
[ ] The wiki is updated with any design decisions/details.

Codecov Report

Merging #11163 into master will increase coverage by 0.00%.
The diff coverage is 92.30%.

@@           Coverage Diff            @@
##           master   #11163    +/-   ##
========================================
  Coverage   61.41%   61.41%
========================================
  Files         596      596
  Lines       32848    32862    +14
  Branches     4655     4659     +4
========================================
+ Hits        20173    20182     +9
+ Misses      12465    11662   -803
- Partials      210     1018   +808

Impacted Files
Coverage Δ

src/client/application/diagnostics/types.ts
100.00% <ø> (ø)

src/client/telemetry/index.ts
87.38% <ø> (ø)

...pplication/diagnostics/checks/pythonInterpreter.ts
91.07% <90.00%> (-0.60%)
:arrow_down:

...rc/client/application/diagnostics/promptHandler.ts
100.00% <100.00%> (+4.76%)
:arrow_up:

src/client/telemetry/constants.ts
100.00% <100.00%> (ø)

src/datascience-ui/react-common/arePathsSame.ts
75.00% <0.00%> (-12.50%)
:arrow_down:

src/client/common/utils/platform.ts
64.70% <0.00%> (-11.77%)
:arrow_down:

src/client/linters/pydocstyle.ts
86.66% <0.00%> (-2.23%)
:arrow_down:

src/client/datascience/debugLocationTracker.ts
76.56% <0.00%> (-1.57%)
:arrow_down:

...client/datascience/kernel-launcher/kernelFinder.ts
75.70% <0.00%> (-0.94%)
:arrow_down:

... and 171 more

Continue to review full report at Codecov.

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


study summary page for researchers

Month selector (form start of study to today)
New participants: chart of participants who have joined the study, per day in the selected month
Total participants: just a field with the total number of participants (this includes withdrawals)
Total withdrawals: just a field
Completed tasks: chart of completed tasks (no matter what type), per day in the selected month
Total completed tasks, per type: a table with total completed tasks, per task ID (should also say the type, eg "DataQuery 1")

use chartjs as chart library


Stepping behaviour can get hijacked by breakpoints

Basically, if a breakpoint triggers while you're stepping through some unrelated code, the debugger will:
a) break at the breakpoint, regardless of whether its condition is evaluated as true or false.
b) "hijack" the stepping behaviour, i.e. the debugger will no longer break on the next instruction of the step operation.
Repro steps:

Compile the following program:

#include <Windows.h>

void foo()
{
	Sleep(3000u);
}

int main()
{
	while (true)
	{
		foo();
	}
	return 0;
}

Run the executable, attach WinDbg to it.
Set a normal breakpoint at the instruction that calls foo in main.
Set a breakpoint with /w "false" at the instruction that calls Sleep in foo.
Wait until program breaks at the first breakpoint.
Step over the instruction.
Observe that the debugger breaks on the second breakpoint, despite the condition being false. Additionally, the debugger doesn't respect the step operation and won't break on the instruction following the foo call if you resume execution.

Thank you for the report.  It would appear that 'gc' (go w/ continuation of the previous operation) is broken if a different breakpoint is hit during a step operation.  That also affects "/w" conditional breakpoints.  This is now fixed internally and should be in the next external debugger release.


MICRO AE.exp does not specify the llc_prefetcher_types

Hello. MICRO AE.exp does not specify the llc_prefetcher_types. Why does multi.llc_pref not output the message "unsupported prefetcher type "?

HI @szuhzw, the llc_prefetcher_types is a knob of type vector of strings (src/knobs.cc:22). If you have have not specify llc_prefetcher_types knob, the vector will be of size 0, in which case the code inside the for loop at prefetcher/multi.llc_pref:26 will not even execute. Hence, there won't be any log saying "unsupported prefetcher types". The log will be printed if and only if you have passed an invalid prefetcher name with llc_prefetcher_types knob.


Refractoring control.lua

Removes some duplicated code.

Oh jeez, I totally did not see this until I had already pushed version 1.0.3, and now there are merge conflicts all over. I do like your changes, simplifying duplicated code segments.
This is actually the first pull request I've ever had for anything, and I'm sorry I didn't see it earlier; if you could re-review the current control.lua and apply your changes again, I'd be glad to merge them in.

Sure :)
Commit is now compatible with 1.0.3

Excellent, merged (with a small fix applied).


March 2023 Topics

Lightning for Everyone in Any App: Lightning as a Service via the Breez SDK

Credit: Breez
“ Instead of requiring developers to learn a new technology from the ground up, the SDK lets them add bitcoin payments to their apps, which people are already using. Our SDK revolutionizes developers’ experience with Lightning, they in turn improve the users’ UX by cleverly, creatively, and easily integrating Lightning into their apps, and everybody wins.”

While everyone's distracted by jpegs, something else is burning blockspace and bloating the UTXO set. (Thread)

Credit: mononaut

Fedipool: Fedimint Could Mitigate Bitcoin Mining Pool Concerns

Credit: Odell
“A group of independent miners choose to create a Fedimint together. Their combined hash rate results in reduced payout variance: they are paid more frequently and predictably than if they mined alone. Rather than a single pool operator constructing blocks and choosing which transactions to include, each Guardian can construct their own blocks, reducing censorship risk. Additional miners can join the pool in the future to take advantage of the above, but rather than be a Guardian, they choose which Guardian they want to construct their blocks.”

mempool.space (updates)
Discover the Fedimint Hackathon winners

Credit: Fedi
“The quality of the modules that were submitted was truly impressive, with projects from federated storage to community finance tools that really highlighted the potential impact of Fedimint as a platform that could solve real-world problems.“

Strike Launches 'Sending API': Businesses Can Easily Use the Lightning Network for Payments

Credit: Strike
“Once a Lightning invoice has been received, a quote must be generated. The quote specifies the dollar cost of paying the Lightning invoice’s bitcoin amount, and therefore offers a temporary conversion rate between dollars and bitcoin. Both the Lightning invoice and the quote have expiration times.”
“To send a payment, simply execute the quote. When the quote is executed, dollars are sent from the sender’s cash balance, converted into bitcoin, routed through the Lightning Network, and delivered to the recipient.”

The U.S. State Of Wyoming Has Passed A Bill That Protects Its Citizens From Having To Disclose Private Keys

Credit: BTCCasey / Bitcoin Magazine
“The bill states that, “No person shall be compelled to produce a private key or make a private key known to any other person in any civil, criminal, administrative, legislative or other proceedings in this state that relates to a digital asset, digital identity or other interest or right to which the private key provides access unless a public key is unavailable or unable to disclose the requisite information with respect to the digital asset, digital identity or other interest or right.”
It does not specify that it would be only for Bitcoin keys, so it would also apply the same to private keys utilized as decentralized identities, or any other use cases.

Dual Funded Channels - what exactly are they, and how do they work? (Thread)

Credit: LN Capital
“Dual Funding allows for payments to move in either direction as soon as the channel is opened. In a Dual Funded Channel (DFC), both parties commit funds to the transaction that opens the channel.”

BitcoinSearch.xyz is a recently-launched search engine for Bitcoin technical documentation and discussions

How Many Bitcoin Confirmations is Enough?

Credit: Jameson Lopp
“At time of writing, Foundry has 36% of the global hashrate; that means if you're accepting payments after 3 confirmations there's a 49% chance that Foundry could still rewrite the chain to facilitate a double spend. The 6 block confirmation rule of thumb to achieve 99.99% assurance a double spend can't happen (and assumes a 10% hashrate attacker) now requires 60 confirmations to achieve the same level of confidence.”

Bitcoin Core Maintainer Marco Falke Steps Down

“I have been the quality assurance and testing maintainer of Bitcoin Core for about 7 years now. In a challenging decision, I concluded to transition out of my role as maintainer.”

BlueWallet Shutting Down Custodial Lightning Wallet on April 30th

TL;DR: If you have sats on BlueWallet’s lightning node, please move them as soon as possible.

[bitcoin-dev] BIP for OP_VAULT

Credit: James O'Beirne

[Lightning-dev] Highly Available Lightning Channels

Credit: Joost Jager

[bitcoin-dev] Codex32

Credit: Russell O'Connor

Introducing Flow 2.0: A New LSP Focused On Just-In-Time Liquidity

Credit: Voltage / Graham Krizek
“Our LSP will be able to detect a payment and open a channel instantly to ensure the payment can reach your node. This will allow all service providers, app developers, or merchants to offer a noncustodial, private, and seamless experience with almost zero effort and maximum efficiency.”
“There are a couple of examples where static channel provisioning falls short. First is the merchant use case. The last thing a merchant wants to do is monitor their channel capacity, they want to receive payments without thinking about it. Secondly, noncustodial applications need liquidity but developers don’t want to have to write complex channel management in their apps or lock up their own liquidity. Flow 2.0 solves these issues (as well as others) by enabling a receiver to have zero liquidity and still receive payment via Voltage’s liquidity.”

The Breez Open-LSP Model: Scaling Lightning by Sharing ROI with 3rd-Party LSPs

Credit: Breez / Roy Sheinfeld
“Breez is developing Lightning as a Service (LaaS) because both of those things — machines and money — can get very arcane very quickly. We love bitcoin, we believe in Lightning, and we’re trying to make it easier for everyone to use, from consumers to entrepreneurs to developers.”


698 | Partition to K Equal Sum Subsets.cpp | C++

Title - 698.Partition to K Equal Sum Subsets.cpp
What will change -

Created Partition to K Equal Sum Subsets.cpp

Type of Issue -

[x] Adding New Code

Programming Language

[x] C++

Self Check

Ask for issue assignment and wait to get assigned to it before making Pull Request.
Add your file in the proper folder
Clean Code and Documentation for better readability
Add Title and Description of the program in the file

I appreciate it if you could assign this issue to me. I would love to work on it.
Thank you.

I would like to contribute in the cpp code. please assign this to me.


Automatic resolver for single types leaves pk argument optional

Describe the Bug
Given the following code:
@strawberry.type
class Query:
  foo: Foo = strawberry.django.field()

Will generate the following schema:
foo(pk: ID): Foo!

When it should probably generate:
foo(pk: ID!): Foo!

If you accidentally forget to pass the pk argument you will get a slightly more misleading get() returned more than one Foo -- it returned xyz!
System Information

Operating system: macOS/Linux
Strawberry version (if applicable): ==0.133.5

Additional Context

+1 (I agree with bug label)

here is the patch to correct this:
Index: strawberry_django/filters.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/strawberry_django/filters.py b/strawberry_django/filters.py
--- a/strawberry_django/filters.py	(revision b9c2127a179f26df05ccfe1830f35c7f42908d09)
+++ b/strawberry_django/filters.py	(revision c6bd0a1b81c4cd370106c3d0059360296c730215)
@@ -182,7 +182,7 @@
             filters = self.get_filters()
             if self.django_model and not self.is_list:
                 if self.is_relation is False:
-                    arguments.append(argument("pk", strawberry.ID))
+                    arguments.append(argument("pk", strawberry.ID, is_optional=False))
             elif filters and filters is not UNSET:
                 arguments.append(argument("filters", filters))
         return super().arguments + arguments

here is the pull request (test passes) https://github.com/strawberry-graphql/strawberry-graphql-django/pull/214

@fireteam99 the pull request i made to correct this is merged. You can test it. If OK you can close this issue.

I'll close the issue, considering that the PR fixed it. If that's not the case we can reopen it :)

@stygmate thanks for fixing!


Using Windows SDK v7.0 x64 version to build latest Vim from Git was failed

Hello,
I'm using Windows SDK v7.0 x64 version to build Vim 8.0 from Git, but unfortunately it failed.

Here is my build script. It is always work before.
----------------------------------- script start : build.cmd -------------------------
@echo off
@rem to build big Vim with OLE, Perl, Python, Ruby and Tcl
set INCLUDE=D:\GnuWin64\include;D:\Lua\include;D:\Ruby\include;%INCLUDE%
set LIB=D:\GnuWin64\lib;D:\Lua\lib;D:\Ruby\lib;%LIB%
set TOOLDIR=D:
set INSTALL_DIR=D:\Vim
set VIM_SRC_DIR=E:\Gits\vim
set PLUG_MGR=D:\Vim\vimfiles\autoload\plug.vim
set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v7.0\Include
:: to avoid invoke link.sh under src directory
set PATHEXT=%PATHEXT:.sh;=%
cd /d %~dp0
@rem uninstall previous version if it exist
if exist %INSTALL_DIR%\Vim80 (
cd /d %INSTALL_DIR%\Vim80
uninstal
)
if exist %VIM_SRC_DIR% (
cd /d %VIM_SRC_DIR%
git fetch --all
git reset --hard origin/master
) else (
echo "Downloading Vim ..."
git clone https://github.com/vim/vim.git E:\Gits\vim
)
cd /d %VIM_SRC_DIR%\src
if exist .\ObjCULYHTRAMD64 rmdir /s /q .\ObjCULYHTRAMD64
if exist .\ObjGOULYHTRAMD64 rmdir /s /q .\ObjGOULYHTRAMD64
@rem build for no-GUI version
nmake -f Make_mvc.mak CPU=AMD64 FEATURES=HUGE debug=no GUI=no MBYTE=yes IME=yes DYNAMIC_IME=yes GIME=yes CSCOPE=yes ICONV=yes GETTEXT=yes NETBEANS=yes OPTIMIZE=MAXSPEED SNIFF=yes POSCRIPT=yes PERL=%TOOLDIR%Perl DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 LUA=%TOOLDIR%Lua DYNAMIC_LUA=yes LUA_VER=53 RUBY=%TOOLDIR%Ruby DYNAMIC_RUBY=yes RUBY_VER=25 RUBY_VER_LONG=2.4.0 RUBY_PLATFORM=x64-mswin64_90 TCL=%TOOLDIR%Tcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes
@rem build for GUI version
nmake -f Make_mvc.mak CPU=AMD64 FEATURES=HUGE debug=no GUI=yes OLE=yes MBYTE=yes IME=yes DYNAMIC_IME=yes GIME=yes CSCOPE=yes ICONV=yes GETTEXT=yes NETBEANS=yes OPTIMIZE=MAXSPEED SNIFF=yes POSCRIPT=yes PERL=%TOOLDIR%Perl DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 LUA=%TOOLDIR%Lua DYNAMIC_LUA=yes LUA_VER=53 RUBY=%TOOLDIR%Ruby DYNAMIC_RUBY=yes RUBY_VER=25 RUBY_VER_LONG=2.4.0 RUBY_PLATFORM=x64-mswin64_90 TCL=%TOOLDIR%Tcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes
@rem Copy the "runtime" files into "Vim80"
xcopy /I /Y /F /E ...\runtime* %INSTALL_DIR%\Vim80
@rem Copy the new binaries into the "Vim80" directory
xcopy /I /Y /F *.exe %INSTALL_DIR%\Vim80
xcopy /I /Y /F vimtbar.dll %INSTALL_DIR%\Vim80
xcopy /I /Y /F .\GvimExt\gvimext.dll %INSTALL_DIR%\Vim80\GvimExt64
xcopy /I /Y /F .\xxd\xxd.exe %INSTALL_DIR%\Vim80
@rem Copy vimtutor into "Vim80"
xcopy /I /Y /F ..\vimtutor.* %INSTALL_DIR%\Vim80
@rem install vim
cd /d %INSTALL_DIR%\Vim80
::install -install-popup -install-openwith -add-start-menu -install-icons -create-directories vim -register-OLE
::del /F /S /Q "C:\Users\public\Desktop\gVim Easy 8.0.lnk"
::del /F /S /Q "C:\Users\public\Desktop\gVim Read only 8.0.lnk"
install
xcopy /F /Y E:\Releases_vimrc %INSTALL_DIR%
xcopy /F /Y E:\Releases.ycm_extra_conf.py %INSTALL_DIR%
@rem Update the plugins
if exist %PLUG_MGR% (
vim +PlugUpgrade +qall
vim +PlugUpdate +qall
) else (
curl -fLo %INSTALL_DIR%\vimfiles\autoload\plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim +PlugInstall +qall
)
cd /d %~dp0
------------------------------------------ script end ----------------------------------------------

take the daily build:
https://github.com/vim/vim-win32-installer

Hello @skywind3000 ,
Could you help to find the reason why I can't build it by myself by the Compiler version I'm using and the scripts. It seems like the newest Vim can't use VC2008 Express which included inside Windows SDK v7.0.

Kindly regards,
Jiang Jianshan

Have you read the documentation?
https://github.com/vim/vim/blob/master/src/INSTALLpc.txt

Hello @chrisbra and @tonymec ,
I will switch the compiler from Visual Studio 2008 Express to Visual Studio Community 2015. Thanks for your hints.

Kindly regards,
Jiang Jianshan

closing then.

I think this is caused by 8.0.1783 and should be fixed.
uint8_t should not be used here. It is a C99 feature but MSVC 2010
or older doesn't support it.
Cc @ntak
@brammool Which is the minimum version of MSVC we should support? Maybe MSVC 2008?

We have been trying to support MSVC 2008, and we can fix this problem.
uint8_t is defined in libvterm/include/vterm.h, which is not included in
this place.  We can change it to char_u.
--
`When any government, or any church for that matter, undertakes to say to
its subjects, "This you may not read, this you must not see, this you are
forbidden to know," the end result is tyranny and oppression no matter how
holy the motives' -- Robert A Heinlein, "If this goes on --"
/// Bram Moolenaar --<EMAIL_ADDRESS>-- http://www.Moolenaar.net   \
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///


Odd install behavior

When I installed this library for python3, the package downloaded, then pip ran at 100% cpu for almost 2 minutes with no output before finishing the install.
Collecting pymspack
  Downloading pymspack-0.1.1.tar.gz (62kB)
    100% |████████████████████████████████| 71kB 2.2MB/s
<2 minutes of super high CPU use>
Installing collected packages: pymspack
  Running setup.py install for pymspack ... done
Successfully installed pymspack-0.1.1

After the install, I can not import pymsunpack, there is no /usr/local/lib/python3.5/dist-packages/pymspack folder, and only a pymspack-0.1.1-py3.5.egg-info/ folder. The enclosed installed-files.txt lists only.
top_level.txt
PKG-INFO
dependency_links.txt
SOURCES.txt
not-zip-safe

This happens if no matter if I have the apt-package libmspack0 (with -dev) installed or not.

There were an issue with Python 3 version of this package in version 0.1.1.
I uploaded a new version (0.2) to Pypi, with precompiled packages for Linux amd64 with Python 2.7 and 3.5. To build the Python extension from the source distribution you will need Cython.

Thanks for working on this. I tried installing the package, and now I get this:
$ sudo -H pip install pymspack
Collecting pymspack
Downloading pymspack-0.2.0.tar.gz (67kB)
100% |████████████████████████████████| 71kB 2.0MB/s
No files/directories in /tmp/pip-build-z_857qs1/pymspack/pip-egg-info (from PKG-INFO)
$ pip --version
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
I also get this behavior in a python 3 fresh virtual env.

Oh. Cython, not CPython, that explains whe pxd and pyd files that were unfamiliar to me. But with that correction, I think my issue is still relevant.

In a python 3 fresh virtualenv, with Cython installed, I can't reproduce:
# virtualenv --python=python3.5 env
# . env/bin/activate
(env) # pip install cython
(env) # pip install pymspack
(env) # python
>>> import pymspack
>>> pymspack.ext.__version__
'0.2.0'
>>>

Installing Cython did fix the issue. I see you have cython listed as a dependency. But it appears that the wrong directive is used.
https://packaging.python.org/requirements/
https://github.com/gcrahay/pymspack/blob/master/setup.py#L43
setup_requires vs install_requires.
I will make a PR for this.

I read the setup file more and see you use it for setup, so that is the correct directive. For some reason, Cython was not being automatically fetched when I tried to do the setup. From pip I did not even see your message about requiring Cython (from setup.py). Is there a way to ease the install?

I didn't found any way to ease the install. Maybe raise an Exception when Cython is not found?


Updated ports

What are your changes?
Add ports.
What type of changes does your doc introduce?

[ ] Bug fix
[x] New feature

What is the urgency level of this change?

[ ] Blocker
[ ] High
[ ] Medium

I have completed these items:

[ ] I have tested all commands and code snippets.
[ ] I have built locally and tested for broken links and formatting.
[ ] I have made this change for all affected versions (e.g. 1.7, 1.8, and 1.9).
[ ] My doc follows the style guide: https://github.com/dcos/dcos-docs#contributing.

Ping @emanic, @sascala, or @joel-hamill for reviewing pull request changes.
If you included a comment with your commit, it appears here:

relates to EE PR https://github.com/mesosphere/dcos-docs-enterprise/pull/912

@joel-hamill Some conflicts.


Jodit Playground Sources

I apologize if it's not the right place to ask, but I don't see else where I could.
I would like to integrate the right pane options of Playground.
Where could I find the sources of it ?

Hi https://github.com/jodit/jodit-play

Ok, thanks a lot !!


Add roadmap to README

We might want to add a ROADMAP.rst in the top level so it can be included
to in the docs.
On Mar 4, 2015 8:16 AM, "Keith Chambers"<EMAIL_ADDRESS>wrote:

—
Reply to this email directly or view it on GitHub
https://github.com/CiscoCloud/microservices-infrastructure/issues/71.

I just committed a first cut to the main README to get something out there.  I need to understand a bit more about how we update readthedocs.org.

This repo has a webhook to RTD - any time there's a push to master it rebuilds the docs. Basically, we'd just add ROADMAP.rst in the root, and then include it in the toctree directive in docs/index.rst.

Hey Brian, can you help me to create a list with market items in Sphinx?

[x] Foo
[ ] Bar
[ ] Baz

I've been Googling around for 20 minutes and can't find a solution.

Keith-
I'm not sure rST natively supports a checklist, but you could do something like this:
'''

[x] Foo
[ ] Bar
[ ] Baz
'''

I think it would transform fairly cleanly.

@keithchambers try substitutions:
- |checked| foo
- |unchecked| bar
- |unchecked| baz

.. |checked| unicode:: U+2610
.. |unchecked| unicode:: U+2611

Here are the docs for: replacments, the unicode directive, and the code points I'm using in that example

I think you could even make your substitution | | and |x| if you want to mirror the GFM syntax.

Thx! I'll give it a go this afternoon!

Committed and verified!  Closing.


Update sbt-tpolecat to 0.1.17

Updates io.github.davidgregory084:sbt-tpolecat from 0.1.12 to 0.1.17.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "io.github.davidgregory084", artifactId = "sbt-tpolecat" } ]

labels: sbt-plugin-update, semver-patch

Superseded by #226.


[ENH] fill_direction

minor fix for fill_empty

allow a hashable for the column name

Please tag maintainers to review.

@ericmjl

🚀 Deployed on https://deploy-preview-1214--pyjanitor.netlify.app


Mathematics fail

Can someone tell me how a is greater than b?
a =<PHONE_NUMBER>_i32
b =<PHONE_NUMBER>_u32
puts a > b

Surely this is a bug. And a serious one at that.

Huh, apparently comparing signed and unsigned integers is similar in C:
http://stackoverflow.com/questions/2084949/arithmetic-operations-on-unsigned-and-signed-integers
How do you think it should be handled?

In a word? Properly.

See #571


RFC: Stable API Change: k_mem_slab_free()

Problem description
See https://github.com/zephyrproject-rtos/zephyr/issues/61888
Proposed change
See https://github.com/zephyrproject-rtos/zephyr/issues/61888.
Detailed RFC
See https://github.com/zephyrproject-rtos/zephyr/pull/61901
Dependencies
None

Dependencies
None

Is this really the case?
Per the docs:

Dependencies:
- Impact to users of the API, including the steps required
to adapt out-of-tree users of the API to the change

So you are saying there is no impact? If I take the first commit from https://github.com/zephyrproject-rtos/zephyr/issues/61888 and run twister on the code base, I get no build errors and no warnings, many samples and tests would fail however.
Given that we are not deprecating the API, it means that user code will stop working as expected and that is going to be difficult to detect and debug.
The only information we give the user is a one-liner in the release notes, which is going to be easy to miss.

Per the docs:

Dependencies:

Impact to users of the API, including the steps required
to adapt out-of-tree users of the API to the change

So you are saying there is no impact? If I take the first commit from #61888 and run twister on the code base, I get no build errors and no warnings, many samples and tests would fail however.

No, I clearly misread the docs, thanks for pointing it out. I have updated this now.

Complete


fix: add --replace flag

add one cluster in clusterset1 to clusterset2 (by overwrite)
#133  this can be regarded as remove+add
Signed-off-by: ycyaoxdu<EMAIL_ADDRESS>

test output:
╰─$ clusteradm clusterset add set1 --clusters cluster1                                                                                1
Cluster cluster1 is already added into Clusterset set2, you can't add it to set1

╰─$ clusteradm clusterset add set1 --replace --clusters cluster1
Cluster cluster1 is added into Clusterset set1

/approve
/lgtm


Question - How to use generated types

Hi, i want to use the generated type in every component in the code.
But the generated type has a __typename non nullable property, but i'm not necessarily requesting it in the api.
It means that i cannot pass the result of a query to a function that receives the generated type unless i requested __typename.
Did i misunderstood something?

You can either use Partial<Type> or wrap your genql query in a function and use ReturnType<typeof functionName>

__typename is required because it has type String!

Omitting "__typename" seems reasonable `Omit<Type, "__typename">

Omit is the best option here, but is still not great. Now everywhere that I use one of the generated result types, I have to wrap it in Omit<Type, "__typename">.
It would be nice if the CLI had an option to generate response types excluding __typename.


[Bug]: ValueError: Tool with name functions not found, some queries will result in this error, while others won't.

Bug Description

I have modified according to this page, adding unique names to the metadata.
But the error still happend.

I have modified all the EnginTool's ToolMetadata
I also print the metadata for the retrieval step, ensuring that the names in the metadata are included.

I follow the these two Example, got same error.
Multi-Document Agents (V1)
Multi-Document Agents
Version
0.10.38
Steps to Reproduce
response = agent.query("my_query")
Relevant Logs/Tracbacks
No response

Hi, I have verified my tools names I am using in my queries match the names defined in the ToolMetadata.

But the error still happend.

I'm not sure what LLM you are using, but it's just hallucinating a tool name, which can happen

Hi @logan-markewich, I use AzuerOpenAI gpt3.5, so could this be an issue with the LLM API?

Hi @dosu , some queries won't result in this error, but some querirs will happen..
this won't happen

this happen


Debug/cli test order

DO NOT MERGE

Closing this as we now know what the problem was (threaded code not returning results in the same order every time).

Barbara fixed this here https://github.com/mlcommons/modelbench/pull/552/files


Testing limit sell

Hi guys.
Using python and your latest version.
While trying to call HitBTC's method  hitbtc.create_limit_sell_order
This pops out.
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 249, in fetch
    response = opener.open (request, timeout = int (self.timeout / 1000))
  File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\Program Files (x86)\Python36-32\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 409: Conflict

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tests/test_ccxt.py", line 33, in f
    exchange.create_limit_sell_order('EOSETH', '0.0', '0.0')
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 593, in create_limit_sell_order
    return self.create_order (product, 'limit', 'sell', amount, price, params)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 8279, in create_order
    return self.tradingPostNewOrder (self.extend (order, params))
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 8304, in request
    return self.fetch (url, method, headers, body)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 284, in fetch
    self.raise_error (error, url, method, e, details)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 222, in raise_error
    details,
TypeError: 'NoneType' object is not callable

As a product to be selled i have tried to put EOS/ETH and EOSETH but I am getting the same error.

On LiveCoin I get on the same method an error :
Traceback (most recent call last):
  File "tests/test_ccxt.py", line 37, in f
    exchange.create_limit_sell_order('ETH/BTC', '0.0', '0.0')
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 593, in create_limit_sell_order
    return self.create_order (product, 'limit', 'sell', amount, price, params)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\ccxt\__init__.py", line 9384, in create_order
    return getattr (self, method) (self.extend (order, params))
AttributeError: 'livecoin' object has no attribute 'privatePostSelllimit'

On Poloniex while calling the same method with 'ETH/BTC' didn't work but it did when i replaced it with
BTC_ETH which is the way that their products are written.It would be amazing if we could call it with unified symbols.
Thank You and I am really sorry if one of these problems is coming from my side.

Hello!
Let us do this step by step. Can you show some code you're using to initialize HitBTC? I mean, from creation of the instance up to a call to create_limit_sell_order?  In order to test, please run this code:
import ccxt
hitbtc = ccxt.hitbtc ({
	"apiKey": "18339694544745d9357f9e7c0f7c41bb",
	"secret": "8340a60fb4e9fc73a169c26c7a7926f5",
})
# hitbtc.load_products ()
# hitbtc.fetch_balance ()
print (hitbtc.create_limit_sell_order ('EOS/ETH', 100.0, 100.0))

Can you please run this piece of code and copy its output here? After that, we will deal with Poloniex.

Please, write if that snippet works, if that is the case, I will make an automatic product preloading, so that nobody ever forgets to load them )

Yeah,that was the problem with HitBTC.My bad.
Poloniex and livecoin stil broken unfortunately.

The Livecoin issue is a bug in the library, indeed, thanks for posting this! I have uploaded the fix for it and it should be working within 20-30 minutes in the next version 1.1.127. That is the Livecoin part. So, I consider it fixed, thanks again.
Now I am going to look deeper into Poloniex.

Code for testing poloniex:
import ccxt
poloniex = ccxt.poloniex ({
	"apiKey": "NAC75MYB-R2G5KRO5-IVBTG5RQ-VWR05TFJ",
	"secret": "e4d27ab551a565e606b67a50067b629bdfda62b61e33a4a5f98f02ed2d4f29c68edf0e49487a18adfb83833fd59ef99d14e8abb66f2657177f00dd941ff99d07",
	"verbose": True,
})
poloniex.load_products ()
print (poloniex.create_limit_sell_order ('ETH/BTC', 100.0, 100.0))

What output do you get if you run this snippet?

With poloniex the problem is probably the same as with HitBTC. Should work, if you loaded products previously. I will definitely make a silent auto-preload in the next version for this issue to go away forever )

Alright, livecoin should be available now since 1.1.127 and should work as expected. Please update your version, then try making a real or fake livecoin order and paste the output here (with verbose mode = True). The issue with Livecoin should be gone.

Yeah they are all gone,thank You very much.


RFC Documenting Javascript code

Problem
Currently in Invenio there is no on standard for documenting the Javascript code.
https://github.com/inveniosoftware/invenio/blob/pu/invenio/modules/workflows/static/js/workflows/tags.js
https://github.com/inspirehep/inspire-next/blob/master/inspire/modules/deposit/static/js/deposit/task_manager.js
Proposal
Use only the Sphinx one, add the information about it in guidelines for contributing, kwalitee or somewhere else.

Glad to see this RFC :smiley:
I'm not sure if Sphinx is as expressive when it comes about js code as other javascript documentation tools (eg. jsdoc has special tags to describe events and mixin and also comes with handy examples on how to document AMD modules), but I think it would be the easiest to start using in the project. It would also be good, I guess, to agree on some convention when it comes about documenting some repeatable pieces of code - like flightjs components - as it would help to improve readability of that code.
:+1: for the proposal

like flightjs components - as it would help to improve readability of that code.

Agreed, I think that especially documenting flightjs events requires more attention.

:+1: for deciding on a standard. Sphinx would have the benefit of centralizing documentation into readthedocs.org, correct? Additionally we badly need some introduction on all our infrastructure (bower, amd, jasmine) to help a JS newbie (such as me) getting oriented.

Sphinx doesn't sound like a bad idea, but what are some of the  alternatives to Sphinx besides jsdoc?

Here is nice article, which deals with the most popular tools (JSDoc, YUIDoc, Doxx, Docco), containing a comparision table at the end.

:+1:  for the RFC !

There is an example for Sphinx and Javascript documentation: https://github.com/eternicode/bootstrap-datepicker/blob/master/docs/conf.py

There is an example for Sphinx and Javascript documentation: https://github.com/eternicode/bootstrap-datepicker/blob/master/docs/conf.py

Important to note here is that they don't document their code per se. Our usecase is different, as we want to document functions inside the code. Sphix's disadvantage is that there is no way to document JS special constructions, such as events.
Still, if we can't integrate any of standards mentioned by @bouzlibop with RTD, I would suggest sticking to Sphinx.
However, I see one tool that might come in handy:
https://github.com/juhamust/jsdoc-toolkit-rst-template

There is an example for Sphinx and Javascript documentation: https://github.com/eternicode/bootstrap-datepicker/blob/master/docs/conf.py

Important to note here is that they don't document their code per se. Our usecase is different, as we want to document functions inside the code. Sphinx's disadvantage is that there is no way to document JS special constructions, such as events.

Agreed - I think it would be painful to be obliged to maintain docs and code in separate files (this is the case when using only Sphinx with its current JavaScript support).
I found this ext - https://github.com/lunant/sphinxcontrib-autojs - which could probably work for us (it is similar to sphinx autodoc - getting docs from source files). It enforces you to have comments like:
/**:SomeClass.prototype.someMethod( reqArg[, optArg1[, optArg2 ] ] )

The description for ``someMethod``.
*/

as so starting with double asterisks (similar to how it is done in JSDoc). Another thing is that I'm not sure how stable it is - last commit is from around 4 years ago and it has only 63 downloads in the last month from PyPI. Anyway I tested it with some files and it worked for me.
My feeling is however that if we want to produce some solid documentation we should go with JSDoc annotations anyway.

documentation is hosted using GitHub pages http://inveniosoftware.github.io/invenio-search-js/
automatic documentation deployment https://github.com/inveniosoftware/invenio-search-js/blob/master/deploy.sh
CI integration https://github.com/inveniosoftware/invenio-search-js/blob/master/.travis.yml#L76-L77


Socials Not Appearing in Footer

Hello,
I recently tried changing my site's theme to be minima with the "auto" skin. This had the side effect of really messing with my footer. I have it pretty much back to the way I want except I can't get my github or linkedin to appear in the footer. I took the following code and modified it to be the correct links but so far it is not appearing
minima:   social_links:     - { platform: github,  user_url: "https://github.com/jekyll/jekyll" }     - { platform: twitter, user_url: "https://twitter.com/jekyllrb" }'
(Also if there was a better way to enable dark mode than this please let me know, I feel that I may have slightly overcomplicated this somehow.
Thank you for your time,
Alex

Hello @alexcw-5,
I took a look at your repository and found an issue with your config file: You seem to have defined the minima setting twice with differing values:
# _config.yml

minima:
  social_links:
    - { platform: github,  user_url: "https://github.com/alexcw-5" }
    - { platform: linkedin, user_url: "https://www.linkedin.com/in/acacereswright" }

# Build settings
#theme: minima
remote_theme: jekyll/minima
minima:
  skin: auto

You may inspect which definition got preference by having the following somewhere in your layouts / markup:
<pre>
{{ site.minima | jsonify }}
</pre>

To fix, combine the two definitions:
# _config.yml

remote_theme: jekyll/minima

minima:
  skin: auto
  social_links:
    - { platform: github,   user_url: "https://github.com/alexcw-5" }
    - { platform: linkedin, user_url: "https://www.linkedin.com/in/acacereswright" }

Hello @ashmaroli,
That worked, thanks!
Just out of curiosity, do I need to have all of the directories like _sass, _layouts, and _includes in the directory of my project, or should I only keep the ones where I modify a file within it, such as _layouts since I removed the subscribe button from the footer?
Thank you again!

do I need to have all of the directories like...

No. You only need to keep ones that are modified.
On other note, it would be better to lock remote-theme to a particular SHA (refer plugin documentation) instead of the default branch directly because minima:master is currently unstable and may contain breaking changes in the future.

Thanks again for the advice!
I do have two quick questions in regards to your response if you don't mind answering them:

Does that apply to files too, so if I only modify the footer I just need to keep the _layouts/footer.html file and can remove the rest since I did not modify them?
I added the  'jekyll-seo-tag' to my gemfile and config file, but from what I could tell from the documentation I don't need to set the version anywhere it will update automatically?

I suggest having a look at Jekyll's documentation at https://jekyllrb.com/docs/themes/ for answers.

Hi Ashwin,
Sorry to bother you again with another question. After looking around the documentation I thought  something like the screenshot below was the correct way to lock the version of minima correctly. However, this has the effect of ignoring the skin and social links. I'm a bit confused since 2.5.2 seems to be the latest release.
I feel like there is something obvious I am missing, and I understand that answering questions isn't your job but I feel as if I am close so any small tips helps.

@alexcw-5 minima-2.5.2 is indeed the latest release but the features you're using (skins and minima.social-links) are part of unreleased changes on master. So, locking to use these features forever is:
remote_theme: jekyll/minima@d7122a0


Online-version

Arrange a way to run reveal.js with GitHub pages.

Need to decide how to go at hosting the remark.js files.

just refert to remark-site?
own repo, with or without tagging to have absolute versions available?
something else?


Allow clean jobs to run when a PR is merged

Composite jobs can check additional conditions like whether
or not the PR was merged.
Change-type: patch
Signed-off-by: Kyle Harding<EMAIL_ADDRESS>

@balena-ci I self-certify!


npm tests fail when offline

the npm tests read github to tests the markdown parsing. when working offline, the tests fail.

Would you rather:

mock GitHub
exclude tests with network activity from unit testing?

Why not use replay?

Ok, so we just mock it using Replay. Makes the tests more robust to content changes in that repo, too.

I found another way: we can check for connectivity, and skip the test when offline.

Just tested, tests work offline.


Oracle solution / Shortest path algorithm

Hi,
very nice project! I'm using it for an exploration task and I was wondering whether an oracle exists to determine the shortest path between the agent and the goal state (or any other position on the map)? Or how such an implementation could best be approached?
Best,

Hello Marius. There is unfortunately no oracle as that would be very difficult to implement for any path that is not trivial. Your best bet would be to compare against a trained policy.

Thank you, for the quick response! While looking into the problem I already expected such an answer but I was hoping I missed something.


[ng] alignment for dropdown's nested menu is wrong

Select one ...  (check one with "x")
[x] bug
[ ] feature request
[ ] enhancement

Expected behavior

The dropdown's nested menu should have an overlap of 4px and the nested item should align with one of the parent items.
Actual behavior

Alignment is off on the Angular component. See screenshots for reference:
static

angular

Reproduction of behavior
Compare static and angular versions on our website:
https://vmware.github.io/clarity/documentation/dropdowns#examples
Environment details

Angular version: 4.3.X

Clarity version: 0.10.0-rc1 or above

OS and version: all

Browser: all

It's the set of selectors starting https://github.com/vmware/clarity/blob/master/src/clarity-angular/popover/dropdown/_dropdown.clarity.scss#L292 that we don't have anymore for the Angular version of the dropdown. My bad for missing this.

1.the overlap of 4px
I try the way below to fix it, but it need hard code  clrposition attribute.
    //Directions
    .dropdown {
        // nested dropdown (submenu)
        .dropdown {
            .dropdown-menu {
                border-color: $clr-dropdown-child-border-color;
                position: absolute;
            }

            [clrposition="right-bottom"] {
                margin-bottom: $clr-dropdown-submenu-vertical-margin;
                margin-left: $clr-dropdown-submenu-overlap-margin;
            }

            [clrposition="left-bottom"] {
                margin-bottom: $clr-dropdown-submenu-vertical-margin;
                margin-right: $clr-dropdown-submenu-overlap-margin;
            }
        }
    }

Another solution : Add directions class on clr-dropdown component in runtime.

I am not sure have any better solution.
2.the nested item should align with one of the parent items
Have more clear example or picture to show align result ?

@mathisscott I'm pinging you as you start to think about dropdowns that this is a known issue in Angular.
The workaround here would be to either use the CSS dropdowns or override some of the Angular dropdowns.
There is a workaround available for this issue, and we recommend using it for Clarity Angular. Given we are starting to work on this component with Clarity Core, we don't anticipate investing in this given how stale it is. We would consider a contribution to address this issue if someone is able to work out a solution. As we build Clarity Core implementations, this issue won’t be an issue. To help us clean up our backlog, we are going to close this with a functional workaround available and suggest you follow updates for Clarity Core for enhancements that can support your use case with Clarity Core components.


Update nl_BE and nl_NL translations

Changes in the i18n object has been made after nl_BE and nl_NL was last updated.

Fixed daec721252471dd5a0aca13f5e4e8f5ab0ef7dc9

sup

Ooh, comments :dancer:

You know the drill, @RDux

https://github.com/npolar/filefunnel.js/pull/7

dafuk took u so long, slacker?! :angry: :wink:

You saw it coming...

@RDux Please update nl_BE and nl_NL with the newly added rejected property.


Curl#curl_headers: Work with 56 exit_status

[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same change?
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[ ] Have you written new tests for your changes? Here's an example.

[x] Have you successfully run brew typecheck with your changes locally?
[x] Have you successfully run brew tests with your changes locally?

I previously added the 8 curl exit code (weird server reply) to the list of non-success exit codes that #curl_headers will handle. We're now seeing failures with a 56 exit code (failure in receiving network data), where the server returns a 4xx response for a HEAD request but the same request using GET works as expected (e.g., casks like beeper, get-api, odrive, ui, etc.).
This adds 56 to the list of exit codes in #curl_headers, so a response with a 4xx HTTP status will be automatically retried using GET.

Thanks @samford!


[SPARK-12610][SQL] Left Anti Join

What changes were proposed in this pull request?
This PR adds support for LEFT ANTI JOIN to Spark SQL. A LEFT ANTI JOIN is the exact opposite of a LEFT SEMI JOIN and can be used to identify rows in one dataset that are not in another dataset. Note that nulls on the left side of the join cannot match a row on the right hand side of the join; the result is that left anti join will always select a row with a null in one or more of its keys.
We currently add support for the following SQL join syntax:
SELECT   *
FROM      tbl1 A
          LEFT ANTI JOIN tbl2 B
           ON A.Id = B.Id

Or using a dataframe:
tbl1.as("a").join(tbl2.as("b"), $"a.id" === $"b.id", "left_anti)

This PR provides serves as the basis for implementing NOT EXISTS and NOT IN (...) correlated sub-queries. It would also serve as good basis for implementing an more efficient EXCEPT operator.
The PR has been (losely) based on PR's by both @davies (https://github.com/apache/spark/pull/10706) and @chenghao-intel (https://github.com/apache/spark/pull/10563); credit should be given where credit is due.
This PR adds supports for LEFT ANTI JOIN to BroadcastHashJoin (including codegeneration), ShuffledHashJoin and BroadcastNestedLoopJoin.
How was this patch tested?
Added tests to JoinSuite and ported ExistenceJoinSuite from https://github.com/apache/spark/pull/10563.
cc @davies @chenghao-intel @rxin

Test build #55144 has started for PR 12214 at commit 5df21df.

LGTM, pending tests.

Test build #55144 has finished for PR 12214 at commit 5df21df.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55144/
Test PASSed.

Merging in master.

@hvanhovell It sounds like something is wrong?
  test("left anti join") {
    val df = Seq(1, 3).toDF("int")
    val df2 = Seq(1, 5).toDF("int2")

    checkAnswer(
      df.as("a").join(df2.as("b"), $"a.int" === $"b.int2", "left_anti"),
      Row(3) :: Nil)
  }

Yeah it is broken for the BroadcastHashJoin unique key case :(...: https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoinExec.scala#L358-L373
I am gonna open a JIRA and create a PR today.


Run Python PostCommit

Run Python PostCommit

Run Python Postcommit

Run Python Postcommit

@pabloem @aaltay  Could one of you help merge this please? Thank you!
cc: @fredo838


Remove Array.append.

Fixes #1
Proposed Changes

Remove (deprecated) Array.append.

@timohanke: Are there any better ways to prepend a single value to an array?

Type Text has a .size() function so you can inspect the parity before you even build the iterator. You can concatenate Text type as in Text.fromChar('0') # t. Then afterwards convert to Array.


Fixes for bug #14

Hopefully fixed #14. Needed to export CUR_DIR so the sub shell in navigate_to could see it, added quotes to prevent string splitting, made navigate_to a bit safer.

Thank you very much! Tested it and navigate_to() runs perfectly now. Again, thank you for your contributions here. Will merge this now.

No problem, always happy to help


How do I render the button?

Is your feature request related to a problem? Please describe.
The documentation for the button is a bit difficult to parse, with all of this deprecated content and different dependencies and doc files. I  have followed what appear to be steps to render the button (I think?), I have referenced other repos/sample repos (and things have changed?), and I still can't seem to get the button to render in React.
Describe the solution you'd like
I think this repo would benefit massively from a Getting Started or How To Render The Button section. I have worked with ODS before, and it seems to have changed since I last used it, so I think a single section for how to render the button with the latest version would be awesome if kept up to date.

When you are saying that you can't get the button to render, what is missing?
Is the web component not rendering the shadow DOM or is there an issue that the CSS is not being applied to the custom element?

Also, I think what you are looking for is in this React demo repo
https://github.com/AlaskaAirlines/OrionReactDemo/blob/master/PROJECT_SETUP.md

Great question, sorry I should have clarified.
What I have done:
Imported the necessary sass file in my sass
@import "~@alaskaairux/orion-design-tokens/dist/tokens/SCSSVariables";
And verified that I can use the variables and they display properly.
Imported the auro button in my App.js
import '@alaskaairux/ods-button/dist/auro-button';
Added the element to my render() function
<auro-button>Hello World</auro-button>
What I'm seeing:
I am simply seeing the text "Hello World" displayed in bold with no other styling. It seems like I may be missing style sheets. I have tried importing the tokens in App.js but nothing seemed to work. In the inspector I see #shadow-root (open) inside the <auro-button> component

Sure, I see where the issue is.
SCSSVariables are Auro Sass variables, e.g. $thing. The native web components need the Auro CSS Custom Properties in order to render properly.
Importing /SCSSVariables into your primary Sass aggregator will provide access to all the use cases of using Sass variables in your code, e.g.
.foo {
  color: $auro-color-background-darker
}

When using a web component, the CSS in the component itself is looking for CSS custom properties in the global scope, e.g.
:root {
  --auro-color-background-darker: #01426a
}

In order to do this, in your global Sass you could import SassCustomProperties. Or you can also import the CSS file CSSTokenProperties.css into your App.js file.
Either way, you only need to make this reference once and be sure it is in a global space so that all other UIs will be able to consume this resource.
Here is the full list of all the pre-processed resources from Tokens
https://github.com/AlaskaAirlines/OrionDesignTokens#install-pre-processed-resources

Thanks so much, I think this was the missing piece. I had tried importing the CSSTokenProperties.css in my App.js but it wasn't working, but after adding SassCustomProperties to my global sass file, I am now seeing the correct render and styling of the button.
Woohoo!


Feature proposal: Wrap text

Wrap text that goes above the window width.

Thanks for the suggestion!
I've thought about doing it, but haven't needed it enough to actually do it yet.
This again is something that unfortunately needs some refactoring before it can be done :/. The rendering part isn't very hard, but it should also change the behaviour of some commands. If I only changed the rendering, then when pressing down on the first row of a wrapped line, the cursor would jump to the next "real" line and not the next row of the wrapped line.
Like this (The | symbol is the cursor)
01 print("Very| long text here. Very long text here. Very long text here. Very long
     text here. Very long text here. Very long text here. Very long text here.")
02 # A comment line here ...

Pressing the down arrow would show:
01 print("Very long text here. Very long text here. Very long text here. Very long
     text here. Very long text here. Very long text here. Very long text here.")
02 # A comment| line here ...

The desired result would really be this:
01 print("Very long text here. Very long text here. Very long text here. Very long
     text here.| Very long text here. Very long text here. Very long text here.")
02 # A comment line here ...

Anyway this is an important feature so I'll keep this open and try to get it done when I have time :)

Sure, just an idea :)

Closing for now, will revisit during the rewrite.


[question] TtlCacheBacking - SystemTime or Instant?

Hi,
I was looking at this crate, evaluating it for my use.
While examining the code of TtlCacheBacking I've noticed that it's using SystemTime in order to determine the age of a cached entry.
My question is, why SystemTime instead of Instance? Was this due to a problem which you've encountered?
The reason for my questions is a caveat with SystemTime which each call to SystemTime::now() translates to a system call (at least on Linux) - a relatively slow operation.
Under heavy load, the affect of this can be significant.
Instant, on the other hand, does not suffer from the same problem.

Sorry, I have not received any notification about this issue.

I'll move it to an Instant instead!

About to leave, - tests were passing. If you don't mind give it a shot and let me know if you encounter any issues with it or if it's good to go! :)

Hi,
Sorry for the delay. I somehow missed it.
Yes, the change looks great.
Thankyou!


Added 212 countries and regions.

新加212个国家地区。比如
印度

日本

埃及

地图来自https://github.com/pissang/starbucks/issues/2

Codecov Report

Merging #183 into dev will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##              dev     #183   +/-   ##
=======================================
  Coverage   97.43%   97.43%
=======================================
  Files          67       67
  Lines        2380     2380
=======================================
  Hits         2319     2319
  Misses         61       61

Impacted Files
Coverage Δ

pyecharts/_version.py
100% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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

忍不住再发一个：

Good job!


[SPARK-12498][SQL][MINOR] BooleanSimplication simplification

Scala syntax and existing Catalyst expression DSL allows us to refactor the BooleanSimplification optimization rule to a clearer and more readable form. Actually you hardly need any extra comments to understand most of the transformations.

Test build #48237 has started for PR 10445 at commit 41abd4e.

Test build #48237 has finished for PR 10445 at commit 41abd4e.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48237/
Test PASSed.

It's much more readable! LGTM

It seems to me the change is not necessary and might actually complicate the analyzer code itself due to the reliance on the dsl implicits and this "unapply" (I didn't even know it existed.....)
One thing I do like though is the True and False, although I'd rename it TrueLiteral and FalseLiteral, in order to make it clear it is a literal.

Update: the unapply is probably fine. I still wouldn't have the dsl though.

Test build #48471 has started for PR 10445 at commit d6ab482.

Thanks for the review! I reverted the DSL part and those changes that are not obviously correct.

Test build #48471 has finished for PR 10445 at commit d6ab482.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48471/
Test PASSed.

Merged build finished. Test PASSed.

I'm going to merge this. Thanks.


Note is not clear

The note says "-MediaRelayRoutingLocationOverride - this command is not available for use in direct routing scenarios." however this page is for Direct Routing only.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 7a420204-479f-d8c9-ea30-9f07431b4b42
Version Independent ID: a67787ef-c6ac-74bb-baef-5835391b5949
Content: Direct Routing country codes - Microsoft Teams
Content Source: Teams/direct-routing-country-codes.md
Service: msteams
GitHub Login: @CarolynRowe
Microsoft Alias: crowe

Hi @gsromeo, thank you for your feedback.
There is a pending update to change that note for this one:

[!NOTE]
MediaRelayRoutingLocationOverride parameter is reserved for use with managed carriers.

You'll see it in the next couple of days.
Related to https://github.com/MicrosoftDocs/OfficeDocs-SkypeForBusiness/pull/7042.

@gsromeo Thank you for submitting feedback. We understand that this issue has been resolved.
Please feel free to re-open this issue if there is a specific area of the docs that we can improve or make better. Thank you.


Prevent errors when interacting with selected non-visible layers

References and relevant issues
Closes #7314
Description
Approach 1
Set the layer's editable attribute following the layer's visible attribute to prevent being able to interact/edit the layer while is hidden.
A preview (when a layer is hidden the layer mode gets now set to the pan/zoom mode since is not editable):

https://github.com/napari/napari/pull/7348/commits/6585c3246dfcc500bbf4e09ddd62a744aabf01ff
Note: Partially discarted since there are already in place some tests that check for the independence of attribute values (setting visible should not change the editable value) and also does not restore mode being used when the layer was visible (always makes the mode end up being pan/zoom).
Approach 2
Change mode following visible attribute value (changing mode to be pan/zoom if the layer is not visible and saving the previous mode to restore it when the layer is visible again) and prevent changing mode to something different to pan/zoom while the layer is not visible:

https://github.com/napari/napari/pull/7348/commits/d127bcd4c340ccc8968676d731c9c6855692df1d
Approach 3
Don't mess with attributes values dependencies (visible x mode x editable) and just disable mouse bindings if a layer is not visible (and add validations around in case values being used for layer computations end up being None)
A preview:

https://github.com/napari/napari/pull/7348/commits/5642a88799426332d173045d0085350ecd8c5532
General notes

Regardless of the approach to implement the fix, the desire functionality seems to be not being able to interact/change a layer that is not visible (even when is still selected) while also preserving the state in regard of mode selected once the layer is visible again. An example user flow (explaining current behavior and desired one) is described at https://github.com/napari/napari/pull/7348#issuecomment-2456053311

So seems like in fact visible and editable should be independent and that's why tests are failing here (see https://github.com/napari/napari/issues/1346 for more details). Maybe, instead of setting editable to follow the visible value, when setting visible to False the layer mode should be changed to be pan/zoom? 🤔 What do you think @psobolewskiPhD ?

So seems like in fact visible and editable should be independent and that's why tests are failing here (see #1346 for more details). Maybe, instead of setting editable to follow the visible value, when setting visible to False the layer mode should be changed to be pan/zoom? 🤔 What do you think @psobolewskiPhD ?

I may have written or modified some of those tests while fixing some related bugs. I don't think there was a strong consensus on the desired behavior, so if you have a better proposal, I think it's fine to change the tests.

Edit: Thinking a little bit more on this, maybe being able to track the mode when the layer is visible and restoring it after the layer is visible again could make sense? A preview of the behavior (which the latest commit implements):

Oh, this might be the better proposal :) Something like this sounds good to me. Ideally the actual state of editable and visible would be independent (i.e. changing visible to False does not change editable to False), but things that depend on both values (e.g. the mode) just check them both appropriately (or use some derived property).

I think visible to False should change editable to False.
Try this on main/0.5.4
Open a sample image and make a Labels layer.
Paint in the labels layer and hide it to see just the image--you can use the V keybind.
Click/drag.
Show the labels layer: Oh! you were painting the whole time!
You don't want that I don't think, but when you go back to visible you should return to the previous state, so you could resume painting.
With this PR currently I get the behavior I expect?

I think visible to False should change editable to False

I think makes sense if the attribute is used only over the GUI but maybe the reason for their independence is to allow actions/editions programatically? So even when a layer is marked as not visible people maybe still want to programatically edit the layer? Not totally sure if the editable attribute is used for something else than allowing setting values for the mode attribute 🤔

With this PR currently I get the behavior I expect?

Yep, I would say so. So with the latest changes here, when hidding the layer (visible -> False) the mode is changed to pan/zoom. After the layer is set to be visible again (visible -> True), the previous selected mode gets restored:

Also, your mention of the keybinding to show/hide the layer made realize that even when we set the mode to pan/zoom when hidding the layer, people could use the mode keybindings to select again a different mode than pan/zoom. Latest changes also add a validation to prevent that

Things may go wrong if someones is accessing the mode programmatically and expects it not to change. Couldn't we simply disable mouse bidnings for invisible layers? That seems to be the main source of pain.

Things may go wrong if someones is accessing the mode programmatically and expects it not to change.

With the latest changes here you shouldn't be able to change the mode when setting the layer visibility to False but maybe you think that even when the layer is not visible the mode should be able to change?

Couldn't we simply disable mouse bidnings for invisible layers? That seems to be the main source of pain.

Yep that could be another approach :+1: Should I try to explore that option?

Couldn't we simply disable mouse bidnings for invisible layers? That seems to be the main source of pain.

I think this makes total sense and is less intrusive for users who might be toggling visibility/mode programmatically right? That way, mode/visibility etc. would still change as it does now, it's just that the mouse couldn't interact with an invisible layer. I'm much less concerned about programmatic mouse interactions not working as expected... @Czaki @psobolewskiPhD thoughts on just disabling mouse bindings?

With the latest changes here you shouldn't be able to change the mode when setting the layer visibility to False but maybe you think that even when the layer is not visible the mode should be able to change?

Yes, that's what I meant.

I'm much less concerned about programmatic mouse interactions not working as expected

Exactly! If someone is at the point of doing programmatic mouse movements, surely they can handle programmatically making it visible :P

Yep that could be another approach 👍 Should I try to explore that option?

I would give it a go yes! You can probably add a clause in the functions here https://github.com/napari/napari/blob/main/napari/utils/interactions.py

So the flaw of disabling mouse bindings vs. switching to pan/zoom link before is you lose the ability to pan/zoom, which is pretty nice.
If you pull this down and use it while annotating, then the behavior of 3edc030 is a lot nicer than the current version of the PR.
But I guess we can consider that for a future enhancement vs. strict bug fix here?

But I guess we can consider that for a future enhancement vs. strict bug fix here?

That makes sense to me :+1: Also, thinking about the pan/zoom mode usage when certain criteria is met, seems like that could be related with https://github.com/napari/napari/issues/7067 ? Maybe it could be worthy to discuss over that issue the cases where the pan/zoom mode should be selected automatically (or even if that makes sense) and in general what should happen to the mode when setting the layers different attributes and the interaction between layers modes and current layers selection?

@dalthviz I think disabling mouse bindings is the best fix for the reported bug, and you're right we should discuss the mode changes in the other issue.
It would be good to see a test. Could we add a shapes layer, hide it, try to draw on it and then assert the shape wasn't drawn? Similarly since pan/zoom is disabled we could try a scroll and then asserting the zoom level is the same. That later test would eventually break if we change stuff as a result of #7067 but I think that's actually a good thing haha.

Similarly since pan/zoom is disabled we could try a scroll and then asserting the zoom level is the same

Checking the creation of such a test, I noticed that zooming, even if the layer is not visible, is posible. My guess is that such interaction is available even with the changes here since the zoom is handled with the viewer camera? 🤔

In fact even if no layer is selected you can zoom 🤔 :

Following that, not sure if there is something else that needs to be done here but let me know!

Checking the creation of such a test, I noticed that zooming, even if the layer is not visible, is posible. My guess is that such interaction is available even with the changes here since the zoom is handled with the viewer camera? 🤔

Yes. If not event handler accepts the event, the default vispy handling happens.

Heh, the fact that zoom works begs pan to work too IMO.

So, if I'm understanding correctly, this PR should also add the zoom behavior when an invisible layer is selected while not changing the current mode selected, right?

To be honest, this further convices me of something I've thought for a while: pan-zoom should really be a viewer mode and not a layer mode...

To be honest, this further convices me of something I've thought for a while: pan-zoom should really be a viewer mode and not a layer mode...

That kind of makes sense since seems to me that the pan/zoom mode is basically letting the viewer know that the active layer wants the viewer camera to support mouse pan and zoom interactions. My guess is that things are as they are since these kind of interactions (mostly the mouse pan) can interfere with layer modes that rely on mouse callbacks? 🤔 Anyhow, I would say that opening an issue to further discuss that idea could be worthy :+1:

Especially with the new changes requested by @jni and when comparing the behavior to the similar https://github.com/napari/napari/pull/7408 I strongly prefer the change to pan/zoom behavior, as here https://github.com/napari/napari/commit/d127bcd4c340ccc8968676d731c9c6855692df1d
This is particularly the case if you open an image layer and then do some annotation (any shape tool, brush or polygon labels tool). If you use the v shortcut to toggle visibility of the annotation layer, with current latest commit you will still have the tool for the mouse, but it doesn't do anything obviously. With mode switch, you get the expected behavior.

Right — I'm sorry for muddying the waters @psobolewskiPhD — I only looked at the final behaviour, not all the alternatives in the description. 🤦 I totally agree that Approach 2 is the right approach. To be honest I don't even know where my head was when I was reviewing this PR not once but twice, I apologise for that. :disappointed: The past ~6 weeks have been full-on for me but things should be calmer now and you can expect your regularly-scheduled reviewing from me. 🙏
@dalthviz I'm really sorry for the long circles you have had to run here. I agree with @psobolewskiPhD.
Regarding the other concerns raised here, about programmatic changes to the layer, I actually think that this is not that big a deal: just like folks can programmatically update the visibility when adding mouse interactions, they can update it when changing the mode.
Alternatively, changing the mode programmatically while invisible could, instead of raising an error, change the remembered previous mode.
I'm ok with any of the options for what happens when setting mode to invisible layers, but I agree with @psobolewskiPhD that when the layer goes invisible, the mode should in fact go back to pan/zoom.


Script evaluation fails on ToString() on simple types

I have encountered a strange bug which relates to invoking ToString() on a NET object. This seems to work on everything except the simplest types (string, int, bool, double, char, etc). Please find the code that reproduces this in the following repo: https://github.com/gunsh/clearscript-to-string-bug
Here is the program output which shows success for DateTime, Uri, KeyValuePair<> and object as well as failure for string, int, double, bool and char.
I am guessing this is because simple types are converted to JavaScript internal types which makes them non-NET types but that makes simple tasks like "text".Substring(1) or 1234.ToString("N") impossible.
4/11/2020 2:03:18 PM
https://github.com/
[A, B]
System.Object
TypeError: context.Value.ToString is not a function Error testing String!!! [String]
TypeError: context.Value.ToString is not a function Error testing 0 [Int32]
TypeError: context.Value.ToString is not a function Error testing 3.14 [Double]
TypeError: context.Value.ToString is not a function Error testing True [Boolean]
TypeError: context.Value.ToString is not a function Error testing A [Char]

Hello @gunsh,

I am guessing this is because simple types are converted to JavaScript internal types which makes them non-NET types

That's correct. Without automatic conversion of those fundamental types, using ClearScript would be very painful.

but that makes simple tasks like "text".Substring(1) or 1234.ToString("N") impossible.

There are many ways to provide access to such methods. One possibility is to expose a generic method that stores the value in a host variable:
engine.Script.host = new HostFunctions();
engine.Execute(@"
    Object.prototype.toClr = function () {
        return host.newVar(this.valueOf());
    }
");

With this setup, you can make your test work as follows:
Console.WriteLine(engine.Evaluate("context.Value.toClr().ToString()"));

You can also use expressions such as "text".toClr().Substring(1). Unfortunately 1234.toClr().ToString("N") is a syntax error in JavaScript.
Good luck!

Thank you @ClearScriptLib. That was very helpful.
Fortunately (or not), I have rolled my own solution even before you managed to post yours. I have pushed an update to the sample repo to a "fix" branch.
I find this so useful perhaps it's worth including some solution for this problem into a future update of built-in HostFunctions?
What I did is essentially expose a $ global function that wraps a NET object (especially simple types) into a wrapper that implements DynamicObject. This gives a super simple syntax that allows Substring(1) or ToString("N") or anything else to work.
$(1000).ToString("N") outputs 1,000.00
$("abcd").Substring(1) outputs bcd

Hi @gunsh,
It's great to hear that you found a solution! The $ function is a great idea!
Please reopen this issue if you have any additional questions or comments about this topic.
Thanks!


What is the training data for traning the HMM model of estimating polya length?

I wonder what organisms or cell types you used to get the emission distributions. And do you observe any differences among cell types?

We developed program using a small subset of human and SIRV reads from this dataset. We tested the trained models using data ONT generated found here

We developed the program using a small subset of human and SIRV reads from this dataset. We tested the trained models using data ONT generated found here

Thanks a lot!


How to get if My image is back on scale factor 1

As a user, If I double tap on image to scale it, by default I am getting result where image is scaled by 2. (scale : 2)
Now if i want to get this value in code, using onMove I can see scale as 2. Here's the problem is -  onMove will only fire if user moves image. If i keep on doing double tap on image, scale factor will be increasing to 2 and coming back to 1. This process will keep going, but there is no way (or unfortunately I am not able find) to get scale (scaling factor) in this scenario.
Purpose - I wanted to show / hide some section based on scale factor (If scale 1 - show, otherwise hide)
PS - I know onMove gives scale but it will only trigger if user moves image, keep on double tap on image does not trigger it, scenario mentioned above)
PLEASE HELP!!!!

I hope you find it useful
<ImageZoom
  ref={ref => (this.ImageZoom = ref)}   //Here
  cropWidth={Dimensions.get("window").width}
  cropHeight={this.state.height}
  imageWidth={Dimensions.get("window").width}
  imageHeight={this.state.height}
  pinchToZoom={true}
  responderRelease={() => {  //start
  this.ImageZoom.reset();   <===  HERE
   }}                     //end
   >
   <FastImage
     style={{
      flex: 1,
      height: this.state.height,
      width: WidthG
    }}
     source={{
      uri: this.state.image
    }}
    resizeMode={FastImage.resizeMode.contain}
   />
</ImageZoom>

I hope you find it useful
<ImageZoom
  ref={ref => (this.ImageZoom = ref)}   //Here
  cropWidth={Dimensions.get("window").width}
  cropHeight={this.state.height}
  imageWidth={Dimensions.get("window").width}
  imageHeight={this.state.height}
  pinchToZoom={true}
  responderRelease={() => {  //start
  this.ImageZoom.reset();   <===  HERE
   }}                     //end
   >
   <FastImage
     style={{
      flex: 1,
      height: this.state.height,
      width: WidthG
    }}
     source={{
      uri: this.state.image
    }}
    resizeMode={FastImage.resizeMode.contain}
   />
</ImageZoom>

How can use this only when we changed image ?
Case :

If we still on the same image, don't fire reset
If we change image (swipe left or right), fire reset On the previous image

?
Please


Change inline css to proper stylesheets where appropriate

Too many pages rely on inline CSS.  This is inefficient and needs to be refactored.

I have removed a lot of the inline CSS, what's left can likely be smashed into a CSS file.
We could make use of more partials to reduce replicated code.

This issue was moved to gridcoin-community/Gridcoin-Site#5


Add new connectivity overview page

What this PR does / why we need it

Towards https://github.com/giantswarm/giantswarm/issues/30732
Things to check/remember before submitting

If you made content changes

Run make dev to render and proofread content changes locally.
Bump last_review_date in the front matter header if you reviewed the entire page.

It is a draft, I just marked it now. I have created a ticket to explain what is the purpose of this doc entry. I am hesitating if we need just an outline or we (as sig docs participants) can further facilitate the article's writing. Now the body contains the template outline and some suggestions on how to write it. My thinking was to let the champion write the draft and help him later with wording and syntax to be consistent and similar to other sibling pages. WDYT?

It is a draft, I just marked it now. I have created a ticket to explain what is the purpose of this doc entry. I am hesitating if we need just an outline or we (as sig docs participants) can further facilitate the article's writing. Now the body contains the template outline and some suggestions on how to write it. My thinking was to let the champion write the draft and help him later with wording and syntax to be consistent and similar to other sibling pages. WDYT?

I think SIG Docs could provide an outline, but then again the champion is the expert of what should even be included in the article (whether it's in "Overview" or "Getting started", doesn't matter). Getting together online to draft an outline could work, instead of trying that asynchronously (which might be slower).


GitHub action to deploy docs on push to master

I'm not 100% sure how to test whether this works or not. Probably we'll just have to merge this, then push some change to master and see if it runs successfully.
Closes #7

@birchmd Works :+1: (Please note my comments for the future.)

https://github.com/aurora-is-near/doc.aurora.dev/runs/2603381012
https://github.com/aurora-is-near/doc.aurora.dev/commit/af4aef6438de09086c6d3b61b3d323ccc16f9830

@birchmd On the downside, it does destroy all gh-pages branch history:
https://github.com/aurora-is-near/doc.aurora.dev/commits/gh-pages
Ideally that would be preserved so that we would know what exactly was published when. But it's not a high priority to fix.

Agreed, that is not good. I assume this is because of the --force option passed by the action.
The action is not very complex, so maybe we should copy the script locally to our repo and remove the --force option. Then use our own copy of the script in the action.


weird calculation fail

In this picture, the 1 - pow(2, -10*x) cannot calulate while the every element in the x array could be calclate with the same expression.

In the current version, only the first argument of the pow() can accept an array. You can see which arguments can accept arrays in the candidate completion list.

If you want to give an array as the second argument, which is not cool, such a function can be defined as follows:
pow(2,[1,2,3]) // --> Error
def mypow(x,*y)=pow(x,y)
mypow(2,[1,2,3]) // --> [2, 4, 8]

Understood, thx.