AppleScript : repeat with each item from end to beginning

I’m trying to do a repeat form a list but I would to repeat from the last item of the list to the newest instead of the another way.

How can I do that knowing that this will do in the wrong order :

   repeat with each from 2 to count of items of creationDate         --     end repeat 

What I’m trying to do is to return the item number of the latest item which content the text “whatever”

Automate arranging files into folders based on beginning of file name?

Looking to quickly arrange a whole load (talking about multiple thousands) of files into subfolders, and the files come in sets of three (left audio, right audio, video) separate files. Not experienced in terminal really but messed around in Automator before.


00015_A01.mxf 00015_A02.mxf 00015.mxf 00016_A01.mxf 00016_A02.mxf 00016.mxf

I want to automate it so that finder looks for files with matching first characters, and puts them in a sub folder (preferably with the name of that file but I’ve managed a workaround for that.)

So the result would be:

[00015] (folder) 00015_A01.mxf 00015_A02.mxf 00015.mxf

[00016] (folder) 00016_A01.mxf 00016_A02.mxf 00016.mxf

Any ideas? I checked around on here but the answers were a bit over my head…

Any help really appreciated folks!

Unable to get Surface Go to start from the beginning of task sequence to retry

My sysadmin hands me a Surface Go he wants me to fix… He tried imaging it via pxe task sequence and it failed half way through the driver setup/windows setup (the blue please wait) I think he got impatient and shut it down to retry the image in the middle of the important after-image setup. It already applied the image –> triggered a restart –> and began driver install and windows 10 setup as far as I know. The issue is that even when I delete the name from SCCM to make the asset a unknown computer when I go to pxe, it still picks up where it left off, after the first restart of the TS then errors out agian.

I just booted it to a USB windows 10 boot drive. I formatted the surface go, and it still picks up from that first restart in the Task Sequence (after applying OS).

There must be a corresponding token on the sccm server that I can delete, no? Like the ccr and ccrretry folder?

Im trying to reimage this thing but it wont start from the beginning of the TS.

Any ideas?


Is my visa status for all destinations in a flight with connections checked in the beginning or before each flight?

For complicated reasons, I want to buy a flight to Australia through New Zealand, but get off in New Zealand and not use the ticket to Australia.

One problem with this approach is that I can’t have luggage because it would be transferred to Australia.

But assuming I would fly without checked in luggage, another problem is that I don’t have a visa for Australia. Will they check it before the first leg of my journey and not allow me to fly at all, or can I fly to New Zealand because they would only check my visa status there before my flight from New Zealand to Australia?


Make repeating numbers 0 and putting them at the beginning of array

I am new to programming and I have made a program to make all repeating numbers in an array 0 and put those all 0s in left side:

import java.util.*; class ArrayWork {     public static void main(String args[])     {         Scanner sc = new Scanner(;         int arr[],n,i,j,nr[]= new int[5];         System.out.println("Enter the value for n: ");         n = sc.nextInt();         if(n>25)             System.out.println("Invalid input");         else         {             arr = new int[n];              System.out.println("Enter the array elements: ");             for(i=0;i<n;i++)             {                 arr[i] = sc.nextInt();             }             int count =0;             for( i=0; i< arr.length-1;i++)             { for (j=i+1;j<arr.length;j++)                 {if(arr[i]==arr[j])                    nr[i]=arr[i];                     System.out.println(nr[i]);                 }}             for(int v=0;v<n;v++){  for(i=0;i<n;i++)             {                 if(arr[i]==nr[v])                 {                     for(j=i-1;j>=0&&arr[j]>0;j--)                     {                         arr[j+1]=arr[j];                     }                     arr[j+1]=0;                 }             }}              System.out.println("The array is: ");             for(i=0;i<n;i++)             {                 System.out.print(arr[i] + " ");             }         }     }  } 

Can I do anything to make this program smaller although the output is coming right and the program is ok but I have made many loop, Hope you know any better way?





How do I create a screen that shows at the beginning of every question

I want to create a screen that show the number of question your on and other stuff before each question. It would show until data for next question is read and loaded up.

How would I create this screen? I thought of just creating a separate View Controller and then showing it at the beginning of every question but I believe that this is inefficient.

Noise in beginning of alsa application

I have ALSA driver for capture device which works fine with VLC. when I try to capture and render using own application having some issues. Issue is:When I start play, it has some noise in beginning and audio is discontinuous in between. Discontinuous means, some audio frame are getting dropped in between. It looks like cut cut sound for sine wave and it continuous to play. I have tried snd_pcm_drop and snd_pcm_drain but no use.

For rendering audio I’m using aplay.c file as a reference. However, using play.c code I’m getting noise in beginning, to cross check this I have dumped application buffer and then played using aplay utility. Content in application buffer is fine. I have also confirmed with FFPlay application. FFPlay also plays with out noise. aplay reference link , and my audio render is similar to reference link.


Can you please let me know why there is noise while playing audio in beginning

Can I use RSA to encrypt an AES256 key that I put at the beginning of my AES256 encrypted file?

I have a master server generating large files for other (known) servers to download.

Those files:

  • Are quite big. From 20MB to 5GB.
  • Are written once by the server and then it forgets about them.
  • Nobody should be able to read the content of the file except the server it has been generated for.
  • Will be downloaded over HTTPS using a library such as RequestJS

Based on this knowledge, I planned to generate an RSA key pair for each server, store the public key in the database of the master server along with the servers’ specific data (like unique identifier) and only keep the private key on the server it belongs to.
I thought I would just have to encrypt the whole 5GB file using the server’s public key and only it would be able to decrypt it.

However, after looking around on the internet, I noticed that it’s an extremely bad idea to encrypt big things using RSA. It’s not meant for this purpose at all.

I also heard a lot about AES and decided to take a look at the way the TLS works and noticed it uses RSA encryption for the symmetric AES keys.
Now, I’m thinking that I should encrypt my files using AES with a randomly generated key per file but I need to transmit the key to the server.

My idea is the following:

  • Generate a random 256 bits key per generated file.
  • Use this key to encrypt the whole file.
  • Use the public key of the target server to encrypt this key.
  • Prepend the encrypted key to the file so that it’s a whole package.
  • Sign the whole thing with the master private key (but I haven’t thought about that yet so I’m open to suggestions regarding the algorithm)

And, on the reception side, the server would just read the first 256 bits, decrypt with its private key and use the decrypted payload as a key to decrypt the file itself.

Since I have no deep knowledge of security, I would like to be sure that it a good idea. I see no real downside but I may not know what I’m talking about enough to judge that.

At first I thought HTTPS would be sufficient but I don’t want anyone to be able to get the file so I still need more encryption than the connection itself.
Moreover, I wouldn’t want a “slave” server to be able to decrypt the content of another. And I should be able to revoke a server by changing its key pair.

Adding a cell in a sheet with a specific column number requirement that pushes cells to the beginning of the next line

I have a sheet that I need to only be 5 columns. I use this as a teaching calendar. Sometimes I need to add a cell in the middle if there is an activity that will add an extra day into my calendar (or what I planned for one day, actually takes two days). However, adding a cell only pushes the row to the right and adds a new column.

Instead, I need it to keep to only 5 columns and instead move the cells to the beginning of the next row instead.

Is this possible?