syntax

How to detect vulnerable/personal information in CVs programmatically (by means of syntax analysis/parsing etc...)

To make matter more specific: How to detect people names (seems like simple case of named entity extraction?) How to detect addresses: my best guess - find postcode (regexes); country and town names and take some text around them. As for phones, emails - they could be probably caught by various regexes + preprocessing Don't care about...

How to write properly a nested form with a N-N relation

While working on Rails 3 app, I came to the problem of nested forms. One collection is a set of predefined objects (created with db:seed). The other collection should show a form to allow to choose a few elements. An example is better than a long description, so here it is. Suppose you have 2 models: User and Group. Suppose there are...

How to pass a integer using performSelectorInBackground

I don't want to passAnInt with object. Can I pass it with Int only? if not , how can I do so? Thank you. [myController performSelectorInBackground:@selector(passAnInt:) withObject:int]; ...

what is the meaning of == sign ?

Hi, I am trying to figure out what == sign means in this program? int main() { int x = 2, y = 6, z = 6; x = y == z; printf("%d", x); } ...

Objective-C Strings

I am reviewing code that makes the following call: id<PLResultSet> results = [sqliteDatabase executeQuery:@"select * where id=?",Id]; sqliteDatabase is an instance of PlausibleDatabase (from GoogleCode, I gather). The code works, but I don't understand it. Specifically, how does this section work? @"select * where id=?",Id Is the...

Meaning of lone curly-braced code blocks in C.

I've come across a bit of code that contains a couple code blocks, delineated with curly braces {}. There is no line before the code blocks marking them as part of if statements, function definitions, or anything else. Just a code block floating in the middle of a function. Is there any meaning to this? gcc seems perfectly happy going...

MySql versions compatibility issue

I have a MySql script which runs successfully on Mysql 5.0.67. On Mysql 5.1.36 it simply gives a syntax error. I'm not sure since what version of MySql the script syntax problem started. Does anyone know of a compatibility issue from this older version to the later versions? Thank you ...

Difference Between <%: and <%=

Possible Duplicate: ASP.NET special tags I hope this isn't too much of a newbie question. I seem to always use the correct syntax, but I don't really understand why I'm using the <%: and <%= in ASP.NET, and I was hoping someone could clarify for me. I found this article which explains <%= and <%#, but wasn't able to find anyth...

Does Lua support Decorators?

I come from a Python background and really like the power of Python Decorators. Does Lua support Decorators? I've read the following link but it's unclear to me: http://lua-users.org/wiki/DecoratorsAndDocstrings UPDATE Would you also mind given an example how how to implement it in Lua if it's possible. ...

class variable in Javascript

How do I declare class variables in Javascript. function Person(){ fname = "thisfname"; //What needs to be put here } alert(Person.fname) //It should alert "thisFrame" I don't want to use this approach. function Person(){ } Person.fname = "thisfname"; alert(Person.fname) //alerts "thisframe" ...

Can someone walk me through this line

var types = { "Grocery": "gro", "Restaurant": "res", "Bar": "bar", "Pizza Delivery": "piz", "Quick Service": "qui", "Retail": "ret", "Salon": "sal" } $(".type_changer").attr("id", types[$(this).text()]); I understand that the class type_changer id is being changed to the part of this array but I don't understand types[$(...

javascript regex - remove a querystring variable if present

I need to rewrite a querysting using javascript. First I check to see if the variable is present, if it is I want to replace it with a new search term. If it is not present then I just add the new variable I'm able to get it to work with simple terms like hat, ufc hat whitespaces are %20, so ufc hat is really ufc%20hat I run into probl...

How to write a double type into file in c/c++ in windows?

double Time; ... WriteFile( tmp_pipe, Time, sizeof(double), &dwWritten, NULL ); The above reports : error C2664: 'WriteFile' : cannot convert parameter 2 from 'double' to 'LPCVOID' ...

Razor syntax PHP equivalent

Is there an equivalent to the new ASP.NET razor syntax in PHP? ...

Simple for loop not working.

I've just started learning programming. I'm studying for loops but this program does not work as expected. I want to break the loop when $a is equal to 3 so that I get the output 1 2 but I get 3 as output :( for($a=0;$a<10;++$a) { if($a==3) break print"$a "; } Please help. ...

What is the purpose of the parentheses in Perl's `foreach` statement?

I always wonder why I must write foreach my $x (@arr) instead of foreach my $x @arr What is the purpose of the parentheses here? ...

PHP Colon syntax for control structures convertor

Dear all, I would like to ask is there any software or script able to do conversion from Colon syntax to curly brackets syntax? From if ($value): endif; To if ($value) { } I am using Netbeans IDE, when I use curly brackets it will highlight the start or the end point. and I personally also prefer curly brackets syntax. Anyone k...

Haxe syntax; what does the following mean?

I have the following bit of syntax: Void -> Void //in context example private var _onClickEvents : List < Void -> Void > ; which seems to be accepted as a type definition, the same as Bool or TextField. I presume it has similar use to how Haskell defines function type signatures? ...

Why are C# 3.0 object initializer constructor parentheses optional?

It seems that the C# 3.0 object initializer syntax allows one to exclude the open/close pair of parentheses in the constructor when there is a parameterless constructor existing. Example: var x = new XTypeName { PropA = value, PropB = value }; As opposed to: var x = new XTypeName() { PropA = value, PropB = value }; I'm curious why ...

ODBC VB Throwing syntax error

I cant see what is wrong with my SQL statement syntax code is here: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Using Con1 As New Odbc.OdbcConnection("Driver={MySQL ODBC 5.1 Driver};Server=127.0.0.1;Database=MyGame;User=root; Password=MyPasswordWhichIWontTellYou;") ...