syntax

C++: Trouble with tr1::bind (C2065)

I'm getting a compiler error with bind: using namespace std; bool odp(int arg1, int arg2); // ... find_if(vec.begin(), vec.end(), tr1::bind(odp, iValue, _1)); // C2065 My goal is to curry odp(), so its first argument is iValue, and apply that function in find_if. The error: C2065: '_1' : undeclared identifier. What am I doing w...

Strange ruby syntax

Hi, what the syntax is in Action Mailer Basics rails guide ? class UserMailer < ActionMailer::Base def welcome_email(user) recipients user.email from "My Awesome Site Notifications <[email protected]>" subject "Welcome to My Awesome Site" sent_on Time.now body {:u...

c++ callback syntax in a class

I am trying to figure out the syntax to register a callback with this 3rd party software. I think it is probably a basic question, I just am not too familiar with c++. They have a method for registering a callback function so their code can call a function in my code when an event happens. They provided a working example that register...

Cryptic Erlang Errors

Okay so I started learning erlang recently but am baffled by the errors it keeps returning. I made a bunch of changes but I keep getting errors. The syntax is correct as far as I can tell but clearly I'm doing something wrong. Have a look... -module(pidprint). -export([start/0]). dostuff([]) -> receive begin -> io:form...

mysql - offset problem

Hi, I recently posted a question about getting last 3 results in table in the correct order. I now want the get all comments apart from the last 3 in the correct order. Here is my syntax; SELECT * FROM (SELECT * FROM $table ORDER BY ID DESC OFFSET 3) AS T ORDER BY TIME_STAMP The error I am receiving is: You ...

Using colon syntax and variables in Sass

I am still using the old colon syntax (I prefer it more than the bracket syntax) and this particular code: a.button-link +box($main-color) +border-radius(5px) :background :color $main-color :color #fff :padding 5px generates a warning like so: DEPRECATION WARNING: On line 12, character 3 of '/Users/eumir/rail...

Conditional OrderBy

So, right now I've got a number of columns the user can sort by (Name, County, Active) and that's easy but messy. Looks something like this... Select Case e.SortExpression Case "Name" If (isDescending) Then resultsList.OrderByDescending(Function(a) a.Name).ToList() ...

Why do I see javascript arrays getting created with string.split()?

I see code like this all over the web var days= "Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "); Why do that instead of var days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; I don't think laziness or ignorance has anything to do with it. This is out of jQuery 1.4.2 props:...

Where is my associative array and how do I access it using Perl DBI?

I'm working with perl, and using DBI. Up to now, I've been using ->fetchall_arrayref to get the results of a database query, and just accessing the array by numeric keys. However, I much prefer to be able to access records by the field names (associative fetch) than numeric. How do I do this, and what is the correct syntax for accessing...

Looping over an array to build a multidimensional array in Perl, converting from PHP, and syntactically wrong

Working on converting an array to another array. In PHP, this is easy, but Perl has some syntax that I am having a hard time getting my head around and understanding. Here is my loop in Perl: foreach my $r (@toindex){ #print Dumper $r; %indexed{@$r[0]}{'image_id'} = @$r[0]; #Broken %indexed{"@$r[0]"}{'image_id'} = @$r[0...

Why PHP variables start with a $ sign symbol?

Has anybody ever thought about this question. Why we must write $var_name = value; and not var_name = value;? Yes I know that it is the syntax rule that PHP uses, but why is it a $ sign symbol? ...

Question regarding implementation of multi component dependent uipickerview

I am having trouble grasping the concept of multi component uipickerviews. I really would like to just OWN this subject. I would like to make a 4 component pickerview with components that are dependent on one another. The first component is being populated from an array from my db, and that is showing up fine. I have all of the other i...

In T-SQL, how to insert a new row with all values set by default?

Hi, In Microsoft SQL database, I have a table where every column have default values (either fixed values or stuff like identity or getdate()). I am trying to write an SQL statement which will insert a new row in which every cell will have a default value. Neither insert into MySchema.MyTable nor insert into MySchema.MyTable () va...

what programming languages support labels with break and continue statments ?

I recently read about labelled statments in java and the ability to specify a label with the break and continue statements. What other languages support this sort of syntax ? ...

What's wrong with JavaScript's regular expression notation?

I was reading Douglas Crockford's web page, JavaScript: The World's Most Misunderstood Programming Language, and I couldn't help but notice that, under Design Errors, he mentions "the notation for literal regular expressions." What exactly is he talking about? What's wrong with JavaScript's notation for regular expressions, and why? ...

JQuery: .hide() is not a valid function

Firebug is complaining about this line: $("#original-description").text(response['course']['original_description']).hide(); Do I have a syntax error? Looks fine to me. More context: bindOnSuccess($('#course-search'), function(response) { if (!response) { $("#system-status").text("Sorry, no course could be found for that ...

What is the name of such notation?

JSON web site uses very clear notation to describe JSON's syntax: What is the name of such notation? Is this is just a graphical presentation of BNF or it has it's own name? ...

Please help me understand this syntax (implementing static assert in C++)

This syntax was used as a part of an answer to this question: template <bool> struct static_assert; template <> struct static_assert<true> {}; // only true is defined #define STATIC_ASSERT(x) static_assert<(x)>() I do not understand that syntax. How does it work? Suppose I do STATIC_ASSERT(true); it gets converted to static_a...

c++: explain this function declaration

class PageNavigator { public: // Opens a URL with the given disposition. The transition specifies how this // navigation should be recorded in the history system (for example, typed). virtual void OpenURL(const GURL& url, const GURL& referrer, WindowOpenDisposition disposition, PageTr...

Why is there String/string and Object/object in C#?

Possible Duplicate: String vs string in C# I know there is no difference between using string and String. But, why is there the option in C#? Is it the same for object and Object? EDIT Note, that I am asking why. ...