syntax

Correct InstallUtil Path To File Syntax?

I'm trying to install a Windows Service using a batch file, let's call it "installservice.bat". Inside the file I have the following commands: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -i ".\MyService.exe" pause When I excute the batch file (running as administrator on Vista) I get this: Exception occurred whil...

PHP syntax question: What does the question mark and colon mean?

Possible Duplicate: quick php syntax question return $add_review ? FALSE : $arg; What do question mark and colon mean? Thanks ...

insert values with select

I have two tables create table p ( x number, y number, z number ); create table q ( a number, b number, c number, d varchar2(20) ); I have inserted insert into p values('1','2','3'); now i need to insert into q selecting values from p with last field getting name like Table _name in table q values such tha...

What is wrong with my syntax here?

The goal is to count the number of paragraphs in a group of users text... (I will assume its always bigger than 5 paragraphs for this exercise) Then I want to 1/2 the number of paragraphs, round it down and enter some content(echo "yehhoo") in between. I do understand the way I have gotten my $newvalue is not very good, would also lik...

Close multiple DIV elements with a jQuery function

Hi. I need a small function for jQuery that would close multiple DIV elements, but I'm having trouble with JS syntax. I got this far: function closePanels{ $("#servicesPanel").hide("fast"); $("#portfolioPanel").hide("fast"); $("#contactPanel").hide("fast"); $("#aboutPanel").hide("fast"); }; Sounds logical to me: That...

Checking VBScript syntax

Any good utilities out there for verifying VBScript syntax without actually running the script? What I'm getting at is if I do something like: If (year == "2005" && type == 1) Then ... End If Is there a tool that will tell me that the '&&' really should be 'And' and the '==', just '='? ...

Force parentheses even when calling parameterless functions in VB.NET?

Hi, in VB.NET it is possible to omit parentheses when you call a parameterless function. However this can be very confusing because developers could think that a statement is accessing a property instead of a method. this could result in a performance drop if you are calling the method again and again instead of storing the result in a ...

Does ColdFusion have a short syntax for creating a struct?

Is there any "short" syntax for creating a struct in ColdFusion? I'd like to replace this verbose code: <cfscript> ref = StructNew(); ref.Template = "Label"; ref.Language = "en"; stcML = GetPrompts(ref); </cfscript> with something more like a JavaScript object: <cfscript> stcML = GetPrompts({ Template: "Label", Language: "...

Are there any languages that allow units?

When writing the following today in C# DateTime.Now.AddYears(-60) I wondered whether there are any languages that allow a more natural syntax with units: DateTime.Now - 60years Does anyone know of any? Specifically, I'm interested in the presence of unit operators(?) that turn "60years" into e.g. "TimeSpan.FromYears(60)". It'd also...

ORDER BY on different columns in different directions in SQLite

I have a table defined by: CREATE TABLE bar_table ( _id INTEGER NOT NULL PRIMARY KEY, index INTEGER NOT NULL DEFAULT '65535', _date DATE ) My basic select statement is: SELECT * FROM bar_table ORDER BY <your-clause-here> How do I order my selection by index ascending, and date descending? i.e. small indexes come before lar...

MySQL need help.. how can I filter max(date)

i have a table assumed like this [table a] UID | UNAME ------------------ 001 | a 002 | b 003 | c [table b] UID | LOGS ---------------------- 001 | 2009/08/01 001 | 2009/08/03 003 | 2009/08/02 and i want to have a query like this UID | LASTLOG -------------------- 001 | 2009/08...

Why does this syntax work in MySQL (matching column-pairs against column-pairs)?

Just now I needed to do something like the following query, and was surprised that it actually worked as intented. However I cannot find any documentation on it so I'm a little afraid about unknown side effects of this. Here's what I wrote: select * from Table1 where (col1, col2) in (select col3, col4 from Table2) This seems to be mat...

referencing JS object member without the key

var foo = { "bar": {"blah": 9 } }; Is there a way to get the ["blah"] value of the only member of foo if I don't know the key is "bar"? Can I somehow reference the first member of an object without knowing its key? I'm looking for the equivalent of foo[0]["blah"] if foo were a normal array. In my case, I can't practically iterate...

double $ statement in php

What does the double $ statement stands for in PHP? ...

Why are there not more control structures in most programming languages?

Why do most languages seem to only exhibit fairly basic control structures from a logic point of view? Stuff like If ... then, Else..., loops, For each, switch statement, etc. The standard list seems fairly basic from a logic point of view. Why is there not much more in the way of logic syntactical sugar? Perhaps something like a propos...

having and conditional count() in linq query

I want to create this query: select Something, count(Something) as "Num_Of_Times" from tbl_results group by Something having count(Something)>5 I started with this: tempResults.GroupBy(dataRow => dataRow.Field<string>("Something")) .Count() //(.......what comes here , to make Count()>5?) ...

What does "use strict" do in javascript, and what is the reasoning behind it?

Recently I ran some of my javascript code through Crockford's JSLint, and it gave the following error: Problem at line 1 character 1: Missing "use strict" statement. Doing some searching, I realized that some people add "use strict"; into their javascript code. And once I added the statement, the error stopped appearing. Unfort...

Possible to use stylesheet.css.erb in Rails?

Hey, I'm new to Rails and Ruby in general. I was wondering if it's possible to use an embedded ruby css file (css.erb), similar to using html.erb files for views. For example, I'm using <%= stylesheet_link_tag "main" %> to link to my main.css file in public/stylesheets, but when I change the file extension from main.css to main.css.e...

Ruby templates: How to pass variables into inlined ERB?

Hello! I have an ERB template inlined into Ruby code: require 'erb' DATA = { :a => "HELLO", :b => "WORLD", } template = ERB.new <<-EOF current key is: <%= current %> current value is: <%= DATA[current] %> EOF DATA.keys.each do |current| result = template.result outputFile = File.new(current.to_s,File::CREAT|File::TRUNC|File::R...

Why is arrow notation for yield deprecated?

I'm reading through a pretty swell wikibook on F#. At the bottom of the section on List Comprehensions, it explains that one can use an arrow operator instead of the yield/yield! keywords. But it notes that this is deprecated. I was wondering why? ...