Allow more type specific reactions without switch statements

In my own use of data binding and view holders I have some more complex interactions from the view to the view holder. I have several controls within an item that have their own listeners. So I have different ViewHolder types and I actually have a variable in the layout for the holder and I can bind to or use methods on the ViewHolder to do listeners or provide additional data to the view.
Looking at this library as a possible alternative to my complex Adapter and ViewHolder, I don't see a good way to handle these more complex interactions. It is possible using the OnBindListener, but that is a single listener for all types. You end up having to do a switch statement and probably a cast. That is a code smell and what we would like to avoid by using a library like this.
I am trying to think what is the best way to accomplish this in a minimally invasive way. What I am envisioning is a version of the map call that also accepts a parameter of a class that extends LastAdapter.ViewHolder which has an onBind method that subclasses can override to do custom work (and  FYI you should add support for unbinding as well to clean up things when a view is removed from the list).
Just sort of thinking out loud here.

Hello @dalewking,
by "complex interactions" you mean handling different click listeners for different elements within the same item type? If so, as you said, you can do that using the OnBindListener but, again as you said, there is only one for all the item types so the code wouldn't be so clean. However, there's another way you can achieve that using this library and it is handling the clicks in the layout itself. I think that way will fit your needs. Here's an example:
<layout ...>

    <data>
        <variable name="item" type="...Item" />
    </data>

    <LinearLayout ...>

        <ImageView ...
            android:onClick="@{v -> item.onItemImageClick(v)}" />
        <TextView ...
            android:onClick="@{v -> item.onItemTitleClick(v)}" /> />
        <TextView ...
            android:onClick="@{v -> item.onItemDescriptionClick(v)}" /> />

    </LinearLayout>

</layout>

public class Item {

    ...

    public void onItemImageClick(View view) {
        // handle click on image
    }

    public void onItemTitleClick(View view) {
        // handle click on title
    }

    public void onItemDescriptionClick(View view) {
        // handle click on description
    }

}

FYI you should add support for unbinding as well to clean up things when a view is removed from the list

Can you provide more information about that?

Please, let me know if that worked for you.

Well, yes and mostly no. Sure, of course everything works if you can do everything through calls on the item itself, but sometimes the item is just a dumb model object that doesn't have the ability to handle the extra functionality. Perhaps it is cleaner if the list doesn't contain a bunch of dumb model objects but instead is a list of item view models that wrap the dumb model objects, but it would be nice to not force that on to the user.
In my case I have items that have enable/disable switches on them and the ability to delete them.
If there was a way to create your own type specific ViewHolder classes that would be much more powerful.
The thought on unbind was some way to notify the user that onViewRecycled was called on the holder so they can release resources.

I will consider adding this kind of functionality for next versions. Actually, I thought about it before but decided not to include it as the intention was to use Data Binding, and listeners (onBind/onClick...) are there for cases where you can't use Data Binding or just want to declare the functionality in a quick and explicit way.
However, I don't think that creating the specific ViewHolders is the way to do it, at least for this library, as the point here is actually avoiding them... More "customizable" listeners for specific item types could be an option, though.
Meanwhile, I want to let you know that you can still keep your dumb models and handle the clicks in other classes:
<layout ...>

    <data>
        <variable name="item" type="...Item" />
        <import type="...Listeners" />
    </data>

    <LinearLayout ...>

        <ImageView ...
            android:onClick="@{v -> Listeners.onItemImageClick(item, v)}" />
        <TextView ...
            android:onClick="@{v -> Listeners.onItemTitleClick(item, v)}" /> />
        <TextView ...
            android:onClick="@{v -> Listeners.onItemDescriptionClick(item, v)}" /> />

    </LinearLayout>

</layout>

public class Listeners {

    public static void onItemImageClick(Item item, View view) {
        // handle click on image
    }

    public static void onItemTitleClick(Item item, View view) {
        // handle click on title
    }

    public static void onItemDescriptionClick(Item item, View view) {
        // handle click on description
    }

}

I know it is pretty much the same, but now you are keeping your models classes as simple as possible and can handle the events anywhere else, maybe even as an internal class in the Activity/Fragment where you are using the adapter.

I tried playing with it a bit and here is what I came up with moving modified OnBindListener to map call and adding OnUnbindListener as a patch file:
diff --git a/lastadapter/src/main/java/com/github/nitrico/lastadapter/LastAdapter.kt b/lastadapter/src/main/java/com/github/nitrico/lastadapter/LastAdapter.kt
index e8827e9..6de0ab5 100644
--- a/lastadapter/src/main/java/com/github/nitrico/lastadapter/LastAdapter.kt
+++ b/lastadapter/src/main/java/com/github/nitrico/lastadapter/LastAdapter.kt
@@ -27,9 +27,8 @@ import android.view.ViewGroup

 class LastAdapter private constructor(private val list: List<Any>,
                                       private val variable: Int,
-                                      private val map: Map<Class<*>, Int>,
+                                      private val map: Map<Class<*>, Mapping<*>>,
                                       private val layoutHandler: LayoutHandler?,
-                                      private val onBindListener: OnBindListener?,
                                       private val onClickListener: OnClickListener?,
                                       private val onLongClickListener: OnLongClickListener?)
 : RecyclerView.Adapter<LastAdapter.ViewHolder>() {
@@ -38,17 +37,32 @@ class LastAdapter private constructor(private val list: List<Any>,
         @JvmStatic fun with(list: List<Any>, variable: Int) = Builder(list, variable)
     }

+    class Mapping<T>(val layout: Int, val bindListener: OnBindListener<T>?,
+                     val unbindListener: OnUnbindListener?) {
+
+        @Suppress("UNCHECKED_CAST")
+        fun onBind(item: Any, view: View, binding: ViewDataBinding, position: Int)
+            = bindListener?.onBind(item as T, view, binding, position)
+
+        fun unBind(binding: ViewDataBinding) {
+            unbindListener?.onUnbind(binding)
+        }
+    }
+
     class Builder internal constructor(private val list: List<Any>, private val variable: Int) {

-        private val map = mutableMapOf<Class<*>, Int>()
+        private val map = mutableMapOf<Class<*>, Mapping<*>>()
         private var handler: LayoutHandler? = null
-        private var onBind: OnBindListener? = null
         private var onClick: OnClickListener? = null
         private var onLongClick: OnLongClickListener? = null

-        fun map(clazz: Class<*>, layout: Int) = apply { map.put(clazz, layout) }
+        fun <T> map(clazz: Class<T>, layout: Int, bindListener: OnBindListener<T>? = null,
+                    unbindListener: OnUnbindListener? = null)
+                = apply { map.put(clazz, Mapping(layout, bindListener, unbindListener)) }

-        inline fun <reified T: Any> map(layout: Int) = map(T::class.java, layout)
+        inline fun <reified T: Any> map(layout: Int, bindListener: OnBindListener<T>? = null,
+                    unbindListener: OnUnbindListener? = null)
+                = map(T::class.java, layout, bindListener, unbindListener)

         fun layoutHandler(layoutHandler: LayoutHandler) = apply { handler = layoutHandler }

@@ -57,13 +71,6 @@ class LastAdapter private constructor(private val list: List<Any>,
                     = ItemPosition(item, position).f()
         })

-        fun onBindListener(listener: OnBindListener) = apply { onBind = listener }
-
-        inline fun onBind(crossinline f: ItemViewTypePosition.() -> Unit) = onBindListener(object: OnBindListener {
-            override fun onBind(item: Any, view: View, type: Int, position: Int)
-                    = ItemViewTypePosition(item, view, type, position).f()
-        })
-
         fun onClickListener(listener: OnClickListener) = apply { onClick = listener }

         inline fun onClick(crossinline f: ItemViewTypePosition.() -> Unit) = onClickListener(object: OnClickListener {
@@ -80,14 +87,16 @@ class LastAdapter private constructor(private val list: List<Any>,

         fun into(recyclerView: RecyclerView) = build().apply { recyclerView.adapter = this }

-        fun build() = LastAdapter(list, variable, map, handler, onBind, onClick, onLongClick)
+        fun build() = LastAdapter(list, variable, map, handler, onClick, onLongClick)

     }

     inner class ViewHolder(internal val binding: ViewDataBinding) : RecyclerView.ViewHolder(binding.root) {

-        fun bindTo(item: Any) {
+        var mapping: Mapping<*>? = null
+
+        fun bindTo(item: Any, mapping: Mapping<*>) {
             binding.setVariable(variable, item)
             binding.executePendingBindings()

@@ -98,9 +107,18 @@ class LastAdapter private constructor(private val list: List<Any>,
                 onLongClickListener.onLongClick(item, itemView, itemViewType, adapterPosition)
                 true
             }
-            onBindListener?.onBind(item, itemView, itemViewType, adapterPosition)
+
+            mapping.onBind(item, itemView, binding, adapterPosition)
+
+            this.mapping = mapping
         }

+        fun unbind()
+        {
+            mapping?.unBind(binding)
+
+            mapping = null;
+        }
     }

@@ -116,7 +134,8 @@ class LastAdapter private constructor(private val list: List<Any>,
         return holder
     }

-    override fun onBindViewHolder(holder: ViewHolder, position: Int) = holder.bindTo(list[position])
+    override fun onBindViewHolder(holder: ViewHolder, position: Int)
+        = holder.bindTo(list[position], map[list[position].javaClass]!!)

     override fun onBindViewHolder(holder: ViewHolder, position: Int, payloads: MutableList<Any>?) {
         if (isForDataBinding(payloads)) holder.binding.executePendingBindings()
@@ -126,7 +145,7 @@ class LastAdapter private constructor(private val list: List<Any>,
     override fun getItemCount() = list.size

     override fun getItemViewType(position: Int) = layoutHandler?.getItemLayout(list[position], position)
-            ?: map[list[position].javaClass]
+            ?: map[list[position].javaClass]?.layout
             ?: throw RuntimeException("Invalid object at position $position: ${list[position]}")

     override fun onAttachedToRecyclerView(rv: RecyclerView) {
@@ -140,6 +159,12 @@ class LastAdapter private constructor(private val list: List<Any>,
         recyclerView = null
     }

+    override fun onViewRecycled(holder: ViewHolder) {
+        super.onViewRecycled(holder)
+
+        holder.unbind()
+    }
+
     private fun addOnRebindCallback(b: ViewDataBinding, rv: RecyclerView?, pos: Int) {
         b.addOnRebindCallback(object: OnRebindCallback<ViewDataBinding>() {
             override fun onPreBind(binding: ViewDataBinding) = rv != null && rv.isComputingLayout
@@ -161,8 +186,12 @@ class LastAdapter private constructor(private val list: List<Any>,
         fun getItemLayout(item: Any, position: Int): Int
     }

-    interface OnBindListener {
-        fun onBind(item: Any, view: View, type: Int, position: Int)
+    interface OnBindListener<in T> {
+        fun onBind(item: T, view: View, binding: ViewDataBinding, position: Int)
+    }
+
+    interface OnUnbindListener {
+        fun onUnbind(binding: ViewDataBinding)
     }

     interface OnClickListener {

After posting that, the unbind should probably also pass the view.
It seems with this also that the click listeners are not really necessary as you can just use the bind listener and set them yourself if you wanted them.

I'm aware you do not make pull requests on GitHub but, honestly, I don't know how to apply a patch file. Could you copy/paste the whole file here or somewhere else so I can take a look at it more easily?

Wasn't even that. I recently did a PR for RxJava, just didn't have time to
do anything more and it was more for you to review to see if it made sense
to you.
On Sun, Oct 9, 2016 at 1:46 AM, Miguel Ángel Moreno <
<EMAIL_ADDRESS>wrote:

I'm aware you do not make pull requests on GitHub but, honestly, I don't
know how to apply a patch file. Could you copy/paste the whole file here or
somewhere else so I can take a look at it more easily?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nitrico/LastAdapter/issues/6#issuecomment-252466411,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAVHzjAqon2wm-bPgqit6hjXXezLwGxeks5qyH-lgaJpZM4KPe04
.

--
Dale King

Well... It looks fine but my main concern is what I called the LayoutHandler (the capacity to choose different layouts depending on the position of the item in the adapter or any internal status of the item itself).
Setting the OnBindListener, for example, while using the LayoutHandler doesn't seem to be supported with the modifications you made. Sure it would be possible to do but I can't see it happening without adding extra complexity than just the method returning the layout id. So we would be adding an additional way of doing something that can already be done at the expense of the LayoutHandler, which I find it quite useful.
In my opinion, the map methods are very handy and have to be there as you will be "mapping" classes to layouts pretty often. But the key element here (to support the LayoutHandler as well) should be the layout id, not the item class. And with the layout id being an integer and not a class, the needed generics to generate listeners with different signatures (for different item types) doesn't seem to be possible.
The solution could be passing also the specific binding class for each type to use it for the generics thing but, again, it would kind of "ruin" the simplicity of the current LayoutHandler (its method should then return the layout id AND the binding class for this layout).
A good combination of all those possibilities passing the specific binding class or using the default ViewDataBinding when not useful/needed could be great, but it should be very well thought.
I'd like to know your opinion.

Hello @dalewking
I've been working on a solution similar to what you posted. I've done some modifications so the item and its binding are both cast to their appropriate classes in the listeners, except for the OnUnbindListener. The onViewRecycled(holder: ViewHolder) method in RecyclerView doesn't even provide the position of the view that is being recycled so it doesn't seem easy, if possible, to cast the item and the binding to their appropriate classes. I don't find using the binding as just ViewDataBinding so useful.
Can you tell me some good cases where having this OnUnbindListener would be useful? What kind of resources should be released there?

In the code I was looking at converting, I have type specific view holder classes for the various types. There are 2 variables bound to the layout, the item and the holder itself. The holder is used as the target of various event methods. In reality, the unbind handling just does:
		binding.setVariable(BR.holder, null);
		binding.executePendingBindings();

So ViewDataBinding is enough in my case.
This list in particular maintains a list of timers and alarms. Some of them have a text view that counts down the time so the text keeps updating. Setting the holder to null will cause the count down text view to quit counting down.

This list in particular maintains a list of timers and alarms. Some of them have a text view that counts down the time so the text keeps updating. Setting the holder to null will cause the count down text view to quit counting down.

I actually, I double checked and I was wrong about that. My unbind is just setting the holder variable to null on the layouts which unregisters the listeners from the views is all the unbind is really doing.

LastAdapter 2.0 will include specific listeners for each type and the onUnbind callback (probably onRecycle).
Please, see https://github.com/nitrico/LastAdapter/issues/10


[example] Remove the dependency on @material-ui/styles

Closes #26572
_document.js is looking for this. It seems it was just missed

[x] I have followed (at least) the PR section of the contributing guide.

Though I do think we don't actually want to use that package since it pulls in jss. @mnajdova Are there plans for ServerStyleSheets being exported from the corresponding styled engine?

It should be removed from the example, the example is already configured to work with SSR, no need for pulling JSS too.

Note that the issue is not specific to Next.js. We have Gatsby, SRR, and Next.js with TypeScript that is impacted.

It should be removed from the example, the example is already configured to work with SSR, no need for pulling JSS too.

What should be removed from the example?

What should be removed from the example?

I should have been more clear, I meant ServerStyleSheets should be removed.

It should be removed from the example, the example is already configured to work with SSR, no need for pulling JSS too.

What should be removed from the example?

I removed all the {ServerStyleSheets} code and uninstall @material-ui/styles
The _document.js code is like below:-
import * as React from "react";
import { CacheProvider } from "@emotion/react";
import createCache from "@emotion/cache";
import Document, { Html, Head, Main, NextScript } from "next/document";
import createEmotionServer from "@emotion/server/create-instance";
import theme from "../styles/theme";

const getCache = () => {
  const cache = createCache({ key: "css", prepend: true });
  cache.compat = true;

  return cache;
};

export default class MyDocument extends Document {
  render() {
    return (
      <Html lang="en">
        <Head>
          {/* PWA primary color */}
          <meta name="theme-color" content={theme.palette.primary.main} />
          <link
            rel="stylesheet"
            href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
          />
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </Html>
    );
  }
}

// `getInitialProps` belongs to `_document` (instead of `_app`),
// it's compatible with static-site generation (SSG).
MyDocument.getInitialProps = async (ctx) => {
  // Resolution order
  //
  // On the server:
  // 1. app.getInitialProps
  // 2. page.getInitialProps
  // 3. document.getInitialProps
  // 4. app.render
  // 5. page.render
  // 6. document.render
  //
  // On the server with error:
  // 1. document.getInitialProps
  // 2. app.render
  // 3. page.render
  // 4. document.render
  //
  // On the client
  // 1. app.getInitialProps
  // 2. page.getInitialProps
  // 3. app.render
  // 4. page.render

  // Render app and page and get the context of the page with collected side effects.
  const originalRenderPage = ctx.renderPage;

  const cache = getCache();
  const { extractCriticalToChunks } = createEmotionServer(cache);

  ctx.renderPage = () =>
    originalRenderPage({
      // Take precedence over the CacheProvider in our custom _app.js
      enhanceComponent: (Component) => (props) =>
        (
          <CacheProvider value={cache}>
            <Component {...props} />
          </CacheProvider>
        ),
    });

  const initialProps = await Document.getInitialProps(ctx);
  const emotionStyles = extractCriticalToChunks(initialProps.html);
  const emotionStyleTags = emotionStyles.styles.map((style) => (
    <style
      data-emotion={`${style.key} ${style.ids.join(" ")}`}
      key={style.key}
      // eslint-disable-next-line react/no-danger
      dangerouslySetInnerHTML={{ __html: style.css }}
    />
  ));

  return {
    ...initialProps,
    // Styles fragment is rendered after the app and page rendering finish.
    styles: [
      ...React.Children.toArray(initialProps.styles),
      ...emotionStyleTags,
    ],
  };
};

Though I do think we don't actually want to use that package since it pulls in jss. @mnajdova Are there plans for ServerStyleSheets being exported from the corresponding styled engine?

It should be removed from the example, the example is already configured to work with SSR, no need for pulling JSS too.
https://github.com/mui-org/material-ui/blob/6f43dd902de99947af7938af5cb61543c6797ca3/examples/nextjs/pages/_document.js#L5

After removing all the {ServerStyleSheets} code, I'm facing "FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory" problem.
I reset to include the {ServerStyleSheets} code again. It working fine now.
I am like ⁉

@mnajdova I would propose that we continue this PR, it's simple and yet important for us as a friction point in the adoption of v5.

I have pushed a commit to push https://github.com/mui-org/material-ui/pull/26589#issuecomment-854513735 further

I've updated the title of the PR, looks like we are removing, not fixing the dependency.

@garfunkelvila It's a great first pull request on Material-UI. Thank you for working on it!


Fixing ODD validity

This PR introduces changes to the ODD to make it valid against the current TEI ODDs schema. Some of the changes are substantial, but the resulting schema will have only one real change (which itself is a fix, see below).
Changes with no consequences for the schema:

associated latest ODD schema served directly from TEI servers instead of local copy. The URL always points to latest stable release of the schema, so that we know right away if we need to make changes for validity.
attDef elements defining attributes with semiclosed lists were not valid against a schematron check that imposes either a datatype or a closed list. This was fixed by adding a generic "string" datatype.
attDef elements  defining attributes without any datatype are not valid, so I added a generic "string" datatype. NB a lot of these need to be improved! Either with a token datatype (eg like data.word in TEI), or a more specific one, but this is for another bug fix / enhancement.
datatype macros for shared attribute values (such as data.ARTICULATION) where defined with  rng:choice, which is fine, but the RNG documentation element (in a different namespace) is not allowed by the TEI schema. I replaced this with tei:valList, which is an element used specifically for describing attribute values. This is a more semantic element than rng:choice and allows using the same tei:desc element that is used for documentation elsewhere. This is a major change in the ODD, but it has no consequences for the schema.

Change with consequences for the schema (a FIX):
"One-or-more-value" datatypes are currently defined as separate datatypes. For example data.SLURS is defined with an rng:content of rng:oneOrMore occurrences of data.SLUR. This is not processed by Roma and currently these datatypes are broken in the schema generation. The change proposed here follows common practice in the TEI schema:

only define single datatypes
when specifying the datatype of an attribute, use tei:datatype[@maxOccurs='unbounded'].
This means that "one-or-more-value" datatypes are not necessary and are therefore removed in this PR.

Now Roma processes the datatypes correctly and multiple values are allowed by the schema as originally intended.
NB Removing "one-or-more-value" datatypes (such as data.SLURS, data.TIES, data.URLS and many more) means that they will not be listed in the datatypes documentation of the guidelines, and will result in a change to the HTML and PDF guidelines. In my opinion this should not be too alarming unless known MEI customizations have been calling these datatypes directly, in which case they should switch to "single" datatypes with tei:datatype[@maxOccurs='unbounded']. A notification to MEI-L should be sufficient in my opinion.

Noted the failing build, looking into the problem

Classifying as a bug, since as I understand it, this fixes ODD validation (currently our ODD schema is invalid?)

@ahankinson we were validating against a local copy of an old TEI ODD schema. Our ODD is invalid against the latest TEI ODD schema. Here I'm also proposing to always validate from the latest published schema instead. If that seems like a good idea, we should probably remove out local copy (the PR doesn't do that for now).

How often and what type of changes should we expect to see in the ODD schema? If we validate against the latest one, we need to make sure we do suddenly have our schema not validating anymore because of some changes there.

If we keep the latest schema, we will only have to deal with small issues from time to time as soon as they arise. In my experience these are typically introduced by stricter schematron rules. If we stick to one version and don't update regularly, we would have to introduce larger changes at less regular times, such as the ones proposed in this PR.
We depend on the TEI Stylesheets and they evolve together with the ODD schema. It is in our interest to keep up with these changes to make sure that we always can generate schemata without errors or missing bits (as it was happening for "one-or-more-values" datatypes).

I would go with @raffazizzi on this one, but we should make sure to test it first. Would an effective test case be one that hits data.SLURS or data.TIES?

I would also like to hear opinions about this from others who are more experienced with TEI. @bwbohl? @kepper?

This is beyond my scope in TEI – I'm happy to use, but don't oversee the implications at this level. One thing @pe-ro and I wondered about in NY is what would happen to semi-open lists. These lists allow you to recommend some values, but ultimately leave it to the user to write whatever he wants. However, oxygen hints to the suggested values, making it less error-prone than a fully open list. Are they unaffected, or will they go away?

@kepper the semiclosed list will work in the same way as before. The only difference is that now there is a "string" datatype defined for the custom values. This is sufficient for validity and does not change the current behaviour.
In general, unless I've done something wrong, there will be no change to the schema, except for values with repeated datatypes, which will now work (they where broken before as you and @pe-ro pointed out to me in NY).

I think "NMTOKEN" is a better choice than "string" for the datatype of items in a valList.  This will work seamlessly in most cases.  Unless there's a way to qualify some values, however, this won't work for MEI datatypes like data.TEXTRENDITION where values and datatypes are intermingled rather than defined once for all the values in the list.

I think "NMTOKEN" is a better choice than "string" for the datatype of items in a valList.

I agree. Though we should take care of that in another issue or pull request. Adopting "string" does not change the status quo, as that's what we were already adopting silently. Switching to NMTOKEN instead affects the schema and current usage, so it needs its own discussion, IMO.

this won't work for MEI datatypes like data.TEXTRENDITION

data.TEXTRENDITION is a closed list, so there is no need to provide an alternative datatype: the list is the datatype (see here).
The only reason there must be a datatype specified for semiclosed lists is to cover and regulate the "open" part of the list.

If you look closely, you'll see that data.TEXTRENDITION is not really a closed list, at least not in the conventional sense.  Down near the end of the definition rng:data is used to "parameterize" certain values --
<rng:data type="string">
<rng:param name="pattern"

(underline|overline|line-through|strike|letter-spacing|line-height)(\d+)</rng:param>
</rng:data>
<rng:data type="string">
<rng:param name="pattern"
(letter-spacing|line-height)((+|-)?\d+(.\d+)?)</rng:param>
</rng:data>

The new TEI approach seems to disallow this kind of thing by insisting on the same datatype for every value in the  and by not providing this kind of parameterization.

My attempt at including a chunk of the ODD didn't work, so everyone should look at the mei-source file.

Oh I see. My bad! I missed the datatypes at the bottom. Let me look for a ODD-friendly solution.

Thanks.  If the rng: namespace is no longer supported, I think the only solution might be created (at least) 2 different MEI datatypes -- one for the plain values and one for the parameterized ones -- then allow attributes to utilize values from these 2 dataypes.  But I'm also not sure of how to accomplish that either.

I don't agree that using NMTOKEN is a change to the schema.  We've not been silently using "string", we've been silently using "NMTOKEN".  Making that explicit won't change anything.

Is this the correct syntax for semi-open lists now? At least for those with values that don’t require parameterization?  --

indicates the unit used for a measurement of size or duration.

byte.

From: Raffaele Viglianti<EMAIL_ADDRESS>Sent: Tuesday, June 30, 2015 8:10 AM
To: music-encoding/music-encoding
Cc: pe-ro
Subject: Re: [music-encoding] Fixing ODD validity (#239)
@kepperhttps://github.com/kepper the semiclosed list will work in the same way as before. The only difference is that now there is a "string" datatype defined for the custom values. This is sufficient for validity and does not change the current behaviour.
In general, unless I've done something wrong, there will be no change to the schema, except for values with repeated datatypes, which will now work (they where broken before as you and @pe-rohttps://github.com/pe-ro pointed out to me in NY).
—
Reply to this email directly or view it on GitHubhttps://github.com/music-encoding/music-encoding/pull/239#issuecomment-117154693.

I worry about attributes like expan that had no datatype. Those may as well be treated as strings and not NMTOKEN which, if I understand correctly, does not allow spaces. This changes the schema, I think.
So while I agree that NMTOKEN is better suited than string for a lot of the attributes we're updating, I think we should look at each case individually. I would be inclined to resolving this issue with string, which is safe enough, and then start working on which attributes should get NMTOKEN right away, but in a different place.
If not, perhaps a middle ground would be introducing NMTOKEN to datatypes only, but leave the others to review another time?

Yes, those attributes without a datatype assume string values.  Value lists in MEI datatypes, on the other hand, assume NMTOKEN values.  There are only a few outlying cases that use other datatypes, such as nonNegativeInteger, token, decimal, positiveInteger, etc.  But in all of those cases, the datatype is already specified and shouldn’t be a problem.
From: Raffaele Viglianti<EMAIL_ADDRESS>Sent: Tuesday, June 30, 2015 2:48 PM
To: music-encoding/music-encoding
Cc: pe-ro
Subject: Re: [music-encoding] Fixing ODD validity (#239)
I worry about attributes like expan that had no datatypehttps://github.com/music-encoding/music-encoding/blob/develop/source/specs/mei-source.xml#L9011. Those may as well be treated as strings and not NMTOKEN which, if I understand correctly, does not allow spaces. This changes the schema, I think.
So while I agree that NMTOKEN is better suited than string for a lot of the attributes we're updating, I think we should look at each case individually. I would be inclined to resolving this issue with string, which is safe enough, and then start working on which attributes should get NMTOKEN right away, but in a different place.
If not, perhaps a middle ground would be introducing NMTOKEN to datatypes only, but leave the others to review another time?
—
Reply to this email directly or view it on GitHubhttps://github.com/music-encoding/music-encoding/pull/239#issuecomment-117299232.

Ok :) I'll add nmtoken to the datatypes and leave string elsewhere, then.

I’m working through all the datatypes now.  I’ll send you the file ASAP.  I think we only need to change those places where we use <a:documentation>.  In all other cases, <rng:data type=”whatever”> works fine.
From: Raffaele Viglianti<EMAIL_ADDRESS>Sent: Tuesday, June 30, 2015 3:06 PM
To: music-encoding/music-encoding
Cc: pe-ro
Subject: Re: [music-encoding] Fixing ODD validity (#239)
Ok :) I'll add nmtoken to the datatypes and leave string elsewhere, then.
—
Reply to this email directly or view it on GitHubhttps://github.com/music-encoding/music-encoding/pull/239#issuecomment-117306921.

One question, though: since  doesn’t require @type, is @type assumed to be “string” when it’s missing?

<valList> has a default value of open for @type. So it's not specified it's an open list.

Thanks.

For the record, 3576a61 merges changes by @pe-ro. A list of changes is in the commit message.
c99501c introduces a change to get rid of rng:list in data.DURATION.gestural. This is not necessary for validity, but strengthens consistency with all the other changes from rng to ODD notation.
To do this I had to introduce to partial datatypes (similary to what we've been doing so far):

data.DURATION.gestural.prop for proportional duration
data.DURATION.gestural.pat for the ppq, beats, or seconds pattern
Happy to change the names if you have better suggestions.

Now I'll figure out what's wrong with the build.

It looks like the master branch of the TEI Stylesheet is ZAPping too many elements and classes from our ODD. The same problem exists with the one on master now. Possibly Travis CI should use the latest release tag instead? I think @sebastianrahtz uses the master branch for development and can become unstable.

Ok this is going through now. Should we merge? :)

If the ODD file parses and the customization service works as it should, then I say we're ready to proceed.  But, I'd like to wait for @lpugin to approve it as well.

Seeing Travis in action, so to speak, I'm wondering what should happen at the next release for changes that break backward compatibility.  We should have a stylesheet that migrates the example files to the new schema, but where does it "plug into" the build process?

Since 'tags' are a snapshot of the repo as it was at a given point in time, then any of the samples or tests that are included in that tag should build against that version in perpetuity. So if we're releasing MEI 2015 we (on the develop branch):

Roll the customization into mei-source.
Validate the examples and update where needed. This can be manually or with an XSLT.
Once everything is built and tested we merge develop to master and tag it.

I'm hoping we can gradually build up a test set in 'tests' that will validate the various customizations too.

I will take over merging it, but I'll wait for Laurent to say OK too.

I  am a bit distressed I seem to have broken MEI builds;I am in the process of implementing Pure ODD datatypes. Is there anything still wrong?

All is good! Thanks for the quick fix @sebastianrahtz

Looks good to me, but considering the topic, I would rather ask for @pe-ro 's OK.

Ha! He already asked for yours. ;)
https://github.com/music-encoding/music-encoding/pull/239#issuecomment-118115399

Who wants to hit the button?  The sooner it's done, the sooner we can get to work on the next release.

I'll do it.

Unfortunately, it appears that the customization service doesn't work.  It produces an RNG, but all new or replaced datatype declarations (data.BETYPE and data.ACCIDENTAL.EXPLICIT, for example) result in empty definitions.

Yes, the customeization service does not work just yet. I'm working on an update... Sorry for the delay!
(PS: Anyone out there who wants to help, get in touch...)

On Jul 6, 2015, at 8:40 PM, pe-ro<EMAIL_ADDRESS>wrote:
Unfortunately, it appears that the customization service doesn't work. It produces an RNG, but all new or replaced datatype declarations (data.BETYPE and data.ACCIDENTAL.EXPLICIT, for example) result in empty definitions.
—
Reply to this email directly or view it on GitHub https://github.com/music-encoding/music-encoding/pull/239#issuecomment-118952883.

Just checking on its status, didn’t intend to rush you.


Remaining() when past due returns negative value

In case of a long process without .update() calls, it happens that the execution is past due.
In such situation calling remains() would return something close to 0xffffffff.

Initially I thought of returning 0, but it might be interesting to return a negative value to know how late we are.
That's actually what I expected initially from the library, until I realised remains() returned uint

Damn, I forgot to save changes on TickTwo.cpp. I'll recreate a pr.

Sorry, don't understand the problem. update() should normally called inside loop(), this is essential to work properly.

I know that ideally, update() is to be called and take care of running the task if it's due.
In my case, I have 2 ticks, each with their own interval.
I light sleep between the ticks actions, so I use remaining() to know how long should be the sleep.
When one task is running, it cannot be interrupted by the other (and I won't pause the other one, because there is no reason to delay it).  When task1 is over, I check remaining() on task2 to know if it's past due and should run it now or if there is still some time interval, so I go to sleep etc.
Because of  remaining() returning uint, I cannot tell if I have a (super) long interval remaining or if I missed it.
Hope this clears it.
Thanks for your lib btw, very useful!

I will close this PR because I will not change the variable format for solving a very special issue.
The library is not thread safe, therefore you should use RTOS or Mbed ...

I'm not using threads. This library is adequate for my code.
Still, with update() called in loop() you cannot avoid having a situation with remaining() called after the interval. It makes no sense to return<PHONE_NUMBER> in this case. That remains a bug to me.
If you really want to keep uint, return 0.


Fix CI for EG data-plane

We put a JSON snippet into the main readme for guidance to service team, but autorest is trying to be too smart and read it. I'm trying to bypass the process by making this block ignored with a fake filter.

FWIW, @lmazuel, I verified that this fixes the T2 Code generation for JavaScript (as expected, it was blowing up without this fix)


caption.py strange output

Hello,
I used the pre-trained model and word map provided,
and it seems to work but in caption.py I obtain always the same sentence with whatever picture,
that is:
" a close up of a black and white background"
that makes me think that there is something wrong with the image preprocessing.
Do you have any suggestions on how to understand better this problem and fix it?
Thanks

I commented  /.255 in the image processing and it was fine...How did it work for you?

Hey, how are you loading the pretrained models provided? @efacco
I am getting this issue? Is it due to any PyTorch version problem?
    772     unpickler = pickle_module.Unpickler(f, **pickle_load_args)
    773     unpickler.persistent_load = persistent_load
--> 774     result = unpickler.load()
    775
    776     deserialized_storage_keys = pickle_module.load(f, **pickle_load_args)

ModuleNotFoundError: No module named 'models'

you must put 2 file caption.py and model.py in the same directory

I have the same problem as you, did you solve it?

您好， 我使用了提供的预训练模型和词图， 它似乎可以工作，但是在 caption.py 中，我总是得到与任何图片相同的句子， 即：
“黑白背景的特写”
这让我觉得图像预处理有问题。 你对如何更好地理解这个问题并解决它有什么建议吗？
谢谢

I have the same problem as you, did you solve it?


getting the returned value with Evaluate

Hi guys .
as a previous Chromy user  , i had the option to evaluate a function in the window context (p.s the current opened page instance) then chaining the result from the window context into the chromy context in order to get the value and pass it along.
chromy.goto(url).wait(predicate).evaluate(()=>{window.SomeFunction()}.results((someFunctionReturnedValue)=>{console.log(someFunctionReturnedValue)}
is there any chance you guys know which function in Puppeteer is the  equivalent "results" function?
thanks in advance!

The return value of page.evaluate is just that.
const someFunctionReturnedValue = await page.evaluate(() => {
    return window.SomeFunction();
});
console.log(someFunctionReturnedValue);


Where is the Pool of connections, and how to limit it.

Hi, I'm trying to migrate https://github.com/suharev7/clickhouse-rs to use yours, but I cannot find where the Pool is.
I want to have some connections always established, and need to keep at least one at all times, i.e. pool_min and pool_max.
Your docs say almost nothing about it, besides that one sentence "Reuse created clients or clone them in order to reuse a connection pool".
Please, care to explain it better? How does a Pool work here?
Thank you.

I see, thanks. I've never used hyper myself, so I'm not familiar with how it manages Pools. I'll try to take a look sometime.
I wanted pool_min and pool_max just because suharev7's provides them, and I've grown accustomed to using them:
pool_min - Lower bound of opened connections for Pool (defaults to 10).
pool_max - Upper bound of opened connections for Pool (defaults to 20).

That makes it simple to limit the number of CH connections, while still having some always available.
And yes, I do agree a Semaphore would be more flexible, although the less new code I have to write to port my system, the sooner I could have it done...
Anyway, I like very much your query with .bind() support and the typed .fetch_all(), very cool features!
But it seems I won't be able to migrate any time soon, until I can make sense of the hyper Pools, and develop this min/max limiter...

It should be noted in docs, I agree and will close the issue after adding it.

I'm also interested. Code example would be super nice.


Multiple app_urls per site

Currently I have the app working on the following url
site1.example.com/help
I'd like to be able to have the same instance accessible from another url for example
site2.example.com/help without being redirected to site1.example.com/help
I'm using nginx as a proxy and a webserver in the following configuration.
reverseproxy (nginx) --> webserver (nginx/php) and I can "access" the site under the 2nd url but after the first request I'm redirected back to the site1.example.com/help url.
In short I'd like to set the APP_URL dynamically based on the request url. So that the url in the browser is always the one the user enters/follows a link too.

Hi @drifter104,
Are you able to explain the use-case in having those two different URLs pointing to a single BookStack instance?

Hi (sorry for the delay)
We have different instances of our software hosted through different urls for different users. Some users are accessing through servers that give them url restrictions so they only have access to the url where their software instance is hosted (e.g. site2.example.com) and would not be able to access any content hosted on another url (e.g.site1.example.com).
We want to be able to host the same software documentation for all users but because of the url restrictions of some users, the easiest way for us to do this would be to have the same instance working on different urls. This way all our users would have access to the same content.

Thanks for describing the use-case.
The support of multiple base-urls is already open under a few different issues, such as #1342, So I'll therefore close this off to reduce duplication.

I have the same issue while using bookstack app. I have no public ip address, so via internet I need to connect through FRP servers to my bookstack app. But in home I can connect bookstack app use local network through local ip.  But because of the APP_URL support only one domain, it impossible in this situation.  so if any methods can support multiple domain config.


helm install grafana erro

Tips:
[root@k8s-master01 ~]# helm install opsgoodness/grafana
Error: file "opsgoodness/grafana" not found

Yes currently we ask people to install the charts by checking out the repository and then installing the chart from the respective directory. Related to #676.


Update camel-jbang.adoc

broken link to example caused by residual closing parenthesis sign

Thanks @brunoNetId


Inconsistent UI on Refresh 🔄

Problem
There is inconsistency in the UI shown when reloaded the same binary without any command run.
Steps To Reproduce
Steps to reproduce the behavior:

dx serve --platform web on this project

Expected behavior
The UI on refresh shows standard elements instead of CSS styles.
Screenshots
Attaching the video herewith:
https://github.com/user-attachments/assets/3bb96e21-ee0e-4fef-b45f-461671298bbd

Environment:

Dioxus version: 0.6.0-alpha.3-6c69c29
Rust version:    1.79.9 (nightly)
OS info:         MacOS
App platform:    web

Hi! The path handling for asset!() changed in the most recent merge of the CLI.
asset!("./assets/")

is now

asset!("/assets/")

this is likely causing the stylesheet hotreload system to load an old version of the stylesheet and/or change the path when you navigate.
The asset!() macro needs to reject the ./ form if the asset doesn't exist, which is a bug. I'll change the title of this issue, but if you want to work around it you need to switch to the new absolute form (which is more consistent with how you would normally handle assets on the web).


Inconsistent parameter loading from script arguments

I noticed recently that the z tip coordinate that is reported on the plotted images was for some reason offset by 0.5Å on the graphene example compared to what I was expecting it to be based on what I did in the OpenCL implementation. I looked into this more closely, and I think the issue is with the parameter loading from the plot script arguments.
The z distance is calculated by adding half of the amplitude to the scan z coordinate at: https://github.com/Probe-Particle/ppafm/blob/8763be1e7e851cb47a1294d49eb04fcd1c14b34b/ppafm/cli/plot_results.py#L239-L242 Notice that it uses the value from the params dict PPU.params['Amplitude']. These values are parsed from the command line arguments in the apply_options function, but it only accepts keywords that are already in the params dict: https://github.com/Probe-Particle/ppafm/blob/8763be1e7e851cb47a1294d49eb04fcd1c14b34b/ppafm/common.py#L228-L230
However, the command line argument for the amplitude is just a: https://github.com/Probe-Particle/ppafm/blob/8763be1e7e851cb47a1294d49eb04fcd1c14b34b/ppafm/cli/plot_results.py#L29 which does not match the value existing in the params dict: https://github.com/Probe-Particle/ppafm/blob/8763be1e7e851cb47a1294d49eb04fcd1c14b34b/ppafm/common.py#L48 so it never gets updated and it uses the default value which is different from the value supplied from the command line.
There are some other command line arguments that have the same issue. It would probably be beneficial to make some kind of dictionary of common command line arguments to use in the scripts to make sure that the names always match.
@ProkopHapala @ondrejkrejci @yakutovicha

Hi, yeah this is a long way problem, how to define height when the tip is effectivery osscilating. It is the closest poin (I have used that in some paper, but always mentioned explicitely)? Is it the center of the oscillation? To be honest, I am not sure, if there is a standard in the field. Basically we should discuss, choose one of these and use them all around - in the papers, all parts and types of the code.

I'm fine with the current convention where it's the half-point of the oscillation. If that should be changed, then I think that's another topic. The issue that I wanted to address here is the problem with the parsing of the command line arguments into the parameter dict.

@mondracek wanted to have a closer look at this issue and share some ideas.

It would be a good to have a common dictionary for params.ini keywords and parser (longname) options with the error message as well.

Another thing that came to mind about the FF generating scripts, is that they all take an input file as a mandatory argument. Currently the input file is given with the -i option, but since it's mandatory, it would probably make more sense to make it a positional argument (no --option). But this would be a backwards incompatible change, so I'm not sure if it's worth it.

Another thing that came to mind about the FF generating scripts, is that they all take an input file as a mandatory argument. Currently the input file is given with the -i option, but since it's mandatory, it would probably make more sense to make it a positional argument (no --option). But this would be a backwards incompatible change, so I'm not sure if it's worth it.

I don't think it is good idea, I never remember the order of positional argumens and typically I prefer to use named auguments even in function calls. (Actually this is one think I like more about python over C++)


Add info about contention profiling to profiling.md

Done.

LGTM

I don't think the test failures were relevant, but I kicked them off again just to be cautious.


[BUG] Playlist return undefined

Describe the bug
A clear and concise description of what the bug is.
When i load this playlist PLVH_c0JJpuSpTf3MI7vqz_6UKwvbbtitk its return undefined, but if i post using Client#http video content is available
To Reproduce
Steps to reproduce the behavior:
Client.getPlaylist("PLVH_c0JJpuSpTf3MI7vqz_6UKwvbbtitk")
Expected behavior
A clear and concise description of what you expected to happen.
Should return all videos in playlist.
Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Thanks for reporting this.
Please update to rc.20, should be fixed


Inherit encoding from parent process in worker daemons

The LANG, LANGUAGE and LC_* (including LC_ALL) environment variables are now passed to worker API daemon processes on Unix. This fixes a problem where on Linux worker daemons would try to access the file system with the default ASCII encoding.
We are passing as few parameters as possible, though, to avoid making worker processes unnecessarily incompatible.
There is also a @SupportsNonAsciiPaths annotation for integration tests that should work when they are executed with file paths containing non-ASCII characters. These tests are executed in the teșt files (notice the U+0219 character) instead of the usual test files folder.
(The intention is to run most integration tests with such a non-ASCII path to shake out more bugs, and annotate the ones that cannot parse non-ASCII paths with @DoesNotSupportNonAsciiPaths. But this is a next step.)
Fixes https://github.com/gradle/gradle/issues/25198

I've triggered the following builds for you:

QuickFeedback build

@bot-gradle test QF please.

I've triggered the following builds for you:

QuickFeedback build

@bot-gradle test QF please.

I've triggered the following builds for you:

QuickFeedback build

@bot-gradle test and merge please.

Your PR is queued. See the queue page for details.

I've triggered a build for you. Click here to see all failures if there's any.

@bot-gradle cancel

I've cancelled the pre-tested commit build.

@bot-gradle test and merge please.

Your PR is queued. See the queue page for details.

I've triggered a build for you. Click here to see all failures if there's any.


Split Config Repos by Folder per Branch

Feature Request
Feature Information:
Currently, we can only specify one branch per repo. This makes it impossible to use the experimental CC branch without first deleting the main branch/folder. This makes the experimental branch useless for the normal user. While working on templates, I also use a branch per game. I have no easy way to work on multiple templates without removing and adding branches repeatedly.
I confirm:

[x] that I have searched for an existing feature request matching the description.

I don't quite follow. You should be able to add the same repo to the list multiple times, just with different branches?

It stores it under the repo folder name. So you can't have more than one.

The branch name is now included in the directory name if specified to avoid this :)

I can't wait to try this stuff out!


double quotes context columns manually

We were working around a bug where context columns were not being quoted properly: bayeslite apparently wants them double-quoted, and we were at best single-quoting them (or perhaps not quoting them at all). For example, here's how we set up our context columns in the counties demo notebook:
 'context-columns': [
        '"Trump 2016"',
        '"Total Population: Foreign Born: Not a Citizen"',
        '"Families: Income in  below poverty level: Married Couple Family: with Related Child Living  Bellow Poverty Level"'
]

(note the single quotes around the double quotes for each context column name)
This PR wraps the user-provided column names in double quotes before running the query.
:warning: this will break existing queries in the form above which manually include double quotes :warning:

@joshuathayer and I found the below resource that lays out some rules for quoting column names, table names, and strings:
https://blog.christosoft.de/2012/10/sqlite-escaping-table-acolumn-names/
This says that column names and table names should be double quoted, and strings should be single quoted.  When looking at the snaql documentation we found that snaql string guards (|guards.string) only added in single quotes, so - where appropriate - we added double quotes to variable names in each of the resource modules.  During that process we found unused snaql queries and removed them.


Add more images as texture background in peoplesanspeople_binaries

Hi. Thank you for your great work.
I am not familiar with Unity. I would like to change the background when running peoplesanspeople_binaries.
How do I import more images to TextureRandomizer when running peoplesanspeople_binaries?

Thank you for your interest in this work. This is not possible to do on the already-built binaries. You can follow the provided Unity template project and re-build the binaries after you've added your own textures.


No updates when Tuya App is not running

Hi,
I tested a simple plug with power measurement and integrated it in Homeassistant without issues.
The switch works properly, but the currrent, voltage, and power values are not updated to Homeassistant at all.
Strangely the values are updated when the Tuya app at my mobile is running and showing the values. When I close the app then the update to Homeassistant is stopped immediately.
I expected no running app is needed with the new integration.
I attached the diagnostics information, maybe it is helpful.
Regards
Sirko
smartlife-ce28d8bbcbfd0dc9fdeb1ae6113354d4-Tuya Steckdose-f9b6617804311f0b5f02779a25bc1d7b.json.txt

That's exactly the problem I have with the Tuya integration (nnot beta) in HA with many of my devices. I was thinking of installing this Smartlife Beta version to see if I have improvements on that, and If I can monitor Amps or Watts of a socket, without having to have the app opened. But if you say that it is not updating neither, then I will waiting thy fix that.
I think there is more than a year with this problem. There is a lot of threads around about it. It is a shame that Tuya-smartlife developers havent done anything to fix the HA updates for their addon.

From what i have discovered, the smart life app sent a request to the cloudAPI that "wakes-up" the device and made it to report the info. The problem is that this is done in a non-standard way (for example, my thermostat recieves a {"week_up_btn": true} call that triggers the report.
I'm not trying to automate this process using a CRON job external to HA, i'll let you know if there are any updates...

I have found a workaround that works for me.
Using the IOT TUYA API, I have discovered all the device properties and found out that 唤醒通知 is a property called "week_up_btn" (probably misspelled wake).
If you set that property to true, it triggers the device to report the status and then reset to default.
The workaround is setting this property to true every x seconds, making the device report regularly.
I'm not sure if this applies to other devices, but for my thermostat works.

Same problem with a smart plug. No matter if it uses cloud Tuya, or this integration - no updates if app is closed

Using the IOT TUYA API, I have discovered all the device properties and found out that 唤醒通知 is a property called "week_up_btn" (probably misspelled wake).

Where can i find this, please?


error	Rule eu-lab-1

seems to have an error in rule:
"'At least one of these Observation elements shall be provided: "value", "dataAbsentReason", "hasMember" or "component"' Failedorg.hl7.fhir.exceptions.PathEngineException: Unable to evaluate as a boolean: registered,cancelled (@char 11) (log: org.hl7.fhir.exceptions.PathEngineException: Unable to evaluate as a boolean: registered,cancelled (@char 11))"

The problem is that in the java fhirpath implementation the or seems to have precedence over the in, if an additional paranthesis is added the invariant is working as expected:
original:
status in ('registered'|'cancelled') or value.exists() or hasMember.exists() or component.exists() or dataAbsentReason.exists()
modified:
(status in ('registered'|'cancelled')) or value.exists() or hasMember.exists() or component.exists() or dataAbsentReason.exists()
will provide a PR for this.

according to http://hl7.org/fhirpath/N1/#operator-precedence the original should be correct.


prepare flist for deploying threefold hub/validators

need to exist as docker image
convert to flist
document the environment variables

https://github.com/threefoldtech/threefold_hub/pull/40

@ashraffouda what is the flist url?

thanks. will close as it should be also autobuilt in the workflow #70


Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

What changes were proposed in this pull request?

The way to write mini hdfs has been removed, which is consistent with AppBalanceSelectStorageStrategyTest.
Closing the scheduling thread for writing the hdfs file.
Using CountDownLatch instead of thread.join().

Why are the changes needed?

To resolve #526
Does this PR introduce any user-facing change?

No.
How was this patch tested?

Fix ut.

Thanks for fixing this @smallzhongfeng. Please add a @Timeout() tag after @Test. In case of cdl.await() never return.

Good idea, added.

Codecov Report

Merging #544 (2baa7e7) into master (3ef80ed) will increase coverage by 5.61%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master     #544      +/-   ##
============================================
+ Coverage     58.72%   64.33%   +5.61%
- Complexity     1652     1654       +2
============================================
  Files           199      186      -13
  Lines         11214     9108    -2106
  Branches        996      920      -76
============================================
- Hits           6585     5860     -725
+ Misses         4237     2931    -1306
+ Partials        392      317      -75

Impacted Files
Coverage Δ

...che/uniffle/server/storage/HdfsStorageManager.java
90.90% <0.00%> (-4.33%)
:arrow_down:

...a/org/apache/uniffle/coordinator/QuotaManager.java
85.29% <0.00%> (-4.26%)
:arrow_down:

...orage/LowestIOSampleCostSelectStorageStrategy.java
70.90% <0.00%> (-3.64%)
:arrow_down:

...he/uniffle/server/storage/MultiStorageManager.java
60.71% <0.00%> (-3.44%)
:arrow_down:

.../java/org/apache/uniffle/server/ShuffleServer.java
60.95% <0.00%> (-3.43%)
:arrow_down:

...storage/handler/impl/DataSkippableReadHandler.java
83.78% <0.00%> (-2.71%)
:arrow_down:

...ava/org/apache/uniffle/server/ShuffleTaskInfo.java
98.07% <0.00%> (-1.93%)
:arrow_down:

...rg/apache/uniffle/server/buffer/ShuffleBuffer.java
93.38% <0.00%> (-1.66%)
:arrow_down:

...e/storage/handler/impl/HdfsShuffleReadHandler.java
56.25% <0.00%> (-1.57%)
:arrow_down:

.../apache/uniffle/coordinator/ClientConfManager.java
91.54% <0.00%> (-1.41%)
:arrow_down:

... and 56 more

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

@jerqi @advancedxy @zuston do you want to take a look?

Thanks for your review. @kaijchen @jerqi

Hi @smallzhongfeng, seems selectStorageMulThreadTest is timeout occasionally.
https://github.com/apache/incubator-uniffle/actions/runs/4184426217/jobs/7250404544#step:6:614

I think we need to increase this time? @kaijchen WDYT?


Added key expression support to Kafka producer

This is an attempt to support dynamic Kafka keys expressions as described in - https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/130 .

@hekonsek Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@hekonsek - thanks for the contribution. Looks good, in general. Would you mind to add a test too?
Thanks!

Sure :) Just did it.

@hekonsek Thank you for signing the Contributor License Agreement!

Please let me know if you want me to submit a documentation for this option to spring-cloud-stream AsciiDoc.

@hekonsek Yes, please add some documentation. We maintain it in the same repository as the binder, i.e. https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/blob/master/spring-cloud-stream-binder-kafka-docs/src/main/asciidoc/overview.adoc so it can just be an extra commit to this PR.

Done!

Another quick comment is that we add author tags for significant changes and update the copyright years on all changes - will fix on merge.

Squashed rebased and merged as https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/commit/61e7936978180e194d0ce67c97e4dc2d81cdbdfb.
Additional documentation polishing via https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/commit/c68ea8c570a719b2a1bcd9febcd2feab0d3dd8a2.

Thanks for the contribution @hekonsek - looking forward for more :)

Many thanks for all your help Marius.
I will have some more questions for you regarding taking advantage of this improvement and dynamic destinations in Data Flow environment. Which eventually may end up in additional pull requests as well. But I will open another issues for this problem and ping your from there :) .


Fix RichTextEditor story

Closes NCI-Agency/anet#3139

@cemalettin-simsoft :

The text inside RichText storybook had some inconsistency. Like this, h1 is smaller than h2-h3 etc.

Looks like Storybook adds global styling like this:
h2 {
  font-weight: 900;
  font-size: 32px;
  line-height: 1;
  margin: 0 0 4px;
  display: inline-block;
  vertical-align: top;
}

so it's very hard to avoid that problem.

I thought the problem might come from RichTextEditor component's styling. If the issue is only presented in storybook, then it is probably fine.

Indeed. It did however prompt me to add the missing bootstrap stylesheet that we also include in our global index.js. Does not help in this case, but better to be complete.


Show messages on MESSAGES tab, not ADMIN

The messages are currently displayed under the admin page.
The panel needs to be moved to the messages page.

I fixed it


Datagrid design review: Sorting

Design review

Component epic #1607 #2499
Links: PAL guidance / Storybook v2 / Storybook v1

Sorting (Carbon)

Standards

[ ] All pattern updates/changes/iterations have been discussed with the
component developer
[ ] Patterns have been approved by either DSAG or another approving entity

Pattern and behavior

[ ] The component behaves according to the guidelines set by the pattern
maintainer
[ ] The component’s UI matches the pattern specifications set by the pattern
maintainer
[ ] The component’s motion matches the specifications set by the pattern
maintainer(s)
[ ] The UI produced is responsive, cross-browser, and responds to the
currently set Carbon theme.
[ ] Colors, themes, sizes and additional props are true and correct, aligning
with Carbon set tokens (unless otherwise specified by the pattern)
[ ] Paddings/margins/spacings are true and correct, in both desktop and mobile
views

Storybook

[ ] A functioning component renders in Storybook
[ ] The Storybook displays multiple scenarios that show how the component can
be used
[ ] Changing props in the Storybook updates the component

@Ashley-Bock to help with this review 🙌

Standards

[ ] All pattern updates/changes/iterations have been discussed with the component developer

[ ] Patterns have been approved by either DSAG or another approving entity

Pattern and behavior

[ ] The component behaves according to the guidelines set by the pattern maintainer

[ ] The component’s UI matches the pattern specifications set by the pattern maintainer

[ ] The component’s motion matches the specifications set by the pattern maintainer(s)

[ ] The UI produced is responsive, cross-browser, and responds to the currently set Carbon theme.

[ ] Colors, themes, sizes and additional props are true and correct, aligning with Carbon set tokens (unless otherwise specified by the pattern)

[ ] Paddings/margins/spacings are true and correct, in both desktop and mobile views

Storybook

[ ] A functioning component renders in Storybook

[ ] The Storybook displays multiple scenarios that show how the component can be used

[ ] Changing props in the Storybook updates the component

No issues between guidance and storybook. Only thing to consider, do designers have to always signify which column the table is sorted by default? In storybook, it doesn't appear that it shows which column has the default sorting and the guidance doesn't mention it either.

The keyboard interactions look good.
There are a few screenreader issues when testing with voiceover.

Table description
Currently voiceover provides only a vague description of the table.  Need to add aria-label, aria-describedbyor caption to provide accessible description of the table
See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/table_role

Aria sort

Need to check markup of the table - should be using aria-sort so that the screenreader announces to the user that the table is sortable

Current:
Current:
Correct example from https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced:

Row splitters:

Row splitters are not interactible via keyboard focus alone, but are interactable via screen reader
When interacting via screenreader use, the row splitters aren't working properly  - Was this worked on in a different PR maybe?

Current:
Current:

When using CNTRL+Option+L/R arrows to navigate horizontally through the table with the screen reader, it reads the the contents of a cell as a group, saying the same content three times.  Should be reading out just text.  I'm not sure why this is happening when navigating horizontally but not vertically

Current:

Lmk if you want to talk through any of these issues if they are not clear by the descriptions 😄

@kristastarr @matthewgallo The bit on row splitters — I think this is coming from the resizable columns feature. I think we should be able to re-add the resizing behavior so might be worth having you take a review at the behavior once we have that working again. Don’t think that one needs to be a part of the Sorting followup though.
Not sure if we have a good solution of the groups at the moment either ... I’m guessing it’s also part of a number of other extensions. Might need some ideas on how we approach this. How critical do you think this one is for our initial release? :thinking:

For the row splitters, yes I think it makes sense to fix it on the resizable columns feature since that impacts multiple other components.
For the groups - I don't think I delved into the code for this one, but can take a look - did you guys see what's causing them to be "grouped"?

Opened a new issue for investigating why cells are being interpreted as groups so we can close this one!


Response stream is not interrupted after mapping the effect type

I am having troubles interrupting a stream which is sent in a response using http4s. It happens only if I try to convert the effect type of the routes:
All imports are omitted to save the space. I am sorry for very fat code samples, but it's the best way I could narrow it down.
Here is my routes definition:
class TestController[F[_] : Concurrent : Timer](deferred: Deferred[F, Unit]) extends Http4sDsl[F] {

  private implicit val uuidEncoder: EntityEncoder[F, UUID] =
    EntityEncoder
        .stringEncoder[F]
        .contramap(_.toString + "\n")

  val routes: HttpRoutes[F] = HttpRoutes.of[F] {
    case GET -> Root / "stream" =>
      val stream = Stream
        .repeatEval(Concurrent[F].delay(UUID.randomUUID()).flatTap(_ => Timer[F].sleep(2.seconds)))
        .interruptWhen(deferred.get.attempt)
      Ok(stream)
    case POST -> Root / "complete" =>
      deferred.complete(()).flatMap(_ => Ok("stream is cancelled"))
  }

}

Here is how I instantiate those routes twice with multiple effects (IO[_] and EitherT[IO, String, _]) and then merge them into one route with final effect (IO[_]) and two prefixes:
object Routes {

  def createRoutes(
      deferred1: Deferred[IO, Unit],
      deferred2: Deferred[IO, Unit]
  )(implicit c: Concurrent[IO], timer: Timer[IO]): HttpRoutes[IO] = {

    type SpecialEff[T] = EitherT[IO, String, T]

    val ioToSpecial: IO ~> SpecialEff = EitherT.liftK
    val specialToIO: SpecialEff ~> IO =
      new ~>[SpecialEff, IO] {
        override def apply[A](fa: SpecialEff[A]): IO[A] = fa.value.flatMap {
          case Left(_)    => IO.raiseError(new RuntimeException("should never happen"))
          case Right(res) => IO.pure(res)
        }
      }

    val dsl = Http4sDsl[IO]
    import dsl._

    val ioTestRoutes: HttpRoutes[IO] = new TestController[IO](deferred1).routes
    val specialTestRoutes: HttpRoutes[SpecialEff] =
      new TestController[SpecialEff](deferred2.mapK(ioToSpecial)).routes

    val convertedSpecialRoutes: HttpRoutes[IO] = Kleisli { requestIO =>
      val requestSpecial =
        Request[SpecialEff]( // no mapK cause it uses Stream#translate for the body (which makes stream uninterruptible)
          method = requestIO.method,
          uri = requestIO.uri,
          httpVersion = requestIO.httpVersion,
          headers = requestIO.headers,
          body = requestIO.body.translateInterruptible(ioToSpecial),
          attributes = requestIO.attributes
        )

      val specialResult: OptionT[SpecialEff, Response[SpecialEff]] =
        specialTestRoutes(requestSpecial)

      val ioResult: IO[Option[Response[IO]]] = specialResult.value
          .map(_.map { specialResponse =>
            Response[IO]( // no mapK cause it uses Stream#translate for the body (which makes stream uninterruptible)
              status = specialResponse.status,
              httpVersion = specialResponse.httpVersion,
              headers = specialResponse.headers,
              body = specialResponse.body.translateInterruptible(specialToIO)
            )
          })
          .value
          .flatMap {
            case Right(maybeResp) =>
              IO.pure(maybeResp)
            case Left(error) =>
              BadRequest(error).map(Some(_))
          }

      OptionT(ioResult)
    }

    Router[IO]("/io" -> ioTestRoutes, "/special" -> convertedSpecialRoutes)
  }
}

I don't know why, but /io/complete requests interrupt the stream opened with /io/stream just fine, but /special/complete ones do not interrupt the stream opened with /special/stream. Even though in both cases the corresponding Deferred instance is set successfully. I suspect that somehow I made the response body stream uninterruptible while mapping SpecialEff to IO or vice versa.
In case if that is an expected behaviour, could you please point me in the right direction to fix this? I am not expert in fs2 streams, but I don't see any errors in the code.
Also, here is a sample project with this. It's just three scala files, two of which are above: https://github.com/maximskripnik/stream-cancel-issue
Thanks in advance!

Do you think this captures the essence of the problem?  There's no HTTP in it, and it fails for me in the way your app does:
import java.util.UUID

import cats._
import cats.arrow._
import cats.data._
import cats.effect._
import cats.effect.concurrent.Deferred
import cats.syntax.applicativeError._
import cats.syntax.flatMap._
import fs2.Stream

import scala.concurrent.duration._

object WithoutHttp extends IOApp {
  type SpecialEff[T] = EitherT[IO, String, T]
  val ioToSpecial: IO ~> SpecialEff = EitherT.liftK
  val F = Concurrent[SpecialEff]

  def run(args: List[String]) = {
    val deferred = Deferred.unsafe[IO, Unit].mapK(ioToSpecial)
    val stream = Stream
      .repeatEval(IO.delay(UUID.randomUUID()).flatTap(_ => Timer[IO].sleep(2.seconds)))
      .evalMap(uuid => IO.delay(println(uuid)))
      .translateInterruptible(ioToSpecial)
      .interruptWhen(F.attempt(deferred.get))
      .compile
      .drain
    val success = for {
      fiber <- F.start(stream)
      _ <- Timer[SpecialEff].sleep(5.seconds)
      _ <- deferred.complete()
      _ <- fiber.join
    } yield ExitCode.Success
    success.value.flatMap(_.fold(
      s => IO.raiseError(sys.error(s)),
      IO.pure
    ))
  }
}

@rossabaker Yes, I think it really does capture the same issue. It works for IO[_] and does not work for EitherT[IO, String, _] 😞
Thanks for narrowing it down to fs2 or cats. It's clear now that this is not http4s issue

I asked our resident fs2 experts on Gitter to see if they can spot it, and once we find the answer, it might be an interesting problem to wind it back into http4s.  This one has my interest, too. :smile:

The dependencies are a bit old in the example repo, but I confirmed it's happening on http4s-0.21.9 and its transitive dependencies, which should be the latest fs2-2.4.

Not sure it's possible in this case, but one workaround is calling interruptAfter/interruptWhen after calling transalteInterrupt.

@mpilquist Thank your for your attention to this. Unfortunately, our use case implies calling interruptWhen before mapping the effect type.
The idea is that we use one effect that is capable of capturing non-throwable errors (EitherT) for our business logic which includes creating the stream and calling interruptWhen on it. And almost at the end of the world we map this effect to IO. The way we map it is a bit more complicated than in the provided example, but this forces us to handle all the possible errors that might be returned by classes that implement the business logic (and work over EitherT). Calling interruptWhen after translateInterrupt means that we move part of the business logic to one of the outermost layers. This code is also quite complicated with all the Deferred instances and other concurrency primitives we use to track the state, so it's very preferred to keep it somewhere in the innermost layers

@maximskripnik Can you give fs2 version 2.5-bdc810b a try and let me know whether that resolves this issue for you?

@mpilquist Yes, the issue is not reproducible with "co.fs2" %% "fs2-core" % "2.5-bdc810b". The sample provided by @rossabaker also works as expected with this version.
Thanks!

@maximskripnik Cool, I released fs2 2.4.6 with that fix.


Can't start mapproxy after installation

Hi!
I tried to install your packages on Win 7. When installation was finished and I started mapproxy via CMD I got this error:
[i]
C:\Users\maraev>"C:\Program Files (x86)\MapProxy-1.7.1\App\python.exe" "C:\Program Files (x86)\MapProxy-1.7.1\mapproxy_app.py"
Traceback (most recent call last):
File "C:\Program Files (x86)\MapProxy-1.7.1\mapproxy_app.py", line 9, in
from mapproxy.wsgiapp import make_wsgi_app
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\mapproxy-1.7.1-py2.7.egg\mapproxy\wsgiapp.py", line 29, in
from mapproxy.config import local_base_config
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\mapproxy-1.7.1-py2.7.egg\mapproxy\config_init_.py", line 16, in
from mapproxy.config.config import (
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\mapproxy-1.7.1-py2.7.egg\mapproxy\config\config.py", line 23, in
from mapproxy.util.yaml import load_yaml_file
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\mapproxy-1.7.1-py2.7.egg\mapproxy\util\yaml.py", line 17, in
import yaml
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\pyyaml-3.11-py2.7-win32.egg\yaml_init_.py", line 14, in
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\pyyaml-3.11-py2.7-win32.egg\yaml\cyaml.py", line 5, in
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\pyyaml-3.11-py2.7-win32.egg_yaml.py", line 7, in
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\pyyaml-3.11-py2.7-win32.egg_yaml.py", line 4, in bootstrap
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\pkg_resources.py", line 882, in resource_filename
self, resource_name
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\pkg_resources.py", line 1351, in get_resource_filename
self._extract_resource(manager, self._eager_to_zip(name))
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\pkg_resources.py", line 1406, in _extract_resource
manager.extraction_error()  # report a user-friendly error
File "C:\Program Files (x86)\MapProxy-1.7.1\App\lib\site-packages\pkg_resources.py", line 928, in extraction_error
raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg
cache:
[Error 5] Access is denied: 'C:\Users\maraev\AppData\Roaming\Python-Eggs\pyyaml-3.11-py2.7-win32.egg-tmp\_yaml.pyd'
The Python egg cache directory is currently set to:
C:\Users\maraev\AppData\Roaming\Python-Eggs
Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory. [/i]
Off course my profile has access to this directory and I suppose that something is going wrong with standalone python's global environment but I'm not sure. The same I'm getting for both versions 1.7 and 1.8

Hi, seems like a permission issue, python must run with administrator privileges. Please try to start cmd with administrator privileges (run as administrator) and see what happens.

I don't thik so.
I've just set PYTHON_EGG_CACHE=C:\Users\maraev\AppData\Local\Temp (explanations here:  http://stackoverflow.com/questions/2192323/what-is-the-python-egg-cache-python-egg-cache)  and now getting bellow thing:
MapProxy server running at http://localhost:8081/mapproxy
Close this dialog to stop the server
No section: 'formatters'

I'm not able to reproduce your problem. If you found out what causes the issue, please send a pull request with the fix.


[BUTTON IDEA]:Radial gradient btn

1. Name of button:
Radial gradient
2. Description:
on hover the radial gradient start working.
radial-gradient.zip
3. Button Type (Animated, Special, etc...):
Animated
4. Will you work on it?:
I worked upon it.

The animation looks very similar to the ripple button

yes thank you for informing..


Add identify function wrapper to ExLaunchDarkly

This adds a wrapper function for :ldclient.identify to the ExLaunchDarkly module.
identify is recommended for prepopulating the user dashboard. Including the function in the ExLaunchDarkly API addresses a common use case for devs adding it to their projects.
I also updated some bugs in the README. 😄

@quinlanjager did it not trigger the github actions for you?

@quinlanjager did it not trigger the github actions for you?

@hez I don't think so... Maybe it's because it's a fork?

@quinlanjager maybe because you aren't signed up for Github Actions?
I went and merged it, will cut a new ver :)


Can't install Sublime Text formula

I am new to Cask. So here might be something obvious to others. Please correct me if wrong.
I try to install Sublime Text through Cask and get these errors. I compare the format of this formula and it looks similar to others. I also try to update/pull the latest changes. And I try 'brew cask info sublime-text', 'brew cask list sublime-text'. The error is still showing up.
So I end up 'brew tap caskroom/versions' to install Sublime Text 3.
$ brew cask install sublime-text
Error: wrong number of arguments (1 for 0) while loading '/usr/local/Library/Taps/caskroom/homebrew-cask/Casks/sublime-text.rb'
Please report this bug:
    https://github.com/caskroom/homebrew-cask/issues
<main>:8:in `name'
<main>:8:in `<class:SublimeText>'
<main>:in `<main>'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/source/path_base.rb:72:in `eval'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/source/path_base.rb:72:in `rescue in load'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/source/path_base.rb:69:in `load'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/source/tapped.rb:33:in `load'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask.rb:78:in `load'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/install.rb:19:in `block in install_casks'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/install.rb:17:in `each'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/install.rb:17:in `install_casks'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/install.rb:6:in `run'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli.rb:81:in `run_command'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli.rb:121:in `process'
/usr/local/bin/brew-cask.rb:42:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Library/brew.rb:58:in `require?'
/usr/local/Library/brew.rb:141:in `<main>'

Hi there! Looks like you're running an old version of cask, you can upgrade with this command:
brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

@phinze Thanks for pointing it out. I rerun what you said. It works now.


[Feature] make BigQuery execution_project accessible from target object

Is there an existing feature request for this?

[X] I have searched the existing issues

Describe the Feature
In BigQuery, the execution_project might be different from the project. Sometimes we would need this information for context logging, monitoring and alerting. (such as alert the dbt user if they are using the undesired execution_project in their development environment)
It would be great if the execution_project is accessible under target object.
such as
target.execution_project

Describe alternatives you've considered
No response
Who will this benefit?
team using dbt-BigQuery and want to closely monitor how dbt users are using execution_projects correctly and provide warning at the run time.
Are you interested in contributing this feature?
yes
Anything else?
No response

PR here (not sure how cross repo PRs work so manually linking to avoid anyone repeating work).

Thanks for the issue @hui-zheng, and for the quick PR @pgoslatara! Indeed, you beat me to the punch—I'm going to transfer this issue to the dbt-bigquery repo, and mark it a good first issue :)


fixed text color on hover with context-panel items

context pane color item shows up as blue and highlight is blue. This fixes it.

LOL should I just add you as a contributor? :P

hehe that would be great :D


Failing to render template "stencil-base"

When following https://stencil.rgst.io/guide/base-project.html#step-3-import-a-module locally I receive error
ERRO failed to run error="failed to render template \"github.com/getoutreach/stencil-base/.github/CODEOWNERS.tpl\": template: github.com/getoutreach/stencil-base/.github/CODEOWNERS.tpl:2:24: executing \"github.com/getoutreach/stencil-base/.github/CODEOWNERS.tpl\" at <.Runtime.Box.Org>: can't evaluate field Box in type codegen.runtime"
Output of the stencil version
hello-world % stencil --version
   _____ __                  _ __
  / ___// /____  ____  _____(_) /
  \__ \/ __/ _ \/ __ \/ ___/ / /
 ___/ / /_/  __/ / / / /__/ / /
/____/\__/\___/_/ /_/\___/_/_/

stencil: A modern living-template engine for evolving repositories
https://stencil.rgst.io

GitVersion:    0.9.0
GitCommit:     cca6d78fa9006be26fb1759b2f58ef45b1929106
GitTreeState:  clean
BuildDate:     2024-08-13T05:31:30Z
BuiltBy:       goreleaser
GoVersion:     go1.22.5
Compiler:      gc
ModuleSum:     unknown
Platform:      darwin/arm64

Ah sorry about this! Our "getting started" docs are a bit stale since they largely originate from a time where this was part of the getoutreach org. I'll take a pass at that today and get it cleaned up! 😄

This should be resolved now! Let me know how your getting started experience goes 🚀


Attachment view count doesn't show up for certain attachment types

Describe the bug
The attachment count is not displaying for Google Books, Kaltura, YouTube, Flikr, and EQUELLA web pages.
To Reproduce
Steps to reproduce the behavior:

Go to an openEQUELLA item summary page of an item which contains one of the following attachment types: Google Books, Kaltura, YouTube, Flikr, EQUELLA Web Page.
Click on the attachment row to open the popup window that displays the viewcount.
Note that the viewcount row is not displayed (as in screenshot below).

Expected behavior
The view count should be viewable and should increment properly for every type of attachment.
Screenshots
Screenshot of attachment details pane, not even displaying the viewcount row.

Platform:

Tested OpenEquella Version: 2019.2.1, 2020.2

Can confirm this still happens - whether this is a bug or a missing feature remains to be seen. Also happens in the old UI.


ENH: linalg: add batch support to several remaining functions

Reference issue
Follow-up to gh-22133
Toward gh-21466
What does this implement/fix?
This PR adds support for n-dimensional batch input to many of the remaining linalg functions, which typically accept more than one array.
Additional information
I couldn't do cossin because its first argument can be an iterable containing four arrays instead of just one array.
@j-bowhay (or anyone else) would you like to add some of the rest of these in a separate PR? Note that functions like solve, in which the second argument has core dimension 1 but can be batched, probably can't be handled by the decorator, so i'd stay away from those. (@ilayn it would be great if those could be the first to be vectorized in compiled code.)

I can try have a look at some of the remaining functions


JVECTOR-20

Introduce Shared/Unshared annotations. Annotate RAVV methods appropriately.
Using ElementType.TYPE_USE means this travels with the returned value better through most IDEs, but I don't have a strong opinion on the choice between annotating the method and the return type.

Using ElementType.TYPE_USE means this travels with the returned value better through most IDEs

LGTM, but let's add that as a comment to the interface, because METHOD is the more obvious choice.


[Feature Request] Code Call Graph

Would be nice to have a code call graph like so:

Source: https://marketplace.visualstudio.com/items?itemName=YaobinOuyang.CodeAtlas

There is no need for a fancy UI with animations as first implementation. Even a simple call graph exported to GraphViz format would be extremely helpful.
For example:

Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision.

Thanks for the suggestion! We talked about it with the team and we have unfortunately decided we will not be moving forward with this idea. We think there isn't an enough widespread need for this to warrant the maintenance cost for the feature.


bug in 2.0.8: failing view tests and a compile warning

After updating to 2.0.8 I get this compiler warning for some of my views:
warning: this clause for render (overridable 1)/2 cannot match because a previous clause at line 1 always matches

Additionally all render calls in my view tests just return nil, e.g. this test:
  test "renders 500.json" do
    assert render(TermitoolWeb.ErrorView, "500.json", []) == %{errors: %{detail: "Internal Server Error"}}
  end

now just returns nil:
  1) test renders 500.json (TermitoolWeb.ErrorViewTest)
     test/termitool_web/views/error_view_test.exs:11
     Assertion with == failed
     code:  assert render(TermitoolWeb.ErrorView, "500.json", []) == %{errors: %{detail: "Internal Server Error"}}
     left:  nil
     right: %{errors: %{detail: "Internal Server Error"}}
     stacktrace:
       test/termitool_web/views/error_view_test.exs:12: (test)

After downgrading to 2.0.7 everything works again.

I can confirm that upgrading to 2.0.8 breaks tests. I have seen it in 2 applications.

Thanks for reporting the issue, we will take a look.

Thanks for reporting this, both. This is a regression inn 2.0.8, and we’re reviewing a fix for this in https://github.com/appsignal/appsignal-elixir-phoenix/pull/21.
We’re aiming to release 2.0.9 with this patch soon. In the meantime, please downgrade to 2.0.7.

Hey all, I’ve just published version 2.0.9 of the Phoenix integration, which is a patch to resolve the issues introduced in 2.0.8. Could you upgrade and let me know if this resolves the issue for you?
Thanks again!

@jeffkreeftmeijer Thanks for the quick reply.
I have checked out the new version and now regrettably my test suite prints out tens of such warnings:
warning: this clause for render/2 cannot match because a previous clause at line 1 always matches
  web/views/terms_of_service.ex:1

I’ll take another look to see what’s causing that after the change in 2.0.8. Do you still get nil responses from your error views with 2.0.9?

Do you still get nil responses from your error views with 2.0.9?

CI does not even get there as if stops at compilation on those warnings. I will check locally and report back.

Thanks! I’ve pushed a fix for the warnings, which is working for me in my local setup: https://github.com/appsignal/appsignal-elixir-phoenix/pull/22. If time permits, could you try the view-warnings for appsignal_phoenix to see if that still produces those warnings? We’ll do one more round of testing before pushing this out.

So for 2.0.9 I get:
** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1

     The following arguments were given to IO.chardata_to_string/1:

         # 1
         Clubbase.Views.Layout.Club

     Attempted function clauses (showing 2 out of 2):

         def chardata_to_string(string) when is_binary(string)
         def chardata_to_string(list) when is_list(list)

     code: conn = get(conn, WebRoutes.club_member_signups_path(conn, :index, club))
     stacktrace:
       (elixir 1.11.4) lib/io.ex:589: IO.chardata_to_string/1
       (elixir 1.11.4) lib/path.ex:530: Path.do_join/3
       (elixir 1.11.4) lib/path.ex:522: Path.join/2

but on branch: "view-warnings" don't have the above reported compiler warnings and also all tests pass.

That’s good to hear, thanks for helping us test this. I’ve just released version 2.0.10, which includes the patch in the view-warnings branch. Please let me know if you run into any issues with that!

Can confirm, works now again. Thanks for fixing.

Still seems to be happening in 2.0.11
running  mix deps.clean sometimes helps at random, but not every time and it randomly starts happening after a while. It might be compilation related.
Also, when it does happen, and I run dialyzer, I get warnings along the lines of
lib/{view_module_path}:pattern_match_cov
The pattern
_, _

can never match, because previous clauses completely cover the type
_, _.

________________________________________________________________________________
lib/{view_module_path}:pattern_match_cov
The pattern
{template name as charlist}, %{assigns_map}

can never match, because previous clauses completely cover the type
_, _.

I get one error for every render clause I have in my view module.
It only seems to happen for one view module to.
elixir -v
Erlang/OTP 23 [erts-<IP_ADDRESS>] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Elixir 1.11.4 (compiled with Erlang/OTP 23)

Hi @begedin, I am unable to reproduce it in a small test app. You say it happens randomly. Does it keep happening consistently after it fails once?

@tombruijn I'm afraid it wasn't a consistent reproduction after it happens once.
That being said, I haven't seen it for the past two days, so it's also possible it got resolved by 2.0.12? We have been upgrading as soon as a new version was out.
Maybe it was also some weird caching issue, or interaction with another dependency? We try to keep our stuff up to date with dependabot, so several things got upgraded yesterday.

It should have been solved in the latest release yes. It may be a caching issue. It doesn't hurt to throw away the _build and deps directories and any dialyzer cache if it does happen again. It's what I do whenever I worry there's a caching issue 😅


Can glue generate cross modality data？

Hi,
I wonder know if GLUE can generate cross modality data, like you have a pre-trained model, and if you can generate scATAC-seq data using the scRNA-seq data?

Hi @GlancerZ, thanks for your interest in GLUE. The GLUE model can do cross modality prediction in principle, but we did not rigorously evaluate the performance in that regard. Empirically speaking, the output of the VAEs used in our model could be over-smoothing, so we do not really recommend doing so.


Public victory points should include development card victory points after the game has ended

This should probably include some text like "(1 victory point)" / "(X victory points)" next to the victory point tab similar to how knights are shown.

Fixed in 858fd22fa4141f492b02784a0d136a4e97fdceb9.


Anyone else notice that the data.history is correct, but data.current is one day behind?

Dear Catalyst Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment

Operating System: (Windows Version or $ uname --all)
Python Version: $ python --version
Python Bitness: $ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))'
How did you install Catalyst: (pip, conda, or other (please explain))
Python packages: $ pip freeze or $ conda list

Now that you know a little about me, let me tell you about the issue I am
having:
Description of Issue

What did you expect to happen?
What happened instead?

Here is how you can reproduce this issue on your machine:
Reproduction Steps

...
What steps have you taken to resolve this already?
...
This will lead to lookahead bias in some strategies. Not sure if there are any fixes.
...
Sincerely,
$ whoami

@Decision420s , I am closing this.
Please feel free to reopen and provide more information on the issue.


typioca: 2.4.2 -> 2.5.0

Diff: https://github.com/bloznelis/typioca/compare/2.4.2...2.5.0
Changelog: https://github.com/bloznelis/typioca/releases/tag/2.5.0
Description of changes

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
23.11 Release Notes (or backporting 23.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 247758 run on x86_64-linux 1

1 package built:

typioca