Alternative piece movement on a 10x10 board in C - c

I am trying to make the pieces on my board move from left to right and then right to left whenever it moves up a line on the board. I am using 2D arrays to represent the coordinates and pointer arithmetic to manipulate it since we cannot use 2D arrays on the function itself.
while (k <= 11) { //I used K as a marker for the 11 vertical line Im going to make
if (lineOne == 1) {
printf("|");
lineOne = 0;
lineTwo = 1;
k++;
} else if (lineTwo == 1) {
if (row % 2 == 0) { //pointer arithmetic to go through each part of the array
printf("%c%c%c%c", *( * (arrA + row) + col),
*( * (arrB + row) + col),
*( * (arrC + row) + col),
*( * (arrD + row) + col));
col++;
} else if (row % 2 != 0) {
printf("%c%c%c%c", *( * (arrA + row) + col),
*( * (arrB + row) + col),
*( * (arrC + row) + col),
*( * (arrD + row) + col));
col--;
}
lineOne = 1;
lineTwo = 0;
}
}
row++;
divider = 1;
thirdLine = 0;
printf("\n");
These are my initializations
int row = 0, col = 0;
In my head as well, my 2D grid is arranged like this
0
1
2
3
4
5
6
7
8
9
0 1 2 3 4 5 6 7 8 9
This is the output of my code. Dont mind the S, its a bug for another day :(
+----+----+----+----+----+----+----+----+----+----+
|# |S |S |S |S |S |S |S |S |S |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
|- | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
a's turn.
a, press <Enter> to roll.
You rolled a 5
95
95
+----+----+----+----+----+----+----+----+----+----+
|# |S |S |S |S |S |S |S |S |S |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | |a | | | | |
+----+----+----+----+----+----+----+----+----+----+
95
get out
b's turn.
b, press <Enter> to roll.
Here 9 5 are the coordinates I have for that player
As you can see a moved 5 steps to the left when it was supposed to do it from left to right like this
+----+----+----+----+----+----+----+----+----+----+
|# | S| | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | |l | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| |l | S| | | | | | s| |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | |L | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | |l | | |L |S | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | s| | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | s|L | | | | | | | |
|abcd| | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
a's turn.
a, press <Enter> to roll.
+----+----+----+----+----+----+----+----+----+----+
|# | S| | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | |l | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| |l | S| | | | | | s| |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | |L | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | |l | | |L |S | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | | | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | | | | | s| | | | |
| | | | | | | | | | |
+----+----+----+----+----+----+----+----+----+----+
| | s|L | | | | | | | |
| bcd| | | | a| | | | | |
+----+----+----+----+----+----+----+----+----+----+
a rolls a 4!
b's turn
b, press <Enter> to roll.
I just want my pieces to move alternately for each time they move up a Y-axis.

Related

Joining DB tables: repeat values in one table for each group in second table

Students are absent from classes, I have to calculate consecutive absences. 'Date' table has all dates in school year, and indicates if school is in session. Not in session for weekends or holidays. 'Absence' table lists students and the dates they were absent from specific class. I need to list all dates for each 'CLASS' group to see if a class is missed for consecutive days. I have tried CROSS JOIN, couldn't get it to work. Maybe ROW_NUMBER can be used. Any type of solution is welcome!
Date table with dates school is in session. Absence tables with days a student is absent and which class. Last picture is table I want to create. I would like to repeat the dates in the range for each Student/Class group
Try something like the following. You can run this example in SSMS.
DECLARE #Absent table ( stu_id varchar(10), class varchar(10), absent_date date );
INSERT INTO #Absent VALUES
( 'Billie', 'English', '11/03/2020' ),
( 'Billie', 'Math', '11/10/2020' ),
( 'Billie', 'Math', '11/12/2020' ),
( 'Billie', 'Science', '11/19/2020' ),
( 'Billie', 'Math', '11/19/2020' );
DECLARE #InSession table ( CalDate date, InSession bit );
INSERT INTO #InSession VALUES
( '11/02/2020', 1 ),( '11/03/2020', 1 ),( '11/04/2020', 1 ),( '11/05/2020', 1 ),( '11/06/2020', 1 ),( '11/07/2020', 0 ),( '11/08/2020', 0 ),
( '11/09/2020', 1 ),( '11/10/2020', 1 ),( '11/11/2020', 0 ),( '11/12/2020', 1 ),( '11/13/2020', 1 ),( '11/14/2020', 0 ),
( '11/15/2020', 0 ),( '11/16/2020', 1 ),( '11/17/2020', 1 ),( '11/18/2020', 1 ),( '11/19/2020', 1 ),( '11/20/2020', 0 );
SELECT DISTINCT
FORMAT ( s.CalDate, 'MM/dd/yyyy' ) AS CalDate,
s.InSession,
a.stu_id,
CASE
WHEN a.absent_date = s.CalDate THEN a.class
ELSE ''
END AS class,
CASE
WHEN a.absent_date = s.CalDate THEN FORMAT ( a.absent_date, 'MM/dd/yyyy' )
ELSE ''
END AS absent_date
FROM #InSession AS s
CROSS APPLY #Absent AS a
ORDER BY
s.CalDate;
Returns
+------------+-----------+--------+---------+-------------+
| CalDate | InSession | stu_id | class | absent_date |
+------------+-----------+--------+---------+-------------+
| 2020-11-02 | 1 | Billie | | |
| 2020-11-03 | 1 | Billie | | |
| 2020-11-03 | 1 | Billie | English | 11/03/2020 |
| 2020-11-04 | 1 | Billie | | |
| 2020-11-05 | 1 | Billie | | |
| 2020-11-06 | 1 | Billie | | |
| 2020-11-07 | 0 | Billie | | |
| 2020-11-08 | 0 | Billie | | |
| 2020-11-09 | 1 | Billie | | |
| 2020-11-10 | 1 | Billie | | |
| 2020-11-10 | 1 | Billie | Math | 11/10/2020 |
| 2020-11-11 | 0 | Billie | | |
| 2020-11-12 | 1 | Billie | | |
| 2020-11-12 | 1 | Billie | Math | 11/12/2020 |
| 2020-11-13 | 1 | Billie | | |
| 2020-11-14 | 0 | Billie | | |
| 2020-11-15 | 0 | Billie | | |
| 2020-11-16 | 1 | Billie | | |
| 2020-11-17 | 1 | Billie | | |
| 2020-11-18 | 1 | Billie | | |
| 2020-11-19 | 1 | Billie | | |
| 2020-11-19 | 1 | Billie | Math | 11/19/2020 |
| 2020-11-19 | 1 | Billie | Science | 11/19/2020 |
| 2020-11-20 | 0 | Billie | | |
+------------+-----------+--------+---------+-------------+
Note that on 11/19/2020 Billie is marked absent from two classes, creating multiple results for the day.
You will also receive a blank row in addition to an "absent" row on days an absence has been reported. I'm looking to see if I can resolve this part.
UPDATE
Removed the "empty" rows on absent days.
SELECT DISTINCT
s.CalDate,
s.InSession,
a.stu_id,
ISNULL ( x.class, '' ) AS class,
ISNULL ( x.absent_date, '' ) AS absent_date
FROM #InSession AS s
CROSS APPLY #Absent AS a
OUTER APPLY (
SELECT
ab.class, CONVERT ( varchar(10), ab.absent_date, 101 ) AS absent_date
FROM #Absent AS ab
WHERE
ab.stu_id = a.stu_id
AND ab.absent_date = s.CalDate
) AS x
ORDER BY
s.CalDate, stu_id, absent_date;
Returns
+------------+-----------+--------+---------+-------------+
| CalDate | InSession | stu_id | class | absent_date |
+------------+-----------+--------+---------+-------------+
| 2020-11-02 | 1 | Billie | | |
| 2020-11-03 | 1 | Billie | English | 11/03/2020 |
| 2020-11-04 | 1 | Billie | | |
| 2020-11-05 | 1 | Billie | | |
| 2020-11-06 | 1 | Billie | | |
| 2020-11-07 | 0 | Billie | | |
| 2020-11-08 | 0 | Billie | | |
| 2020-11-09 | 1 | Billie | | |
| 2020-11-10 | 1 | Billie | Math | 11/10/2020 |
| 2020-11-11 | 0 | Billie | | |
| 2020-11-12 | 1 | Billie | Math | 11/12/2020 |
| 2020-11-13 | 1 | Billie | | |
| 2020-11-14 | 0 | Billie | | |
| 2020-11-15 | 0 | Billie | | |
| 2020-11-16 | 1 | Billie | | |
| 2020-11-17 | 1 | Billie | | |
| 2020-11-18 | 1 | Billie | | |
| 2020-11-19 | 1 | Billie | Math | 11/19/2020 |
| 2020-11-19 | 1 | Billie | Science | 11/19/2020 |
| 2020-11-20 | 0 | Billie | | |
+------------+-----------+--------+---------+-------------+
UPDATE
So I want the date range, Nov 2 - 20, repeated for every CLASS and every STUDENT included in the raw data.
Try this:
SELECT
CalDate,
InSession,
stu_id,
class,
MAX ( absent_date ) AS absent_date
FROM (
SELECT DISTINCT
CalDate,
InSession,
stu_id,
x.class,
CASE
WHEN x.absent_date = CalDate THEN CONVERT ( varchar(10), x.absent_date, 101 )
ELSE ''
END AS absent_date
FROM #InSession AS i
CROSS APPLY #Absent AS a
OUTER APPLY (
SELECT
ab.class, CONVERT ( varchar(10), ab.absent_date, 101 ) AS absent_date
FROM #Absent AS ab
WHERE
ab.stu_id = a.stu_id
AND ab.absent_date = a.absent_date
) AS x
WHERE
i.CalDate BETWEEN '11/02/2020' AND '11/30/2020'
) AS StudentAbsent
GROUP BY
CalDate, InSession, stu_id, class
ORDER BY
stu_id, class, CalDate;
Returns
+------------+-----------+--------+---------+-------------+
| CalDate | InSession | stu_id | class | absent_date |
+------------+-----------+--------+---------+-------------+
| 2020-11-02 | 1 | Billie | English | |
| 2020-11-03 | 1 | Billie | English | 11/03/2020 |
| 2020-11-04 | 1 | Billie | English | |
| 2020-11-05 | 1 | Billie | English | |
| 2020-11-06 | 1 | Billie | English | |
| 2020-11-07 | 0 | Billie | English | |
| 2020-11-08 | 0 | Billie | English | |
| 2020-11-09 | 1 | Billie | English | |
| 2020-11-10 | 1 | Billie | English | |
| 2020-11-11 | 0 | Billie | English | |
| 2020-11-12 | 1 | Billie | English | |
| 2020-11-13 | 1 | Billie | English | |
| 2020-11-14 | 0 | Billie | English | |
| 2020-11-15 | 0 | Billie | English | |
| 2020-11-16 | 1 | Billie | English | |
| 2020-11-17 | 1 | Billie | English | |
| 2020-11-18 | 1 | Billie | English | |
| 2020-11-19 | 1 | Billie | English | |
| 2020-11-20 | 0 | Billie | English | |
| 2020-11-02 | 1 | Billie | Math | |
| 2020-11-03 | 1 | Billie | Math | |
| 2020-11-04 | 1 | Billie | Math | |
| 2020-11-05 | 1 | Billie | Math | |
| 2020-11-06 | 1 | Billie | Math | |
| 2020-11-07 | 0 | Billie | Math | |
| 2020-11-08 | 0 | Billie | Math | |
| 2020-11-09 | 1 | Billie | Math | |
| 2020-11-10 | 1 | Billie | Math | 11/10/2020 |
| 2020-11-11 | 0 | Billie | Math | |
| 2020-11-12 | 1 | Billie | Math | 11/12/2020 |
| 2020-11-13 | 1 | Billie | Math | |
| 2020-11-14 | 0 | Billie | Math | |
| 2020-11-15 | 0 | Billie | Math | |
| 2020-11-16 | 1 | Billie | Math | |
| 2020-11-17 | 1 | Billie | Math | |
| 2020-11-18 | 1 | Billie | Math | |
| 2020-11-19 | 1 | Billie | Math | 11/19/2020 |
| 2020-11-20 | 0 | Billie | Math | |
| 2020-11-02 | 1 | Billie | Science | |
| 2020-11-03 | 1 | Billie | Science | |
| 2020-11-04 | 1 | Billie | Science | |
| 2020-11-05 | 1 | Billie | Science | |
| 2020-11-06 | 1 | Billie | Science | |
| 2020-11-07 | 0 | Billie | Science | |
| 2020-11-08 | 0 | Billie | Science | |
| 2020-11-09 | 1 | Billie | Science | |
| 2020-11-10 | 1 | Billie | Science | |
| 2020-11-11 | 0 | Billie | Science | |
| 2020-11-12 | 1 | Billie | Science | |
| 2020-11-13 | 1 | Billie | Science | |
| 2020-11-14 | 0 | Billie | Science | |
| 2020-11-15 | 0 | Billie | Science | |
| 2020-11-16 | 1 | Billie | Science | |
| 2020-11-17 | 1 | Billie | Science | |
| 2020-11-18 | 1 | Billie | Science | |
| 2020-11-19 | 1 | Billie | Science | 11/19/2020 |
| 2020-11-20 | 0 | Billie | Science | |
+------------+-----------+--------+---------+-------------+
Solved.
See the last piece of code from Critical Error.

compare two tables in a query taking so long time

I have a a query where i compare 350 rows with other tables which are having 50000 rows it takes 5 minutes to give result.Any faster way to retrieve values get earlier.
select lower(rtrim(substring(rt_queue, 3, 6))) + " Ticor - " + convert(varchar(4), sort_grp_id) + " " + rtrim(batch_no) + ".prn" as FILENAME from tprt_queue where cycle_date >= (select CYCLE from tb_jpachi_cycle) and batch_no <> 'JOBCTR-' and rt_queue not like '%CN%' and status = 'TINTED' and lower(rtrim(substring(prt_queue, 3, 6))) + " Bicor - " + convert(varchar(4), sort_grp_id) + " " + rtrim(batch_no) + ".prn" not in (
select FILENAME from tb_jpachi_filesprocess ) order by rt_dt
This one contains 100000 rows : select FILENAME from tb_jpachi_filesprocess
Later it will increase day by day.
Here is query plan :
QUERY PLAN FOR STATEMENT 1 (at line 1).
STEP 1
The type of query is EXECUTE.
Executing a newly cached statement (SSQL_ID = 230588804).
QUERY PLAN FOR STATEMENT 1 (at line 0).
STEP 1
The type of query is DECLARE.
QUERY PLAN FOR STATEMENT 2 (at line 1).
Optimized using Serial Mode
STEP 1
The type of query is SELECT.
10 operator(s) under root
|ROOT:EMIT Operator (VA = 10)
|
| |RESTRICT Operator (VA = 9)(0)(0)(0)(0)(9)
| |
| | |SEQUENCER Operator (VA = 8) has 2 children.
| | |
| | | |SCALAR AGGREGATE Operator (VA = 1)
| | | | Evaluate Ungrouped ONCE AGGREGATE.
| | | |
| | | | |SCAN Operator (VA = 0)
| | | | | FROM TABLE
| | | | | tb_jpachi_cycle
| | | | | Table Scan.
| | | | | Forward Scan.
| | | | | Positioning at start of table.
| | | | | Using I/O Size 2 Kbytes for data pages.
| | | | | With LRU Buffer Replacement Strategy for data pages.
| | |
| | | |SQFILTER Operator (VA = 7) has 2 children.
| | | |
| | | | |RESTRICT Operator (VA = 3)(0)(0)(0)(6)(0)
| | | | |
| | | | | |SCAN Operator (VA = 2)
| | | | | | FROM TABLE
| | | | | | tprt_queue
| | | | | | Using Clustered Index.
| | | | | | Index : pk_tprt_queue
| | | | | | Forward Scan.
| | | | | | Positioning at index start.
| | | | | | Using I/O Size 16 Kbytes for index leaf pages.
| | | | | | With LRU Buffer Replacement Strategy for index leaf pages.
| | | | | | Using I/O Size 16 Kbytes for data pages.
| | | | | | With LRU Buffer Replacement Strategy for data pages.
| | | |
| | | | Run subquery 1 (at nesting level 1).
| | | |
| | | | QUERY PLAN FOR SUBQUERY 1 (at nesting level 1 and at line 2).
| | | |
| | | | Correlated Subquery.
| | | | Subquery under an IN predicate.
| | | |
| | | | |SCALAR AGGREGATE Operator (VA = 6)
| | | | | Evaluate Ungrouped ANY AGGREGATE.
| | | | | Scanning only up to the first qualifying row.
| | | | |
| | | | | |RESTRICT Operator (VA = 5)(9)(0)(0)(15)(0)
| | | | | |
| | | | | | |SCAN Operator (VA = 4)
| | | | | | | FROM TABLE
| | | | | | | tb_jpachi_filesprocess
| | | | | | | Table Scan.
| | | | | | | Forward Scan.
| | | | | | | Positioning at start of table.
| | | | | | | Using I/O Size 16 Kbytes for data pages.
| | | | | | | With LRU Buffer Replacement Strategy for data pages.
| | | |
| | | | END OF QUERY PLAN FOR SUBQUERY 1.

Need to update "orderby" column

I have a table test
+----+--+------+--+--+----------+--+--------------+
| ID | | Name | | | orderby | | processgroup |
+----+--+------+--+--+----------+--+--------------+
| 1 | | ABC | | | 10 | | 1 |
| 10 | | DEF | | | 12 | | 1 |
| 15 | | LMN | | | 1 | | 1 |
| 44 | | JKL | | | 4 | | 1 |
| 42 | | XYZ | | | 3 | | 2 |
+----+--+------+--+--+----------+--+--------------+
I want to update the orderby column in the sequence, I am expecting output like
+----+--+------+--+--+----------+--+--------------+
| ID | | Name | | | orderby | | processgroup |
+----+--+------+--+--+----------+--+--------------+
| 1 | | ABC | | | 1 | | 1 |
| 10 | | DEF | | | 2 | | 1 |
| 15 | | LMN | | | 3 | | 1 |
| 44 | | JKL | | | 4 | | 1 |
| 42 | | XYZ | | | 5 | | 1 |
+----+--+------+--+--+----------+--+--------------+
Logic behind this is when we have procesgroup as 1, orderby column should update as 1,2,3,4 and when procesgroup is 2 then update orderby as 5.
This might help you
;WITH CTE AS (
SELECT ROW_NUMBER() OVER (ORDER BY processgroup, ID ) AS SNO, ID FROM TABLE1
)
UPDATE TABLE1 SET TABLE1.orderby= CTE.SNO FROM CTE WHERE TABLE1.ID = CTE.ID

Memory Layout Choice of N-Dimensional Array

I've started writing a library for n-dimensional vectors.
There's a couple of design features that I would like to support in this
library:
The memory layout is continuous. This is so that sharing memory, sending over a network, and saving to file is only a matter of passing a pointer.
Different dimensions can support different element sizes (ie [0][0] may be 1 byte while [1][0] may be 2 bytes).
After drawing out some representations of what the memory layout
would look like for vectors of certain dimensions, I've realized that
there is two ways to layout the structure:
Here's the first way. Both representations are a visualization of
a [2][4][3] array.
---------------------------
| index | 0:0:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 1:0:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 0:0:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 0:1:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 0:2:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 0:3:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 1:0:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 1:1:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 1:2:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 1:3:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 0:0:0 |
| Element | |
---------------------------
---------------------------
| Index | 0:0:1 |
| Element | |
---------------------------
---------------------------
| Index | 0:0:2 |
| Element | |
---------------------------
---------------------------
| Index | 0:1:0 |
| Element | |
---------------------------
---------------------------
| Index | 0:1:1 |
| Element | |
---------------------------
---------------------------
| Index | 0:1:2 |
| Element | |
---------------------------
---------------------------
| Index | 0:2:0 |
| Element | |
---------------------------
---------------------------
| Index | 0:2:1 |
| Element | |
---------------------------
---------------------------
| Index | 0:2:2 |
| Element | |
---------------------------
---------------------------
| Index | 0:3:0 |
| Element | |
---------------------------
---------------------------
| Index | 0:3:1 |
| Element | |
---------------------------
---------------------------
| Index | 0:3:2 |
| Element | |
---------------------------
---------------------------
| Index | 1:0:0 |
| Element | |
---------------------------
---------------------------
| Index | 1:0:1 |
| Element | |
---------------------------
---------------------------
| Index | 1:0:2 |
| Element | |
---------------------------
---------------------------
| Index | 1:1:0 |
| Element | |
---------------------------
---------------------------
| Index | 1:1:1 |
| Element | |
---------------------------
---------------------------
| Index | 1:1:2 |
| Element | |
---------------------------
---------------------------
| Index | 1:2:0 |
| Element | |
---------------------------
---------------------------
| Index | 1:2:1 |
| Element | |
---------------------------
---------------------------
| Index | 1:2:2 |
| Element | |
---------------------------
---------------------------
| Index | 1:3:0 |
| Element | |
---------------------------
---------------------------
| Index | 1:3:1 |
| Element | |
---------------------------
---------------------------
| Index | 1:3:2 |
| Element | |
---------------------------
Here's the second way.
---------------------------
| index | 0:0:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 0:0:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 0:0:0 |
| Element | |
---------------------------
---------------------------
| Index | 0:0:1 |
| Element | |
---------------------------
---------------------------
| Index | 0:0:2 |
| Element | |
---------------------------
---------------------------
| index | 0:1:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 0:1:0 |
| Element | |
---------------------------
---------------------------
| Index | 0:1:1 |
| Element | |
---------------------------
---------------------------
| Index | 0:1:2 |
| Element | |
---------------------------
---------------------------
| index | 0:2:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 0:2:0 |
| Element | |
---------------------------
---------------------------
| Index | 0:2:1 |
| Element | |
---------------------------
---------------------------
| Index | 0:2:2 |
| Element | |
---------------------------
---------------------------
| index | 0:3:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 0:3:0 |
| Element | |
---------------------------
---------------------------
| Index | 0:3:1 |
| Element | |
---------------------------
---------------------------
| Index | 0:3:2 |
| Element | |
---------------------------
---------------------------
| index | 1:0:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| index | 1:0:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 1:0:0 |
| Element | |
---------------------------
---------------------------
| Index | 1:0:1 |
| Element | |
---------------------------
---------------------------
| Index | 1:0:2 |
| Element | |
---------------------------
---------------------------
| index | 1:1:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 1:1:0 |
| Element | |
---------------------------
---------------------------
| Index | 1:1:1 |
| Element | |
---------------------------
---------------------------
| Index | 1:1:2 |
| Element | |
---------------------------
---------------------------
| index | 1:2:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 1:2:0 |
| Element | |
---------------------------
---------------------------
| Index | 1:2:1 |
| Element | |
---------------------------
---------------------------
| Index | 1:2:2 |
| Element | |
---------------------------
---------------------------
| index | 1:3:0 |
| elementSize | |
| elementCount | |
| expansionBoundary | |
| slotCount | |
---------------------------
---------------------------
| Index | 1:3:0 |
| Element | |
---------------------------
---------------------------
| Index | 1:3:1 |
| Element | |
---------------------------
---------------------------
| Index | 1:3:2 |
| Element | |
---------------------------
Are there certain advantages/disadvantages in choosing one layout over the other?

Database queues in Asterisk - timeout not being honored

I setup dynamic queues in Asterisk according to this: http://libryder.com/Ez7llN
The queues connect successfully and all members are recognized but it always rings to voicemail, never trying the next member.
+----+------------+-------------+----------+---------+---------+--------------+----------------+------------------+----------------+--------------------+----------------+---------------+---------------+----------------+----------------+------------------+--------------------+------------------------+-------------------+-------+------------+--------+--------------+----------+-----------+----------------+-------------------+-----------------+----------------+-------------+--------+----------------+-----------+-----------------+----------+-----------------+
| id | name | musiconhold | announce | context | timeout | monitor_join | monitor_format | queue_youarenext | queue_thereare | queue_callswaiting | queue_holdtime | queue_minutes | queue_seconds | queue_lessthan | queue_thankyou | queue_reporthold | announce_frequency | announce_round_seconds | announce_holdtime | retry | wrapuptime | maxlen | servicelevel | strategy | joinempty | leavewhenempty | eventmemberstatus | eventwhencalled | reportholdtime | memberdelay | weight | timeoutrestart | ringinuse | setinterfacevar | autofill | timeoutpriority |
+----+------------+-------------+----------+---------+---------+--------------+----------------+------------------+----------------+--------------------+----------------+---------------+---------------+----------------+----------------+------------------+--------------------+------------------------+-------------------+-------+------------+--------+--------------+----------+-----------+----------------+-------------------+-----------------+----------------+-------------+--------+----------------+-----------+-----------------+----------+-----------------+
| 5 | 4352754426 | NULL | NULL | NULL | 5 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | 0 | NULL | ringall | NULL | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | yes | yes | conf |
+----+------------+-------------+----------+---------+---------+--------------+----------------+------------------+----------------+--------------------+----------------+---------------+---------------+----------------+----------------+------------------+--------------------+------------------------+-------------------+-------+------------+--------+--------------+----------+-----------+----------------+-------------------+-----------------+----------------+-------------+--------+----------------+-----------+-----------------+----------+-----------------+
+----------+------------+------------+---------------------------+---------+--------+---------+
| uniqueid | membername | queue_name | interface | penalty | paused | hunt_id |
+----------+------------+------------+---------------------------+---------+--------+---------+
| 18 | agent1 | 4352754426 | local/4352151050#outbound | NULL | NULL | 5 |
| 19 | agent2 | 4352754426 | local/4352151052#outbound | NULL | NULL | 5 |
| 20 | agent3 | 4352754426 | local/4352151054#outbound | NULL | NULL | 5 |
+----------+------------+------------+---------------------------+---------+--------+---------+
Am I missing some option?
Please try with different ring strategy instead of ringall like random or rrmemory. And please also check timeout field it look too low ?

Resources