109 questions
1
vote
1
answer
73
views
Compare values in one sheet to alternating columns in another sheet
I'm an absolute beginner to VBA with no coding background, and trying to make a sort of inventory application. I got stucked and tried so many code snippets found on internet to no avail.
I'm trying ...
2
votes
3
answers
83
views
Add alternating background to each row in display grid with grid of posts
I have a full width div which contains a dynamic grid of posts. The number of columns depends on the screen width, the number of rows depends on the number of posts.
I would like to have an ...
2
votes
1
answer
47
views
python dataframe slicing by row number
all Python experts,
I'm a Python newbie, stuck with a problem which may look very simple to you. Say I have a data frame of 100 rows, how can I split it into 5 sub-frames, each of which contains the ...
0
votes
2
answers
52
views
Display WordPress posts in alternating sets of 3 then 2 items
I am struggling to get the following function work properly. I am trying to configure a loop inside WordPress with wrapping every first 3 items in a div. After that it should wrap the next 2 items in ...
0
votes
0
answers
140
views
Script for row-banding alternating every nth rows
I am looking for a google apps script that will alternate row banding color every nth rows (in my case it will be every 7), accounting for a one row header.
I specifically want to use a script so that ...
2
votes
1
answer
35
views
How to alternate capitalizations with RegEX?
I need to change a sentence to have alternating capitalizations! Having trouble making it ignore the spacebar inputs...
input: the quick brown fox jumps over the lazy dog
output: tHe QuIcK bRoWn FoX ...
0
votes
1
answer
916
views
How to alternate between players?
I have to make a card game in which the starting player changes after each round or mini round (up to me to decide) but I have no clue how to alternate between the 2 players. After reading online, I ...
0
votes
1
answer
98
views
How can I traverse a 2D array in an alternating order
I am writing a swift application so this question would be best answered in swift or any other language if the logic is the same.
I have a 2D array and I want to iterate through each even row as ...
0
votes
1
answer
76
views
How to retrieve 2 values at a time from a map - in Python 3.x
This is a Python 2.x function for handling sequences with x, y coordinates; please note that argument ints is of type map:
def IntsToPoints(ints):
result = []
for i in range(0, len(ints), 2):
...
-1
votes
1
answer
7k
views
Minimum alternating binary series count (coin flip problem)
Given N coins in a row, I need to count the minimum changes necessary to make the series perfectly alternating. For example, [1, 1, 0, 1, 1] must become [0, 1, 0, 1, 0] which requires only 2 changes. ...
0
votes
1
answer
133
views
Java MAXIMUM outcomes, while maintaining minimum changes in an alternating binary sequence (coin flip) question
I am having an issue with a fairly common practice problem about identifying duplicates in a binary sequence (commonly called a 'coin flip' problem) and seem to gave difficulty explaining it, so bear ...
0
votes
4
answers
2k
views
Is there any way to alternate between two values in python
Suppose I have a value say Player 1 and Player 2. Can I assign them to a single variable in such a way such that
print("%s choose this piece" %Player_value)
Expected output
Player 1 choose ...
1
vote
1
answer
2k
views
Write a function that merges two lists, alternating elements from both lists. Python code
For example if a = [1, 4, 9, 16] and b = [9, 7, 4, 9, 11], the function returns a new list, result = [1, 9, 4, 7, 9, 4, 16, 9, 11]
This is the code I have so far.
def merge(a,b):
mergedList =[]
...
0
votes
1
answer
3k
views
Kotlin. Merge two list with alternating values [duplicate]
Is there a ready-made solution for creating an list by alternating elements from two list. I understand how this can be done using loops and conditions, but perhaps there is a ready-made extension ...
-1
votes
1
answer
26
views
Python arranging list with for loop
The question along with the solution is posted. But i didn't understand the solution, especially inside the for loop. Can someone elaborate the code for me?
[1]: https://i.sstatic.net/p1Lkp.jpg![enter ...
0
votes
3
answers
1k
views
Check if List is Alternating Values
So I have an array of N size.
I want to first check if the array is of alternating sequence (We are assuming that the numbers are positive and the values are either 1 or 0)
101010 would return true
...
1
vote
0
answers
153
views
ObjectListView / TreeListView: Alternate background color by expandable section
I have a TreeListView control where each root item is expandable, containing an arbitrary number of subnodes. The background color should alternate only at the root level so that all subnodes are of ...
1
vote
1
answer
229
views
Alternate text in AMP
I'd like to have a line of text fade in fast, stay up for about 5 seconds, fade out fast, then have a different line of text fade in fast, stay for about 5 seconds, fade out fast, then have this ...
1
vote
2
answers
229
views
Issue with alternating between parent and child process using POSIX semaphore functions
I'm attempting to create a C program where the counter is incremented by alternating between the parent and child using the POSIX semaphore functions. So far I'm having trouble using it considering ...
0
votes
1
answer
113
views
Anychart Grid Alternating Colors
Is it possible to get alternating row/column colors in the grid?
see image of flash chart
Also, the grid lines in the old chart were exactly on the values, now the values lie exactly between the ...
2
votes
1
answer
115
views
Matlab unit tests alternate between pass and fail (pass "odd" runs, fail on "even")
I have some unit tests for code that is doing some very minor image manipulation (combining several small images into a larger image). When I was running the tests, I noticed that three out of four of ...
-2
votes
3
answers
175
views
Order rows by their column value to create repeating sequences of ascending values [duplicate]
I want to order my associative rows by their column value as sequences of ascending values.
Sample array1:
$args = [
'a' => ['zebra' => 1],
'b' => ['zebra' => 0],
'c' => ['...
1
vote
3
answers
2k
views
Alternating Directions in Python List - More Pythonic Solution
I feel this should be simple but I'm stuck on finding a neat solution. The code I have provided works, and gives the output I expect, but I don't feel it is Pythonic and it's getting on my nerves.
I ...
1
vote
1
answer
120
views
Online Algorithm approach for alternating subsequence
Consider a sequence A = a1, a2, a3, ... an of integers. A subsequence B of A is a sequence B = b1, b2, .... ,bn which is created from A by removing some elements but by keeping the order. Given an ...
-1
votes
4
answers
1k
views
How to sort an array of associative arrays by alternating "gender" value?
I have an array of arrays:
$students= array(
array("name"=>"...", "gender"=>"male"),
array("name"=>"...", "gender"...
1
vote
1
answer
1k
views
How to alternate empty space color in QTreeWidget?
If I type this code
myTree->setAlternatingRowColors(true);
myTree->setStyleSheet("QTreeWidget{alternate-background-color: red;background: green;}");
colors of rows are interleaves. But if a ...
-3
votes
2
answers
1k
views
Alternating patterns in java
Hello in trying to figure out how to make the following pattern in java
xoxox
oxoxo
xoxox
Im recently learning and have been trying to figure it out for hours. Here is the code that i have so far....
3
votes
2
answers
4k
views
How set css to alternating rows in angular 4
I would like to define a class to alternating rows in angular 4, how to do this?
HTML
<div class="scrollbars">
<div *ngFor="let path of Xyzpaths">
<...
-2
votes
5
answers
7k
views
Alternating sums of a list [duplicate]
9.Write a program that accepts 9 integers from the user and stores them in a list. Next, compute the alternating sum of all of the elements in the list. For example, if the user enters
1 4 9 16 9 7 4 ...
2
votes
1
answer
2k
views
merge streams to produce alternating sequence using lambda or Stream API
I have some code which returns a Stream as intended, but maybe it can be replaced with some type of lambda or stream() operation instead of exhausting the iterators in a while loop?
It is just a ...
1
vote
2
answers
2k
views
Alternating Sum Using Foldr/Foldl (Racket)
Back again with another Racket question. New to higher order functions in general, so give me some leeway.
Currently trying to find the alternating sum using the foldr/foldl functions and not ...
0
votes
1
answer
524
views
copy all rows, paste into another worksheet alternating rows with exsiting data on destination sheet)
I am looking to copy/paste values from ws1 to ws2
Specifically, to copy a range of 2 columns of data from FROM Worksheet #1 TO Worksheet #2, pasting in alternating cells, in same column.
Example:
...
0
votes
1
answer
864
views
Splitting number and adding zeros to the left
First, 0's are left attached to the resulting number until the length is a multiple of the entered number ( f.x. int a = 3 -> the length of the number should be the multiple of the number 3). Then i ...
0
votes
3
answers
1k
views
Alternating signs + loops
I'm supposed to recreate this code
public static void main(String[] args) {
// TODO, add your application code
Scanner keyboard = new Scanner(System.in);
System.out.print("Enter an ...
0
votes
2
answers
252
views
oracle query alternating records
I have a table that looks like this:
SEQ TICKER INDUSTRY
1 AAPL 10
1 FB 10
1 IBM 10
1 CSCO 10
1 FEYE 20
1 F ...
-1
votes
1
answer
609
views
Alternating jQuery functions on button click
I'm trying to get a button to alternate 2 functions, doing a different function on each click. This is the code I have:
var count = 0;
$("#pijlrechts").click(function() {
count++;
var isEven =...
0
votes
3
answers
4k
views
R - Alternating colors in barchart
i'm currently trying to write a shiny app. I want to create a barchart with reactive coloring to radiobuttons.
Before i try to get the code for the reactive coloring, i try to test it, so that i get ...
1
vote
0
answers
206
views
WCF client call fails after changing endpoint port
We are facing the following problem. What we have:
1) "Our" ASMX web-services, hosted both on 80 and 8080 ports
2) "Their" unsupported unknown solution which works with our web-services. That is, it ...
0
votes
1
answer
113
views
How to display two alternating pictures according to season?
Due to taking care of my ailing elderly parents, I haven't been able to do website design for a few years. Now I'm extremely rusty and just can't figure too much out anymore.
Inside a div, I want to ...
0
votes
1
answer
970
views
Alternate layout for every loop
In every loop I want to alternate the layout of my blocks, so it would be like this:
Loop 1: Left column image, right column text
Loop 2: Left column text, right column image
But so far all i'm ...
0
votes
2
answers
1k
views
Setting gridview row background colour by alternating by row data type
I have a GridView where I am listing values for client companies. Take for example the grid listed the company name and a value. I want to give a light gray background color to all Company 1's rows, ...
1
vote
3
answers
179
views
How to echo values from two indexed arrays in an alternating fashion?
I have this code:
<?php
$arrayName2 = array('123', '567');
$arrayName3 = array('abc', 'def');
$arrayName[] = $arrayName2;
$arrayName[] = $arrayName3;
foreach ($arrayName as $key) {
foreach($...
0
votes
2
answers
173
views
PHP add different values out of array alternately
Example :
00:00 22-03-2017, John Wilson
08:00 22-03-2017, Gemma Arterton
16:00 22-03-2017, Arnold Plank
00:00 22-03-2017, Timmy Brouwer
08:00 22-03-2017, John Wilson <- names ...
0
votes
1
answer
46
views
Merge two flat arrays in an alternating fashion to create a new flat array [duplicate]
I have two array like this::
$doctor = Array(
[0] => 4
[1] => 5
[2] => 8
[3] => 35
[4] => 41
[5] => 42
)
$clinic = Array(
[0] => 1
[1] => 3
[2] => 9
[3] => 15
[4] => ...
1
vote
2
answers
3k
views
SSRS Alternating colors in groups
I have tried all the expresssions posted for alternating colors in a group but it's not working correctly.
Here is what my report design looks like:
I would like each group row to alternate colors ...
0
votes
1
answer
2k
views
java - Input 2 integer arrays and print alternating elements
Conditions:
both arrays must be in order or error message
the first array must be as long as or longer than the second or error message
if the first is longer than the second it must continue to ...
2
votes
2
answers
158
views
Overflow from div to full width of screen with alternating background color
I am using the modified snippet below from another thread to create a max-width layout, but I'd like to change .flex-parent:after {yellow} to an alternating background color using pseudo selectors as ...
0
votes
2
answers
358
views
Random different colored backgrounds on post grid layout
I am wanting to use this plugin to display blog posts, but instead of having the image as the background, the client wants different colored images. From another post on here I have figured out the ...
-1
votes
2
answers
300
views
String containing alternating words/numbers - printing words according to count [duplicate]
I have a Java string that contains numbers and words interchanged throughout as follows:
String str = "7 first 3 second 2 third 4 fourth 2 fifth"
I need to find a concise way (if possible) to print ...
1
vote
1
answer
133
views
Table Alternating Color nth-child:not(.class) [duplicate]
I have multiple <tr> in a table and some of those are followed by a <tr class="colapsed"> which has some details. Not all the <tr> tags have details.
I need to create alternating ...