colon

Use colon : or not with selectors

回眸只為那壹抹淺笑 提交于 2019-12-05 14:40:23
I was wondering: what's the difference between writing a selector name with no colon @selector(mySelector) , or @selector(mySelector:) with the colon? As in: UIBarButtonItem *addButton = [[UIBarButtonItem alloc]initWith... target:self action:@selector(addAction:)]; I can't find another example without the colon, but I'm quite sure I have already seen some of them. The colon is needed after the method's name if and only if the method takes an argument. No function parameters: -(void)addAction {} // Use ...@selector(addAction)... Has parameter: -(void)addAction:(id)info {} // Use ...@selector

Lua: colon notation, 'self' and function definition vs. call

我们两清 提交于 2019-12-05 12:47:50
I'm getting terribly confused by the colon notation used when defining/calling Lua functions. I thought I'd got my head round it until I saw this piece of code: function string.PatternSafe( str ) return ( str:gsub( ".", pattern_escape_replacements ) ); end function string.Trim( s, char ) if char then char = char:PatternSafe() else char = "%s" end return string.match( s, "^" .. char .. "*(.-)" .. char .. "*$" ) or s end What's confusing me here is that string.PatternSafe() doesn't reference 'self' anywhere, yet the code seems to work. I've also seen some scripts that use colon notation when

What does a colon mean within an HTML id attribute?

妖精的绣舞 提交于 2019-12-05 11:51:09
问题 I have seen an HTML code like this for the ID attribute: id="t1:c3" Can someone explain this to me? What is the purpose of the colon ( : )? Thank you. 回答1: Colons are allowed inside ID attributes, but hold no special significance. It's not really advisable to use them because they can sometimes cause problems, such as when used with jQuery or CSS, where the colon has special meaning as a pseudo-selector. 回答2: If the HTML is generated with Java ServerFaces this usually produces such IDs, i.e.

Bash command starting with colon with another colon before an equals signs [duplicate]

前提是你 提交于 2019-12-05 06:09:46
This question already has answers here : Explanation of colon operator in “: ${foo=value}” (2 answers) What is the purpose of the : (colon) GNU Bash builtin? (11 answers) Closed 4 years ago . I could not find any documentation that would explain the syntax below. What does it do inside a bash script? Is it a test? : ${foo:=bar}; export foo The : command is the null utility : This utility shall only expand command arguments. It is used when a command is needed, as in the then condition of an if command, but nothing is to be done by the command. Also Bourne Shell Builtins : Do nothing beyond

Colon operator in PHP

孤人 提交于 2019-12-04 07:24:44
This is part of the wordpress code and I don't understand it: if ( is_404() && $template = get_404_template() ) : elseif ( is_search() && $template = get_search_template() ) : elseif ( is_tax() && $template = get_taxonomy_template() ) : elseif ( is_front_page() && $template = get_front_page_template() ) : elseif ( is_home() && $template = get_home_template() ) : elseif ( is_attachment() && $template = get_attachment_template() ) : remove_filter('the_content', 'prepend_attachment'); elseif ( is_single() && $template = get_single_template() ) : elseif ( is_page() && $template = get_page_template

Accessing JSON data with colon in the label

北城余情 提交于 2019-12-04 03:49:03
问题 I have json data with a colon in the label (see responsedata) which I'm finding difficult to access in Angular with the following code: <li ng-repeat="i in items.autnresponse.responsedata | searchFor:searchString"> <p>{{i.autn:numhits}}</p> </li> I keep getting an error like this: Error: [$parse:syntax] Syntax Error: Token ':' is an unexpected token at column 7 of the expression [i.autn:numhits] starting at [:numhits] . JSON data excerpt: "autnresponse": { "action": { "$": "QUERY" },

What's the purpose of the colon in this git repository url?

我的梦境 提交于 2019-12-03 23:50:39
Please pardon my ignorance; I'm new to Git and not sure where better to look for an answer, but what's the purpose of the colon after 'example.com' in the following url (which points to a git repository on my mediatemple server)? git remote add repo_name ssh://serveradmin%example.com@example.com:/home/45678/domains/git.example.com/html/example.git This syntax is actually wrong, but it's a bit like the scp -style syntax that you can use in git URLs, where it separates the hostname from the path on that host. Your options for specifying git URLs are listed in the git clone documentation . In

Opening filenames with colon (“:”) in Windows 7

流过昼夜 提交于 2019-12-03 20:16:03
问题 I am writing a Python app that should run in both Windows and Linux, but am having an issue with one of the filenaming conventions. I need to load a JSON file that has a colon in its name. However, with Windows 7 it doesn't seem to be possible, at least not directly. These files are stored on a NFS drive thus we are able to see it in Windows 7, but cannot open them. Does anyone have a workaround as to how it may be possible to read the JSON file containing a colon in Windows 7 using Python?

Why colons precede variables in Common Lisp

假装没事ソ 提交于 2019-12-03 15:46:15
问题 What does the syntax, colons preceding variable in Common Lisp, mean? I've seen programs with such, and I'll present some sample code here, out of a large set of functions. (defun expand (successorf node) (mapcar (lambda (action-state-cost) (let ((action (car action-state-cost)) (state (cadr action-state-cost)) (cost (caddr action-state-cost))) (make-node :state state :parent node :action action :path-cost (+ (node-path-cost node) cost) :depth (1+ (node-depth node))) )) (funcall successorf

Why colons precede variables in Common Lisp

吃可爱长大的小学妹 提交于 2019-12-03 10:19:20
What does the syntax, colons preceding variable in Common Lisp, mean? I've seen programs with such, and I'll present some sample code here, out of a large set of functions. (defun expand (successorf node) (mapcar (lambda (action-state-cost) (let ((action (car action-state-cost)) (state (cadr action-state-cost)) (cost (caddr action-state-cost))) (make-node :state state :parent node :action action :path-cost (+ (node-path-cost node) cost) :depth (1+ (node-depth node))) )) (funcall successorf (node-state node)) )) They're not variables, actually; those are keywords. They're a special kind of