syntax-error

SyntaxError: invalid syntax - Python 3.5 [closed]

为君一笑 提交于 2019-12-11 20:03:36
问题 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 4 years ago . I have a small code in Python, which looks like that: import sys def _158a(): n, k = map(int, sys.stdin.readline().split()) data = input().split() a=[] for i in range(n): a.append(int(data[i])) ans=0 for i in range(n): if a[i]>=a[k-1] and a[i]: ans+=1 return ans res = _158a() print(res) with input from keyboard:

PHP MVC works locally but when uploaded to host fails [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-11 19:58:28
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . Everything is working fine on localhost/myweb but when i upload the folder myweb to my public_html directory i get error: [16-Sep-2012 18:32:55] PHP

Syntax error with tsoutliers package using Nile dataset

谁说胖子不能爱 提交于 2019-12-11 18:11:41
问题 I'm trying to locate outliers in a time series using the tsoutliers package. I'm using the classic Nile dataset (which you can find here: https://vincentarelbundock.github.io/Rdatasets/datasets.html) and I'm unsucessfully getting the tso() function to work. My code is: nile.outliers <- tso(Nile,types = c("AO","LS","TC")) However, I get this syntax error, or what I assume is a syntax error: Error in tso0(x = y, xreg = xreg, cval = cval, delta = delta, n.start = n.start, : trying to get slot "y

Syntax error in function to shift array by k

霸气de小男生 提交于 2019-12-11 17:05:33
问题 I'm trying to shift array by k to left. Here's my code. But I'm getting compile error on shifted;; line. let shift_left (arr: array) (kk: int) = let size = Array.length arr in let k = kk mod size in let shifted = Array.make size 0 in for i = 0 to size - 1 do if i < k then (shifted.(size - k + i) <- arr.(i)) else (shifted.(i-k) <- arr.(i)) done shifted;; let arr = [| 1; 2; 3; 4; 5; 6; 7; 8; 9; 10 |];; let shifted = shift arr 4;; Array.iter print_int arr; print_string "\n";; Array.iter print

Getting Errors In My Activity Switching App

心已入冬 提交于 2019-12-11 16:31:09
问题 Hello I am trying to fix my app that features a progress bar as well as a button that switches to a new activity. Could someone please help me isolate my errors and give me a solution to the problem? I am very new at android programming! Here is my main activity. I have bolded where I am receiving errors. Here I get an error saying "Activity 1 Must be defined in its own file" package com.example.progressdialog; import android.app.Activity; import android.app.ProgressDialog; import android

Parse error Unexpected } in if-else block [duplicate]

只愿长相守 提交于 2019-12-11 16:18:33
问题 This question already has answers here : PHP parse/syntax errors; and how to solve them? (17 answers) Closed 2 years ago . I have been searching on SO for over an hour but couldn't get my issue resolved. For some reason there is error on page as Parse Error: syntax error unexpected } in line 262. It is closing brackets for the else condition. I removed else condition, the code ran smoothly. Then I reverted back and removed everything inside else condition but still the error is same, I am

Python Syntax error: non-ASCII [duplicate]

↘锁芯ラ 提交于 2019-12-11 14:53:01
问题 This question already has answers here : SyntaxError: Non-ASCII character '\xa3' in file when function returns '£' (6 answers) Correct way to define Python source code encoding (6 answers) Closed last year . I keep getting an error and I'm not sure on how to fix it. The Code line: if not len(lines) or lines[-1] == '' or lines[-1] == '▁': lines = list(filter(lambda line: False if line == '' or line == '▁' else True, list(lines))) Output: SyntaxError: Non-ASCII character '\xe2' in file prepare

Syntax error when querying contacts database for an email

自闭症网瘾萝莉.ら 提交于 2019-12-11 14:47:59
问题 I am trying to do a search through the contacts database for an email address and get the contact ID of that person if it finds it but everytime I try I get a syntax error 01-03 17:15:10.574: E/AndroidRuntime(7907): java.lang.RuntimeException: Unable to start receiver com.app.notifyme.GmailReciever: android.database.sqlite.SQLiteException: near "@gmail": syntax error: , while compiling: SELECT raw_contact_id FROM view_data data WHERE (1) AND ((data1=johnsmith@gmail.com)) 01-03 17:15:10.574: E

the method document of the iwebbrowser2 object failed

霸气de小男生 提交于 2019-12-11 14:27:49
问题 When I launch the site via my code, there is an error of type "method document of object iwebbrowser2 failed " at the level of my variable "oDoc" Private Function CreerNavigateur(ByVal mails As String) Dim IE As Object Dim oDoc As Object Dim Htable, maTable As Object Dim text As String Set IE = CreateObject("InternetExplorer.Application") IE.Visible = False IE.navigate "https://csrtool-ssl.sso.infra.ftgroup/csrtool_web/Bricks/pg/osuit/pages/identity/IdentityAccountAndUsers?type=emailAlias

call overwritten child function within parent function

喜你入骨 提交于 2019-12-11 14:14:47
问题 is it possible in c++ to call a child function from a parent function. Let's take an example: The parent class defines in a function (parse) the general workflow. The workflow then calls different methods which represent part of the flow (parseElementA). These functions can be overwritten by the child class, if not the standart function, which is part of the parent shall be used. My issue is: I create a child object and execute the workflow function (parse). When the overwritten function