syntax

How to throw an exception in C?

I typed this into google but only found howtos in C++, how to do it in C? ...

what does ** mean in C

What does it mean when a object has 2 asterisks at the beginning? **variable ...

Suggestions on syntax to express mathematical formula concisely

Hello. I am developing functional domain specific embedded language within C++ to translate formulas into working code as concisely and accurately as possible. I posted a prototype in the comments, it is about two hundred lines long. Right now my language looks something like this (well, actually is going to look like): // implies tw...

Methods for accessing PHP global variables

$GLOBALS['current_view'] and global $current_view, which do you prefer and why? ...

Objective-C Syntactical Question

Just doing some research on searching for a character or word within a NSString and I came across this code snippet (which works like a charm): return [sourceString rangeOfString:searchString].location != NSNotFound; Am I right in thinking that the above code is functionally identical to: NSRange range = [sourceString rangeOfString:s...

Can I assign test result to a boolean variable in Java?

When I write boolean bool = aString.indexOf(subString) != -1 Eclipse did not complain, does it mean that it is the same as boolean bool = aString.indexOf(subString) != -1 ? true : false? ...

What is this : in php?

What this symbol : mean in php? ...

Add to language syntax in Netbeans/Eclipse

Hey, This may seem like seem like a bit of a weird/uncommon request but I am trying to find out if it is possible. I would like to add to the language syntax in Netbeans or Eclipse easily without needing to create an entirely new language. According to this question http://stackoverflow.com/questions/281992/how-to-add-more-syntax-elemen...

phantom error "error parsing XML: unbound prefix"

The error "error parsing XML: unbound prefix" shows up on my main layout: main.xml when I first open Eclipse. To make the error go away, all I have to do is make a modification to the file, then undo it, then hit save (have to make a change in order to be able to save file and thus trigger the new syntax check). My environment is: F...

Php alternative syntax highlighting in Notepad++

Is there any way to get tags and the if / endif stuff to highlight like the braces? Search brings me no help. ...

C++: Syntax for map where Data type is function?

In C#, what I want would look something like this: IDictionary<string, action()> dict = new Dictionary<string, action()>(); How do I do this in C++? This gives compiler errors: map<string, void()> exercises; ...

error CS0133: Assigning the result of a function to a const in C#.net

Trying to tidy up scope and avoid possible multiple calls to RegisterWindowMessage. Currently have a class used once with the following member [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern int RegisterWindowMessage(string lpString); private int m_message = RegisterWindowMessage("MY_MSG"); As we...

learning to make sense of the syntax of syntax

i want to use alter table but the syntax posted here: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html is very confusing i do not understand what the [ ] mean or the { } mean or the pipes is there some kind of tutorial that can help me understand this? ...

PHP while(variable=mysql_fetch_assoc) - explanation

Hi, I have been working with C# so this is quite strange for me: while($variable=mysql_fetch_assoc) { $X=$variable['A']; $Y=$variable['B']; } If it is like an ordinary loop, then X,Y will be reset with every loop, right? I have not been able to look up in PHP manual how it works. I guess that in each loop it advances to ...

Javascript library for syntax-highlighting syslog text logs?

I'm display some plain-text syslog output on a web page. I'd really like to pretty-print it, highlighting dates and hostnames. Are there any javascript syntax highlighting libraries which come with syslog support? ...

Python: Once and for all. What does the Star operator mean in Python?

Possible Duplicate: What does *args and **kwargs mean? What does the * operator mean in Python, such as in code like zip(*x) or f(**k)? How does it work internally in the interpretor? Is it fast or not? When is it useful and when is it not? Should it be used in a function declaration or in a call? ...

Can Visual Studio 2010 do ".inc" file syntax highlighting?

Can Visual Studio 2010 be configured to do syntax highlighting on ".inc" files? We have numerous large projects with tons of these ".inc" files (asp files) and so changing the file extension to ".asp" is not an option. All I want Visual Studio 2010 to do is treat these ".inc" files just like ".asp" files when it comes to syntax highlight...

Is it possible in Ruby to define a method which name ends with : (colon)?

Just wondering if it is possible, by some loophole, to define a method name that ends in a colon. The purpose it to make things look like this: mymethod: arg1,arg2,arg3 ...

C++ STL: Trouble with iterators

I'm having a beginner problem: bool _isPalindrome(const string& str) { return _isPalindrome(str.begin(), str.end()); // won't compile } bool _isPalindrome(string::iterator begin, string::iterator end) { return begin == end || *begin == *end && _isPalindrome(++begin, --end); } What am I doing wrong here? Why doesn't str.begin(...

C++: Templates for static functions?

I have a static Utils class. I want certain methods to be templated, but not the entire class. How do I do this? This fails: #pragma once #include <string> using std::string; class Utils { private: template<class InputIterator, class Predicate> static set<char> findAll_if_rec(InputIterator begin, InputIterator end, Predicate ...