In another question, I saw the following syntax:
#[unset!]
What is that? If I say type? #[unset!] in R3, it tells me unset!, but it doesn't solve the mystery of what #[] is.
So curious.
Hi chaps,
I hit a bit of a quirk of scala's syntax I don't really understand
object Board {
def getObjectAt(x:Int, y:Int):Placeable = return locations(x)(y)
}
works fine. But
object Board {
def getObjectAt(x:Int, y:Int):Placeable {
return locations(x)(y)
}
}
returns the error
Board.scala:8: error: illegal start of declaration
return locations(x)(y)
I found some stuff that says the second form convinces the scala compiler you're trying to specify an expansion to the return type Placeable. Is there a way I can fix this, or should I just avoid specifying a return type here?
Ok, so I was comparing some stuff in my own DSL to Ruby. One construct they both support is this
x=["key" => "value"]
Knowing the difference between arrays and hashes, I would think this to be illegal, but the result in Ruby is
[{"key" => "value"}]
Why is this? And with this kinda syntax why can't you do
x=("key" => "value")
Why is an array a special case for implicitly created hashes?
I'm learning to use the PHP interactive shell, but I'm having trouble with multi-line code.
Using backslashes like in the UNIX shells doesn't seem to work. What am I doing wrong ?
php > function test(){\
php { echo "test";\
php { }\
php > test();
PHP Parse error: syntax error, unexpected T_ECHO, expecting T_STRING in php shell code on line 2
Hi, I'm trying to use Ubuntu for Rails development and I'm liking gedit except the syntax highlighting does not seem to work with out me setting it for each file I open. Should it not recognize a .rb file a ruby file rather than me having to go into the menu and setting it as such?
Have I missed a setting somewhere?
Thanks
I am looking for the asp.net vb syntax to write;
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://its/foo.wsdl">
With an xmlwriter
Any help greatly appreciated, I'm very stuck!
Thanks.
I was trying to compile a ruby module, and my compiler choked. I think it might have something to do with a line in ruby.h:
void rb_check_type _((VALUE,int));
I've never seen this _ syntax before. What does it mean? Could it cause problems for my compiler (Visual Studio)?
Query:
select t1.col1
from table1 t1
inner join with (nolock) table2 t2 on t1.col2 = t2.col1
Am trying to use nolock option for optimized query in mySQL db, but for some reason the above query
does not work and the error i receive is
You have an error in your SQL syntax;
Any thoughts?
Hi,
I am trying to use the solution given here -
http://stackoverflow.com/questions/218808/c-ado-net-nulls-and-dbnull-is-there-more-efficient-syntax
But I am working with an int.
Thanks
I'm looking for the syntax of the getter/setter. Which is the setter and which is the getter??
Is the readwrite attribute the getter?
Is the assign the setter?
@interface SomeClass : NSObject
{
NSString *str;
NSDate *date;
}
@property (readwrite, assign) NSString *str;
@property (readwrite, assign) NSDate *date;
I'm trying to figure out if
g++ -fsyntax-only
does only syntax checking or if it expands templates too.
Thus, I ask stack overflow for help:
is there to write a program so that syntactically it's valid, but when template expansion is done, an error occurs?
Thanks!
So I have a PHPUnit test, and found this code within a function.
global $argv, $argc;
echo $argc;
print_r($argv);
I understand what these variables represent (arguments passed from the command line), but I've never seen this syntax before:global $argv, $argc;
What specifically is going on here?
I'd like to embed code from my SVN repository into my website, using PHP. The SVN has public anonymous access, so the PHP code should be fine reading it.
The code on said SVN is java, and so far I've had no luck finding a syntax-highlighter to make the code more readable. Ideally I'd like one that uses CSS classes so that I can change the colors to match the look of the website.
Could someone point me to a PHP library that highlights Java code?
I have the array variable say $value, and it has the below given array
[navigation] => navigationHistory Object
(
[path] => Array
(
[0] => Array
(
[page] => order_form.php
[mode] => NONSSL
[get] => Array
(
[id] => 31
)
)
)
)
how to echo/access the 'get' index of the given array in PHP syntax
Hi,
I am having a mind-freeze here, but I cant seem to find the equivalent lambda syntax for -
string[] a = {"a","b","c"};
string[] b = {"1","2","3"};
var x = from a1 in a
from b1 in b
select new{a1, b1};
Hi,
I want to write a simple text editor for iPhone with syntax highlighting support for c,c++.
But the problem is, I dont't know how to do this. The first solution I was thinking about, was to go over the text and highlight keywords when the value of the UITextView has changed, but I think that if I got more than 1000lines of code that doesn't work very well.
Thanks for help!
when I input
mysql -u root -p XXXX dbname < c:/filename.sql
alway get this error "error 1064 <42000:" you have an error in your SQL suntax; check the manual that corresponds to your MySql server version for the right syntax to use near .....
what is wrong with this statement?
I am not very familiar with the Javascript syntax bellow. Can anyone shade light about the sense of this block? For what purpose?
(function foo() {
alert('bar');
})();
Thanks in advance.
This is a module named XYZ.
def func(x)
.....
.....
if __name__=="__main__":
print func(sys.argv[1])
Now I have imported this module in another code and want to use the func. How can i use it?
import XYZ
After this, where to give the argument, and syntax on how to call it, please?
The Python documentation specifies that is is legal to omit the parentheses if a function only takes a single parameter, but
myfunction "Hello!"
generates a syntax error. So, what's the deal?
(I'm using Python 3.1)
I have seen some solutions, or at least tries, but none of them really work.
How do I strip all tags except those inside or [code] - and replace all the < and with < etc. in order to let js do some syntax highlighting on the output?
I have the following code:
function wp_logout_url($redirect = '') {
$args = array( 'action' => 'logout' );
if ( !empty($redirect) ) {
$args['redirect_to'] = urlencode( $redirect );
}
$logout_url = add_query_arg($args, site_url(wp-login.php', 'login'));
$logout_url = wp_nonce_url( $logout_url, 'log-out' );
return apply_filters('logout_url', $logout_url, $redirect);
}
But I get the following error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
How can I fix this?
In MySQL you can insert multiple rows like this:
INSERT INTO 'tablename' ('column1', 'column2') VALUES
('data1', 'data2'),
('data1', 'data2'),
('data1', 'data2'),
('data1', 'data2');
However, I am getting an error when I try to do something like this. Is it possible to insert multiple rows at a time in an SQLite database? What is the syntax to do that?
I am trying to find the correct syntax to pass a varible to my JQuery Post.
var id = empid;
$.ajax({
type: "POST",
url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders",
data: "{empid: empid}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(result) {
alert(result.d);
}
I don't think the data: value is quite right. Someone set me straight?
Thanks!
Hi
There are several PHP or js code formatting libs out there -- does anyone know if similar libs exist in Java?
Ie., Given a string of code, return a formatted string with syntax colouring etc.
It'd be ideal if it auto detected the language, but I might be pushing my luck there...