syntax

What does this code mean: "print >> sys.stderr"

print >> sys.stderr, "Error in atexit._run_exitfuncs:" Why print '>>' in front of sys.stderr? Thanks. ...

why my 'time' class has not 'tzset' attribute.

my code: import time print hasattr(time.tzset)#error and why someone do this like next: if hasattr(time, 'tzset'): # Move the time zone info into os.environ. See ticket #2315 for why # we don't do this unconditionally (breaks Windows). os.environ['TZ'] = self.TIME_ZONE time.tzset() i ...

What is this C# syntax called?

In C#, you can do something like this: SomeFunction (() => { DoSomething (); }); What is the name of this syntax (the () => ...)? ...

Difference between jQuery.extend and jQuery.fn.extend?

Hi, I am trying to understand the jquery plugin syntax, because I want to merge two plugins into one. The blinker that also needs to be able to stop de interval or run a number of times. Anyway, is this syntax the same as jQuery.fn.extend({ everyTime: function(interval, label, fn, times) { return this.each(function() { ...

MYSQL Query Help

I need to get a SQL Query that I can execute to extract certain data. Here are the details: DB Type: MySQL DB Name: adminDB Table Name: licenseinfo Field Name: LicenseNumber So the data in the LicenseNumber Column looks like this: ( this is just a sample there are 300,000 Records) SSCY-334-0W2-5AA SSCY-238-2W1-5F9 SSCY-378-0W5-...

Blocks of statements in Ruby

I have a background from languages which use {} to say that these are "block of statements" but i am learning ruby and really confused how it being done there. So lets say in C i have if ( condition ) { statement1; statement2; } else if (condition) { statement1; statement2; // nested if if (condition) { ...

Tool for braceless, whitespace sensitive C syntax

I'm writing some C at the moment and because I like whitespace sensitive syntax, I'd like to write it like this: #include <stdio.h> int main(void) printf("Hello, world!") return 0 Instead of this: #include <stdio.h> int main(void) { printf("Hello, world!"); return 0; } Does anybody know of a tool that will convert the fo...

Bash: Why is echo adding extra space?

I get: $ echo -e "D"{a,b,c}".jpg\n" Da.jpg Db.jpg Dc.jpg Note: The extra spaces before Db and Dc on the 2nd and 3rd line of the output. Why are these there? Thanks, Dan Edit: Since my actual objective had spaces in it (which I should have written originally): echo -e "Name"{,.}" "{-,}"extra"{,so}" 5v5 "{one,two,No\ four}{,!,\!\!...

SQL CASE [Column] WHEN IN ('case1', 'case2') THEN 'oops' END?

Is there a way to check a CASE when it's in an array: SELECT CASE [Option] WHEN IN (1, 3, 99) THEN 'Wrong option' ELSE 'You go!' END ...

syntax problem in using eval() in a character literal

Hi, i have a link inside a repeater, and i want to change the url dynamically according to the value inside repeater item. The problem is when the href value is like this href='<%# (Boolean.Parse(Eval("HasFile").ToString())==true) ? "www.milliyet.com.tr" : "../Static_Pages_Content.aspx?Parent_ID=Eval("Node_ID")"%>' I'm gettin a synt...

Add a class to an hyperlink with markdown

This is the original link <a href="http://link.com" class="noborder">my link</a>. How do I translate it to Markdown? I don't know how to put the class in. [mylink](http://link.com) ...

What does '<?=' mean in PHP?

<?php $a=1; ?> <?=$a;?> What does <?= mean exactly? ...

Proper jruby syntax for requiring java and including java classes

I can't seem to find what the current syntax for using java classes in Jruby is. This link text article lists: include Java include 'java' require 'java' As valid options, though it says the last option is pre 1.0 and doesn't work. The Jruby Wiki however says to use require 'java' And for including classes I've seen MyClass = Java::...

kwargs sent over pyAMF channel

Hello, I'm using cherrypy server to receive requests over a pyAMF channel from a python client. I started with the mock up below and it works fine: Server: import cherrypy from pyamf.remoting.gateway.wsgi import WSGIGateway def echo(*args, **kwargs): return (args, kwargs) class Root(object): def index(self): return "...

Can a C# expression ever return void?

I have the following method, and I want to know if there is anything that can go in place default(void) below because there is a compiler error that says that void is not valid here: private void applyDefaultsIfNecessary(ApplicationConfiguration configuration) { var defaults = new Dictionary<Predicate<ApplicationConfiguration>, Acti...

What's the syntax to import a class in a default package in Java?

Possible Duplicate: How to access java-classes in the default-package? Is it possible to import a class in Java which is in the default package? If so, what is the syntax? For example, if you have package foo.bar; public class SomeClass { // ... in one file, you can write package baz.fonz; import foo.bar.SomeClass; pu...

How Is Syntax Highlighting Built?

I'm now building a developers editor using Lazarus and as every good developers editor, it needs to have a syntax highlighting, because of this that I want to know some things: How is syntax highlight normally built(using many ifs to change the font on a TextField? TSynEdit is very nice to do this? How to use TSynEdit(links and resourc...

Initializing fields in inherited classes

What's the best way to initialize constants or other fields in inherited classes? I realize there are many syntax errors in this example, but this is the best example to explain clearly what I am trying to do. public abstract class Animal { public abstract const string Name; // #1 public abstract const bool CanFly; public abstract...

Syntax for a for loop in ruby

How do I do this type of for loop in Ruby? for(int i=0; i<array.length; i++) { } ...

Using "->" in c#?

Hi, I have remembered that I have seen "->" used in C#. Apparently I cannot search it through Google (and I do not know what is the name). Therefore I would be very happy if you could explain it to me. Thanks. ...