## Views Jump Menu containing only sibling taxonomy terms

I’m using Views Jump Menu with Drupal 9.

Nodes are tagged with a `software_version` hierarchical taxonomy, following this pattern:

``````├── foo
│   ├── 0.1.0
│   └── 0.2.0
├── bar
│   ├── 0.3.0
│   ├── 0.3.1
│   └── 0.4.0
└── baz
├── 0.1.0
├── 0.2.0
└── 0.3.0
``````

The plan is for nodes of a custom Content Type to be tagged with a child term from the list above (the numerical values), generating a jump list containing only the nodes tagged with sibling terms that share the same parent (i.e., only the documentation pages for different versions of the same software).

Under `/admin/structure/views/view/taxonomy_jump_menu/edit`, there’s a Block display of a View which currently returns the entire taxonomy vocabulary, with all parents and children. In other words, the Jump menu links to documentation for all versions of all the different software.

I’ve been hoping that there’s a way in Views to add a Contextual Filter which could determine the taxonomy term TID of the current node from the URL, use that to determine the TID’s immediate parent TID (of which there should only ever be one) and generate a jump menu containing all the children of the parent TID, excluding the parent term itself.

The config for this View is hundreds of lines of YAML, but here is an excerpt (with many irrelevant lines deleted, but indentation preserved):

``````dependencies:
config:
- taxonomy.vocabulary.software_version
module:
- taxonomy
- user
- views_jump_menu
id: taxonomy_jump_menu
label: 'Taxonomy Jump Menu'
module: views
description: ''
tag: ''
base_table: taxonomy_term_field_data
base_field: tid
display:
default:
display_options:
query:
type: views_query
style:
type: jump_menu
row:
type: fields
fields:
parent_target_id:
id: parent_target_id
table: taxonomy_term__parent
field: parent_target_id
relationship: none
group_type: group
exclude: true
tid:
id: tid
table: taxonomy_term_field_data
field: tid
relationship: none
group_type: group
exclude: false
alter:
alter_text: true
text: '/taxonomy/term/{{ tid }}'
name:
id: name
table: taxonomy_term_field_data
field: name
relationship: none
group_type: group
exclude: false
filters:
status:
value: '1'
table: taxonomy_term_field_data
field: status
plugin_id: boolean
entity_type: taxonomy_term
entity_field: status
id: status
expose:
operator: ''
operator_limit_selection: false
operator_list: {  }
group: 1
vid:
id: vid
table: taxonomy_term_field_data
field: vid
value:
software_version: software_version
entity_type: taxonomy_term
entity_field: vid
plugin_id: bundle
expose:
operator_limit_selection: false
operator_list: {  }
group: 1
sorts: {  }
title: 'Taxonomy Jump Menu'
relationships: {  }
arguments: {  }
filter_groups:
operator: AND
groups:
1: AND
``````

There’s plenty more where that came from, but I’m trying to include only salient details!

I do not think this question has a duplicate answer on this forum. The closest I have found are this question which pertains to menus rather than taxonomy (although maybe my problem is that I should be using a Taxonomy Menu here), and this unresolved question which does not include enough detail to know whether it’s relevant.

I have also checked the issue queues for the contrib module, but it really seems to be a limitation of Views itself, which is in core.

I have tried adding `Configure contextual filter: Taxonomy term: Term Parents` to the View, but that unexpectedly generates a jump menu containing only parent terms:

``````├── foo
├── bar
└── baz
``````

At this point, I am starting to think that it will be much easier to write a hook implementation that will modify the query, but this is a hard topic to research online. (My search queries turn up a lot of irrelevant issue queues going back to Drupal 5.)

So, to boil this all down to an answerable question, what hook implementation would be best suited for this task?

I’m leaning toward using `hook_views_query_alter()` to modify the `\$query` object itself (within `\$query->where`) based on this comment, but I’m in pretty deep water here.

## unity – How to make Player consistently jump *to* a specific target rather than *towards* it?

I’m trying to make it so if my player hits “E” then they jump precisely to a specific target. The current code results in player jumping towards the target but not really making it there.

I’ve tried adjusting forceMultiply and ForceMode and adding an offset but I just can’t get a result that simply consistently launches the player’s rigidbody `rb` towards the `anchorPoint` position.

The code I have is:

``````private void Update()
{
if (Input.GetKeyDown(KeyCode.E))
{
tryGrabbing = true;
}
}

private void FixedUpdate()
{
if (tryGrabbing)
{
rb.AddForce(anchorPoint.transform.position * forceMultiply, ForceMode.Impulse);
}
}
``````

Thank you for any help!!

## physics – (Unity 3D) How to make Player consistently jump *to* a specific target rather than *towards* it?

I’m trying to make it so if my player hits “E” then they jump precisely to a specific target. The current code results in player jumping towards the target but not really making it there.

I’ve tried adjusting forceMultiply and ForceMode and adding an offset but I just can’t get a result that simply consistently launches the player’s rigidbody `rb` towards the `anchorPoint` position.

The code I have is:

``````private void Update()
{
if (Input.GetKeyDown(KeyCode.E))
{
tryGrabbing = true;
}
}

private void FixedUpdate()
{
if (tryGrabbing)
{
rb.AddForce(anchorPoint.transform.position * forceMultiply, ForceMode.Impulse);
}
}
``````

Thank you for any help!!

## How to jump to virtual desktop by number

How do I jump to a virtual desktop by number?

Moving between them one by one is too slow by doing

`ctrl` `win` `left`/`right`

## libgdx – Should delta be applied to every change per frame ? (e.g. acceleration, deceleration, jump, etc.?)

I have written a game based on another game’s original physics. I have all the constants the original game used in the Sega Megadrive. For example:

``````float ACCELERATION = 0.03287f;
float DECELERATION = 0.4f;
float FRICTION     = ACCELERATION;
float TOP_SPEED    = 8f;
``````

when the player presses the right button I do:

``````     if (rightPressed) {
speed.x += ACCELERATION * delta; // accelerate

if (speed.x >= TOP_SPEED * delta) {
speed.x = TOP_SPEED * delta; // impose a top speed limit
}
}
...
else { // user is not moving the player (left/right)
speed.x -= Math.min(Math.abs(speed.x), FRICTION * delta) * Math.signum(speed.x);
}
``````

Several lines later:

``````    x += speed.x * delta;
y += speed.y * delta ;

``````

Is the delta here used correctly? Should it appear anywhere as I did or just the moment I set x and y? My understanding is that speed should accelerate according to delta as well.

Another problem I have is that, by using the original game constants, the character moves in slow motion (even if I only have delta at the moment of updating x and y) so I had to multiply all constants by 15000 in order to have normal playing speed. I expected I may have to multiply by 60 (because of the 60 frames per second of Sega Megadrive) but not by 15000.

## linux – How avoid jump line disappear when concat string [BASH]

I want to list all urls contain in all file of my project.

First function `find_url_in_file`, work well –> I have this list

``````https://www.example.com/en/docs/console/my-project/how-to/add-resources-project
https://www.example.com/en/docs/console/my-project/how-to/generate-api-key
https://www.example.com/en/docs/console/my-project/how-to/delete-a-project
https://www.example.com/en/docs/console/my-project/how-to/join-an-organization
``````

Then with second function `find_all_url_in_file`, when it concat it remove all line jump :

``````https://www.example.com/en/docs/console/my-project/how-to/add-resources-projecthttps://www.example.com/en/docs/console/my-project/how-to/generate-api-keyhttps://www.example.com/en/docs/console/my-project/how-to/delete-a-projecthttps://www.example.com/en/docs/console/my-project/how-to/join-an-organization
``````

I want to keep this line break to have a simple clean nice list. How could I do?
(maybe it’s a better idea to use a temp file ?)

``````all_mdx_file=\$(find_all_mdx)

find_url_in_file(){
local file="\${1}"
local url_list=""
grep -Eo '(http|https)://www.xxxxxx.com(^ )>")+' \$file || : |
while IFS= read -r url; do
url_list+="\$url"
done
echo "\$url_list"
}

find_all_url_in_file(){
local file="\${1}"
local list_url=""
while IFS= read -r mdx; do
# echo "mdx read : \$mdx"
url_in_this_file=\$(find_url_in_file \$mdx )
list_url+="\$url_in_this_file "
done <<< "\$file"
}

find_all_url_in_file "\$all_mdx_file"
``````

## pygame jump animation – Game Development Stack Exchange

So, I am trying to learn a little bit of pygame and I really can’t get my little rectangle to jump.Using this code everything seems right to me.First the player should go up, then once jumpcount turns negative, it should go down, but the movement seems more like a rocket that is never going to land.Could someone tell me what’s wrong with my code?

``````def movement():
jump = False
jumpcount = 10
keyspressed = pygame.key.get_pressed()
if keyspressed(pygame.K_w):
jump = True
if jump == True:
if jumpcount>=-10:
player.y -= (jumpcount * abs(jumpcount))*0.5
jumpcount-=1
else:
jump = False
jumpcount = 10

$$```$$
``````

## c++ – SFML – My jump never stops getting higher

Im making a short jump test in sfml. However I have a problem, whenever the jump button is pressed the character will jump but will not fall down. However, in the beginning of the test, I made the sprite above the ground to see if the gravity function worked, but this still happens. Here is a video

Here is my code:

``````#include <SFML/Graphics.hpp>
using namespace sf;

float VelocityX = 0, VelocityY = 0;
float x = 0, y = 0;
int gravity = 2;
float dt;

void movement() {
if (y < 444) {
VelocityY += gravity * dt;
}
else if (y > 444) {
y = 444;
}
x += VelocityX;
y += VelocityY;
}

int main() {
RenderWindow window(VideoMode(800, 600), "jump test");
RectangleShape rect(Vector2f(20, 20));
const int moveSpeed = 500, jumpForce = 10;

Clock deltaTime;
while (window.isOpen())
{
dt = deltaTime.restart().asSeconds();
Event event;

while (window.pollEvent(event)) {
if (event.type == Event::Closed) {
window.close();
}
}

if (Keyboard::isKeyPressed(Keyboard::Right)) {
VelocityX = moveSpeed * dt;
}
else if (Keyboard::isKeyPressed(Keyboard::Left)) {
VelocityX = -moveSpeed * dt;
}
else {
VelocityX = 0;
}

if (Keyboard::isKeyPressed(Keyboard::Space)) {
VelocityY -= jumpForce;
}

movement();
rect.setPosition(x, y);

window.clear();
window.draw(rect);
window.display();
}

return 0;
}
$$```$$
``````