syntax

How to read complex PHP arrays?

I've been working with ProjectPier, and found arrays like the following. How do I read this architecture with PHP? ApplicationLog Object ( [is_new:DataObject:private] => [is_deleted:DataObject:private] => [is_loaded:DataObject:private] => 1 [column_values:DataObject:private] => Array ( [id] => 24 [taken_by_id] => 1...

Microsoft C Compiler: Inline variable declaration?

I'm writing C in Visual Studio 2010. The compiler doesn't seem to want to let me use inline variable declarations. The following code produces an error: unsigned int fibonacci_iterative(unsigned int n) { if (n == 0) { return 0; } if (n == 1) { return 1; } unsigned int prev_prev = 0; // error unsigned int prev = 1; // error u...

A C++ syntax question involving non trivial templating and friend declaration

Hi, The following code should be self explanatory. I have two questions regarding the used syntax (which is the syntax that must be used). I'll be forever grateful if you could provide me with answers for these presented questions. template <typename T> struct A { template <typename S> void f (const A<S> &s); template <typ...

C# syntax: Placing the interface's name in the implementation's declaration

I came across some interesting C# syntax that I'm not familiar with in the source code for the Composite Application Library for WPF's DelegateCommand<T> class. There are some method declarations which are prefixed with the ICommand interface name, and they do not have accessibility modifiers specified. For example: bool ICommand.CanEx...

Language Tricks to Shorten My Java Code?

I am currently rediscovering Java (working with Ruby a lot recently), and I love the compilation-time checking of everything. It makes refactoring so easy. However, I miss playing fast-and-loose with types to do an each loop. This is my worst code. Is this as short as it can be? I have a collection called looperTracks, which has instan...

how do you access variables defined in masterpage.master.vb in masterpage.master

I have a collection of cookies filled with Browserhawk information in masterpage.master.vb such as; Dim useCSS as boolean = 0 Response.Cookies("Stylesheets").Value = brHawk.Stylesheets if Response.Cookies("Stylesheets") = True then useCSS = 1 if Stylesheets is True I set useCSS to 1, if false I set useCSS to 0 I need to access these i...

$_GET and $_POST

Hi , Really silly question but having a off day today. basically I have a form and the method is set to post on the action page when I use $_POST i dont get the value but if I use $_GET or $_REQUEST I do. this does not make sense could some on just clarify it for me. the code of the form is <form action="create.php" method"POST"> ...

Could anyone please explain this Java syntax?

I have encountered the following Java syntax that I don't recognize. This part is fine: public abstract class Stream<T> implements Iterator<T> { public boolean hasNext() { return true; } public void remove() { throw new RuntimeException("Unsupported Operation"); } } But this I don't get: Stream<Integer>...

C#: Is there a difference between return myVar vs. return (myVar)?

I was looking at some example C# code, and noticed that one example wrapped the return in ()'s. I've always just done: return myRV; Is there a difference doing: return (myRV); ...

Why can't I retrieve "contents" of a note item in Yojimbo, but I can retrieve the "content"?

A note item in Yojimbo's Applescript dictionary is defined as: note item n [inh. database item] : A note item. elements contained by application. properties encrypted (boolean, r/o) : Is the note is encrypted? contents (text) : The contents of the note. syn content If this note is encrypted, the contents property is only rea...

jQuery contains() with a variable syntax

Hello, I have an "uncaught exception: Syntax error, unrecognized expression: )" in a jQuery application. The code is: <script> $(document).ready(function(){ $('.drag').click(function() { $('.drag').each(function(i) { $(this).addClass('test' + i) }); ...

Conditional operator in Python?

Hi All do you know if Python supports some keyword or expression like in C++ to return values based on if condition, all in the same line (The C++ if expressed with the question mark ?) // C++ value = ( a > 10 ? b : c ) ...

Allowed html/css/javascript - class syntax

I am in the need of defining html classes from content, so pretty much every char could be used. According to html reference I may use cdata, so I should not run into problems. I figure though, that css and/or javascript/jquery won't play nicely with that. Anyone has experience with what chars can be used without problems or if there is...

Dreamweaver and PHP (Alternatives)

Hello, I know there has been quite a few comments on this topic. I have tested quite a few IDE's for PHP, I have liked phpDesigner 7, which is great for PHP... but I like the way Dreamweaver has the live rendered view for quick layouts and design. It could be done by rendering to the browser and using firebug, but I really like using ...

Why some method declarations in the UITableViewDataSource protocol are preceded by "tableView:(UITableView *)tableview?

The formulation of the question may be confusing. I do understand why it is useful for a method like cellForRowAtIndexPath to receive a pointer the relevant UITableView. What I don't understand is more Objective-C wise: I would like to put a name on is this special way of declaring methods? Like if an object (e.g. UITableView) that hav...

Please assist in explaining this asp.net error message when converting string to datetime

Function: Public Shared Function ConvertoDate(ByVal dateString As String, ByRef result As DateTime) As Boolean Try Dim supportedFormats() As String = New String() {"MM/dd/yyyy"} result = DateTime.ParseExact(dateString, supportedFormats, System.Globalization.CultureInfo.CurrentCulture, System.Globalization...

php to form script? syntax error unexpected

Hi Can anyone suggest a quick form script for a php form? I generated the one below from telepro and modified the html and emails a bit, but I get this error for the checkbox Parse error: syntax error, unexpected '=' in /home/inn.co.uk/public/mailer.php on line 14 thanks for your help Regards Judi <form method="POST" action="...

C++: A way to declare a variable (or more than one) in an if statement that separates out the variable definition and the test?

One can do this: case WM_COMMAND: if (WORD wNotifyCode = HIWORD(wparam)) { ... } And one can do this: case WM_COMMAND: { WORD wNotifyCode = HIWORD(wparam); if (wNotifyCode > 1) { ... } } But one cannot do: case WM_COMMAND: if ((WORD wNotifyCode = HIWORD(wparam)) > 1) { ... } Using a for statement here I think is mi...

Method of Multiple Assignment in Python

I'm trying to prepare for a future in computer science, so I started with ECMAScript and I am now trying to learn more about Python. Coming from ECMAScript, seeing multiple assignments such as a, b, c = 1, 2, 3 leaves me bewildered for a moment, until I realize that there are multiple assignments going on. To make things a bit clearer, I...

Self Extraction Directive file comment?

I'm using IExpress 2.0 to create the deployment for my Visual Studio project, and it has generated an SED file that I'd like to document. What's the syntax for me to place a comment inside the SED file? ...