calabash-android: "y" and "center_y" coordinates offset by 222 when running query("*") through RubyMine - calabash

When running query("*") through the console on terminal I get output similar to the following. This output is correct for all intents and purposes:
[
[ 0] {
"id" => nil,
"enabled" => true,
"contentDescription" => nil,
"class" => "com.android.internal.policy.impl.PhoneWindow$DecorView",
"rect" => {
"center_y" => 616,
"center_x" => 360,
"height" => 507,
"y" => 363,
"width" => 640,
"x" => 40
}
]
However, when I run the same command on RubyMine during test execution I get incorrectly offset output like this:
{
"id"=>nil,
"enabled"=>true,
"contentDescription"=>nil,
"class"=>"com.android.internal.policy.impl.PhoneWindow$DecorView",
"rect"=>{
"center_y"=>394,
"center_x"=>360,
"height"=>507,
"y"=>141,
"width"=>640,
"x"=>40
},
"tag"=>nil,
"description"=>"com.android.internal.policy.impl.PhoneWindow$DecorView{41fcdad8 V.E..... R....... 0,0-640,507}
}
I am only seeing this behaviour on one specific screen in my app. The rest have all worked as expected, but on this screen it's consistently 222 pixels out.
This is causing a click event to fail as it thinks an element is much higher up the screen than it actually is.
I have occasionally seen the incorrect output on console, and likewise had correct output from RubyMine, however approximately 95% of the time the behaviour has been as I've described.
I am using calabash-android 0.5.2
Does anyone have any idea what could be causing this variation?

It turns out that the offset appeared on this screen in the app as the keyboard was visible on the prior screen.
Clicking to generate a pop up while the keyboard was visible caused calabash to read the location of the view while the keyboard was still present, or at least in the process of disappearing, hence the "y" and "center_y" coordinates were raised a few hundred pixels.
I solved the issue by using 'press_back_button' to close the keyboard before selecting the pop up.

Related

SageMaker Labelling job: Create_labelling_job() fails

I am trying to create a labelling job on SageMaker for labelling the images by drawing a bounding box around it. I have successfully created one from the AWS console but I am unable to make it successful using the boto3 function create_labeling_job() .
Here is the code and the function parameters I used. They are similar to the example from the GitHub amazon-sagemaker-examples but unfortunately it did not work as expected. I can create the job, label the images and the status of the job gets completed. But the output manifest file does not store the annotations numbers.
task_description = "Draw bounding box around the images"
task_keywords = ['Images', 'bounding boxes', 'object detection']
task_title = "Bounding Box task"
job_name = "test-labeling-job"
acs_arn = "arn:aws:lambda:eu-west-1:568282634449:function:ACS-BoundingBox"
prehuman_arn = "arn:aws:lambda:eu-west-1:568282634449:function:PRE-BoundingBox"
human_task_config = {
"AnnotationConsolidationConfig": {
"AnnotationConsolidationLambdaArn": acs_arn,
},
"PreHumanTaskLambdaArn": prehuman_arn,
"MaxConcurrentTaskCount": 1000, # 200 images will be sent at a time to the workteam.
"NumberOfHumanWorkersPerDataObject": 1, # 3 separate workers will be required to label each image.
"TaskAvailabilityLifetimeInSeconds": 864000, # Your workteam has 6 hours to complete all pending tasks.
"TaskDescription": task_description,
"TaskKeywords": task_keywords,
"TaskTimeLimitInSeconds": 3600, # Each image must be labeled within 5 minutes.
"TaskTitle": task_title,
"UiConfig": {
"UiTemplateS3Uri": "s3://bucket-name/bounding-box.liquid.html",
},
"WorkteamArn": "arn:aws:sagemaker:eu-west-1:xxxxxxxxx:workteam/private-crowd/Labellers"
}
ground_truth_request = {
"InputConfig": {
"DataSource": {
"S3DataSource": {
"ManifestS3Uri": "s3://bucket-name/manifest-vic-2.manifest",
}
},
"DataAttributes": {
"ContentClassifiers": []
},
},
"OutputConfig": {
"S3OutputPath": "s3://sagemaker-bucket-name/folder-name-07-12-2022/",
},
"StoppingConditions":{
'MaxPercentageOfInputDatasetLabeled': 100
},
"HumanTaskConfig": human_task_config,
"LabelingJobName": job_name,
"RoleArn": "arn:aws:iam::xxxxxxxxx:role/service-role/AmazonSageMaker-ExecutionRole-xxxxxxxxxx",
"LabelAttributeName": job_name,
"LabelCategoryConfigS3Uri": "s3://bucket-name/label-config.json",
}
sagemaker_client = boto3.client("sagemaker")
sagemaker_client.create_labeling_job(**ground_truth_request)
My label config file looks like the following:
{
"document-version": "2018-11-28",
"labels": [{"label": "animal"}, {"label": "no-animal"}]
}
The manifest file looks like:
{'source-ref': 's3://sagemaker-inout-folder/2022-10-10-12:50:59/A.jpg'}
{'source-ref': 's3://sagemaker-inout-folder/2022-10-10-12:50:59/B.jpg'}
{'source-ref': 's3://sagemaker-inout-folder/2022-10-10-12:50:59/C.jpg'}
And the HTML file is a standard crowd liquid files taken from the github sagemaker examples:
<script src="https://assets.crowd.aws/crowd-html-elements.js"></script>
<crowd-form>
<crowd-bounding-box
name="annotatedResult"
src="{{ task.input.taskObject | grant_read_access }}"
header="Draw bounding boxes around all the cats and dogs in this image"
labels="['Animal', 'No-animal']"
>
<full-instructions header="Bounding Box Instructions" >
<p>Use the bounding box tool to draw boxes around the requested target of interest:</p>
<ol>
<li>Draw a rectangle using your mouse over each instance of the target.</li>
<li>Make sure the box does not cut into the target, leave a 2 - 3 pixel margin</li>
<li>
When targets are overlapping, draw a box around each object,
include all contiguous parts of the target in the box.
Do not include parts that are completely overlapped by another object.
</li>
<li>
Do not include parts of the target that cannot be seen,
even though you think you can interpolate the whole shape of the target.
</li>
<li>Avoid shadows, they're not considered as a part of the target.</li>
<li>If the target goes off the screen, label up to the edge of the image.</li>
</ol>
</full-instructions>
<short-instructions>
Draw boxes around the requested target of interest.
</short-instructions>
</crowd-bounding-box>
</crowd-form>
Once this function is executd, I am able to label the images and the labelling job status changes to 'COMPLETE'. But the output manifest files looks like the following:
{
"source-ref": "s3://sagemaker-inout-folder/2022-10-10-12:50:59/A.jpg",
"test-labeling-job": {
"image_size": [
{ "width": 0, "height": 0, "depth": 3 } ],
"annotations": [] },
"test-labeling-job-metadata": {
"objects": [],
"class-map": {},
"type": "groundtruth/object-detection",
"human-annotated": "yes",
"creation-date": "2022-12-01T08:09:07.933647",
"job-name": "labeling-job/test-labeling-job"
}
}
The image size is weird and the annotations are empty.
Can someone help me if I am doing anything wrong and how do I make this work?
Thank you in advance!

How do I add validation to text area in oracle apex

I am feed up with this Oracle APEX application , their is no proper videos or documentation
I have a Text area field and button
On button click I have written a PL/SQL code to send mail
Is their any way I can populate error / success message on screen
If text area is empty does not have any data then display error message on screen as Text area field is empty
My code :
BEGIN
if (:textarea1 is not null ) then
APEX_MAIL.SEND(p_from => 'alice#example.com',
p_to => 'bob#example.com',
p_subj => 'Email from Oracle Autonomous Database',
p_body => 'Sent using APEX_MAIL');
else
--popup error message on my screen -> `textarea` filed cannot be empty
end if;
END;
The following package of ADD_ERROR.ADD_ERROR does not exist at my end
If text area is empty does not have any data then display error message on screen
You don't need your own validation for that; just set that item's Value required property ON.
Additionally, you can even set process' Server side condition to
When button pressed: pick the button you use to send an e-mail
Type: Item is not null; pick the text area item
You commented that it isn't working. Well, it is. If it doesn't for you, then you did something wrong (although, I can't imagine what would that be, regarding the fact that it is just one property you had to set).
So: if I leave the text area empty and push the button, error message is here:
As of a video with demonstration: I don't have any. Google for it, if you desperately need it.

KO Grid Scrollbars not visible & Display issues

I am having two problems with KOgrid.
1) I could not get scroll bars in the kogrid .It is very difficult to do data entry without scroll bars.
2) I also could not get kogrid to working wihout specifying hard coded height and width.In my application I can not have a fixed height and width.
Did anybody else had the same issue ?
I tried a workaround suggestion from this thread ( using jQuery fix as last line in my viewmodel).
KO Grid Display Isseues, On resize Gird shows one row. Images also included
that just increased that size of the grid but it did not display any data . However, when I resize the page data shows up.
Below are my HTML and kogrid options ( I tried with and without paging options, Ideally I do not want to use paging )
<div data-bind="koGrid: gridOptions"
style="height: 800px; background-color: none;width: 1850px;">
</div>
self.gridOptions = {
data: self.mydatarray,
footerVisible: true,
displaySelectionCheckbox: true,
afterSelectionChange: self.RowSelectionChange,
rowHeight: 50,
selectWithCheckboxOnly: true,
enableSorting: false,
multiSelect: true,
selectedItems: self.SelectedRows,
enableColumnResize: true,
showFilter: false,
canSelectRows: true,
enablePaging: true,
pagingOptions: {
currentPage: ko.observable(1),
pageSize: ko.observable(3),
pageSizes: ko.observableArray([3, 6, 9])
},
rowTemplate: errrowtmpl,
columnDefs: [
{ field: 'Customer', displayName: 'Customer', cellTemplate: Customersddedittmpl, headerCellTemplate: headercelltmpl },
...
...
{ field: 'GenNotes', displayName: 'GenNotes', cellTemplate: simpleedittmpl, headerCellTemplate: headercelltmpl }
]
}
Please let me know if you need any more information
Thanks
Kenner Dev
I found a solution to the problems I am facing.
1) I used Jquery to add scroll bar. I added code line below as last line of my data loading function. I am not sure id this breaks any other KOGrid functionality.In my application I did some basic testing and it seems to be working fine.
$("div.kgViewport").css("overflow", "scroll");
2) I still dont know how to solve this problem 100%. It still does not work unless fixed width and height are mentioned in style. In my app I used vw and vh as opposed fixed width and height to solve the problem of making it work on all screen sizes.
<div data-bind="koGrid: gridOptions"
style="height: 73vh;overflow:scroll;width: 96vw;"></div>

Get/Set igGrid combo cell value

I have an iggrid that is using a JSON data source for the main grid data and the combo box in one of my fields.
I have created the grid and the combo and the data is there. When I change the combo value and commit the grid the main grid column value does not change. I can see this by assigning a default value to the column and then changing it via a combo box.
I am working off of this example.
http://www.infragistics.com/products/jquery/sample/combo-box/grid-editor
Combo Data
occCodeData = [
{ "ID": "0", "OccCode": "Food" },
{ "ID": "1", "OccCode": "Beverages" },
{ "ID": "2", "OccCode": "Electronics" },
{ "ID": "3", "OccCode": "Cookies" }
];
My grid data is stored in a JSON variable in javascript pulled from a web api. I have verified the data is valid using a console write.
Does anyone have this working with standard JSON, JS, and HTML? This main issue is when I change the combo value it does not update my JSON data behind the scenes. The GUI grid changes fine.
When you have editing in the grid, by default the autoCommit option is set to false (meaning the UI updates but the values are not committed to the data source). You can change this to true in order to automatically commit to the data:
//Initialize
$(".selector").igGrid({
autoCommit : true
});
//Get
var commit = $(".selector").igGrid("option", "autoCommit");
Or you can call the commit method manually:
$(".selector").igGrid("commit");
I figured it out. My Sample occCodeData data did not match my current value.
So my default value pulled from the database was 129 but my possible values were 0,1,2,3. This was causing the combo not to change the value because it did not have a match in it's own listing.

List paging in Sencha

I have created a list in Sencha touch2. I need to add paging to it. Lets say i need 25 items to be displayed in a page and on tap of "next" button, the next 25 items has to be displayed.
I believe sencha touch 2 provides paging but am not gettin a handle on it.
My code is
cls:'inboxqueuecls',
xtype:'list',
id:'queuelist',
store:'QueueStore',
plugins: [{
xclass: 'Ext.plugin.ListPaging',
autoPaging: false,
clearOnPageLoad: true
}],
style:{
'border-right':'0.01px black',
'background-color':'rgba(0,140,153,0.2)'
},
itemTpl:'{queueName}'
and my store is
pageSize: 20,
autoload: false,
proxy:{
type:'memory',
reader:{
type:'xml',
record:'string',
rootProperty:'QueuesNames',
}
}
but the "page size" doesn seem to be working.
Anything am missing? Please help.
As TDEBailleul has said pageSize is an attribute of store not of the proxy.
Second, Memory proxy does not support paging. MemoryProxy has its own processing in the Store.js. Specify json or other proxy to get paged ajax call at the output. Another solution is MemoryProxy or ever from other ancestor subclassing.