## Tuesday, June 19, 2012

### Java DB and ij

1, Java DB, aka Derby, is shipped with Java 6+.
2, ij is the Interactive Scription Tool of Derby.

Common Commands of ij:

ij>connect 'jdbc:derby:/www/jvdb';
ij>show connections;
ij>show tables;
ij>run 'my.sql';
ij>set schema user1;
...CRUD...
ij>help;
ij>describe user1.TABLE1;
ij>disconnect;
ij>exit;

## Monday, June 11, 2012

### Run SAS Scripts in Java, JSP and etc.

1, Download SASDriversforJDBCandCONNECT (e.g. SAS Drivers for JDBC and SAS/CONNECT for Windows)
2, ...

### Configuring SAS 9.1 to Use Java 5 or above on Windows

1, Locate C:\Program Files\SAS\SAS 9.1\nls\en\SASV9.CFG
2, Change -Dasa.jre=private into -Dsas.jre=public
3, Restart SAS
4, proc javainfo;
http://support.sas.com/kb/17/226.html
run;

## Tuesday, March 6, 2012

### CSS tricks

Some contents may come from: http://www.webcredible.co.uk/user-friendly-resources/css/css-tricks.shtml

I assume we all know: 1) what id, class, and pseudo-class are; 2) what inline and external style sheet; 3) what  cascading means by: the priorities are calculated and apply to rules.
---------------------------------------------------------------------------------------------------------------

1, CSS for Printing, or Handhelds?

Lots of web pages have a link to a print-friendly version. What many of them don't realise is that there's no need because you can set up a second CSS document to be called up when a user prints the page.

<link type="text/css" rel="stylesheet" href="stylesheet.css" media="screen" /><link type="text/css" rel="stylesheet" href="handheldstyle.css" media="handheld" /><link type="text/css" rel="stylesheet" href="printstyle.css" media="print" />

2, Why 2em?

The name of em is related to M. Originally the unit was derived from the width of the capital "M" in the given typeface.

One em was traditionally defined as the width of the capital "M" in the current typeface and point size

In CSS, "em" is a relative unit of measurement, it's preferred to fixed one like "px".

3, How to make text invsible?

display: none

For screen readers users therefore, a new approach is needed: position: absolute; left: -9000px.

Where did the text go? It moved to the left of the left edge of the screen.

4, What is !important?

!important declaration is something I've seen in real-world CSS code, but I always forget it does after a while. So I write it down this time.

Three Points:

I) CSS is rule-based.
II) The later rule overrides the earlier rule
III) !important rules take precedence over any later rules.

Beware, "!" is totally different from what it is in general languages, like Java and C++. It's simply an exclamation.

Fun with !important. In the following HTML example, will "Hello, World!" be displayed in green or red?

------------------------
<html>
<style type="text/css">
.C1 p {
color: green !important;
}
</style>
<body>
<p class="C1">
<div style="color:red !important;">Hello, World!</div>
</p>
</body>
</html>
---------------------------------------------------------------------------------------------------------------
* This post is for Java developers who want to leverage the power of CSS while minimizing the cost and effort in search for the useful features in tons of books and specifications. Most CSS books are not written for software developers.