Here are some funny jokes and aphorisms about computer programming and programmers in general: There are only 10 types of people in the world: Those who understand binary, and those who don’t.
It’s always a long day, 86,400 won’t fit into a short.
Why do programmers always mix up Halloween and Christmas? Because Oct 31 equals Dec 25.
“Knock, knock.” “Who’s there?” very long pause… “Java.”
Programming is like sex: One mistake and you have to support it for the rest of your life.
Here’s a little JavaScript function that disables all form elements:
function disableElements(formName) { var fm = document.forms[formName]; for(var i = 0; i < fm.elements.length; ++i) { fm.elements[i].disabled = true; } } As you may have noticed the only parameter you need to pass is the form name.
In Java it is possible to retrieve the number of columns of a ResultSet dinamically, thanks to the ResultSetMetaData class. Here’s an example:
// Here you get the conn object. E.g.: // Connection conn = DriverManager.getConnection(...); Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("SELECT * FROM your_table"); ResultSetMetaData rsmd = rs.getMetaData(); int numCols = rsmd.getColumnCount(); System.out.println("Number of columns in your_table: " + numCols); The previous code retrieves and displays the number of columns of your_table.