Why would font names need quotes?

You can always put a specific font family name in quotes, double or single, so Arial, “Arial”, and ‘Arial’ are equivalent. Only the CSS-defined generic font family names like sans-serif must be written without quotes. Contrary to popular belief, a font name consisting of space-separated names such as Times New Roman need not be quoted. … Read more

Python “private” function coding convention

From Python’s Class module documentation: Private” instance variables that cannot be accessed except from inside an object don’t exist in Python. However, there is a convention that is followed by most Python code: a name prefixed with an underscore (e.g. _spam) should be treated as a non-public part of the API (whether it is a … Read more

Where do you put your Rack middleware files and requires?

As of Rails 3.2, Rack middleware belongs in the app/middleware directory. It works “out-of-the-box” without any explicit require statements. Quick example: I’m using a middleware class called CanonicalHost which is implemented in app/middleware/canonical_host.rb. I’ve added the following line to production.rb (note that the middleware class is explicitly given, rather than as a quoted string, which … Read more

Java: Infinite Loop Convention [closed]

There is no difference in bytecode between while(true) and for(;;) but I prefer while(true) since it is less confusing (especially for someone new to Java). You can check it with this code example void test1(){ for (;;){ System.out.println(“hello”); } } void test2(){ while(true){ System.out.println(“world”); } } When you use command javap -c ClassWithThoseMethods you will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)