<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.9.2" -->
<rss version="0.92">
<channel>
	<title>theLogicBlog</title>
	<link>http://thelogic.org/blog</link>
	<description>Things for me to remember</description>
	<lastBuildDate>Tue, 08 Jun 2010 11:23:40 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Oracle NLS settings</title>
		<description><![CDATA[DATABASE
 -> settings from init.ora at creation of database
 -> select * from nls_instance_parameters;
INSTANCE
 -> settings from init.ora or spfile when instance was started
 -> overwrites DATABASE settings
 -> select * from nls_session_parameters;
SESSION
 -> settings changed through alter session
 -> overwrites INSTANCE settings
 -> select * from nls_session_parameters;
Character Set:
select value from nls_database_parameters where parameter = [...]]]></description>
		<link>http://thelogic.org/blog/2010/05/28/oracle-nls-settings/</link>
			</item>
	<item>
		<title>Quick start for Java WebStart</title>
		<description><![CDATA[1. Java Class TheTime.java

import java.awt.*;
import javax.swing.*;

public class TheTime {
  public static void main(String args[]) {
    JFrame frame =  new JFrame("Time Check");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JLabel label = new JLabel();
    Container content = frame.getContentPane();
    content.add(label, BorderLayout.CENTER);
    String message [...]]]></description>
		<link>http://thelogic.org/blog/2010/04/08/quick-start-for-java-webstart/</link>
			</item>
	<item>
		<title>Sending a message from a JSP/Servlet into JMS-Queue with GlassFish</title>
		<description><![CDATA[1. Create Connection Factory and Destination Resource in GlassFish admin console:
Resources / JMS Resources / Connection Factory -> New
JNDI-Name: jms/myFactory
Resource-Type: javax.jms.ConnectionFactory
Additional Properties: Remove username and password
Resources / JMS Resources / Destination Resources -> New
JNDI-Name: jms/myQueue
Physical Destination Name: myQueue
Resource Type: javax.jms.Queue
2. Create a new web application in NetBeans, edit index.jsp:

       [...]]]></description>
		<link>http://thelogic.org/blog/2010/02/11/sending-a-message-from-a-jspservlet-into-jms-queue-with-glassfish/</link>
			</item>
	<item>
		<title>New Eclipse installation with viPlugin, GlassFish, Derby</title>
		<description><![CDATA[1. viPlugin
Name: viPlugin
Site: viplugin.com
2. GlassFish
Plugin Site: http://ajax.dev.java.net/eclipse
GlassFish download: https://glassfish.dev.java.net/downloads/v3-final.html
Servers / New Server / GlassFish v3
Preferences / GlassFish -> start Derby with GlassFish
3. Derby
http://db.apache.org/derby/derby_downloads.html (core &#038; ui) into eclipse/plugins
Data Source Explorer / Database Connections -> New -> Derby
New Driver Definition / Derby Client JDBC Driver
]]></description>
		<link>http://thelogic.org/blog/2010/02/09/new-eclipse-installation-with-viplugin-glassfish-derby/</link>
			</item>
	<item>
		<title>Writing / Appending a File in Java</title>
		<description><![CDATA[
try {
  BufferedWriter writer = new BufferedWriter(new FileWriter("file.txt", true));  // true defines append to file instead of overwrite
  writer.write("text into file" + "\n");
  writer.close();
} catch (Exception e) {
  System.out.println(e.getMessage());
}

]]></description>
		<link>http://thelogic.org/blog/2010/01/12/writing-appending-a-file-in-java/</link>
			</item>
	<item>
		<title>Date and Time in Java</title>
		<description><![CDATA[

import java.util.*;
import java.text.*;

// actual date and time
Date d = new Date();
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String now = f.format(d));

// other time zone
df.setTimeZone(TimeZone.getTimeZone("America/New_York");
String nowNY = f.format(d));

]]></description>
		<link>http://thelogic.org/blog/2010/01/12/date-and-time-in-java/</link>
			</item>
	<item>
		<title>XML: SAX or DOM?</title>
		<description><![CDATA[There are some differences between the SAX and DOM XML parser. The main difference in one sentence are:
1. SAX reads the XML document once and can react on events but it won&#8217;t save the XML structure in memory.
2. DOM reads the XML document and stores it in a tree which allows manipulation or to extract [...]]]></description>
		<link>http://thelogic.org/blog/2009/09/22/xml-sax-or-dom/</link>
			</item>
	<item>
		<title>Determining the type of a file using the extension</title>
		<description><![CDATA[This is how the type of a file can be determined using the extension of the file:

1
2
3
4
5
6
7
8
9
10
public class FileType &#123;
	public static void main&#40;String&#91;&#93; args&#41; &#123;
		String fileName = &#34;foo.pdf&#34;;
		String extension = fileName.substring&#40;fileName.lastIndexOf&#40;&#34;.&#34;&#41;&#41;;
		System.out.println&#40;&#34;Extension: &#34; + extension&#41;;
		if &#40;fileName.equalsIgnoreCase&#40;&#34;.pdf&#34;&#41;&#41; &#123;
			System.out.println&#40;&#34;It is a PDF-File.&#34;&#41;;
		&#125;
	&#125;
&#125;

]]></description>
		<link>http://thelogic.org/blog/2009/08/06/determining-the-type-of-a-file-using-the-extension/</link>
			</item>
	<item>
		<title>SSL-encrypted Client/Server connection in Java</title>
		<description><![CDATA[1. Generating a key pair (public key + private key) for the server and store those as certificate in the keystore &#8220;ServerKeystore&#8221;

keytool -genkey -keystore ServerKeystore -alias SSLCertificate -keyalg RSA -validity 360

2. Export the public key of the server and import it into the keystore &#8220;ClientKeystore&#8221;

keytool -keystore ServerKeystore -export -alias ServerKeystore -file ServerCertificate.crt
keytool -keystore ClientKeystore -import [...]]]></description>
		<link>http://thelogic.org/blog/2009/05/06/ssl-encrypted-clientserver-connection-in-java/</link>
			</item>
	<item>
		<title>Encrypt USB-stick on Ubuntu in three steps</title>
		<description><![CDATA[1. Install the required package:

sudo apt-get install cryptsetup

2. Create a partition on the USB-stick:

sudo cfdisk /dev/sdX

3. Encrypt the partition:

sudo luksformat -t ext2 /dev/sdX
Creating encrypted device on /dev/sdX...
Are you sure? &#40;Type uppercase yes&#41;: YES
Enter LUKS passphrase:

Entering the USB-stick into Ubuntu will bring up the following window:

To edit the label of the USB-stick (by default it&#8217;s just [...]]]></description>
		<link>http://thelogic.org/blog/2009/05/02/encrypt-usb-stick-on-ubuntu-in-three-steps/</link>
			</item>
</channel>
</rss>
