syntax

Object reference not set to an instance of an object (NullreferenceException was unhandled by user code)

How can I get around this exception? Dim imagepathlit As Literal = DownloadsRepeater.FindControl("imagepathlit") imagepathlit.Text = imagepath Here is the repeater: <asp:Repeater ID="DownloadsRepeater" runat="server"> <HeaderTemplate> <table width="70%"> <tr> <td colspan="3"><h2>Files you can download</h2></td> </tr> </Heade...

Why do some people prefer "T const&" over "const T&"?

So, I realize that const T& and T const& are identical and both mean a reference to a const T. In both cases, the reference is also constant (references cannot be reassigned, unlike pointers). I've observed, in my somewhat limited experience, that most C++ programmers use const T&, but I have come across a few people who use T const&. I ...

What does a syntax like this mean in C#?

What does a syntax like this mean in C#? public abstract class HostFactory<TApp> : ServiceHostFactory where TApp : IFoo ...

Repeater not repeating :0) (asp.net)(vb)

Morning stackoverflow, I have a repeater, with the following code in my aspx page; <asp:Repeater ID="Contactinforepeater" runat="server"> <HeaderTemplate> <h1>Contact Information</h1> </HeaderTemplate> <ItemTemplate> <table width="50%"> <tr> <td colspan="2"><%#Container.DataItem("position")%></td> </tr> <tr> <td>Name:</td> <td><%#Cont...

Is there any difference between [1 2] and [1 ,2] in MATLAB?

>> [1 2] ans = 1 2 >> [1 ,2] ans = 1 2 >> It looks the same,is that true? ...

error: expected `;' before '{' token - What is the cause?

Here is my implementation file: using namespace std; #include <iostream> #include <iomanip> #include <string> #include <stack> //line 5 #include "proj05.canvas.h" //----------------Constructor----------------// Canvas::Canvas() //line 10 { Title = ""; Nrow = 0; Ncol = 0; image[][100]; // line 15 position.r = 0; position...

Floated Child Elements: overflow:hidden or clear:both?

As a web developer I frequently will have two floated (child) divs inside of another (parent) div. Actually I do this all day long. <style type="text/css"> #left {float:left;} #right {float:right;} </style> <div id="parent"> <div id="left" class="child">&nbsp;</div> <div id="right" class="child">&nbsp;</div> </div> Thi...

Simple syntax error still eluding me.

Here is the header for a class I started: #ifndef CANVAS_ #define CANVAS_ #include <iostream> #include <iomanip> #include <string> #include <stack> class Canvas { public: Canvas(); void Paint(int R, int C, char Color); const int Nrow; const int Ncol; string Title; int image[][100]; stack<int> path; struct PixelCoord...

What does fopen('text.txt', 'wt') mean in MATLAB?

I tried help fopen, but there is no explanation what t means . ...

What does L == 2 mean in MATLAB?

BW = logical([1 1 1 0 0 0 0 0 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 0 0 0 0]); L = bwlabel(BW,4); [r,c] = find(L == 2); How can a mat...

Inconsistent syntax c# ?

private string[] GetRoles() { string[] foo = {"Test"}; return foo; } The above compiles, but... private string[] GetRoles() { return {"Test"}; } Does not. Replacing it with: return new string[] { "Test" }; Will obviously compile though. Is this inconsistancy or am i being stupid, or am i just wrong...

What's the difference between {} and [] in MATLAB?

>> A={1 2;2 3} A = [1] [2] [2] [3] >> A=[1 2;2 3] A = 1 2 2 3 It seems to me they are essentially the same thing? ...

VS 2008 and C99

Hi, I read with interest the post "How universally is C99 supported ?". One of the comments therein points that Microsoft doesn't support C99. But the comment symbol // works with VS 2008 and this symbol is in C99. I have two questions: To what extent VS 2008 support C99? Is it ok in the same code to mix C89 and C99 syntax together? So...

What does ~= mean in MATLAB?

I've never seen this operator yet. ...

Making Vim auto-indent PHP/HTML using alternative syntax

I edit PHP in Vim and have enjoyed the auto-indenting, but PHP's alternative syntax doesn't auto-indent how I would like. For instance, in an HTML template, Vim doesn't recognize the open control structure in the same way it does when using braces. Example: <html> <body> <p> <?php if (1==1): ?> This line should be inde...

PHP syntax error “unexpected $end”

I have 3 files 1) show_createtable.html 2) do_showfielddef.php 3) do_showtble.php 1) First file is for creating a new table for a data base, it is a fom with 2 inputs, Table Name and Number of Fields. THIS WORKS FINE! <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8...

what is the 'wb' mean in this code.. using python

code: file('pinax/media/a.jpg', 'wb') thanks ...

python while loop

def merge(l1,l2): i=0; while((l1[i]!=none)||(l2[i]!=none)): SyntaxError: invalid syntax being a newbie i can't figure out whats wrong with the abouve code. ...

Syntax proposition: readability of templated type declarations

I wonder if syntax as follows would be helpful in your opinion as a code readability improvent and self-commenting of code: std::map<std::string name, std::vector<int> scores> myMap; In this example it clearly says and no other comment is needed, what for we are using myMap variable. Looking forward to your opinions. ...

get value from array in php

Array ( [0] => Array ( [OPT] => 65 ) ) how to get 65 to a variable in PHP help me please.... ...