Add ‘foot’ to list of terminals with image support

Foot (https://codeberg.org/dnkl/foot), a Linux Wayland terminal, has sixel support:

Wow, what a cool terminal! I never heard of it. Thank you for sharing

Btw, could you please check how does v2.wttr.in look like in this terminal?

Btw, could you please check how does v2.wttr.in look like in this terminal?

"Sorry, we are running out of queries to the weather service at the moment."
Will post some screenshots once it's working again ;)

Please try again, it should work now

The overall looks depend a lot on which font you use.
My primary font (Dina) doesn't have any graphical symbols, causing it to fallback to other fonts. For example, the arrows are taken from different fallback fonts, causing a weird mix of single-cell and double-cell arrows.
Furthermore, some of the graphical symbols are single width characters but double width glyphs. For example, the colorized arrows seen in the image below. By default, foot crops these:

There is however an option that disables the cropping:

But note that this causes the first digit of the wind speed to be overwritten by the double-width wind-direction arrow (in the "Weather:" line under the graphs).
Using DejaVu Sans Mono as primary font results in a slightly more uniform look:

@dnkl Daniel, thank you for the cool screenshots collection.
As I expected, DejaVu Sans Mono was the best option in this case, but perhaps it is not the best choice for other terminal programs. By the way, if you you use nerd fonts, you can try the v2d and v2n views which are tweaked for such fonts (they use special characters for weather symbols).
It could be possible to combine real graphics (like v3) with textual information (like footer of v2),
and so make this combined output look uniform does not matter what font is used.
Apropos combined output, do you know by chance, does foot support images that are
displayed as a part of the string, or it always needs the whole string for an image?
Some thing like text IMAGE text?

As I expected, DejaVu Sans Mono was the best option in this case, but perhaps it is not the best choice for other terminal

Precisely. The nice thing with foot is that you can specify a custom font fallback list. This allows you to tweak the fonts for the terminal, without having to change your system default fontconfig settings.
For what it's worth, the latest git version now defaults to allowing double-width glyphs to overflow, thus preventing the weather glyphs from being cut in half.

By the way, if you you use nerd fonts, you can try the v2d and v2n views which are tweaked for such fonts (they use special characters for weather symbols).

Thanks! I don't normally, but might test it to see how it looks.

Apropos combined output, do you know by chance, does foot support images that are
displayed as a part of the string, or it always needs the whole string for an image?

Yes it does. You can even emit a sixel image, and then move the cursor into the middle of it and then print regular text. But do note that the affected cells are replaced with text. I.e. you wont get text on-top off the image.
Btw, in case it wasn't clear: I am the author of foot :)

Some thing like text IMAGE text?

IMAGE text IMAGE should also work

@dnkl Daniel, hi! I expected that you are the author of the foot, but I was not 100% sure. But now when I am 100% sure I want to ask you several questions:

Is it possible in foot to expose width and height of the character via some interface? What is the main method of communication with foot? Of course, one of the possible and probable the most obvious way would be to expose it via an environment variable, but if the size of the terminal changes, the environment variable becomes outdated. Do you have some better ideas?

In your implementation of sixel, is it possible somehow to specify the alternative text? That must be displayed in case you have switched sixel off? And is it possible to switch sixel off in foot by the way?

@dnkl Daniel, hi! I expected that you are the author of the foot, but I was not 100% sure. But now when I am 100% sure I want to ask you several questions:

Is it possible in foot to expose width and height of the character via some interface? What is the main method of communication with foot? Of course, one of the possible and probable the most obvious way would be to expose it via an environment variable, but if the size of the terminal changes, the environment variable becomes outdated. Do you have some better ideas?

In your implementation of sixel, is it possible somehow to specify the alternative text? That must be displayed in case you have switched sixel off? And is it possible to switch sixel off in foot by the way?

Is it possible in foot to expose width and height of the character via some interface?

There's the TIOCGWINSZ ioctl; foot will fill in both the ws_col/ws_row and the ws_xpixel/ws_ypixel fields. Do note that most terminal emulators leave the pixel fields at 0. Among those who does set them, some may include window padding while others do not.
Foot does not include padding, which means you can easily calculate the cell size: cell_width = ws_xpixels / ws_col, and similar for the height.
There's also the CSI Ps t family of escape sequences. For example, \E[16t will report the cell width and height. Or \E[14t to get the window size (in pixels), \E[18t to get the window size in characters.

What is the main method of communication with foot?

Foot does not implement any custom interfaces. You use terminfo, and escape sequences to query and communicate with it.

but if the size of the terminal changes, the environment variable becomes outdated. Do you have some better ideas?

The usual way is to register a handler for the SIGWINCH signal to detect size changes. Once a change has been detected, you  can use your method of choice to query what the new size is (e.g TIOCGWINSZ).

In your implementation of sixel, is it possible somehow to specify the alternative text? That must be displayed in case you have switched sixel off? And is it possible to switch sixel off in foot by the way?

There's no way to specify an alternative text. I'm not aware of any standardized way(s) to do this?
There's no way to turn of sixel in foot. Except, perhaps, by setting the maximum sixel size to 0x0, with the \E[?2;3;0;0S escape.

Is it possible in foot to expose width and height of the character via some interface?

There's the TIOCGWINSZ ioctl; foot will fill in both the ws_col/ws_row and the ws_xpixel/ws_ypixel fields. Do note that most terminal emulators leave the pixel fields at 0. Among those who does set them, some may include window padding while others do not.
Foot does not include padding, which means you can easily calculate the cell size: cell_width = ws_xpixels / ws_col, and similar for the height.
There's also the CSI Ps t family of escape sequences. For example, \E[16t will report the cell width and height. Or \E[14t to get the window size (in pixels), \E[18t to get the window size in characters.

What is the main method of communication with foot?

Foot does not implement any custom interfaces. You use terminfo, and escape sequences to query and communicate with it.

but if the size of the terminal changes, the environment variable becomes outdated. Do you have some better ideas?

The usual way is to register a handler for the SIGWINCH signal to detect size changes. Once a change has been detected, you  can use your method of choice to query what the new size is (e.g TIOCGWINSZ).

In your implementation of sixel, is it possible somehow to specify the alternative text? That must be displayed in case you have switched sixel off? And is it possible to switch sixel off in foot by the way?

There's no way to specify an alternative text. I'm not aware of any standardized way(s) to do this?
There's no way to turn of sixel in foot. Except, perhaps, by setting the maximum sixel size to 0x0, with the \E[?2;3;0;0S escape.

Foot does not include padding, which means you can easily calculate the cell size: cell_width = ws_xpixels / ws_col, and similar for the height.

Yes, this was exactly the plan, but the problem is that I didn't manage to find a good method to access this info. For COLS/ROWS the method is obvious, but not for this.

There's also the CSI Ps t family of escape sequences. For example, \E[16t will report the cell width and height. Or \E[14t to get the window size (in pixels), \E[18t to get the window size in characters. Not sure how common it is for terminal emulators to support these though.

What about foot? Does it support it?

but if the size of the terminal changes, the environment variable becomes outdated. Do you have some better ideas?

The usual way is to register a handler for the SIGWINCH signal to detect size changes. Once a change has been detected, you can use your method of choice to query what the new size is (e.g TIOCGWINSZ).

Yes, I know about SIGWINCH, but that is not exactly what I need. In my case it does not matter when exactly the terminal size is changing/was changed, I am searching for a good and portable method to get the terminal size at the moment of the query.
I suppose that to use TIOCGWINSZ is the best method here.

In your implementation of sixel, is it possible somehow to specify the alternative text? That must be displayed in case you have switched sixel off? And is it possible to switch sixel off in foot by the way?

There's no way to specify an alternative text. I'm not aware of any standardized way(s) to do this?
There's no way to turn of sixel in foot. Except, perhaps, by setting the maximum sixel size to 0x0, with the \E[?2;3;0;0S escape.

Yes, I know that there is no straightforward method to specify an alternative text,
but what I mean here, maybe you have an idea how it could be possible to specify some text,
that would be displayed by terminals that do not support sixel (by default),
and display the sixel above/instead of it if sixel it supported.
I am almost sure that it is possible with foot,
especially if we know terminal geometry and text geometry, and perhaps even if we don't.

Foot does not include padding, which means you can easily calculate the cell size: cell_width = ws_xpixels / ws_col, and similar for the height.

Yes, this was exactly the plan, but the problem is that I didn't manage to find a good method to access this info. For COLS/ROWS the method is obvious, but not for this.

There's also the CSI Ps t family of escape sequences. For example, \E[16t will report the cell width and height. Or \E[14t to get the window size (in pixels), \E[18t to get the window size in characters. Not sure how common it is for terminal emulators to support these though.

What about foot? Does it support it?

but if the size of the terminal changes, the environment variable becomes outdated. Do you have some better ideas?

The usual way is to register a handler for the SIGWINCH signal to detect size changes. Once a change has been detected, you can use your method of choice to query what the new size is (e.g TIOCGWINSZ).

Yes, I know about SIGWINCH, but that is not exactly what I need. In my case it does not matter when exactly the terminal size is changing/was changed, I am searching for a good and portable method to get the terminal size at the moment of the query.
I suppose that to use TIOCGWINSZ is the best method here.

In your implementation of sixel, is it possible somehow to specify the alternative text? That must be displayed in case you have switched sixel off? And is it possible to switch sixel off in foot by the way?

There's no way to specify an alternative text. I'm not aware of any standardized way(s) to do this?
There's no way to turn of sixel in foot. Except, perhaps, by setting the maximum sixel size to 0x0, with the \E[?2;3;0;0S escape.

Yes, I know that there is no straightforward method to specify an alternative text,
but what I mean here, maybe you have an idea how it could be possible to specify some text,
that would be displayed by terminals that do not support sixel (by default),
and display the sixel above/instead of it if sixel it supported.
I am almost sure that it is possible with foot,
especially if we know terminal geometry and text geometry, and perhaps even if we don't.

What about foot? Does it support it?

Yes, it does.

I suppose that to use TIOCGWINSZ is the best method here.

I would suggest trying this first. If it returns 0 in the pixel fields, try CSI 16 t. If that doesn't work, maybe try CSI 14 t (text-area size in pixels) combined with CSI 18 t (text area size in chars). Though I suspect that if a terminal doesn't support CSI 16 t, it probably doesn't support CSI 14 t and/or CSI 18 t either.

maybe you have an idea how it could be possible to specify some text, that would be displayed by terminals that do not support sixel (by default), and display the sixel above/instead of it if sixel it supported.

How about this: before printing the sixel, get the current cursor position. Then, print the sixel image. Now get the cursor position again. If it hasn't moved, the terminal doesn't support sixels and you can print the alternate text instead.
If the cursor did move, then either terminal does support sixels, or it doesn't properly ignore unsupported DCS sequences (and that's a bug in the terminal - they should ignore unrecognized DCS sequences).

What about foot? Does it support it?

Yes, it does.

I suppose that to use TIOCGWINSZ is the best method here.

I would suggest trying this first. If it returns 0 in the pixel fields, try CSI 16 t. If that doesn't work, maybe try CSI 14 t (text-area size in pixels) combined with CSI 18 t (text area size in chars). Though I suspect that if a terminal doesn't support CSI 16 t, it probably doesn't support CSI 14 t and/or CSI 18 t either.

maybe you have an idea how it could be possible to specify some text, that would be displayed by terminals that do not support sixel (by default), and display the sixel above/instead of it if sixel it supported.

How about this: before printing the sixel, get the current cursor position. Then, print the sixel image. Now get the cursor position again. If it hasn't moved, the terminal doesn't support sixels and you can print the alternate text instead.
If the cursor did move, then either terminal does support sixels, or it doesn't properly ignore unsupported DCS sequences (and that's a bug in the terminal - they should ignore unrecognized DCS sequences).

I checked several terminals, and almost all of them provide information about
the window size for the TIOCGWINSZ call:
#include <sys/ioctl.h>
#include <stdio.h>
#include <unistd.h>

int
main(void) {
	struct winsize ws;
	ioctl(STDIN_FILENO, TIOCGWINSZ, &ws);

	 printf ("lines %d\n", ws.ws_row);
	 printf ("columns %d\n", ws.ws_col);
	 printf ("x_pixels %d\n", ws.ws_xpixel);
	 printf ("x_pixels %d\n", ws.ws_ypixel);

	return (0);
}

I checked alacritty, uxterm, wezterm, mlterm, and all of them support it; the only terminal without support  from that that I've checked was aminal. SO I think we can rely on this method.
The method that you are proposing could work iw we could work interactively work with the terminal but we can't: the server must generate the output without knowing anything about the terminal, and send it to the client. Ideally it should be something like:
ALTERNATIVE TEXT LINE 1
ALTERNATIVE TEXT LINE 2
ALTERNATIVE TEXT LINE 3
[SIXEL START]
GO 3 LINES ABOVE
PICTURE
[SIXEL STOP]

so that the clients that do not support sixel, just ignore everything from START to STOP, and the clients that understand sixel overwrite the first three lines.
In that case curl v3.wttr.in could just work without specifying the terminal type (without specifying if sixel is supported or not). Currently we need to specify it explicitly, but if we could implement the scenario described above, it could just work

I checked several terminals, and almost all of them provide information about
the window size for the TIOCGWINSZ call:
#include <sys/ioctl.h>
#include <stdio.h>
#include <unistd.h>

int
main(void) {
	struct winsize ws;
	ioctl(STDIN_FILENO, TIOCGWINSZ, &ws);

	 printf ("lines %d\n", ws.ws_row);
	 printf ("columns %d\n", ws.ws_col);
	 printf ("x_pixels %d\n", ws.ws_xpixel);
	 printf ("x_pixels %d\n", ws.ws_ypixel);

	return (0);
}

I checked alacritty, uxterm, wezterm, mlterm, and all of them support it; the only terminal without support  from that that I've checked was aminal. SO I think we can rely on this method.
The method that you are proposing could work iw we could work interactively work with the terminal but we can't: the server must generate the output without knowing anything about the terminal, and send it to the client. Ideally it should be something like:
ALTERNATIVE TEXT LINE 1
ALTERNATIVE TEXT LINE 2
ALTERNATIVE TEXT LINE 3
[SIXEL START]
GO 3 LINES ABOVE
PICTURE
[SIXEL STOP]

so that the clients that do not support sixel, just ignore everything from START to STOP, and the clients that understand sixel overwrite the first three lines.
In that case curl v3.wttr.in could just work without specifying the terminal type (without specifying if sixel is supported or not). Currently we need to specify it explicitly, but if we could implement the scenario described above, it could just work

I checked alacritty, uxterm, wezterm, mlterm, and all of them support it; the only terminal without support from that that I've checked was aminal. SO I think we can rely on this method.

I have a vague memory of all VTE-based terminals not setting it. Though I guess it is fine as long as all sixel-capable terminals do set it?

The method that you are proposing could work iw we could work interactively work with the terminal but we can't: the server must generate the output without knowing anything about the terminal,

Ah, got you.
Unfortunately, there's no way to move the cursor while in sixel mode. But I guess you already knew that. I've been trying to come up with a way to do something similar, but haven't had much success.
Not sure how your TIOCGWINSZ work ties into this, but if you have the cell dimensions, you could emit enough ALTERNATE TEXT to cover all the vertical space that will be used up by the sixel, then emit a "save cursor position" escape, move the cursor back up to the first alternate text line, emit the sixel, and then finally emit a "restore cursor position" escape. Of course, this breaks if the terminal window is smaller than the sixel...

I checked alacritty, uxterm, wezterm, mlterm, and all of them support it; the only terminal without support from that that I've checked was aminal. SO I think we can rely on this method.

I have a vague memory of all VTE-based terminals not setting it. Though I guess it is fine as long as all sixel-capable terminals do set it?

The method that you are proposing could work iw we could work interactively work with the terminal but we can't: the server must generate the output without knowing anything about the terminal,

Ah, got you.
Unfortunately, there's no way to move the cursor while in sixel mode. But I guess you already knew that. I've been trying to come up with a way to do something similar, but haven't had much success.
Not sure how your TIOCGWINSZ work ties into this, but if you have the cell dimensions, you could emit enough ALTERNATE TEXT to cover all the vertical space that will be used up by the sixel, then emit a "save cursor position" escape, move the cursor back up to the first alternate text line, emit the sixel, and then finally emit a "restore cursor position" escape. Of course, this breaks if the terminal window is smaller than the sixel...

Hi @dnkl Daniel! Next (short) question: what is the best way to detect that we are running inside foot? In other terms TERM can be used + there are other methods like using XTGETTCAP.
What is the best method for foot?

While TERM can be used (foot's default terminfo is foot, or foot-direct), I wouldn't recomment it; many people override it with e.g. xterm-256color. Also, up until recently, the foot and foot-direct terminfo's weren't available at all on FreeBSD, meaning all FreeBSD users used xterm-256color.
If you absolute need to identify foot, you can do so using the instructions here: https://codeberg.org/dnkl/foot/src/commit/4ec2c598616f11a16548ec7b2cf8812050e04b26/README.md#user-content-programmatically-checking-if-running-in-foot.
If it's for identifying sixel capable terminals I would recommend using Send Device Attributes (\E[c) and looking for a \E[?62;Psc, \E[?63;Psc or \E[?64;PSc response, where Ps is a colon-separated list of attributes, where 4 indicates sixel support. All sixel-capable terminals that I'm aware support this. For example, foot replies with \E[?62;4;22c, indicating sixel and ANSI color support.

This method seems to be very reliable indeed. I tested a dozen of different terminal with Sixel support and found only one (aminal) that does not seem to handle this properly; yet another one (kitty by @kovidgoyal ) handles the query but returns a \e[?62;c. Kitty does not support Sixel though, it has its own image encoding protocol, but ANSI color support (that is of course present in the terminal) is not specified in the response either

handles the query but returns a \e[?62;c. Kitty does not support Sixel though

Right, so the reason I mentioned the 62, 63 and 64 responses is that they correspond to VT220, VT320 and VT440 respectively. Only these responses are followed by an attribute list. Earlier VTs had custom responses that did not include an attribute list.
A fairly safe, but not entirely correct, method of detecting sixel support using this query is to look for a ;4 (semicolon followed by a "4") in the response.
valid response formats are:
Responses:
 - CSI?1;2c      vt100 with advanced video option
 - CSI?1;0c      vt101 with no options
 - CSI?6c        vt102
 - CSI?62;<Ps>c  vt220
 - CSI?63;<Ps>c  vt320
 - CSI?64;<Ps>c  vt420

Ps (response may contain multiple):
 - 1    132 columns
 - 2    Printer.
 - 3    ReGIS graphics.
 - 4    Sixel graphics.
 - 6    Selective erase.
 - 8    User-defined keys.
 - 9    National Replacement Character sets.
 - 15   Technical characters.
 - 16   Locator port.
 - 17   Terminal state interrogation.
 - 18   User windows.
 - 21   Horizontal scrolling.
 - 22   ANSI color, e.g., VT525.
 - 28   Rectangular editing.
 - 29   ANSI text locator (i.e., DEC Locator mode).


about chatGPT three steps

📚 The doc issue
hello author！
I don't know training correspondence.  Maybe My understanding is wrong 。
In /applications/ChatGPT)/examples/ , as far as I think:
'Train with dummy prompt data' is first step of chatGPT,
'Train the reward model' is second step of chatGPT,
but I dont't know the three step by RLHF using Pre-training language model with reward model，and what is about 'Train with real prompt data' step ?

同问，我也想知道如何用ColossalAI实现ChatGPT的三步训练。

I think 'Train with dummy prompt data' is the 3rd step of chatGPT,

我也有同样的问题，求指教

I think 【train_prompts.py】 is the first step to train SFT, 【train_reward_models.py】 is the second step to train RM,
【train_dummy.py】 uses PPO training, initial_model uses the model of the first step, critic_model uses the model of the second step, so this is the RLHF of the third step. As for train_prompts.py, PPOTrainer is also used. Initial_model and critic_model can use the original pre-trained model. I don’t know if this is the case.

I think 【train_prompts.py】 is the first step to train SFT, 【train_reward_models.py】 is the second step to train RM, 【train_dummy.py】 uses PPO training, initial_model uses the model of the first step, critic_model uses the model of the second step, so this is the RLHF of the third step. As for train_prompts.py, PPOTrainer is also used. Initial_model and critic_model can use the original pre-trained model. I don’t know if this is the case.

thank you for your reply

I think train_prompts.py is the last step. As for the first step, it doesn't seem to be provided in the code and is introduced as a pre-trained model in a later step. We can train it in a fine-tuned way.

Looking at the paper, the first and second steps use prompt data, and the last step does not seem to require prompt data. I'm not sure either. In addition, do you know how to use the trained model for inference or deployment prediction?

The train_dummy.py is copy from train_prompts.py, with only one line of code added for generating dummy data.
As we can see by the figure in the paper, the third step uses the prompt data and the gpt3 model to generate some results, and then uses reinforcement learning to learn how to choose better responses. So I think that the third step is actually doing prompt training as well.
As for the model training, I am also exploring it, and there is a lack of data at the moment. If you are interested, we can stay in touch～

Looking at the paper, the first and second steps use prompt data, and the last step does not seem to require prompt data. I'm not sure either. In addition, do you know how to use the trained model for inference or deployment prediction?

I think inference like GPT2, it also predicts word one by one, Then load last trained model can be inference  like GPT2

As for the model training, I am also exploring it, and there is a lack of data at the moment.

ok,my qq:805650606

Thanks for your reply!

Now that we need do the finetune(1st) step by ourselves. Do you know any finetune code that could be integrated into this project?

I think train_prompts.py is the last step. As for the first step, it doesn't seem to be provided in the code and is introduced as a pre-trained model in a later step. We can train it in a fine-tuned way.

Now that we need do the finetune(1st) step by ourselves. Do you know any finetune code that could be integrated into this project?

I think train_prompts.py is the last step. As for the first step, it doesn't seem to be provided in the code and is introduced as a pre-trained model in a later step. We can train it in a fine-tuned way.

Now that we need do the finetune(1st) step by ourselves. Do you know any finetune code that could be integrated into this project?

Training with the Transformers framework is relatively simple, and there are plenty of tutorials on the web for fine-tuning, or you can refer to the official documentation

Thank you for your feedback, and sorry about late reply.
And in /applications/ChatGPT)/examples/  ,we have 3 examples :
train_dummy  -> show the vanilla way to start training step 3.
train_prompts -> use prompts to train in training step 3
trian_reward_model -> to train rm in training step 2
Because training step 1 is a simple supervised finetune progress as many other models, we don't implement it here.

Thank you for your feedback, and sorry about late reply. And in /applications/ChatGPT)/examples/ ,we have 3 examples : train_dummy -> show the vanilla way to start training step 3. train_prompts -> use prompts to train in training step 3 trian_reward_model -> to train rm in training step 2 Because training step 1 is a simple supervised finetune progress as many other models, we don't implement it here.

thanks! Could you pls add a vanilla infer code for chatgpt?

Could you show this simple SFT code ?

i have the same problem，too~Could you show this simple SFT code ?

Hi @graciechen @wqw547243068 @cloudfool We have updated a lot. Please check the latest code and doc.
https://github.com/hpcaitech/ColossalAI/tree/main/applications/Chat/examples
This issue was closed due to inactivity. Thanks.


fix: better wording, styling

Description
This PR introduces minor fixes to the wording, styling, and phrasing of existing tutorials. ~Currently blocked by #154~

@leohhhn
Please merge in the main changes into this PR branch

@zivkovicmilos do you know why the Gno Test CI does not run?


Improved batching for code loading (#4362)

Pull request opened by the merge tool on behalf of #4362

Pull request rejected by merge tool. The tests for this branch did not succeed.

Merged into branches iso5 in c7793b59868e0b62d522cef29b71dabda803c983


Automated cherry pick of #11389

Add ServiceAccount as an alias for ServiceAccountName in the v1 API.
Addresses #11380, the consistent failure in #11355.

+cc @zmerlynn / @brendandburns (unsure who is release czar)

Cross-link #11389.

LGTM!


gltf_baker doesn't bake tangent space normal maps

gltf_baker should generate normal/bent normal maps in tangent space. Right now it takes the normals computed by libray and just writes them to PNG as is. They should at least be encoded to fit in 0..1 instead of -1..+1.

Let me know if there is significant interest in reviving the tool, its usage message still describes it as an AO baking tool but the UV wrapping was very dodgy and we sort of gave up on it.
On a related note I wonder if we should consider moving projects like this and Tungsten into a separate repo outside of Filament since they are somewhat experimental.

We should definitely move those projects out if we're not going to maintain it. Actually I would recommend we do a big sweep of samples/ in general and ditch the ones that are not useful. If we do move gltf_baker out we may want to consider moving OpenImageDenoise and libray as well. Anything we do to shorten build times is nice.
We should also stop backing an IBL + FlightHelmet in gltf_viewer (shorter build times, smaller executables) and move gltf_viewer to tools or at least install it in bin in our release packages. It is a genuinely useful app and good example of Filament. material_sandbox should be given the same treatment I think. It's a good showcase of what Filament can do.
lightbulb, frame_generator and sample_full_pbr should move to a test directory. They're really useful for us during development and nothing else. All the vk_* samples should probably be renamed because they're not really Vulkan specific.
What do you think?

BTW the only reason I looked at gltf_baker and filed this bug is because I'm implementing support for bent normal maps. I have other tools I can use to bake bent normals so I don't need this one. But in case it worked… :)

Your plan for samples/ sounds great, the only part that I dislike is removing the default IBL from the viewer, personally I find it helpful. Moreover the fact that we invoke cmgen in the build has helped us catch issues in the past.  As a compromise maybe we could add a CMake option for this feature.

gltf_baker has been removed but exists in our history.


Test event production without defining a subject

As reported on Slack
I received a undefined method topic' for #<Model ... error when writing come model specs in my Rails app because my model was producing Kafka events.
The source of the bug seems to be related to this line which forces me to define my test subject as a Karakfa testing consumer instead of an instance on my model class.
But as I do not consume any event from the topic on which I produce the event I am unable to use the consumer_for helper and have to define test double to avoid the bug
@mensfeld wrote this in response to my question

need to decommission the subject from consumer reference and then for consumer specs use the subject but otherwise direct reference

 NoMethodError:
       undefined method `topic' for #<Visit id: "02d1b80e-4eae-4143-bde3-51ddc9a447a9", visited_at: "2022-10-19 09:04:58.147965000 +0000", visitor_id: "7e44f979-692d-4a4f-9ea8-03bdd2113e19", page_path: "0.3938326796841043">

I can repro with the example rails app. Trivial to fix.

@NotGrm works on my side but just to be sure: https://github.com/karafka/karafka-testing/pull/103 can you test this branch?
I added this case in the examples app repo to cover for any future cases. Once confirmed :ok: will merge and release.

@mensfeld it is ok for me. Thanks a lot 🚀


tf.keras.Model() behaves incorrectly if inputs is a dictionary view

System information.

Have I written custom code (as opposed to using a stock example script provided in Keras): Yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 20.04.5 LTS
TensorFlow installed from (source or binary): binary
TensorFlow version (use command below): 2.10
Python version: 3.9
Bazel version (if compiling from source): n/a
GPU model and memory: n/a
Exact command to reproduce: see below

Describe the problem.
tf.keras.Model() does not always correctly map input tensors to input layers for models with multiple inputs.
Describe the current behavior.
As demonstrated in the code example below, the ability to correctly map input tensors to model input layers by layer name stops working silently as soon as (i) the inputs argument of tf.keras.Model() is a dictionary-value view and (ii) the inputs are not provided in ascending order (by layer name).
Describe the expected behavior.
The expectation was that either all cases covered in the code example pass without error or that tf.keras.Model() fails (raises an exception) when receiving unsupported inputs.
Contributing.

Do you want to contribute a PR? (yes/no): not planned, but would consider it after aligning on how the issue should be addressed
If yes, please read this page for instructions
Briefly describe your candidate solution(if contributing):

Standalone code to reproduce the issue.
import numpy as np
import tensorflow as tf

def run_test(*, use_plain_list: bool, sort_dict: bool):
    data_in = {
        "a": np.array([1, 3], dtype=np.float64).reshape((1, 2,)),
        "b": np.array([1, 2, 3], dtype=np.float64).reshape((1, 3)),
    }

    input_a = tf.keras.layers.Input((2,), name="a")
    input_b = tf.keras.layers.Input((3,), name="b")
    output = tf.keras.layers.Dense(1, name="output")(input_b)

    inputs = {}
    # Note how input layer names (= dict keys) are not in ascending order
    inputs["b"] = input_b
    inputs["a"] = input_a
    if sort_dict:
        inputs = {
            key: inputs[key]
            for key in sorted(inputs.keys())
        }
    model = tf.keras.Model(
        inputs=(
            list(inputs.values()) if use_plain_list else inputs.values()
        ),
        outputs=output,
    )
    model.compile(loss="mse", optimizer="adam")

    print(model(data_in).numpy().item())

if __name__ == "__main__":
    print("[PASSES] Passing inputs as plain list and sorted by name")
    run_test(use_plain_list=True, sort_dict=True)
    print("[PASSES] Passing inputs as plain list, although not sorted by name")
    run_test(use_plain_list=True, sort_dict=False)
    print("[PASSES] Passing inputs as dict-value view, but sorted by name")
    run_test(use_plain_list=False, sort_dict=True)
    print("[FAILS] Passing inputs as dict-value view and not sorted by name")
    run_test(use_plain_list=False, sort_dict=False)

Source code / logs.
The script above can probably be used as a basis for creating relevant unit-test cases.
Log output:
2022-10-13 15:32:01.051111: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-10-13 15:32:01.163823: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2022-10-13 15:32:01.163876: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2022-10-13 15:32:01.186457: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2022-10-13 15:32:01.631140: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory
2022-10-13 15:32:01.631221: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory
2022-10-13 15:32:01.631248: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
[PASSES] Passing inputs as plain list and sorted by name
2022-10-13 15:32:02.104453: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2022-10-13 15:32:02.104524: W tensorflow/stream_executor/cuda/cuda_driver.cc:263] failed call to cuInit: UNKNOWN ERROR (303)
2022-10-13 15:32:02.104549: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (LAPTOP-URBMT3GM): /proc/driver/nvidia/version does not exist
2022-10-13 15:32:02.104892: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
-1.3255137205123901
[PASSES] Passing inputs as plain list, although not sorted by name
2.081906318664551
[PASSES] Passing inputs as dict-value view, but sorted by name
1.242689609527588
[FAILS] Passing inputs as dict-value view and not sorted by name
Traceback (most recent call last):
  File "/home/marek/src/debug-tf/test_view_issue.py", line 43, in <module>
    run_test(use_plain_list=False, sort_dict=False)
  File "/home/marek/src/debug-tf/test_view_issue.py", line 32, in run_test
    print(model(data_in).numpy().item())
  File "/home/marek/.local/share/virtualenvs/debug-tf-TD15A9yo/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/home/marek/.local/share/virtualenvs/debug-tf-TD15A9yo/lib/python3.9/site-packages/keras/engine/input_spec.py", line 277, in assert_input_compatibility
    raise ValueError(
ValueError: Exception encountered when calling layer "model_3" "                 f"(type Functional).

Input 0 of layer "output" is incompatible with the layer: expected axis -1 of input shape to have value 3, but received input with shape (1, 2)

Call arguments received by layer "model_3" "                 f"(type Functional):
  • inputs={'a': 'tf.Tensor(shape=(1, 2), dtype=float64)', 'b': 'tf.Tensor(shape=(1, 3), dtype=float64)'}
  • training=None
  • mask=None

@gowthamkpr I was able to replicate the issue on colab, please find the gist here. Thank you!

@pikulmar - Apologize for the delay in getting back on this issue.
I think there's an error in the logic.  When the run_test gets input that use_plain_list=False, you want to pass inputs directly and not convert to inputs.values().  So Model definition line becomes -
    model = tf.keras.Model(
        inputs=(
            list(inputs.values()) if use_plain_list else inputs
        ),
        outputs=output,
    )

This fixes the issue you were having.  Also, if you add tf.keras.utils.set_random_seed(10), at the start of the run_test function, you can also verify that it will give same answer in for all four input variations.
Hope this resolves the issue for you and sorry for the delay in my response.
I will close this issue now.  If this doesn't resolve it, please re-open it.

@sampathweb Thank you for your reply. I am aware that passing as dictionary for inputs works. However, I still think the current behavior could be improved. With the above definitions, the following works:

Model(inputs=inputs, ...): passing a dictionary for inputs, works as expected.
Model(inputs=list(inputs.values()), ...): passing a list for inputs, also works as expected.
Model(inputs=inputs.values()), ...): passing the result of dict.values(), which is a view object (not a list) for inputs. This seems to work at first, but behaves incorrectly when calling the model. Since such errors can be confusing and hard to identify for users, it would appear more user-friendly if TensorFlow would either raise an error in this case, or internally convert list-like types into plain lists.


Automated Package Upgrade

:tada: This PR is included in version 2.2.47 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


std.algorithm.sorting.partition has many issues

jack (@JackStouffer) reported this on 2016-06-14T06:43:09Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=16170
Description
* The SwapStrategy.semistable branch does not call save for result, therefore this breaks with forward ranges
* The SwapStrategy.unstable !isDynamicArray branch does not call save for result, therefore this breaks with forward ranges
* The SwapStrategy.unstable !isDynamicArray branch requires a bidirectional range, only forward range primitives are tested for
* is(typeof(swap(result.front, r.front))) is never tested for

A lot of this stems from the fact that arrays are the only means of testing for this function

github-bugzilla commented on 2016-09-30T15:43:23Z
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/e21f2729ba3f99605c7db5572c96ad83b1b7ae86
[Issue 16170] Seperate std.algorithm.sorting.partition into various overloads in order to facilitate further improvements

https://github.com/dlang/phobos/commit/b2978040ca3c0f061f283e4f433507b635337efb
Merge pull request #4429 from JackStouffer/issue16170

[Issue 16170] Partial Fix for Broken std.algorithm.sorting.partition

github-bugzilla commented on 2016-10-01T11:47:32Z
Commits pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/e21f2729ba3f99605c7db5572c96ad83b1b7ae86
[Issue 16170] Seperate std.algorithm.sorting.partition into various overloads in order to facilitate further improvements

https://github.com/dlang/phobos/commit/b2978040ca3c0f061f283e4f433507b635337efb
Merge pull request #4429 from JackStouffer/issue16170


DistortionRGB = 0 ( d415)

Dear support,
I have used "CustomRW -r " to get an xml of a d415 camera,
the file generated includes the following section

1

1920
1080

1381.06
1380.51

960.317
500.743

        **0
0
0
0
0**

the values for DistortionRGB seem wrong ...
can someone please explain them ?
( running ubuntu 16.04, Firm ware  : <IP_ADDRESS>,
librealsense2.so.2.9.1 ( otherwise  CustomRW will not run) )
thanks,
Omer.

Please see #1430

I have reviewed #1430, and accept the answer written there.
can you please also shed some light on

960.317
500.743
a. the value  500.743 is a bit surprising since its very far from half of the total number of pixel on axis y (1080)
b. should the values for  PrincipalPoint change for different resolutions?
and if so, can i use CustomRW to generate them ? ( i did not see a that CustomRW has a resolution parameter).
Thanks,
Omer.

i see that github has altered my last post.
the values i received for PrincipalPointRGB are : 960.317,500.743.
Omer.

[Realsense Customer Engineering Team Comment]
hi @omerbrandis,
for your question a) it seems a bit far from 540, but calibration handled this.
b), i don't think the value change for different resolutions.

[Realsense Customer Engineering Team Comment]
hi @omerbrandis,
do you need more support on this?


SDK integration issue in application

Hi, I have tried to follow your provided SDK integration document but I'm facing some issues while doing all the processes. I have drag and drop both Resources.bundle and paytabs-iOS.framework into my project. After that, I have updated info.plist file and added #import <paytabs-iOS/paytabs_iOS.h> header file in my Bridging header class also i have change the Other Linker Flag as mentioned in the document. Now when I clean and build the project it shows me error of Pods file not found. I have installed all the pod files mentioned in the document and when i try to run the application it shows me error message of Pod file not found.
Why is it so, i have followed each n every steps as mentioned in the document. What am i missing in that?

These are the errors i'm facing. Please help me in that.

@Hamza123Imran In case if you are using OCR version, please add the following dependency
pod 'PayCardsRecognizer'

I have tried with OCR and without OCR by commenting the OCR pod file. But whenever i try to do all setup as mention in document, i face an error that Pod file not found

Hi hamza, please try our samples available on github with your account (merchant id & secret key).
if the error still appears, please produce the issue with a sample app and forward the sample to us with same results, logs, dependencies and third party libraries

and provide the below information for further investigations,,,,
environment (Xcode version,device IOS version etc), and which programing (Swift, Java, etc)

HI @Walid-033 the xcode version is Version 11.3.1 (11C504), Device is Iphone 11 Max Pro

@Walid-033 there might be no issue with your sample application, that is not our issue at all, the issue is when we integrate the Paytabs SDK in our application its not getting integrated, and i have explained the issue in detail email.
My initial assumption is its due to conflicting dependencies i.e. Reachability , IQKeyboardManager , ReachabilitySwift, IQKeyboardManagerSwift.
1: When we exclude ReachabilitySwift, IQKeyboardManagerSwift in pod file our project wouldn't run.
2: IF we exclude Reachability , IQKeyboardManager  Paytabs Sdk gives error missing header files.
3: When we include both we get this error.

Hi hamza, please try our samples available on github with your account (merchant id & secret key).
if the error still appears, please produce the issue with a sample app and forward the sample to us with same results, logs, dependencies and third party libraries

I can use it, if my error get remove. First issue i'm facing is regarding pod file not found.
I have integrated SDK in both existing project and new project but face same errors.

@Hamza123Imran  You can't exclude our dependencies, otherwise SDK will not work, you are using same dependencies with swift flavor,

@Hamza123Imran You can't exclude the SDK dependencies, and you are using same dependency but with Swift flavor, for example https://github.com/tonymillion/Reachability, it is required by the SDK, also it supporting Swift, so you can remove ReachabilitySwift and modify your app to fit Reachability, it should fix your conflict.

Please use the latest version 4.0.8 https://github.com/paytabscom/paytabs-ios-library-sample/tree/master/sdk

Hello team
i integrated successfully apple pay with paytabs payment gateway but i have a error
Response Code: 4001
Response Result: The request is not properly formatted.
Tokenization Cutomer Email:
Tokenization Customer Password:
TOkenization Token:
please help us as soon as possible
Thanks
Ashish

I am trying to pay with paytabs I am using paytabs v4.0.8-lite(ios) version but when I click on pay button nothing happens.i am using simulator 8(13.3)  and xcode 11.3
Please help


Updated mpb bar progress bars

This fixes a bug when downloading from an origin for the first time and a weird error message shows up. Turns out the package needed some updating. This took some time since the function we originally had for v7 no longer existed in v8. Also changed around the styling a tad and made it look nice and work with this new version upgrade. Removed what I thought was an unnecessary extra bar being made to say "done". Also found a typo to be fixed within handle_http.

Hey @joereuss12, it looks like something that was changed is causing the Test action to throw this:
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x8115ec]

Can you investigate and let me know when you've patched things back up?

@jhiemstrawisc just updated with some more changes too. I can undo the log level if needed depending on how Brian responds to the issue I made (#135) and I'll make a note in the issue to revert it back if needed.


LAUNCH ANY OTHER WORLD AND MAP

Whenever I run the code it works fine with turtlebot3_world.launch.py file, but i want to launch turtlebot3_dqn_stage4.launch.py file, mean i want to launch any other built-in map.
What changes should i make in the existing code to launch the other world?

You could just make a copy of turtlebot3_world.launch.py and modify the function generate_launch_description() where it creates the variable world. You would need to point where is the world file that you want to launch.

Would you mind closing this issue as answered if my reply helped out?


Doesn't honor base path config

Base path has been set to '/' but got following:
<!doctype html>
--
  | <html lang="en" xmlns="http://www.w3.org/1999/html">
  | <head>
  | <meta charset="utf-8">
  | <title>Cloud Products</title>
  | <base href="/productinfo/">
  | <meta name="viewport" content="width=device-width, initial-scale=1">

Hi @estahn, could you please provide some context: how did you start the application (docker, docker-compose or you built it yourself)

Yes, that would make it easier :)
I used the helm chart with the following config:
  - name: flippant-waterbuffalo
    namespace: devops
    chart: banzaicloud-stable/productinfo
    version: 0.4.5
    values:
      - ingress:
          enabled: true
          hosts:
            - productinfo.example.com
          tls:
            - secretName: ***
              hosts:
                - productinfo.example.com
        providers:
          amazon:
            enabled: true
            awsAccessKeyId: ***
            awsSecretAccessKey: ***

We're using helmfile

Same with the curl command in the UI, it doesn't use the actual hostname of the installation. I guess this will need to be passed in, e.g. baseURL.
Get the same result with cURL:curl -L -X GET 'https://banzaicloud.com/productinfo/api/v1/providers/amazon/services/compute/regions/ap-southeast-2/products'

Hi @estahn,
We fixed our image and released 0.4.1 version.
If you want to use with the helm chart, you should set app.basePath value like this.
    namespace: devops
    chart: banzaicloud-stable/productinfo
    version: 0.4.6
    values:
      app.basePath: /yourpath
      ...


Security contact

Is there a preferred security contact for this project?

Hi! I don't see how there's anything security-relevant here? You can write it here, or in the worst case if you're really worried we can try to chat somewhere.

This is a funny side project, written in about ten minutes. If you didn't notice that, then I'm worried about the quality of your research.
Closing, as there is no actual issue.


Hello world frontend

Get the main page to load with a hello world

pushed up with original frontend setup


Changing path doesn't change file/folders to reflect new path

Describe the bug
If you look at my config below I have

        path: '{{path}}/{{path}}'
        preview_path: '{{path}}'

So it saves the article this way:

slug

slug.md
images.jpg

To Reproduce
Add my settings.
Then create a new post. path: slug1

slug1

slug1.md
images.jpg

Change path to slug 2
File and folder is still named under previous name.

slug1

slug1.md
images.jpg

Expected behavior

slug2

slug2.md
images.jpg

Also branch name is still slug1 instead of slug2
Screenshots

Applicable Versions:

Netlify CMS version: "netlify-cms-app": "2.13.1",
Git provider: gitlab (AWS lightsail bitnami)

CMS configuration
# https://www.netlifycms.org/docs/gitlab-backend/
backend:
  name: gitlab
  repo: root/site.com
  branch: master
  api_root: https://mygitlab.com/api/v4
  base_url: https://mygitlab.com/
  auth_type: implicit
  app_id: 222
  auth_endpoint: oauth/authorize
# Where to save image
media_folder: src/content/images/cms
# Prefix image url (gatsby-remark-relative-images staticFolderName + media_folder = image)
public_folder: /images/cms
publish_mode: editorial_workflow
collections:
  - name: default
    label: Default
    folder: src/content/pages
    create: true
    media_folder: ''
    public_folder: ''
    path: '{{path}}/{{path}}'
    preview_path: '{{path}}'
    fields:
      - { name: path, label: Path, widget: 'string' }
      - { name: createdAt, label: Created Date, widget: 'datetime' }
      - { name: updatedAt, label: Last Updated Date, widget: 'datetime' }
      - { name: title, label: Title, widget: 'string' }
      - { name: description, label: Description, widget: 'string' }
      - { name: keywords, label: Keywords, widget: 'string' }
      - { name: tags, label: Tags, widget: 'list' }
      - { name: featuredImage, label: Featured Image, widget: 'image' }
      - { name: content, label: Show on home page, widget: 'boolean', default: true }
      - { name: body, label: Body, widget: 'markdown' }

Note the path: '{{path}}/{{path}}'. This will create pr with the name /slug1/slug1/, maybe having that slash breaks? but sometimes works... so should be something else.
Additional context

Hi @stevemarksd, this is intended as changing the file path will most likely break existing published URLs in static site generators.
This is discussed in https://github.com/netlify/netlify-cms/issues/445. Closing this issue in favour of #445


RC v.2.0

Support react@18, react-dom@18, react-leaflet@4

Storybook isn't supporting react@18
https://github.com/storybookjs/storybook/tree/next/app/react

react-hooks-testing-library isn't supporting react@18
https://github.com/testing-library/react-hooks-testing-library


Namespace prop on TemplateMessage

Hi, is this namespace prop required?
https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages#template-object
Here it says if is opcional on local api, I can't find a good doc for cloud api
https://developers.facebook.com/docs/whatsapp/business-platform/changelog#on-premiseswa2412

Hi again @jrrcdev! 👋
I'll review it as soon as I get home!!
Thanks by the way! 😁


[ci] Fix verible lint action version

Fixes the CI that was broken by #22257
Unlike other actions, the tag is called v2.0 and not v2. See https://github.com/chipsalliance/verible-linter-action/tags for tags.
I've checked the fix on my own fork here: https://github.com/jwnrt/opentitan/pull/13

Superseded by https://github.com/lowRISC/opentitan/pull/22287 which will also prevent this kind of breakage happening again (for this action at least)


Undefined method safe_append

Kaminari master, rails 5.
I have an error.
ActionView::Template::Error (undefined method `safe_append=' for "":ActiveSupport::SafeBuffer):
     6:     remote:        data-remote
     7:     paginator:     the paginator that renders the pagination tags inside
     8: -%>
     9: <%= paginator.render do -%>
    10:   <nav class="pagination">

   21:     def paginate(scope, options = {})
=> 22:       paginator = Kaminari::Helpers::Paginator.new(self, options.reverse_merge(:current_page => scope.current_page, :total_pages => scope.total_pages, :per_page => scope.limit_value, :remote => false))
   23:       paginator.to_s
   24:     end

It will render if you change output_buffer like that before to_s
    def paginate(scope, options = {})
      paginator = Kaminari::Helpers::Paginator.new(self, options.reverse_merge(:current_page => scope.current_page, :total_pages => scope.total_pages, :per_page => scope.limit_value, :remote => false))
      paginator.output_buffer = ActionView::OutputBuffer.new
      paginator.to_s
    end

@onemanstartup Hmm, I cannot reproduce the error. Could you show me what's in your Gemfile?

@amatsuda I have a big Gemfile 😄  I removed some.
gem 'rails',  '~> 5.0.0.beta4' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'pg',     '~> 0.18'        # Use postgresql as the database for Active Record
gem 'bcrypt', '~> 3.1.7'       # Use ActiveModel has_secure_password
gem 'redis',  '~> 3.0'         # Dependency for ActionCable, Sidekiq
gem 'hiredis'
gem 'devise', github: 'plataformatec/devise' # User authentication
gem 'aasm'                     # State machine
gem 'puma'                     # Use Puma as the app server
gem 'pundit'                   # Authorization for actions
gem 'russian' # Russian localization
gem 'http_accept_language'
gem 'friendly_id', github: 'norman/friendly_id' # For slugs
gem 'babosa' # For friendly_id transliterate russian title
gem 'mailgun_rails'                          # Mailing
gem 'shrine'                                 # File Upload
gem 'simple_form'
gem 'turbolinks', '~> 5.0.0.beta'
gem 'datagrid'
gem 'responders'

gem 'kaminari', github: 'amatsuda/kaminari' # Pagination
gem 'faraday'

I use pagination with datagrid.

Thanks for the fix @onemanstartup I ran into the same problem

+1

I'm sorry I'm still not able to reproduce this situation. More info needed. :eyes:

I have the exact same problem. I'm pretty sure this is some sort of dependency issue.

Same error happens for me if quantity of records is over 25(default for pagination),  @dpedoneze's  commit do the trick 👍  what do you think @amatsuda ?

Same issue rails 5, mongoid master, kaminari-mongoid

paginator.output_buffer = ActionView::OutputBuffer.new fixed this

We do not believe we should fix this issue until we fully understand what the root cause is. It would be fantastic if any of you could provide with an example that replicates the bug.

@Fudoshiki  where does that line go?

I have the same problem, but unfortunately my code base is not public so I cannot share it.
However, here's a handy copy-pasta monkey patch for anyone needing it..
# put somethwere, like #{RAILSROOT}/config/initializers/kaminari_monkey_patch.rb
module Kaminari
  module ActionViewExtension
    def paginate(scope, options = {})
      paginator = Kaminari::Helpers::Paginator.new(self, options.reverse_merge(:current_page => scope.current_page, :total_pages => scope.total_pages, :per_page => scope.limit_value, :remote => false))
      paginator.output_buffer = ActionView::OutputBuffer.new
      paginator.to_s
    end
  end
end

I got this issue when I used slim-rails OR haml-rails.
I have no problem with erb.
Here is my version
GIT
  remote: git://github.com/amatsuda/kaminari.git
  revision: be3a2c9a2182fae145e7ff88223feb4d55ed539d
  specs:
    kaminari (1.0.0.alpha)
...
    rails (<IP_ADDRESS>)
...
    slim (3.0.7)
      temple (~> 0.7.6)
      tilt (>= 1.3.3, < 2.1)
    slim-rails (3.1.0)
      actionpack (>= 3.1)
      railties (>= 3.1)
      slim (~> 3.0)

OR
    haml (4.0.7)
      tilt
    haml-rails (0.9.0)
      actionpack (>= 4.0.1)
      activesupport (>= 4.0.1)
      haml (>= 4.0.6, < 5.0)
      html2haml (>= 1.0.1)
      railties (>= 4.0.1)

I also experienced this problem.
It was caused by using Kaminari in HAML.
Thank you for the monkeypatch @pirkka.
I have created a minimal Rails application that demonstrates the issue:
https://github.com/sampierson/kaminari_bug_804

the same problem
gem 'slim-rails'
gem 'kaminari', github: 'amatsuda/kaminari', branch: 'be3a2c9a'

I'm not sure of the cause, but here is some basic information I've gathered:

Rails has SafeBuffer and OutputBuffer.  SafeBuffer provides a safe_concat method.  OutputBuffer inherits from SafeBuffer.  OutputBuffer aliases safe_concat as safe_append, but SafeBuffer does not.

Issue #11 was concerned with instantiating a buffer when one was not already intialized by the template.  The code for this fix has, I think, migrated to Paginator#initialize.  Specifically: @output_buffer = template.output_buffer.class.new.

The implication of these two points, and the monkey patches in this thread, is that a SafeBuffer is being instantiated where an OutputBuffer should be.  However, I can't see where that is.  From a brief code search, HAML seems to choose OutputBuffer.
It is also unclear to me where the call to safe_append occurs.  safe_append doesn't appear in the kaminari or HAML code base.  It's only invoked in the Rails code base in the context of ERB templates, which neither kaminari nor HAML delegate to, that I can see.

An error
ActionView::Template::Error (undefined method `safe_append=' for "":ActiveSupport::SafeBuffer):
     6:     remote:        data-remote
     7:     paginator:     the paginator that renders the pagination tags inside
     8: -%>
     9: <%= paginator.render do -%>
    10:   <nav class="pagination">
    11:     <%= first_page_tag unless current_page.first? %>
    12:     <%= prev_page_tag unless current_page.first? %>

My current Gemfile
gem 'rails', '~> 5.0.0', '>= <IP_ADDRESS>' # <IP_ADDRESS>
gem 'puma', '~> 3.0' # 3.6.0

gem 'kaminari', github: 'amatsuda/kaminari', branch: 'be3a2c9a'
gem 'slim-rails', '3.1.1'
gem 'slim', '3.0.7'
gem 'temple', '0.7.7'
gem 'tilt', '2.0.5'

this patch works for DEV env
module Kaminari
 module ActionViewExtension
   def paginate(scope, options = {})
     paginator = Kaminari::Helpers::Paginator.new(self, options.reverse_merge(:current_page => scope.current_page, :total_pages => scope.total_pages, :per_page => scope.limit_value, :remote => false))
     paginator.output_buffer = ActionView::OutputBuffer.new
     paginator.to_s
   end
 end
end

But for production it doesn't. I think, because of some magic related to Rails initialization process in production mode, maybe something like config.eager_load = true. Not sure. I will check.
But definitely problem exists.

I still can't understand why it doesn't work on production mode.
Best solution which I've found is create erb template and don't use paginate methid in SLIM template
notes/index.slim
= render(template: 'notes/paginate', locals: { items: @notes })

paginate.html.erb
<%= paginate items %>

I think, @amatsuda use erb template for development, that is why it's impossible to reproduce this bug.

So sorry for the breakage. Just pushed a workaround for the issue, so I hope the current master would work for both Haml and Slim.


LDAP Connector Search for >= JSON format

Fixes E-875

@ruthryi , isnt this change applicable to 400 as well?


Update info about enabling rangefeeds

Updated Enable Rangefeeds section:

Removed outdated info about changefeeds that collect changes by
periodically sending a request for any recent changes. Rangefeeds have
been the only type of changefeed available since at least v19.2
Moved the Enable Rangefeeds section to be higher on the page since
it's required for changefeeds to work

Closes #8003

This change is

Online preview: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/d543e67977b6a381daa2c82526fe76ed0d9e57a9/
Edited pages:

v19.2/change-data-capture.md
v20.1/change-data-capture.md
v20.1/stream-changefeed-to-snowflake-aws.md
v20.2/change-data-capture.md

Online preview: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/297342c1b6d2498f26f6e928cecfc6adafafc53b/
Edited pages:

v19.2/change-data-capture.md
v20.1/change-data-capture.md
v20.1/stream-changefeed-to-snowflake-aws.md
v20.2/change-data-capture.md

Online preview: http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/da5838282ba74cef3cbde04ab9081eb4de7bbbc0/
Edited pages:

v19.1/change-data-capture.md
v19.2/change-data-capture.md
v20.1/change-data-capture.md
v20.1/stream-changefeed-to-snowflake-aws.md
v20.2/change-data-capture.md


tons of errors with non-magnet files

My console is full of this and I've not been getting any of my feed for days:
10/10/16 17:11:29.537 com.giorgiocalderolla.Catch.CatchFeedHelper[23970]: Could not download http://reflektor.karmorra.info/torrent/ED01562FC20BF203BDDE461FD80EC3FF7843390C.torrent: Error Domain=com.giorgiocalderolla.Catch.CatchFeedHelper Code=-7 "Could not download file (bad status code 404)" UserInfo={NSLocalizedDescription=Could not download file (bad status code 404)}
I switched my feed to magnet links and 20-ish things showed up immediately... BUT:
Magnets aren't a good solution to this problem, as my data is all on an external disk and not always plugged in to my laptop. Firing up Transmission without that disk winds up pausing all of the existing torrents (which need to be manually resumed) and then new torrent tries to write to a disk path that doesn't exist, and corrupts.
Further, webloc files aren't recognized by Transmission, so disabling the "Open automatically" preference just seems to break things further.
Is it possible to have multiple sources to check?
OR, is it possible to have a setting that only checks if a path exists? (I'm starting to like this one)
OR, am I missing something?

So couple things:

webloc files work fine with Transmission, in the sense that double-clicking one will open Transmission and start downloading.
What do you mean by "multiple sources"?
Catch should already skip checking if the output folder is invalid. It checks for its existence and writability, before even attempting to check the feed. https://github.com/mipstian/catch/blob/master/CTCScheduler.m#L125

For whatever reason, github was down for the PNW last night.... I'm back:

webloc files might open in transmission, but they don't get picked up via the directory scanning mechanism... double-clicking one might be fine... but what about twenty? Bad workflow.
This might be from showrss, not from catch... but I was hoping there could be multiple sources for the torrent files so if one goes wonky, you have a backup plan.
I don't want Catch to check the output folder (well, I do, but that's not what I'm requesting). I want to be able to specify my transmission download folder, and not have catch check until that path exists (ie, transmission can start up and start downloading w/o errors).

The more I think about it the more I really like 3. I haven't coded on an OSX project in a long time, but I could take a rough stab at it to get the idea across.

Open automatically exists precisely to avoid launching stuff manually! Saving files and using some dir scanning is no substitute.
ShowRSS yeah, and afaik it's not so much an issue of finding the sources, it's they just don't exist because .torrent files are problematic.
There's no way that I know of to tell Transmission where to download. Not to mention Catch is supposed to work with any torrent client.

So, why not just set Catch's output folder to the external drive and use Open automatically?

I don't know what you mean by "Saving files and using some dir scanning is no substitute". As I said originally, open automatically is problematic. I'm in my cafe right now. I don't have my external disk attached, and Catch just fired off a magnet, opened Transmission, and invalidated all the missing torrents. Had I left it open, it would have tried to download the magnet file to a path that doesn't exist and corrupted after writing the first block.

Totally possible, see https://transmissionbt.com/help/gtk/2.3x/html/preferences.html#downloading

Further, This isn't about Transmission. Regardless of whatever client I'm using, I'm going to be using an external disk. I just want catch to be smarter so that if, for example, "/Volumes/Media" isn't mounted, then it shouldn't check for torrents yet. The path is arbitrary. It is no different than the time restrictions for Catch.
I hadn't thought of setting Catch to output to the external drive. Right now it goes to my downloads folder, which fits my mental model of the pipeline that I'm working through (web -> Downloads -> Transmission -> torrents folder -> process folder -> file or watch).
I still think this would be a good feature addition. Do you not?

I know you can set Transmission's download folder in its preferences, I meant it can't be done programmatically. As far as I know, you can't pass a .torrent file or magnet link to Transmission and tell it where to download its contents.
I don't think this feature would make sense as it's just a redundant and more roundabout way of using the app as intended. Meaning: using magnet links, open automatically, and setting your download folder to where you want stuff to be downloaded to.
I think the wording in Catch could be improved though. When the last update fails, we should have a reason for the failure in the UI. And in a case like this, it should probably say "skipped" instead of "failed", and mention that the download folder isn't available as a reason for skipping.
Additionally, the app currently pops up its configuration panel on launch if the download folder is invalid, which doesn't perfectly support your use case.

Your first two paragraphs make me think that we're talking past each other.
I agree that it would be nice if Catch would differentiate between skipping and actually invalid updates. That would be nice. In my case, I think they were actually invalid updates (when I was fetching real torrent files).

Additionally, the app currently pops up its configuration panel on launch if the download folder is invalid, which doesn't perfectly support your use case.

Where "doesn't perfectly support" means "totally messes up"? If I'm understanding correctly, you are suggesting a workaround to my feature request to set up Catch to save to the external disk, as opposed to the default Downloads folder, even tho I'm using magnets, so it won't check until the disk is available... but if the disk isn't there when catch starts up (which it NEVER is), it'll bring up its preferences every time. Is that a correct understanding? That's an anti-workflow if ever I heard of one.
Versus: add a preference to Catch to allow users to specify where their torrents actually are (not where the torrent files to be fed to their clients are downloaded) and add 1 extra boolean check next to the time range checker to see if the directory currently exists.

So what I hear you saying is the only problem you see with my solution is that the dialog pops up (please correct me if I'm wrong). That is really easy to change. Way easier than to add a new setting – not that that's hard, it's just hard by comparison. Most importantly though, having another setting is way more consequential.
Also to clarify, the dialog would pop up when Catch launches (which generally happens at login), not when it checks every 10m. In my personal use, that translates to about once a month. The problem is more that currently, an unreachable path is considered "invalid configuration", so the app won't accept it. We should change that logic so invalid paths don't invalidate the whole configuration, and specifically check for invalid paths (on top of the configuration validity) before checking the feed. That's a two-line change.
Torrent files are on their way out: they are almost unfeasible today with ShowRSS, and it's not gonna get any better. Even if you had the setting as you described, you would still get 404s. So we gotta make magnets work.
I think it's reasonable to have Catch skip checks when the download folder is unavailable, whether it's used to write torrent files or not. We could even have the UI say "Catch will skip checking if this location becomes unavailable" next to the setting.

Having just travelled for 2 weeks I gotta say...
I feel even more strongly that the feature I'm suggesting is the right way to go. NOT checking and NOT opening magnets unless an destination of interest is available is the right thing for the average user. This has nothing to do with transmission and everything to do with Catch not playing well with others.
I'm not in a position to do this PR (no xcode, been years)... but I can take a first stab at it if that helps relieve pressure.

That (skipping checks when the folder isn't available) is what I've proposed as well. The difference between our proposals is that you want to have two different settings, one for where to download the .torrent files to, and one where to download their contents to. I just want to use the existing setting. Because .torrent files are unviable as it is and I'm being told it's not gonna get any better, having two settings doesn't make sense to me. In a magnet-only world there are no .torrent files. At best, we might be able to tell the torrent client to output to the folder chosen in Catch.
How does having two folder settings help?
No need to PR, in fact I was gonna make this change and upload an alpha build so anybody can try it out. The enhanced messaging (i.e. "Check skipped because download folder isn't available" or similar) will come later, but there will be a message in Console. Sounds good?

@zenspider try this alpha and let me know how it goes, I think it'll suit your use case: https://github.com/mipstian/catch/releases/tag/2.0-alpha1


Introducing namespaces

We want to create namespaces because you and I like Faker and want to keep the library organized and easy to use. Besides that, we need to determine great taxonomy to maintain and scale our modules.
I'm going to start suggesting a few namespaces for the current modules.
Faker.Bitcoin => Faker.Blockchain.Bitcoin

Faker.Cat => Faker.Creature.Cat
Faker.Team => Faker.Creature.Team
Faker.Team.En => Faker.Creature.Team.En

Faker.Pokemon => Faker.Fiction.Pokemon
Faker.Pokemon.En => Faker.Fiction.Pokemon.En
Faker.StarWars => Faker.Fiction.StarWars
Faker.StarWars.En => Faker.Fiction.StarWars.En
Faker.Superhero => Faker.Fiction.Superhero
Faker.Superhero.En => Faker.Fiction.Superhero.En

Faker.Beer => Faker.Objects.Beer
Faker.Beer.En => Faker.Objects.Beer.En

I'll try to come with taxonomy for the other modules soon. Feel free to suggest a few good namespaces. Your ideas are always welcome.
Faker.Address
Faker.Address.En
Faker.Address.Es
Faker.App
Faker.Avatar
Faker.Cat.En
Faker.Code
Faker.Code.En
Faker.Color
Faker.Color.En
Faker.Color.Es
Faker.Color.PtBr
Faker.Commerce
Faker.Commerce.En
Faker.Company
Faker.Company.En
Faker.Date
Faker.DateTime
Faker.File
Faker.Food
Faker.Food.En
Faker.Gov.Us
Faker.Industry
Faker.Industry.En
Faker.Internet
Faker.Internet.En
Faker.Internet.Es
Faker.Internet.PtBr
Faker.Internet.UserAgent
Faker.NaiveDateTime
Faker.Name
Faker.Name.En
Faker.Name.Es
Faker.Name.PtBr
Faker.Nato
Faker.Phone.EnUs
Faker.Phone.EnGb
Faker.Pizza
Faker.Random
Faker.Random.Elixir
Faker.Random.Test
Faker.String
Faker.Util
Faker.UUID

Lorem already looks ok, doesn't it?
Faker.Lorem
Faker.Lorem.Shakespeare
Faker.Lorem.Shakespeare.En
Faker.Lorem.Shakespeare.Ru

I'm not sure how I feel about additional namespacing. It doesn't seem incredibly intuitive to me. I'd never think to look for StarWars under Fiction. It's also adding additional vertical space that I think is unnecessary.
Just my $0.02. 😄

I think it's quite good idea to extend a little bit the namespaces as you suggest @vbrazo, We could prevent to have overwritten modules. I can take this task of the suggested namespaces you provided if you want.


esp32c3: improve memory utilization

Change the layout of MCUboot segments to increase the memory available in the user application.
This will reduce the difference of available memory between the simple boot and MCUboot app builds.

Fixing https://github.com/zephyrproject-rtos/zephyr/issues/73400

It requires https://github.com/zephyrproject-rtos/zephyr/pull/73816


fix(challenges): Update stock price checker sample project URL and add proxy info

Updated sample project URL and added information about a proxy for stock price information.

[x] I have read freeCodeCamp's contribution guidelines.
[x] My pull request has a descriptive title (not a vague title like Update index.md)
[x] My pull request targets the master branch of freeCodeCamp.
[x] None of my changes are plagiarized from another source without proper attribution.
[x] All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
[x] My changes do not use shortened URLs or affiliate links.

Closes #18023 and https://github.com/freeCodeCamp/freeCodeCamp/issues/17818

Thought I should update the URLs for the other languages while I was at it. Also made a couple of minor changes to the test text here. If these changes are approved I'll update the Glitch project to match.

Thank you for reviewing this @Manish-Giri. Also a big thank you to @Em-Ant for not only fixing this project, but also for building a proxy for the stock price API.


Pip version error

Installing via pip (latest version - 1 day old) results in an error:
C:\Users\dd>pip install deepy
Collecting deepy
Downloading deepy-0.1.4.tar.gz (94kB)
100% |################################| 98kB 330kB/s
Complete output from command python setup.py egg_info:
Using gpu device 0: GeForce GTX 970M
Traceback (most recent call last):
File "", line 20, in
File "c:\users\ddofer\appdata\local\temp\pip-build-vtis_g\deepy\setup.py", line 12, in
requirements = open(os.path.join(os.path.dirname(file), 'requirements.txt')).read().strip().split("\n")
IOError: [Errno 2] No such file or directory: 'c:\users\dd\appdata\local\temp\pip-build-vtis_g\deepy\req
uirements.txt'
----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in c:\users\ddofer\appdata\local\temp\pip-build-vtis_g\deepy

Fixed in commit 3e5fbd450e42e38c81aa3a879229c1ccccbf6df2


diff view does not do merge properly

do diff, apply edits from A <- B, etc, do Save -- results are not right -- lots of stuff missing..  need a better strategy here!

fixed this


Move kube-proxy to use authed-port instead of readonly-port.

Want to retire readonly port.  Also wanted by GKE.

In cluster/saltbase/salt/kube-proxy/default change --master=http://" + grains.api_servers + ":7080 to --master=https://" + grains.api_servers + ":6443, etc
add a line like fs.StringVar(&s.AuthPath, "auth_path", s.AuthPath, "Path to .kubernetes_auth file, specifying how to authenticate to API server.") to proxy command.
add a line like cmd/kubelet/app/server.go:236:	authInfo, err := clientauth.LoadFromFile(s.AuthPath) to proxy cmd.`.
set {% set auth_path = "--auth_path=/var/lib/kubelet/kubernetes_auth" -%}
e2e test it.

Bonus: fix other distros.

cmd/kube-proxy/app/server.go does BindClientConfigFlags, but there is no flag to set the Token
Options:

change kube-proxy to do clientauth.LoadFromFile(filename) to load a kubernetes_auth file, like kubelet does.  @jlowdermilk didn't you have some reason to not like continued use of kubernetes_auth files?  Does that only apply to human/desktop clients, or also to in-pod clients?
add a flag --token= which BindClientConfigFlags will use.  Don't like this one because it is putting secret on the command line where it may accidentally be pasted, or otherwise seen.
add a TokenFile option to client.Config which tells the Client to read just the token from a file.  Make BindClientConfigFlags be able to set this with a --token-file argument.  Problem here is need to define a new file format.
@deads2k should kube-proxy be using pkg/client/clientcmd and if so how?

The motivation for deprecating kubernetes_auth files is mainly that they complicate loading rules when used with kubeconfig files. Even if they didn't, I think there is value in having one consistent way of storing and loading auth config, and that way should probably be kubeconfig.
I would go with #4. It should be fairly easy to have the kubeproxy load the token from a kubeconfig file, and change the salt rule to manage a kubeconfig file instead of a kubernetes_auth file.

@jlowdermilk
Should I do

{ "config":  { "users" : [ {...} ] } } or
{ "config":  { "contexts" : [ {"user" : { ... } } ] } }

If the second one, what do I say for the cluster name?  Not sure that is readily available in the place where I want to generate this file.
Can I do:

"user" : {"authPath" : "/var/lib/kubelet/kubernetes_auth" }
or do I need to do "user" : {"token" : "asdfk" }

You can load a kubeconfig directly from a single file using:
	loader := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeConfigFile}, &clientcmd.ConfigOverrides{})

@erictune, it's probably simplest to just load the auth bits from kubeconfig to start. We can consider loading endpoint data (i.e. "cluster") for the master later if it makes it cleaner.
You could specify an authPath, but that would counter the goal of using kubeconfig and not kubernetes_auth. I'd recommend a kubeconfig that looks like
apiVersion: v1
kind: Config
users:
- name: kubelet
  user:
    token: asdfk

Then in cmd/kube-proxy/app/server.go, you can load and access the token with
config := clientcmd.LoadFromFile("/path/to/kubeconfig")
token := config.AuthInfos["kubelet"].Token

@deads2k, is the loader actually necessary if you just want to load a single file without merge rules? I think the above should work fine, but pls correct if I'm wrong.

@jlowdermilk LoadFromFile does not resolve relative paths (if it did, you'd never be able to know what the file actually contains).  If you have references to certs and keys, you might need to use clientcmd.ResolveLocalPaths.

@jlowdermilk
We aren't doing node upgrades yet, right?  Because changing the auth file format and changing what format the kubelet and kube-proxy expect would require that the upgrade change them both at once.

@deads2k @jlowdermilk
Okay, so if I do:
config := clientcmd.LoadFromFile("/path/to/kubeconfig")
I get a "pkg/client/clientcmd/api".Config.  How do I turn that into a "pkg/client".client?

Oh, I need to do:
loader := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeConfigFile}, &clientcmd.ConfigOverrides{})

and then do:
client := client.New(loader.ClientConfig())
Wow that is a lot of work to make a client!

The minimum file that is usable appears to be this:
apiVersion: v1
kind: Config
users:
- name: kubelet
  user:
    token: abc123
clusters:
- name: local
  cluster:
     server: https://kubernetes-master:6443
     insecure-skip-tls-verify: true
contexts:
- context:
    cluster: local
    user: kubelet
  name: onlycontext
current-context: onlycontext

A bit more verbose that I had hoped for.

Wow that is a lot of work to make a client!

If you have a config in memory, you can use clientcmd.NewDefaultClientConfig(), but that won't resolve paths relative to a file location.  We just recently started tracking LocationOfOrigin for stanzas, so I think we have sufficient information to make a cleaner load method now.  Just a thought, but I don't think I'll be able to get to that in the short term.

@erictune: @mbforbes is working on upgrade testing right now. That said, if we happen to break it ... I'm not sure anyone would run you through the ringer.

been working on this for last few days.  just hitting one stumbling block after another with salt and startup scripts.

Fixed by  #7303


Fix issue #574

thanks @ehooo , tested ok for me, you just ave a PEP8 violation to fix up:
E501 line too long (87 > 79 characters)
                    if getattr(withitem.optional_vars, 'id', None) == self.var_name.id:
                                                                               ^


TransactionView: AddressTableLookupMeta

Problem

Task in #2255

Summary of Changes

Parse MessageAddressTableLookups

Fixes #

rebased sinced CI was skipping and i couldn't figure out how to get it to re-run jobs...

rebased sinced CI was skipping and i couldn't figure out how to get it to re-run jobs...

Sometime I need to re-login to buildkite to make the rerun button available. Perhaps you were in similar situation

Sometime I need to re-login to buildkite to make the rerun button available. Perhaps you were in similar situation

Ah no, it was the github-side CI tasks. Usually there's a re-run button, but there wasn't 🤷♂


[CELEBORN-969][HELM] Allow user set priorityClass used by celeborn pods

What changes were proposed in this pull request?
Allow user set priorityClass used by celeborn pods
Why are the changes needed?
Allow user set a proper priorityClass to avoid unwanted evict happens.
Does this PR introduce any user-facing change?
No, default values change nothing.
How was this patch tested?
Run test locally before make a pull request
helm template test charts/celeborn > new_rendered.yaml && diff old_rendered.yaml new_rendered.yaml

Thanks, merging to main/0.3


TransactionTimePeriod - should it be public constructor?

Describe the bug
I'm trying to create a new transaction using the SDK but I keep running in to an error:
{
    "field": "billing_period.starts_at",
    "error": "Invalid type. Expected: string, given: object"
},
{
    "field": "billing_period.ends_at",
    "error": "Invalid type. Expected: string, given: object"
}

Here is my transaction logic:
$transactionData = new CreateTransaction(
    items: $items,
    customerId: $this->transaction->customer->paddle_id ?? null,
    addressId: $this->transaction->address->paddle_id ?? null,
    businessId: $this->transaction->business->paddle_id ?? null,
    currencyCode: new CurrencyCode(
        $this->transaction->currency_code
    ),
    collectionMode: new CollectionMode(
        $this->transaction->collection_mode
    ),
    discountId: $this->transaction->discount->paddle_id ?? null,
    billingDetails: new BillingDetails(
        enableCheckout: $this->transaction->enable_checkout,
        paymentTerms: new TimePeriod(
            interval: Interval::from(
                $this->transaction->terms_interval
            ),
            frequency: $this->transaction->terms_frequency,
        ),
        purchaseOrderNumber: $this->transaction->purchase_order_number ?? null,
        additionalInformation: $this->transaction->additional_information ?? '',
    ),
    billingPeriod: TransactionTimePeriod::from([
        'starts_at' => new DateTimeImmutable($this->transaction->starts_at),
        'ends_at' => new DateTimeImmutable($this->transaction->ends_at)
    ]),
    customData: new CustomData([
        'transaction_id' => $this->transaction->id,
        'customer_id' => $this->transaction->customer->id,
    ])
);

// Log the serialized data
Log::info('Transaction Data: ' . json_encode($transactionData));

And the output:
{
    "items": [
        {
            "quantity": 1,
            "price_id": "pri_abc"
        }
    ],
    "customer_id": "ctm_abc",
    "address_id": "add_abc",
    "business_id": "biz_abc",
    "custom_data": {
        "transaction_id": 2,
        "customer_id": 1
    },
    "currency_code": "USD",
    "collection_mode": "manual",
    "discount_id": null,
    "billing_details": {
        "enableCheckout": true,
        "paymentTerms": {
            "interval": "day",
            "frequency": 28
        },
        "purchaseOrderNumber": "TEST-PO-123",
        "additionalInformation": ""
    },
    "billing_period": {
        "startsAt": {
            "date": "2024-08-23 10:07:00.000000",
            "timezone_type": 2,
            "timezone": "Z"
        },
        "endsAt": {
            "date": "2025-08-23 10:07:00.000000",
            "timezone_type": 2,
            "timezone": "Z"
        }
    }
}

I could be completely missing something but I've trawled through the classes and can't get my head around it.
Steps to reproduce

Create a new CreateTransaction method.
Submit via SDK

Expected behavior
I would expect to be able to access the billingPeriod params like so:
billingPeriod: new TransactionTimePeriod(
    startsAt: $this->transaction->starts_at,
    endsAt: $this->transaction->ends_at
)

But I can't because the constructor of the TransactionTimePeriod class is private.
Instead, I have to use the ::from method which causes the serialization error.
I think the constructor on the TransactionTimePeriod class should be public and if you're in agreement I can submit a PR.
Code snippets
No response
PHP version
8.3.10
SDK version
1.1.1
API version
1
Additional context
If there's an intended usage pattern that I may be missing or another recommended approach to avoid this issue, please let me know.

Hey @dutypro I think you are correct, thank you so much from opening a PR to fix this, I will approve it and bump the version ❤

@dutypro  closing this issue, changes got released see v.1.1.2 release, thanks again for your contribution.


swift ios app - string.numberByEvaluatingString()

Hi,
I am new to swift ios programing and I have a issue using numberByEvaluatingString().
Basically, if I input something like "ln3" without the bracket or like "3++++3", the app will crash... Is there a way to prevent the app from crashing if wrong input is entered? Thanks!

If your app is crashing, then you're not using the API correctly. Without seeing your code or see the crash log, I can't tell you why.
However, both the 1.1 and the 2.0 branch parse both of those examples correctly.

Thanks for replying! My code is simply the following:
let result = inputText.text.numberByEvaluatingString().doublevalue
where inputText is a textview.
The error message is the following (when evaluating "9+++"):
error: Error Domain=com.davedelong.ddmathparser Code=10 "no right operand to binary +" UserInfo={NSLocalizedDescription=no right operand to binary +}
fatal error: unexpectedly found nil while unwrapping an Optional value
(lldb)
The code will crash the app if wrong format is being entered such as "ln(5", "3++++1", "2+", etc...
I just need the app not crashing when wrong format is entered. Is there something like "On Error Resume/Goto" stuff in Swift?

After reviewing your Unit Test for Issue 108, I think I found a way around it...
Can I just put guard in front of my code?
guard let result = inputText.text.numberByEvaluatingString().doublevalue else {return}
in this way, the app seems not exiting...

Hm, interesting; I'm not sure what the issue would be, and since this is the Objective-C code, it's not worth my time to investigate it.
Instead of using master and the Objective-C code, I would recommend using the 2.0 branch, which contains the entire parser re-written in Swift, and packaged as a framework.


Q: Inscription dates potentially should show up in the summary on the inscription page

If you look at the code for the USEP collectioN.xml template, it seems to be displaying the indexed dates of the inscription. However, this doesn't show up. see l. 34 in https://github.com/Brown-University-Library/usepweb_project/blob/master/usep_app/usep_templates/collectioN.html
This display seems to be set in https://github.com/Brown-University-Library/usepweb_project/blob/master/usep_app/views.py on line 96 where show_dates is set to false.
I'm curious if it would display the dates if it were set to true, or if it was turned off because we aren't yet indexing the dates. As I can't see the solr.xsl file, I can't check.

This isn't for the collection page, it should apply to the summary at the top of an individual inscription page. Prob handled by display xsl.

I think this belongs in the data repo. closing


Convert try-catch to assertThrows

There are many instances in our tests where we expect an exception to be thrown and use a try-catch block to ensure that it is. An example (where IllegalArgumentException will be thrown upon calling new Range(tr)) looks like this:
    try {
      new Range(tr);
      fail("Thrift constructor allowed invalid range");
    } catch (IllegalArgumentException exc) {
      /* good! */
    }

This way if the expected exception is thrown, the catch block catches it and does nothing, otherwise the test will fail via the fail() statement. While this works, it can be more effectively handled using assertThrows(). Preserving functionality, the example above would be converted to:
    assertThrows("Thrift constructor allowed invalid range", IllegalArgumentException.class,
        () -> new Range(tr));

These instances were found using the ErrorProne profile from #2447 with -Xep:TryFailRefactoring added as an arg in the ErrorProne plugin section in the pom.

For those interested, this command will run all the tests touched by these changes:
mvn clean verify -Dit.test=MultiTableBatchWriterIT,UsersIT,KerberosIT,AccumuloOutputFormatIT,AccumuloInputFormatIT,DeleteFailIT,ScannerContextIT,SampleIT,ThriftBehaviorIT,ConditionalWriterIT,NativeMapIT,CloneIT,ExistingMacIT,CleanUpIT,LargeSplitRowIT,ShellServerIT,LocatorIT,ConcurrentDeleteTableIT,BulkNewIT,CredentialsIT -Dtest=TransactionWatcherTest,SourceSwitchingIteratorTest,TransformingIteratorTest,RootTabletStateStoreTest,CertUtilsTest,CombinerTest,RFileTest,VisibilityEvaluatorTest,DeletingIteratorTest,SingletonManagerTest,FormatterConfigTest,AccumuloInputFormatTest,InMemoryMapTest,AddressUtilTest,TTimeoutTransportTest,ColumnSliceFilterTest,LocalityGroupUtilTest,RowIteratorTest,ScannerOptionsTest,RangeTest,TableOperationsHelperTest,Upgrader9to10Test,TabletFileTest,AccumuloOutputFormatTest,FilterTest,TabletLocatorImplTest,SortedLogRecoveryTest,CredentialsTest -Dspotbugs.skip -Dtimeout.factor=1

The ErrorProne plugin also pointed out a test that looks like it is not behaving as intended.
https://github.com/apache/accumulo/blob/3ea979d5971016b9c2512a96cc5b6bd5d1969b2e/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java#L348-L359
It looks like the test is expecting the the call to recover() to fail and if it doesn't, the test will fail via the call to fail(). But in this case, the fail() statement will be caught as a Throwable and not cause the test to fail when reached, Functionally, the whole try catch block does nothing more than call recover(). I'm not certain im interpreting this correctly but if I am, I'm not sure how to handle this case.

It looks like the test is expecting the the call to recover() to fail and if it doesn't, the test will fail via the call to fail(). But in this case, the fail() statement will be caught as a Throwable and not cause the test to fail when reached, Functionally, the whole try catch block does nothing more than call recover(). I'm not certain im interpreting this correctly but if I am, I'm not sure how to handle this case.

Yeah, ErrorProne is correct. fail(), like all the JUnit assertions, triggers an AssertionError that is caught and reported. We shouldn't be catching Throwable here, because it will also catch and ignore that AssertionError. We should only catch Exception, at most. We need to figure out which exception is expected, and use assertThrows with that directly like you've done with the others.

The call to recover() doesn’t throw any error. I forgot to mention that.
On Mon, Feb 7, 2022 at 7:41 PM Christopher Tubbs @.***>
wrote:

It looks like the test is expecting the the call to recover() to fail and
if it doesn't, the test will fail via the call to fail(). But in this
case, the fail() statement will be caught as a Throwable and not cause
the test to fail when reached, Functionally, the whole try catch block does
nothing more than call recover(). I'm not certain im interpreting this
correctly but if I am, I'm not sure how to handle this case.
Yeah, ErrorProne is correct. fail(), like all the JUnit assertions,
triggers an AssertionError that is caught and reported. We shouldn't be
catching Throwable here, because it will also catch and ignore that
AssertionError. We should only catch Exception, at most. We need to
figure out which exception is expected, and use assertThrows with that
directly like you've done with the others.
—
Reply to this email directly, view it on GitHub
https://github.com/apache/accumulo/pull/2472#issuecomment-1032093257,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALMD2IIZ3PUPUEIAIMYRTPTU2BREZANCNFSM5NYV4DBA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Dominic Garguilo

I looked through all the instances of fail() manually and I think I changed all that I plan to for this PR. This should be ready for review now.

The ErrorProne plugin also pointed out a test that looks like it is not behaving as intended.
https://github.com/apache/accumulo/blob/3ea979d5971016b9c2512a96cc5b6bd5d1969b2e/server/tserver/src/test/java/org/apache/accumulo/tserver/log/SortedLogRecoveryTest.java#L348-L359
It looks like the test is expecting the the call to recover() to fail and if it doesn't, the test will fail via the call to fail(). But in this case, the fail() statement will be caught as a Throwable and not cause the test to fail when reached, Functionally, the whole try catch block does nothing more than call recover(). I'm not certain im interpreting this correctly but if I am, I'm not sure how to handle this case.

Im still not too sure what to do in this case. I don't think I made it clear originally that the call to recover() does not throw an exception so the test hits the fail() every time (which is caught and ignored). This does not seem like it is the intended behavior of the test - it seems like the test expects the call to recover to throw an exception which does not happen.

Im still not too sure what to do in this case. I don't think I made it clear originally that the call to recover() does not throw an exception so the test hits the fail() every time (which is caught and ignored). This does not seem like it is the intended behavior of the test - it seems like the test expects the call to recover to throw an exception which does not happen.

That's clearly a bug. You could create a new ticket for that. It definitely seems like the expectation is that the method call should fail, and it's not failing. It needs to be tracked down whether it should fail, and why it isn't, or if it shouldn't fail and this test should be removed because it has a faulty premise.

That's clearly a bug. You could create a new ticket for that. It definitely seems like the expectation is that the method call should fail, and it's not failing. It needs to be tracked down whether it should fail, and why it isn't, or if it shouldn't fail and this test should be removed because it has a faulty premise.

I created #2489 to track this issue.

I ran all the unit tests, and all the ITs that were changed, and everything works fine. I did see FateIT fail, but that is known flaky (#2474)


Support for Web Parakeet

https://github.com/WebParakeet
Adding Support for Web Parakeet

@lincanbin Added you to organization https://github.com/WebParakeet

What's that?

A hosting control panel.

@lincanbin This system is similar to cpanel, webmin, or kloxo. I want to add your script to our script installer.

#166

#167

Can you please join my organization?

#168


Add sideEffects: false to dnt.ts.

Codecov Report

Merging #258 (554fb6b) into main (dc8604f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #258   +/-   ##
=======================================
  Coverage   97.65%   97.65%
=======================================
  Files          34       34
  Lines        2260     2260
  Branches      230      230
=======================================
  Hits         2207     2207
  Misses         52       52
  Partials        1        1

Flag
Coverage Δ

unittests
97.65% <ø> (ø)

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