## What’s the worst case complexity of Robert W. Floyd’s cycle detection algorithm?

Givens. I understand Floyd’s algorithm can determine the length $$\lambda$$ of the loop and the length $$m$$ of the tail. The hare will not necessarily catch the tortoise on the first cycle, but it is guaranteed to catch it after a number $$k$$ of cycles, where $$k$$ is a natural number.

Question. Given I know these facts, how can I deduce the worst case complexity of the algorithm?

## How to make an android bot app for performing some background tasks in a cycle?

I am working on a project in which, I want to create an Android App. The app will open a website in background, wait for the page to load. Then, it will find something on the page. After that it will do a specific task. Then, wait for the process to be completed. If the process gets completed, it will have some delay. Then, it’ll reopen the url again and thenafter repeat the same task in a cycle. It should continue doing the directed tasks until any unwanted system or wanted user interruption. I’ve searched a lot on web to know that if something could be done in this route. But, I couldn’t find anything helpful. I want something similar to this

Here, in the above mentioned tutorial, he is using Python Script for making an Instagram bot for PC. The bot will open Browser, then the Instagram’s Feed, then will find the button by text “Like” and then go back, thenafter it’ll repeat the cycle. I want something similar.

1). But, instead of Liking every post/photo, I want my bot to comment something on the posts of people whom I or the person using the bot is following on Instagram.

2). Second thing is, this process is being done on the main window. I want this process to be done in background.

3). He is doing it in(for) PC. I want to do it in/for Android.

4). I may follow his tutorial for PC and using Python. But, how would I do it using Java or Kotlin in Android Studio.

I started to do some research and build a very very beginning level app. Which You may find here

I am open to suggestions.

Please check the project and if it is possible to achieve what I want from only some modifications in my current project, then please do tell me.

Please tell me the solutions, hints, suggestions, advice, anything helpful in this project except a downvote 😁.

If you find anything ineligible or wrong according to the forum then, please before downvoting, let me know in the comments section.

P.S. :- If this question should be asked in any other forum of stack exchange then please comment it’s name. I’ll immediately put down this question from here and ask it in the respective forum. Thanks!

## Where in the views processing cycle can I read the views filter parameters?

Because the exposed filters area takes up too much space on the screen, I want to collapse the exposed filters area and display a plain text version of the views parameters, rather than waste spacing show the filter controls’s settings.

Where in the views cycle will all the parameters be present and in what variables so I can read them and display them in some divs above the exposed filters area?

Using some Javascript to read the filter parameters in the menu andplacing them in a div will help, but I prefer to do it in PHP code itself.

Having the same for the contextual filters will also help.

## Which bones are rotated for Leon in RE4 during walk cycle?

I would like to create a character controller like Leon in RE4.

As many may know, Leon has this cool “sideways look” when walking: His hands and head are rotated a bit to the right.

At first I thought that his feet and hip are not rotated at all and that only his abdomen was rotated.

Now, after some investigations, I’m really surprised:

After seeing this video (for example at 00:20) where a camera FOV hack was applied and one can finally see his lower body, I’m not sure anymore what exactely is rotated and which bones actually determine his walking direction.

Can anybody who has a good eye tell me what exactely they’re doing with Leon in order to get this “sideways” feel?

Thank you!

## Is the longest Hamiltonian cycle NP-complete?

As I understand it to prove something is NP-complete you have to show that it’s NP-hard by reducing and a known NP-complete problem to your problem and also prove that it is in NP which you do showing that an answer can be verified to be correct in polynomial time.

Now for the longest Hamiltonian cycle in a weighted graph, I know how the reduction would work, but I’m confused about how to verify a solution in polynomial time. To verify that the cycle is Hamiltonian is easy but how would I know if a cycle I’m looking at really is the longest?

Any help would be appreciated!

## shortest cycle passing through vertices a and b with changeable edge weights

given a weighted undirected graph with $N$ vertices $(N \leqslant 500)$ we start from vertex $S$ and wo go to $M$ and then we go to $T$ and then we return to $S$ .

each edge in graph has weight $a_i$ at the beginning but after the first time we pass any edge that edge weight will become $b_i$ . ($b_i \leqslant a_i$ )

the task is to find the minimum sum of edges for this traverse.

time limit : 2 sec.

This is from Iran’s IO, a contest that is finished. Source: https://quera.ir/course/assignments/4573/problems

## Cycle between the last two windows (similar to CMD+TAB)

Hello Mac OS X+ power users.

I generally have two screens but I’m stuck with just a laptop for a while.

Is there a way to cycle between the last two apps you’re using? CMD+Tab would cycle between all open apps. I’d like just between the last two.

A workaround I have is to maximize the screen of the two applications I’m using, and CTRL+<right arrow> or CTRL+<left arrow> to cycle between the Desktops but is there something easier that happens in the same Desktop?

Thanks!

## Pipelining and instruction cycle

I was solving some problems on number of clocks required in pipelining. However I came across this problem, Consider the sequence of machine instruction given below:

MUL R5,R0,R1 DIV R6,R2,R3 ADD R7,R5,R6 SUB R8,R7,R4 In the above sequence, R0 to R8 are general purpose registers. In the instructions shown, the first register shows the result of the operation performed on the second and the third registers. This sequence of instructions is to be executed in a pipelined instruction processor with the following 4 stages: (1) Instruction Fetch and Decode (IF), (2) Operand Fetch (OF), (3) Perform Operation (PO) and (4) Write back the result (WB). The IF, OF and WB stages take 1 clock cycle each for any instruction. The PO stage takes 1 clock cycle for ADD and SUB instruction, 3 clock cycles for MUL instruction and 5 clock cycles for DIV instruction. The pipelined processor uses operand forwarding from the PO stage to the OF stage. The number of clock cycles taken for the execution of the above sequence of instruction is _________.

I got the answer as 15 however the correct answer is 13. Am I doing something wrong or is the answer key at fault? The link for reference: https://gateoverflow.in/8218/gate2015-2-44

## Redirection cycle while using alias

I’m trying to setup a home web-server.

My folder structure is the following:

/home/pi/www/ ├── homeGUI │   ├── backend /* Contains an express server listening on 8080 */ │   ├── frontend /* Contains an Angular application */ │   │   ├── index.html │   │   └── /* Other .js files */ │   └── scripts └── index.html 

while my site configuration is this one:

server{     listen 80;     listen [::]:80;      root /home/pi/www;      index index.html index.htm;      server_name _;      #intended to serve the angular application     location /homeGUI/ {         alias /home/pi/www/homeGUI/frontend/;         try_files $uri$  uri/ /homeGUI/frontend/index.html; #this one is causing problems     }      #intended to serve the files in the www folder     location / {         try_files $uri$  uri/ index.html;     }      #intended to serve the express server     location /homeGUI/api/ {         proxy_pass  http://127.0.0.1:8080     } } 

The configuration above can serve all 3 contents(the static index.html, the angular application and the express server).

The problem I have is when i navigate to a route of the angular application directly (or by refreshing the page while on that route) (es: localhost/homeGUI/route1) this cause a redirect cycle because it tries to redirect to /homeGUI/frontend/index.html which then falls into the same location rule and cycle.

All I want to accomplish is redirect every request like /homeGUI/* to the /home/pi/www/homeGUI/frontend/index.html file with the exception of /homeGUI/api which should go to the express server on port 8080.

Any help is appreciated. Thanks.