Why use $_SERVER[‘PHP_SELF’] instead of “”

The action attribute will default to the current URL. It is the most reliable and easiest way to say “submit the form to the same place it came from”. There is no reason to use $_SERVER[‘PHP_SELF’], and # doesn’t submit the form at all (unless there is a submit event handler attached that handles the submission).

What does ‘SSSXXX’ mean in a java simple date format object?

I’ve found this in some legacy code that I don’t understand. Does anyone know what the SSSXXX bit means, it seems to be adding 2 hours to my date!? Answer: According to the API S refers to milliseconds and X to the timezone. The “Examples” section contains an example of SSSXXX yielding a three-digit millisecond representation followed by a “full” timezone offset … Read more

SQLiteDatabase.query method

tableColumns null for all columns as in SELECT * FROM … new String[] { “column1”, “column2”, … } for specific columns as in SELECT column1, column2 FROM … – you can also put complex expressions here:new String[] { “(SELECT max(column1) FROM table1) AS max” } would give you a column named max holding the max value of column1 whereClause the part you put after WHERE without … Read more

Installing cgdb on a mac os x

Неу, yeah, the git source for cgdb doesn’t come with the configure script pre-built. (The official release distributions do, however.) If you have the right tools installed, you can fix this by running: This will generate the configure script, and then you can install it as you would any other autoconf-based source package.

What is WEB-INF used for in a Java EE web application?

The Servlet 2.4 specification says this about WEB-INF (page 70): A special directory exists within the application hierarchy named WEB-INF. This directory contains all things related to the application that aren’t in the document root of the application. The WEB-INF node is not part of the public document tree of the application. No file contained in the WEB-INF directory may be served directly … Read more

Read entire file in Scala?

By the way, “scala.” isn’t really necessary, as it’s always in scope anyway, and you can, of course, import io’s contents, fully or partially, and avoid having to prepend “io.” too. The above leaves the file open, however. To avoid problems, you should close it like this: Another problem with the code above is that … Read more