assertValue doesn't work on select boxes with the Selenium IDE Firefox plugin
Date : March 29 2020, 07:55 AM
wish of those help Just because it's not available from "Show All Available Commands" does not necessarily mean you'll not be able to use it. Add a command to the IDE and select it in the sequence of operations in your test (i.e. from the "Table" view not the "Source" view). Now you'll see the "Command", "Target" and "Value" for your selected operation; just change the command to the one you require.
|
Exception:Input array Input array is longer than the number of columns in this table combobox
Tag : chash , By : user119605
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Looks like you're only retrieving one column in your select query but you're adding a 2 column array to you're new row. You may be able to get away with the below: DataRow dr;
CommonDBTransaction c = new CommonDBTransaction();
string sql = "SELECT MId FROM Module";
DataTable dt = c.searchData(sql);
dr = dt.NewRow();
dr[0] = "--Select Module--";
dt.Rows.InsertAt(dr,0);
metroComboBoxMod.ValueMember = "MId";
metroComboBoxMod.DisplayMember = "MId";
metroComboBoxMod.DataSource = dt;
DataRow dr;
CommonDBTransaction c = new CommonDBTransaction();
string sql = "SELECT MId AS MId, MId AS DisplayId FROM Module";
DataTable dt = c.searchData(sql);
dr = dt.NewRow();
dr[0] = 0;
dr[1] = "--Select Module--";
dt.Rows.InsertAt(dr,0);
metroComboBoxMod.ValueMember = "MId";
metroComboBoxMod.DisplayMember = "DisplayId";
metroComboBoxMod.DataSource = dt;
|
C#: Creating a string array from user input, then if it can't be parsed into int array, retrying the input
Tag : chash , By : ugufugu
Date : March 29 2020, 07:55 AM
With these it helps First of all, make the user experience as good as possible. Inputing a matrix all at once can be error prone, make the user's life easier and take it step by step. Second, make small methods that perform simple tasks; they are easier to reason about, easier to write, easier to debug and easier to modify if new requirements come along. Don't make methods do too much, it will only buy you headaches and more debugging hours than necessary. If you are learning, don't worry if it seems you are breaking down to seemingly absurdly simple tasks, you wont regret it. Always remember that the most complicated problems you can imagine are always solved solving smaller and easier ones. private static int GetIntegerFromUser(string prompt)
{
int value;
Console.Write($"{prompt}: ");
while (!int.TryParse(Console.ReadLine(), out value))
{
Console.WriteLine("That is not a valid value. Please try again.");
Console.Write($"{prompt}: ");
}
return value;
}
private static (int Rows, int Columns) GetMatrixSize()
{
var rows = GetIntegerFromUser("Please enter number of rows");
var columns = GetIntegerFromUser("Please enter number of columns");
return (rows, columns);
}
private static int[,] GetMatrixValues(int rows, int columns)
{
var matrix = new int[rows, columns];
for (var row = 0; row < rows; row++)
{
for (var column = 0; column < columns; column++)
{
matrix[row, column] =
GetIntegerFromUser($"Enter matrix value [{row}, {column}]");
}
}
}
public static int[,] GetMatrixFromUser()
{
var size = GetMatrixSize();
return GetMatrixValues(size.Rows, size.Columns);
}
private static bool IsInRange(int value,
int lowerInclusiveBound,
int upperExclusiveBound,
string messageOnFailedValidation)
{
if (value >= lowerInclusiveBound &&
value < upperExclusiveBound)
return true;
Console.WriteLine(messageOnFailedValidation);
return false;
}
private static (int Rows, int Columns) GetMatrixSize()
{
int rows, columns;
do
{
rows = GetIntegerFromUser("Please enter number of rows");
columns = GetIntegerFromUser("Please enter number of columns");
} while (!IsInRange(rows,
1,
int.MaxValue,
"Number of rows must be equal or greater than one.") |
!IsInRange(columns,
1,
int.MaxValue,
"Number of columns must be equal or greater than one."));
return (rows, columns);
}
private static int[,] GetMatrixValues(int rows, int columns)
{
Debug.Assert(rows > 0 && columns > 0);
var matrix = ...
}
private static bool IsInRange(int value,
int lowerInclusiveBound,
int upperExclusiveBound,
string messageOnFailedValidation)
{
Debug.Assert(upperExclusiveBound > lowerInclusiveBound);
if ...
}
|
Input array of objects as input and return an array as output from Stored Procedure
Tag : oracle , By : user143038
Date : March 29 2020, 07:55 AM
it fixes the issue I have a requirement where I need to pass the nested array of objects as an input to stored procedure , get the data from table as group of different date ranges, and return all the date ranges data as an output. I am a newbie in PL/Sql , so request your guidance here . , Oracle Setup: Create a collection to input: CREATE TYPE intlist AS TABLE OF int;
CREATE TYPE daterange AS OBJECT(
start_date DATE,
end_date DATE
);
/
CREATE TYPE daterangelist AS TABLE OF daterange;
CREATE TABLE test_data ( id, start_date, end_date ) AS
SELECT 1, DATE '2019-01-01', DATE '2019-01-02' FROM DUAL UNION ALL
SELECT 2, DATE '2019-01-02', DATE '2019-01-03' FROM DUAL UNION ALL
SELECT 3, DATE '2019-01-03', DATE '2019-01-04' FROM DUAL UNION ALL
SELECT 4, DATE '2019-01-04', DATE '2019-01-05' FROM DUAL;
CREATE PROCEDURE test_proc (
i_ints IN intlist,
o_dates OUT daterangelist
)
IS
BEGIN
SELECT daterange( start_date, end_date )
BULK COLLECT INTO o_dates
FROM test_data
WHERE id MEMBER OF i_ints;
END;
/
DECLARE
p_ranges daterangelist;
BEGIN
test_proc( intlist( 1, 3, 4 ), p_ranges );
FOR i IN 1 .. p_ranges.COUNT LOOP
DBMS_OUTPUT.PUT_LINE( p_ranges(i).start_date || ' - ' || p_ranges(i).end_date );
END LOOP;
END;
/
01-JAN-19 - 02-JAN-19
03-JAN-19 - 04-JAN-19
04-JAN-19 - 05-JAN-19
|
Using an Array to analyze input and utilizing it for a counter of array listing within the input in Python
Date : March 29 2020, 07:55 AM
|