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
4
votes
3 answers

C code: left shift is shifting but dropping top bits

I'm doing a small embedded project where I have 40 bits transferred through a SPI type interface. I pull these bits off of a 32 bit bus and place the upper 32 bits into a uint32_t variable and the lower 8 bits into a uint8_t variable. I'm trying to…
SparkyGuru
  • 43
  • 4
4
votes
1 answer

Shift clicking bootstrap / FlatUI checkboxes

I have this neat script for handling when a user shift clicks from one checkbox to another to select multiples. var last_clicked = null; $("table.multi-select").on("click", "input:checkbox", function (e) { // allow shift clicking var grid =…
roryok
  • 9,325
  • 17
  • 71
  • 138
4
votes
4 answers

How to shift all elements in a table?

I'm trying to think of an easy way to make all elements in a table shift up one. It is for a game I am playing, attempting to switch between all targets in a table! For example, let's say I'm surrounded by three mooks who want to kill me, so I…
Jonathan Picazo
  • 975
  • 3
  • 13
  • 23
4
votes
3 answers

Does "print $ARGV" alter the argument array in any way?

Here is the example: $a = shift; $b = shift; push(@ARGV,$b); $c = <>; print "\$b: $b\n"; print "\$c: $c\n"; print "\$ARGV: $ARGV\n"; print "\@ARGV: @ARGV\n"; And the output: $b: file1 $c: dir3 $ARGV: file2 @ARGV: file3 file1 I…
MeesterMarcus
  • 700
  • 1
  • 9
  • 25
4
votes
2 answers

JavaScript: What is the logic behind the 'shift' method?

Basically, how do you return AND remove the first element of an array WITHOUT using the shift() OR splice() methods(or any other methods for that matter)? thanks in advance!
4
votes
5 answers

C unsigned int array and bit shifts

If i have an array of short unsigned ints. Would shifting array[k+1] left by 8 bits, put 8 bits into the lower half of array[k+1]? Or do they simply drop off as they have gone outside of the allocated space for the element?
Darrel
  • 55
  • 1
  • 1
  • 3
4
votes
3 answers

Left Shift Overflow on 68k/x86?

I heard that the Motorola 68000 and Intel x86 architectures handle overflow from left shifting differently. Specifically the 68k LSL vs. the Intel SAL/SHL assembly instructions. Does anyone know the specifics of this? Do they set different flags, or…
Tony R
  • 11,224
  • 23
  • 76
  • 101
4
votes
1 answer

Time series shift into future with R

I'm trying to shift a time series (zoo object) 7 days (trading week) ahead into future. library(quantmod) getSymbols(c("AAPL"), from="2013-01-01", return.class="zoo") aapl <- Ad(AAPL) tail(aapl) 2013-05-07 2013-05-08 2013-05-09 2013-05-10…
dansan566
  • 91
  • 1
  • 7
4
votes
1 answer

Python: KeyError 'shift'

I am new to Python and try to modify a pair trading script that I found here: https://github.com/quantopian/zipline/blob/master/zipline/examples/pairtrade.py The original script is designed to use only prices. I would like to use returns to fit…
VincentH
  • 1,009
  • 4
  • 13
  • 24
4
votes
1 answer

fourier shift theorem matlab

I'm currently trying to understand the 2d fourier shift theorem. According to what I've learnd so far a translation in the image space leads to differences in phase but not the magnitude in frequency space. I tried to demonstrate this with a little…
Mini
  • 63
  • 1
  • 5
4
votes
1 answer

Shifting data in the SQl table

I have a table containing columns ID, Variant (INT), A1.....A20 (VARCHAR(16)) Can anyone recommend the best method to shift the data in columns starting from X to right, where X is the parameter and column Variant equals to Y (the second…
4
votes
3 answers

Confused about whether I'm passing a scalar or an array to a subroutine in perl?

I've just started learning perl and I am am confused by this exercise (from Learning Perl Chapter 4). At the beginning of the greet() subroutine, I am trying to assign the argument $_ to my $name (my $name = $_) variable but it doesn't work. The…
gozu
  • 159
  • 5
4
votes
5 answers

SHift-click jqgrid multiselect missing last row

I adopted the code from this post and made this fiddle. Try clicking the first row, then shift-clicking the last row. If you notice this code does very well, except the last row, the row that you click on, does not get selected. I have been…
jeffery_the_wind
  • 17,048
  • 34
  • 98
  • 160
4
votes
2 answers

bison shift reduce conflict, i don't know where

Grammar: http://pastebin.com/ef2jt8Rg y.output: http://pastebin.com/AEKXrrRG I don't know where is those conflicts, someone can help me with this?
greenboxal
  • 469
  • 3
  • 16
4
votes
1 answer

C++ array shift to element

Ok the title is not the best but here is what im looking for. int arr[] = {3, 4, 5, 6, 7}; int index = 2; someFunctionICantRemember(int arr, int index); // result {5, 6, 7, 3, 4} I saw this function on www.cplusplus.com but i cant find it anymore.…
user1435915
  • 185
  • 1
  • 1
  • 7