Xcode / C errors: Expected expression, Missing terminating '"' character - ios

I'm incredibly new to C and Xcode in general. Could somebody explain why this isn't working, and how to fix it?

You have a number of issues.
Regarding the Expected Expression error, you declared _declination and _latitude as UITextField. To get the integer value, you can use: _declination.text.intValue. In context:
if (_declination.text.intValue >= 90 - _latitude.text.intValue)
Regarding Missing terminating character " you need to change:
#The star is circumpolar"
to:
#"The star is circumpolar"

You are missing a quote:
"The star is circumpolar!"

Related

Problem with Computercraft: '=' expected near 'monitor'

I am new to computercraft and have a problem with my code.
The error is
'=' expected near 'monitor'
Do anyone know the problem and can fix it?

stdin:1: '=' expected near '<'

So I'm starting to Learn Lua, my problem is that in a tutorial that teaches you to create Guess My Number Game starts with this line:
name = "John"
print<name>
So in the tutorial shows that prints the name but in mine gives this error:
stdin:1: '=' expected near '<'
Please, what am I getting this?
Thank you for all your help.
Functions use parentheses to enclose their arguments, so the second line should be
print (name)

why erlang not supporting expressions like : mysum(32)(1)

I am new in Eralng . get a little query about applying functions
assumming got a funciton defined :
mysum(X) -> fun(Y)-> X + Y end.
then try to calling like this
mysum(32)(332)
getting error
* 1: syntax error before: '('
so I had to
apply(mysum(32),[333])
or
M = mysum(32), M(333)
but I would like to know a little bit more , why it is not supporting , what is the disadvantage
As you expected, mysum return a function. you must enclose the evaluation inside parenthesis to satisfy the erlang parser:
(mysum(32))(332)
this spelling is obviously not ambiguous.
Your expression seems not ambiguous because you know that mysum(32) is a function, but the types are solved at run time in erlang, so the parser has no idea of what is mysum(32), it is expecting some help here to know what it has to do: the parenthesis, the apply or the intermediate variables, but it could be an operator or a separator.

iOS build a regular expression for use with NSRegularExpression

i've tried to read the apple documentation but i'll never use regular expression and i do not understand how to solve this matter.
I need to write a regular expression for check if the user has selected a string that match with this rules:
first letter could be s or S and it's optional
second chars could be a . (char dot) and it's optional
4 number digit could from 1 to 4 and must be always present
after the number could be present any single char from a-z and could be optional
after i can have a . (char dot) and it's optional
the last 2 must be a digit must be always 2 number and could be optional
i tried to write in this way
NSString *regexStr = #"(s|S)?(\\.)?(\\d+){,4}([a-z]?(\\.)?(\\d+){2}?";
but the console give this error
Error making regex: Error Domain=NSCocoaErrorDomain Code=2048
"The operation couldn’t be completed. (Cocoa error 2048.)" UserInfo=0x6d3e9b0
{NSInvalidValue=(s|S)?(\.)?(\d+){,4}([a-z]?(\.)?(\d+){2}?}
Anyone could help me?
Thanks!
Here you go:
(s|S)?(\.)?(\d){0,4}[a-z]?(\.)?(\d){2}?
You had an extra opening parenthesis that made the syntax invalid, and + signs after the \ds, that made the regexp accept infinite numbers of digits.
Regexpal is great for debugging regexps: http://regexpal.com/

javacc parseException... lookahead problem?

I'm writing a parser for a very simple grammar in javacc. It's beginning to come together but at the moment I'm completely stuck on this error:
ParseException: Encountered "" at line 4, column 15.
Was expecting one of:
The line of input in question is z = y + z + 5
and the production that is giving me problems is my expression which get called from
varDecl():
<ID> <EQL> expression()
Expression looks like this:
<VAR> (<PLUS> expression())?| <NUM> (<PLUS> expression())?
| call() (<PLUS> expression())?
I'm at a loss as to why I'm getting this error - any insight would be greatly appreciated.
Hm, yes, that's not a very helpful error from JavaCC. What version of JavaCC are you using?
Also, it's difficult to troubleshoot these problems without seeing the full grammar... and although I understand you might not be in a position to post that.

Resources