AppleScript : keystroke : too slow - applescript

The keystroke on my script take around 5/7 seconds until going to the next step.
I didn't set any delay.
E.g :
-- Click 1
click pop up button 1 of group 2 of group 2 of group 1 of group 2 of group 6 of group 2 of group 1 of group 4 of UI element 1 of scroll area 1 of group 1 of splitter group 1 of window 1
keystroke "Edit"
keystroke return
-- Click 2
click pop up button 1 of group 2 of group 1 of group 1 of group 2 of group 2 of group 6 of group 2 of group 1 of group 4 of UI element 1 of scroll area 1 of group 1 of splitter group 1 of window 1
keystroke "Standard"
keystroke return
So basically, its clicking, show the Click Pop up button, wait 7 secondes, then continue the script.
Any idea?

Don't get your hopes up, but you can try to wrap problem lines in time out or ignoring application responses.
try
with timeout of x seconds
--
end timeout
end try
.
ignoring application responses
--
end ignoring

Related

RabbitMQ Consumer-Increment-Count Configuration In Spring Boot

I have these configurations:
container.setMaxConcurrentConsumers(100);
container.setConcurrentConsumers(1);
container.setPrefetchCount(1);
container.setAutoStartup(true);
container.setConsecutiveActiveTrigger(1);
And this works like: starts with 1 consumer and goes on 1 + 1 + 1 + 1....100(max-consumer) with each active consecutive trigger. Is there a way to increase it like: starts with 1 consumer and goes on 1 + 5 + 5 + 5 ... 100(max-consumer) with each active consecutive trigger?
So it increases the consumer count 1 by 1. But I want to change it like 5 by 5 or 10 by 10.
No; only one consumer is added for each trigger.
I suggest you open a new feature request: https://github.com/spring-projects/spring-amqp/issues

Idle handler function is not running at the exact specified interval

The script uses idle handler that runs every 5 minutes and alerts me to perform the task. But the script always runs late by 10-40 seconds. I am not sure why that is happening.
global numberOfBeeps, beepcycle
on idle
if beepcycle is greater than 0 then
say "Update 5 minute data and watchlist " using "Serena"
set beepcycle to beepcycle - 1
else
say "Update 30 minute data and watchlist" using "Kate"
set beepcycle to 5
end if
return 300
end idle
on run
set beepcycle to 6
end run
The if statement in your script adds this 10-40 seconds to the on idle handler. So, you should correct the return time of on idle handler some way. For example, you can do something like this:
global numberOfBeeps, beepcycle
on idle
set currentDate to (get current date)
if beepcycle is greater than 0 then
say "Update 5 minute data and watchlist " using "Serena"
set beepcycle to beepcycle - 1
else
say "Update 30 minute data and watchlist" using "Kate"
set beepcycle to 5
end if
set timeElapsed to (get current date) - currentDate
return (300 - timeElapsed)
end idle
on run
set beepcycle to 6
end run

How to move a particular app to a specific display programmatically

I need to move a particular running application to a specific display.
First of all I get a list of running apps with
let workspace = NSWorkspace.shared
let apps = workspace.runningApplications
.filter{ $0.activationPolicy == .regular }
if I print apps I get something like
▿ 6 elements
- 0 : <NSRunningApplication: 0x6000021fa480 (com.apple.Safari - 608) LSASN:{hi=0x0;lo=0xc00c}>
- 1 : <NSRunningApplication: 0x6000021fa500 (com.apple.dt.Xcode - 610) LSASN:{hi=0x0;lo=0xd00d}>
- 2 : <NSRunningApplication: 0x6000021fa600 (com.apple.Preview - 625) LSASN:{hi=0x0;lo=0x10010}>
- 3 : <NSRunningApplication: 0x6000021fb280 (com.apple.finder - 629) LSASN:{hi=0x0;lo=0x2f02f}>
- 4 : <NSRunningApplication: 0x6000021f3480 (org.mozilla.firefox - 9202) LSASN:{hi=0x0;lo=0x75075}>
Suppose Preview is on monitor 2 on the right and I want to move it to monitor 1 on the left.
How do I do that on BigSur?

Qlik Sense. Time Filter

Same issue I posted Friday but I will be more specific this time. I have this data:
UserId Action Id Date
1 1 1/1/2018
1 2 1/1/2018
1 2 2/1/2018
2 3 3/1/2018
2 4 4/1/2018
And I want a filter that will yield the following:
Count Instances from FirstDate to 2/1/2018
UserId ActionCount
1 3
2 0
In the data load editor you want to group by the User in order to get that first date:
GroupedUserData:
Load
UserId
min(Date) as FirstDate
resident [The name of your original table];
And then you want to use set analysis chart-side:
sum({<FirstDate = {'<=2/1/2018'}>} ActionCount)

Errors with inter-group communications

I have to implement a scenario where I have 2 groups. Group 1 contains only process 0 and 1. Group 2 contains all the processes. Now the processes in Group 2 read some data and send it to Group 1(process 0 or 1, equal division). It should look like this:
Grp1 Grp2
Rank
(grp)
0 0 0
1 1 1
2 2
3 3
4 4 and so on..
Now to implement this, I have used the following code (All the variables and other things are taken care)
program mpi
use mpi
integer ierr,new_rank1,new_grp1,new_rank2,new_grp2,new_comm1,new_comm2
integer numtasks,rank,orig_grp,tag,sendbuf,recvbuf
integer ranks1(2),ranks2(8),stat(MPI_STATUS_SIZE)
data ranks1 /0,1/,ranks2 /0,1,2,3,4,5,6,7/
call mpi_init(ierr)
call mpi_comm_rank(mpi_comm_world,rank,ierr)
call mpi_comm_size(mpi_comm_world,numtasks,ierr)
call MPI_COMM_GROUP(MPI_COMM_WORLD,orig_grp,ierr)
tag = 342
call MPI_GROUP_INCL(orig_grp,8,ranks2,new_grp2,ierr)
call mpi_comm_create_group(mpi_comm_world,new_grp2,112,new_comm2,ierr)
call mpi_comm_rank(new_comm2,new_rank2,ierr)
if(new_rank2 == 4) then
call mpi_send(123,1,MPI_INT,0,tag,new_comm2,ierr) !send a msg from rank 4 of group 2 to rank 0 of group 1
end if
if(rank <2) then
call MPI_GROUP_INCL(orig_grp,2,ranks1,new_grp1,ierr)
call mpi_comm_create_group(mpi_comm_world,new_grp1,111,new_comm1,ierr)
call mpi_comm_rank(new_comm1,new_rank1,ierr)
if(new_rank1 == 0) then
call mpi_recv(recvbuf,1,MPI_INT,4,tag,new_comm2,stat,ierr)
print*,recvbuf
end if
end if
call mpi_finalize(ierr)
end
Facing errors in sending and receiving data. The other things work fine. And also if the whole concept is wrong, I am open to suggestions.

Resources