Questions tagged [shift]

Questions related to the usage of the right and/or left shift key on the keyboard. For questions regarding bitwise shift operations use [bit-shift]

Questions related to the usage of the right and/or left Shift key on the keyboard. For questions regarding bitwise shift operations use

1054 questions
-2
votes
1 answer

python shift operator uses

Im just learning about pythons bitwise operator << and >>. as far as I see, it takes the binary version of an integer and shifts it n places left or right. that would mean that saying x<
-2
votes
1 answer

what is 0xf1 mean in the code, I am learning shift operators from GeekForGeek

what is 0xf1 mean in the code, I am learning shift operators from GeekForGeek // Masking sign extension class GFG {     public static void main (String[] args) {        char…
-2
votes
2 answers

Why does printing a character variable with %d give a negative value in c?

I tried the following piece of code, expecting the output to be positive 64: char val = 0x80; printf("%d",val>>1); My understanding of what happens is(please correct me if i'm wrong as i probably am): Referring to the ASCII table, there is no…
kiblykat
  • 121
  • 5
-2
votes
2 answers

Shifting an array in a special location using numpy.roll

I have a 256x256 array I want to shift to the right using special row and column. I am using numpy.roll to achieve it. If I use the following code, shift is one column to the right. import cv2 import matplotlib.pyplot as plt import numpy as np #…
rdmato33
  • 1
  • 3
-2
votes
3 answers

Python Pandas update value in row using precedent row value

I have to use precedent row value to calculate new value. I have a lot of rows, i don't want to use loop because it takes a lot of time, i tried with shift but i think it doesn't help me or i probably don't know how to use it. here, little example…
Náthali
  • 937
  • 2
  • 10
  • 22
-2
votes
2 answers

Java Caesar Shift

I've been trying to write a simple Caesar Shift in Java that assumes the user will only enter uppercase letters with no spaces. A becomes Z, B becomes Y and so on. I need to learn how to do this on my own so please dont just write out the code for…
John0121
  • 1
  • 3
-2
votes
2 answers

How LEFT SHIFT and RIGHT SHIFT with binary 1 work?

I know that (10001010<<2) = 00101000 And that (10001010>>2) = 00100010 How to shift when I have only one bit like this (1<<5) and (1>>5)
Listy L
  • 52
  • 7
-2
votes
1 answer

Pandas: add values to two new columns in table if values in two previous columns are continuous?

So, I was trying to accomplish this in SQL but was advised there would be a simple way to do this in Pandas... I would appreciate your help/hints! I currently have the table on the left with two columns (begin subsession and end subsession), and I…
-2
votes
7 answers

Shift array elements

I need some help, I know this question was asked before but I don't get it and I cant solve it, so I need help. I need to move the elements of my array to a position to left. So if the input will be 1,2,3,4,5 then the output will be 2,3,4,5,1. I…
Melin Ven
  • 49
  • 1
  • 1
  • 7
-2
votes
2 answers

IE doesn't seem to like bootstrap modal, it shows up without rounded corners, gray background, and ugliest of all it shifts the entire page down

I am novice in using bootstrap into classic ASP, yes that what I am trying :) And I am struggling with getting the bootstrap modal look the way it looks and behaves in Chrome or Firefox. When I launch the modal dialog in IE 11 I see 1. Corners are…
-2
votes
4 answers

Rotate left verilog case

My task is to write a 16 bit ALU in verilog. I found difficulties when I do the part that needs to rotate the operand and doing the 2's complement addition and subtraction. I know how to work that out by paper and pencil but i cant figure out ways…
Ruka Tsoi
  • 45
  • 2
  • 3
  • 12
-2
votes
2 answers

r matrix individual shift operations of elements

I am trying to optimize some code that I have written as it is very slow for large datasets. I am not sure if the following can be done with matrix operations and I would appreciate if someone had any suggestions to make it faster. I have a matrix…
user2493820
  • 61
  • 2
  • 8
-3
votes
2 answers

C# shift two dimension array fast method

I have a 2D string array in C# and I need to shift that array to left in one dimension how can I do that in efficient way I dont want use nested for and i want an algurithm in O(n) not O(n2) for (int i = 50; i < 300; i++) { for (int j = 0; j <…
mhn_namak
  • 453
  • 1
  • 6
  • 18
-3
votes
1 answer

change character appearance

again, I would need help and specifically with two things im search for all this number , curetly resoluts the first is how to make to this input {51, {'B', 'YZ', 'Y', 'Z', 'ZY', 'A', 'X', 'W'}} this and after the number , I change the comma…
Ion Secred
  • 11
  • 6