repeat

Repetition of the program? [closed]

十年热恋 提交于 2019-12-12 06:45:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I want to loop my program to repeat if the user inputs y the program will repeat over and over again ,but if the user finally inputs n the program will stop import java.util.Scanner; public class ReverseIt { public static void main(String[] args) { Scanner sc = new Scanner (System.in); String name; System.out

Find longest repeating string based on input in perl (using subroutines)

ぃ、小莉子 提交于 2019-12-12 05:49:25
问题 So I'm trying to find the longest repeat for a specific pattern thats given. My code so far looks like this, and is fairly close, however it does not fully give the wanted result: use warnings; use strict; my $DNA; $DNA = "ATATCCCACTGTAGATAGATAGAATATATATATATCCCAGCT" ; print "$DNA\n" ; print "The longest AT repeat is " . longestRepeat($DNA, "AT") . "\n" ; print "The longest TAGA repeat is " . longestRepeat($DNA, "TAGA") . "\n" ; print "The longest C repeat is " . longestRepeat($DNA, "C") . "\n

how to repeat or loop an applescript

扶醉桌前 提交于 2019-12-12 04:48:57
问题 I was looking for an option to color all unread mails in apple mail and I found the following script tell application "Mail" set background color of (messages of inbox whose read status is false) to red --unread set background color of (messages of inbox whose read status is true) to none --default read end tell I added this script to a mail rule, which applies to every message, then it works almost perfect. The only problem is that it works only for one time. So if I get a new message, than

MPMoviePlayerController repeat mode not working in viewDidLoad

∥☆過路亽.° 提交于 2019-12-12 04:47:55
问题 It seems that I'm having a problem with repeatmodeone: it does not repeat the video. This is the code for the video I have in the implementation: - (void)viewDidLoad{ NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Space Particle" ofType:@"mp4"]]; MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc]initWithContentURL:url]; [self presentMoviePlayerViewControllerAnimated:playerController]; [playerController.moviePlayer prepareToPlay];

Repeat Result for num rows in php [duplicate]

寵の児 提交于 2019-12-12 04:14:40
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: i can’t make num rows inside while looping i try allot of to make num rows in while looping to get number of rows for another tables $select_sub_cat = mysql_query("SELECT * FROM sub_cat WHERE ct_id='".$row_main['id']."' LIMIT 8 "); while($row_sub = mysql_fetch_array($select_sub_cat)) { $select_num_sub = mysql_query("SELECT * FROM market WHERE sub_cat='".$row_sub['id']."' "); while($row_num_sub = mysql_fetch

VB.NET XML Serialization Repeat third child Element

余生颓废 提交于 2019-12-12 04:07:21
问题 My app now can make XML and also can make unlimited entries of Element 'Osiguranik. Now I want to make unlimited entries of element 'Usluge' but this Element: 'Usluge' is in Element: 'Osiguranik'. Here is my code: Imports System.IO Imports System.Xml Imports System.Xml.Serialization Public Class Form1 Dim faktura As New Faktura Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 'This button add Ustanova again faktura.Ustanova.Add(New Ustanova() With {.Age =

Random integer Loop

本秂侑毒 提交于 2019-12-12 02:46:22
问题 I'm currently making an app that plays a song. I wanted to play a random song each a button is clicked. I currently have : -(IBAction)currentMusic:(id)sender { NSLog(@"Random Music"); int MusicRandom = arc4random_uniform(2); switch (MusicRandom) { case 0: [audioPlayerN stop]; [audioPlayer play]; break; case 1: [audioPlayer stop]; [audioPlayerN play]; break; but I already tried : - (IBAction)randomMusic:(id)sender { NSLog(@"Random Music"); NSMutableArray * numberWithSet = [[NSMutableArray

Avoiding repetitive conditions in the select case and where clause

社会主义新天地 提交于 2019-12-11 23:37:35
问题 I have a table say TAB1 with the following columns - USER_ID NUMBER(5), PHN_NO1 CHAR(20), PHN_NO2 CHAR(20) I have to fetch records from TAB1 into another table TAB2 such that all records with either one of the two or both PHN_NO1 and PHN_NO2 are of length 10 and begin with 5. If in a record,say only PHN_NO1 satisfies the condition and PHN_NO2 does not then, TAB2.P1 should be same as TAB1.PHN_NO1 but TAB2.P2 should be NULL. If neither of the two satisfy the condition, then the record should

repeat loop in R to compute the cosine of 2.345 correct to 5 decimal places

与世无争的帅哥 提交于 2019-12-11 19:03:16
问题 I want to compute the cosine of 2.345 correct to 5 decimal places using Taylor series. My code is given below. I am not sure what is wrong with that. Any help is appreciated! > x<-2.345 > count<-0 > repeat{ + count<-count+1 + initial = (-1)^(n-1) + numerator = x^(2*(n-1)) + denominator = factorial(2*(n-1)) + total=(initial*numerator)/denominator + if(abs((cos(x)-total)/cos(x))*100 <= 0.00001) break + sum=sum+total + } 回答1: It's a simple matter of correcting what is wrong in your code. x <- 2

How to get a discord bot to output everything user inputs instead of just the first input?

不想你离开。 提交于 2019-12-11 18:55:54
问题 I'm trying to get a bot that will repeat what a user inputs, as many times as the user specifies. The issue I'm running into is that if the user types: !repeat 5 x y , the bot will only repeat x 5 times, and not x y 5 times. This is the code I'm trying to run: @bot.command() async def repeat(times: int, content="Repeating..."): for i in range(times): if times > 10: await bot.say("Cannot spam more than 10 messages at a time.") return else: await bot.say(content) 回答1: You can use the keyword