Friday, February 29, 2008

TSOL Tomcat 5.5 Installation

1. TOMCAT 5.5.x Installation

I had this sitting around, I figure someone out there might have a use for it. And so I present, instructions for installing Tomcat 5.5.x on Trusted Solaris 8:

1. Download the Tomcat binary 5.5.x from http://jakarta.apache.org/tomcat/ and extract it into a local directory referred to from here on as $CATALINA_HOME.

2. In $CATALINA_HOME, copy the contents of $CATALINA_HOME/conf into $CATALINA_HOME/confOriginal. Then delete both directories $CATALINA_HOME/logs and $CATALINA_HOME/conf.

3. Make multi-level directories for $CATALINA_HOME/logs and $CATALINA_HOME/conf. Copy all files in $CATALINA_HOME/confOriginal into $CATALINA_HOME/conf under every label you intend to run a server under.

4. If using Tomcat 5.5.x and J2SDK 1.4 or 1.3: Download compat.jar and unzip it in ../$CATALINA_HOME. Verify that it has placed xercesImpl.jar and xml-apis.jar into $CATALINA_HOME/common/endorsed

5. Go into $CATALINA_HOME/bin and run startup.sh. Verify that the installation was successful by visiting http://localhost:8080 in your web browser. You should see the Tomcat startup page. Shutdown by running shutdown.sh in $CATALINA_HOME/bin.

6. The 5.5.x version of Tomcat does not come with the admin service. It can be useful, so install that as well following these steps:
1. Unzip jakarta-tomcat-5.5.x-admin.zip & copy conf\ and server\ folders and contents over your own Tomcat conf & server folders (into $CATALINA_HOME folder)
2. Copy $CATALINA_HOME\server\webapps\admin\admin.xml to $CATALINA_HOME\webapps\admin.xml
3. Add a line to $CATALINA_HOME\conf\tomcat-users.xml to allow a user to login to the manager & admin modules, e.g.:
4. Restart Tomcat
5. Visit http://localhost:8080/admin and login using admin/admin1

7. Verify the installation by visiting http://localhost:8080/admin.

Wednesday, January 09, 2008

Scanlation Notes

This post no longer exists.

Monday, December 31, 2007

Testimony 2007

Since it is the Christmas month, where the birth of Christ is celebrated, I thought it would be appropriate to take a break from talking about programming to post my testimony as a Christian. This is a testimony that I gave in church at what feels like a few months ago, although it may actually have been a year ago. It was written to be about five minutes long. Re-reading it, I realize I used a fair amount of Christian lingo, so it might not mean the same thing if you don't know much about Christianity.

Oh yeah, in case you didn't know (or guess by now), I'm a Christian. Denominationally... I'd say I'm non-denominational, but if you need to be told a denomination, I guess you could call me methodist. I basically believe in having a close, personal relationship with the loving God/Jesus/Holy Spirit through prayer, fellowship with other Christians, and studying the bible. I don't believe I have any business judging other people or forcing my beliefs on others. However, I won't hide what I believe either and I hope my beliefs show in my everday life because they are the most important part of who I am. So read it or ignore it, this is my one of many accounts about why I belive in God. It's not meant to convert anyone or anything like that, just to let you know a little bit more about who I am. So here goes:

My parents are both Christian and they brought me up as a Christian. We had bible studies every night, where my dad read to us from some family devotions book, swapping our names in for the characters in the life application stories. I prayed before going to bed every night and before every meal. My parents brought my sisters and I to church every Sunday, where I would attend the Sunday School I enjoyed so much, especially in fourth grade. That class was focused on filling out worksheets, which was actually a lot of fun to me. You see, we'd always show up late, and I enjoyed being the first done with the most correct answers despite always coming in late.

When I was seven years old, I prayed the important prayer of asking Jesus to come into my life. Probably a few months after that, I was baptised at the beach. Things are good when you give your life up to Jesus.

But are they really? Honestly, my life has been really blessed. Did God really have anything to do with it or was that just the way it was? Things go well and I feel at peace when I pray, but is it because God is answering my prayer or is it due to self reflection? To feed those doubts was the fact that so many of the arguments against Christianity, like evolutionary debates and religious social studies, resonate quite well with me. Furthermore, I had the feeling that being a Christian and the existence of a god is stifling and inconvenient. I thought life would certainly be more efficient and fun without God. For example, praying takes up time. Figuring out and acting on what I believe to be "God's will" seemed really limiting.

With that mentality, I decided that it not only made sense not to believe in God, but it was a good decision for my life. So no more praying, no more paying attention in church (of course I'd still have to go with my parents), no more trying to figure out God's will. But... that didn't go as well as I hoped.

Without my relationship with God, something was just missing. I knew it wasn't something as simple as "I feel purposeless" or the "feeling of loss." At church recently, we talked about the fingerprints of God... touches God leaves that shows He's there, even if you can't see Him. The touch of God was missing from my life that I didn't want Him to lead. For me, the most explainable missing fingerprint was a sense of knowing my place in everything, the sense of somewhat understanding everything around me.

Soon after, I prayed to God and He spoke to me. I was inspired to pursue a deeper relationship with God. To start off, I just prayed a lot more. I studied the bible closer and would have long discussions about it with other Christians. That led me to worship more geniunely and involve myself more in God's work. I didn't feel like I was making myself do something I didn't want as I tried to followed God's will more while developing a relationship with Him. God has blessed my life greatly, with my friends, and with my wife Carrie, and with my family, and with work. There's nothing so far in my, albeit short so far, life that I really regret and a great part of that is because I truly believe God has been guiding me and I've been listening. Things don't always work out in the short term, but I've almost never minded thanks to God, and something better has always come around so far.

My story isn't very dramatic. I've spent almost all my life as a Christian pursuing a relationship with God. Having a relationship with God gives me an almost perpetual sense of fulfillment, joy, and peace in my life. Of course, even though I believe a relationship with God makes it easier, I know I could get all of that without Him. But there's still that unexplainable touch of God that only comes from a relationship with Him. And that really means everything to me... I think it might have to be experienced to really understand.

And of course, I still have doubts, although it hasn't escalated to the situation I described earlier again. But it really very much is a cycle to me. Doubt, study, and prayer continually bring me in a closer relationship with God. The thing that helps me most though doubt is that I know God exists, since I have a relationship with Him, and I've seen Him transform lives.

Friday, November 30, 2007

TCP Monitor

At work, I've done a lot of client/server work. Whether using RMI JDBC, or SOAP Messages, or our own custom protocols, a lot of my work has involved sending messages back and forth. The easiest way for me to debug programs was with tcpmon. This incredibly useful tool sits between a client and server. It displays any data passedit recieves to the screen, then forwards the message to its destination. Go to the page to read more about it. I've really found it invaluble.

Heh heh... this post was actually just to keep up with an update a month. I'm glad I thought of something useful to post.

Sunday, October 21, 2007

SQL Server and JDBC

This describes how I set up JDBC to interact with a Sql Server Express 2005 database. Sql Server Express 2005 was installed on a Windows XP machine. The database was being accessed using JDBC on a remote Trusted Solaris machine running Java 1.2. The following instructions should apply to more configurations than just that though.


- Installing Sql Server Express 2005 -

1. Install Sql Server Express.

Download it from http://www.microsoft.com/sql/downloads/trial-software.mspx#EXC. During install, selecting all the default options is fine. The only thing you would want to change is using Mixed Mode authentication instead of Windows Authentication. If you didn't select that option, I'll tell you how to do it later, so don't worry about it.


2. Allow TCP/IP Connectivity

Configure TCP/IP connectivity for use with IBM Director Server. By default, SQL Server Express Edition does not have TCP/IP connectivity enabled after installation. This means you won't be able to remotely access the database. In addition, the TCP port must be set for use with IBM Director Server. Complete the following steps:

1. Click Start > All Programs > Microsoft SQL Server 2005 > Configuration Tools > SQL Server Configuration Manager.
2. In the left pane of the SQL Server Configuration Manager window, expand SQL Server 2005 Network Configuration and then click Protocols for SQLEXPRESS.
3. In the right pane of the SQL Server Configuration Manager window, right-click TCP/IP and click Enable. Click OK to acknowledge the warning message.
4. Right-click TCP/IP again and click Properties.
5. In the TCP/IP Properties window, click the IP Addresses tab, and then expand IPALL.
6. Under IPALL, clear the TCP Dynamic Ports field and then type a port number in the TCP Port field. Usually, the port number should be set to 1433.
7. In the TCP/IP Properties window, click OK, and then click OK to acknowledge the warning message.
8. In the left pane of the SQL Server Configuration Manager window, click SQL Server 2005 Services.
9. In the right pane of the SQL Server Configuration Manager window, right-click SQL Server (SQLEXPRESS) and click Restart.


3. Install SQL Server Management Studio

Download SQL Server Management Studio Express from https://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en. If you didn't allow Mixed mode Authentication for the Sql Server Express earlier, complete the following steps:

1. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
2. On the Security page, under Server authentication, select "SQL Server and Windows Authentication mode."
3. In the SQL Server Management Studio dialog box, click OK, to acknowledge the need to restart SQL Server.
4. In Object Explorer, right-click your server, and then click Restart. If SQL Server Agent is running, it must also be restarted.
5. In Object Explorer, expand Security, expand Logins, right-click sa, and then click Properties.
6. On the General page, you may have to create and confirm a password for the sa login.
7. On the Status page, in the Login section, click Enabled, and then click OK.


4. Create Your Database

- Create the database using SQL Server Management Studio. Add a user to the database by going into [database_name]/security/users.
- Give the user permissions for remote access.
a) Right Click [database_name], select properties.
b) Go into properties.
c) Select the user and grant all permissions.


- JDBC Access -

Microsoft provides a JDBC Driver for SQL Server 2005, which can be downloaded from http://msdn2.microsoft.com/en-us/data/aa937724.aspx. There's a "sqljdbc.jar" in the pack that you'll need to put on your classpath. Then you can use the following Driver and Url:

Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
Url: jdbc:sqlserver://[host]:[port, default 1433];"databaseName=[database_name]"

However, I needed to use Java 1.2 for my application and Microsoft's JDBC driver does not support it. It doesn't support 1.3 either. I found another great free driver at http://sourceforge.net/project/shownotes.php?release_id=369359&group_id=33291 which fit my needs: free, supports java 1.2, and easy to use. There's a jtds.jar in the pack that you'll need to put on your classpath. Then you can use the following Driver and Url.

Driver: net.sourceforge.jtds.jdbc.Driver
Url: jdbc:jtds:sqlserver://[host]:[port, default 1433]/[database_name]

I'm assuming you know how to use JDBC already, so this guide ends here.

MS Access and JDBC

This describes how I set up JDBC to interact with a Microsoft Access .mdb database. The MS Access Database was installed on a Windows XP machine. The database was being accessed using JDBC on a remote Trusted Solaris machine running Java 1.2. The following instructions should apply to more configurations than just that though.

- Create the Microsoft Access Database -

1. Go into Control Panel -> Administrative Tools -> Data Sources (ODBC)
2. Click on the System DSN tab
3. Click the Add Button, choose Microsoft Access (*.mdb)
4. Choose the database name. Click the "create" button and decide on the location.
5. Click the Advanced button to give the database a username and password.
6. You can edit these options using the Configure button.


- JDBC Access for Microsoft Access -

You can use JDBC to access the MS Access database using Sun's built in ODBC driver. The Driver and the Url are as follows:

Driver: sun.jdbc.odbc.JdbcOdbcDriver
Url: jdbc:obbc:[database_name]

However, I needed to access the database from a remote host. I couldn't find any direct way to do this, due to the nature of the MS Access database. So to use access the database remotely, I used RmiJdbc. You can download it at http://rmijdbc.objectweb.org/.

RmiJdbc is a bridge to allow remote access to JDBC drivers. You'll find the RmiJdbc jar in the package, which you'll need to include on your classpath. Then you can use the following Driver and Url (to connect to the mdb Access database):

Driver: org.objectweb.rmijdbc.Driver
Url: jdbc:rmi://[host]/jdbc:obbc:[database_name]

In order for this to work, RmiJdbc needs to be listening for requests. Start up the server by executing "org.objectweb.rmijdbc.RJJdbcServer" on the machine the MS Access database is located on. Remember that to put the RmiJdbc jar on your classpath.

I'm assuming that you know how to use JDBC, so I'm going to end my instructions here.


[Reference]
http://rmijdbc.objectweb.org/
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2691&lngWId=2

MySQL and JDBC

This describes how I set up a MySql database to talk with JDBC. The MySql database and server were installed on a Windows XP machine. The database was being accessed using JDBC on a remote Trusted Solaris machine running Java 1.2. The following instructions should apply to more configurations than just that though.


- MySql Database and Server -

1. Download MySql Server from http://www.mysql.org. For my installation, I used MySql Server 4.1, which I downloaded from http://www.mysql.org/downloads/mysql/4.1.html.
2. Install MySql Server using all the default options. Afterwards, you can add the MySql bin path to your PATH enviroment variable for convenience if you want.
3. It's time to create your Database. I used the mysql tool, which can be found in the bin folder of the MySql installation. It's a command line tool. Here is an example of session for setting your database up.

1) C://> mysql -u root -p
2) > create database test;
3) > select host,user,password from mysql.user;
4) > GRANT ALL PRIVILEGES ON *.* to 'user'@'%' identified by 'pass';
5) > select host,user,password from mysql.user;

The first line logs you in. The second line creates a database called test. The fourth line grants priviliges to the database. '*.*' means these all privilges will be granted on everything, 'user' is the username, 'pass' is the password, '%' is a wildcard for the host; Altogether, line 4 allows user to access any mysql database from any host using the password pass. You can limit the host to just localhost or a specific IP and you can limit privileges to a specific database. Lines 3 and 5 will allow you to see if your user was set up correctly: you'll see new entries in the table.


- JDBC Access for MySql -

1. Download the MySql JDBC Driver (called Connector/J) from http://www.mysql.org. It was under Downloads, Connectors, Connector/J. Because I needed to use Java 1.2, I needed to download the older Connector/J 3.0. If you're using a newer JVM, you can use a higher version.
2. Extract the archive and add the jar found at the top level to java's classpath. The mysql jar shouldn't have '-g' in its name anywhere.
3. Now you can write your java code. Use the following Driver and Url:
Driver: com.mysql.jdbc.Driver
Url: jdbc:mysql://[host, default localhost]:[port, default 3306]/[database_name]
4. This isn't a JDBC guide, so I'll end here. Happy coding. And good luck.


TroubleShooting

1. Error 'Can not connect to host': You don't have permission to connect to the database from the machine you're using. This probably means you didn't grant permission to your database correctly.
2. "ClassDefNotFound: java/lang/reflect/InvocationHandler": I go this error when I was trying to use the 5.0 Connector/J with Java 1.2. The 3.0 Connector/J is the only version that supports such an old JVM.

Sunday, September 02, 2007

Keep What You Stream

Streaming Video and Streaming Music are all nice and good when you have a good internet connection. But that's not always the case. Fortunetely, there's free software to help you grab your favorite online media without having to reload a web page endlessly. These are the ones I use, there may be better programs out there, but I've been fine with just these.

Download Helper
I think I've made it clear that I use firefox, this video downloader is a firefox plugin. Let's say you've just watched a YouTube video and want to save it. If you have this installed, then you can just right-click the page, go to the "Download Helper" option, and then choose the flv file. (Youtube videos are flv format, K-lite Mega Codec allows you to watch them, or there are tons of easy to find "flv to avi" programs.) I used Youtube in this example, but this Download Helper will work with just about any streaming video site. Oh yeah, here's a good tip, go to the preferences menu and add 'swf' to the MediaLink and MediaReq tabs so that you can download flash files.

Audacity or Free MP3 Sound Recorder
These two programs will allow you to record sounds, both can record to the MP3 format. Audacity doubles as an editing program, Free MP3 Sound Recorder is more limited but much simpler to use. Both seem safe to me. If you don't trust me, you can google search to find a bunch of other options. Oh yeah, you need to choose either stereo mix or wave in for the sound device if you want to record stuff playing on your computer. This is a problem for certain computers, all the fixes for it seem expensive.

Download Statusbar

And while we're talking about downloading stuff... if you're using firefox, please also be using download status bar. It's a million times better and less intrusive that that default download pop-up manager.

Sunday, August 05, 2007

Fun Reads

I found some kinda fun technical reads. They're on the funny side, fun reads. Enjoy.

http://discovermagazine.com/2007/brain/i-chat-therefore-i-am/article_print
Alice and Jaberwocky AI chatting with each other.

http://worsethanfailure.com/Articles/The_Complicator_0x27_s_Gloves.aspx

The complicator gloves.

http://steve-yegge.blogspot.com/2006/12/parabola.html
Steve Yegge writes a story.

http://scienceblogs.com/principles/2007/05/many_worlds_many_treats.php

Teaching Quantum Mechanics to a Dog

http://www.pbm.com/~lindahl/mel.html
A Real Hacker. This one is classic, but I needed to add it anyway.

Friday, August 03, 2007

Java and Web Services

Today's blog goes over a bunch of web service stuff I learned for a project at work. A web service implementation was desirable because of the potential for interoperability. However, we wanted to send images and have support alerts. None of us really knew about the recent advancements in web services, so I spent a week or two doing a feasibility study. I ended up learning a lot about JAX-WS, Asynchronous Callbacks, and MTOM. So, I'm going to share what I've learned. This entry was written 1/18/2007, so it may not be all that accurate today. Don't blame me, blame our every changing technology.

-- Web Service Study --

Web services have developed a lot between 2004 and 2006. Many new features and capabilities have been added to the tools, which has also made creating and using web services more complex. The technology is still very new and although there are people using it, there isn't much documentation about it. This makes it very difficult to find information about it, especially to the depth that I wanted. At this point, I have a "pretty good" idea about what is out there and how it works. Which means that I can use the APIs and create services, but as for how it really works... I'm basically making educated guesses.

There are at least four different Java web service implementations that support asynchronous callbacks and MTOM out there:

1. JAX-WS (big name): https://jax-ws.dev.java.net/
2. Axis 2 (big name): http://ws.apache.org/axis2/
3. xFire (claims excellent performance): http://xfire.codehaus.org/
4. JibxSoap: http://jibx.sourceforge.net/jibxsoap/index.html


-- JAX-WS --

I only focused on, and will only be discussing, the JAX-WS 2.0 approach. JAX-WS 2.0 is the successor to JAX-RPC. There are two major reasons for this decision.

Firstly, JAX-WS 2.0 is included in Java 6. This means applications using it will require no third party software dependencies or additional jar files for supporting web services. Unfortunetely, the ant tasks to build web services are not included with Java 6, so we as developers still need to get a separate special JAX-WS jar for the development side. The needed classes are the ant versions of the apt and wsimport tools. However, as far as running the client goes, only Java 6, the application, and possibly some client side xml will be necessary. I have verified using a JAX-WS developed application with only JDK 6.

Secondly, JAX-WS also seems to be the most determined to follow specifications, although I'm not sure how standard or widely adopted these specifications are. JAX-WS seems to concentrate on the WS-I standards, which has no track record of adoption. JAX-WS seems to be trying to ensure interoperability with Microsoft's Indigo platform. Going beyond the interoperability provided by JAX-WS itself, the JAX-WS project also provides the foundation for the Web Services Interoperability Technology (WSIT) that provides enterprise features that interoperate with Microsoft Windows Communication Foundation. The WSIT software works as documented, but is known to be incomplete and contain known bugs at this time

JAX-WS currently claims to support:
JAX-WS 2.0
WS-I Basic Profile 1.1
WS-I Attachments Profile 1.0
WS-I Simple SOAP Binding Profile 1.0

The JAX-WS team claims that the next release (JAX-WS 2.1) will support:
WS-Addressing - This standard defines a mechanism for callbacks where the client sends an address the server can send alerts to.

[Selected Relevant Links]
JAX-WS Homepage: https://jax-ws.dev.java.net/
Web Services in Java: http://www-128.ibm.com/developerworks/java/library/ws-java1.html


-- Using JAX-WS --

I'm going to briefly describe how to create a web service and a client to access that web service using JAX-WS. Coding web service server/client applications in JAX-WS requires very specfic design decisions and code annotations. While they aren't very hard to write once you learn them, they take a fair amount of time to learn. And once you get the code running, there may still be a significant amount of effort deploying the service and debugging interoperability problems.

JAX-WS allows (actually, I think forces) you to use annotations to define a web service. Defining a web service would look like this:

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService(name = "StockQuote", serviceName = "StockQuoteService")
public class StockQuoteImpl {
@WebMethod(operationName = "getQuote")
public double getQuote(String ticker) {
double result = 0.0;
if (ticker.equals("GOOG")) {
result = 320.0;
}
return result;
}
}

Once the code is written, you need to run the apt tool on it, which provides a facility for programmatically processing the annotations added to Java. If you want to use this in an ant build, you would want to download the JAX-WS jar which includes com.sun.tools.ws.ant.apt. After you've run apt, then you need to create your war file using the war tool and a custom xml file. Deploy the war file and your web service will be ready to use.

Then, you can write some client code to use this service.

public class StockQuoteClient {
public static void main(String[] args) {
StockQuote port = new StockQuoteService().getStockQuotePort();
double result = port.getQuote("GOOG");
System.out.printf("The stock price of %s is $%f.\n", ticker, result);
}
}

Then you must use wsimport, which generates JAX-WS portable artifacts. If you want to use this in an ant build, you would want to download the JAX-WS jar, which includes com.sun.tools.ws.ant.wsimport. wsimport works by getting the wsdl and creating all the artifacts needed to use this service. In this case, it would generate the JAXB 2.0 binding classes GetQuote, GetQuoteResponse, package-info, and ObjectFactory. Furthermore, it creates the service endpoint interface StockQuote, which provides the client view of the service, and the class StockQuoteService, which allows a client to interact with the client runtime. A point to note here is that, even though the wsimport is from the RI, the artifacts it generates are portable.

With the artifacts created, you can now compile the client. Then you can run the client. Supporting asynchronous callbacks or mtom, which are addressed in the following sections, will add complexity on top of what has been described here.

[More Detailed Tutorial]
JAX-WS Example: http://today.java.net/pub/a/today/2006/06/13/web-services-with-jax-ws-2.0.html


-- Web Service Asynchronous Callbacks and JAX-WS --

Asynchronous web services still imply a request-response protocol. However, asynchronous web services allow the application to do other things while it is waiting for a response from the server. So instead of a blocking operation, you have a non-blocking operation.

In the JAX-WS implementation, you tell the client application to asynchonously use web services through a combination of code and xml. The xml is actually WSDL bindings. This does not mean that the WSDL file on the server side needs special JAX-WS specific bindings that will effect interoperability. Instead it is optional and you may specify client-side xml to merge with the server obtained WSDL. Of course, this means that a .NET client accessing the service would somehow need to know to use asynchronous calls. There isn't any mechanism for that yet.

On the JAX-WS website, it is claimed that "the connection is kept open until the response is received. After that, the callback is called. client/server side handlers do not affect this behaviour." As this implies, using a web service asynchronously is implemented entirely by the client. I believe that when you make an asynchronous request to a web service, JAX-WS creates a new thread that waits for the response so that there is no blocking unless you need the returned data to continue. There isn't any massive polling, just a waiting for a response. Like I said before, the syntax for coding this isn't complicated, but it takes a lot of time to learn and the interoperability may be difficult.

There are two ways to use asynchronous services, which are polling and callback. Each approach definitely has its own benefits and disadvantages.

The polling approach allows you to poll an object that is created when you make the web service request about whether or not a response has been recieved from the server. If it has received a response, you can then request the data response from that object. As I said before, I do not believe that this actually polls the server.

The callback approach allows you to define a callback method when you make the web service request. When the response is received, the callback method is automatically executed. There is no need for you to do anything after making the request, although you can still check if the response has been received yet.

From what I understand, in all implementations, asynchronous web services is completely done on the client side and does not require the implementation to follow any standards. Using the TCPMon tool, I looked into the SOAP messages sent by a test application I developed and verified that there was no change between using the web service synchronously and asynchronously. Asynchronous callbacks are implemented by all the major web service platforms. There is no standardized way to suggest that the web service be used asynchronously, but it won't be impossible.

Java 6 also includes an embedded http server. What this means is that an endpoint can be embedded in client via the JAX-WS API. So using this, the client can send its address to the server, and the server can push information whenever anything is available to a service on the client's server. For this kind of callback, WS-Adressing has a specification about how this should work. JAX-WS does not follow this, but they say that they plan to for the next release. Oh yeah, the embedded server appears to randomly refuse requests if it receives many requests.

[Examples of Use]
JAX-WS Asynchronous Callback Example: http://today.java.net/pub/a/today/2006/09/19/asynchronous-jax-ws-web-services.html
Endpoints in Mustang Example: http://weblogs.java.net/blog/jitu/archive/2006/01/web_service_end.html


-- Attachments and JAX-WS --

The built-in support for Binary Attachments in JAX-WS is MTOM (Message Transmission and Optimization Mechanism). MTOM is a method of efficiently sending binary data to and from web services. It uses XOP (XML-binary Optimized Packaging) to transmit binary data and is intended to replace both MIME and DIME attachments.

The SOAP Message Transmission Optimization Mechanism, paired with the XML-binary Optimized Packaging [XOP], was proposed to address the inefficiencies related to the transmission of binary data in SOAP documents. This solution proposes a method in which XML messages are dissected in order to transmit binary blobs as MIME attachments in a way that is transparent to the application. Since an attachment is not really part of the XML payload, binary data does not need to be base64 encoded, thus reducing its size and increasing its processing speed.

MTOM is supported by the JAX-WS API and is transparent to the user and developer. MTOM is also supported by Microsoft .NET starting in WSE 3.0. The other web service alternative is encoding the data (such as base64 conversion), which is much more inefficient. Unfortunetely, MTOM still doesn't seem all that fast.

[References]

MTOM W3C Recommendation: http://www.w3.org/TR/soap12-mtom/
MTOM and JAX-WS: http://java.sun.com/webservices/docs/2.0/jaxws/mtom-swaref.html
MTOM Performance and Description: http://weblogs.java.net/blog/spericas/archive/2006/04/mtom_performanc.html
JAX-WS MTOM Usage Example: http://blogs.sun.com/milan/entry/using_web_service_to_send


-- From the Web Browser --

As for the web browser, there really hasn't been any outstanding development in that field. People have done funny things to allow callbacks (like using transfers for embedded video for the html requests). The methods were unreliable and very unlikely to really be adopted. Polling still seems like the best way, although it could be heavy on bandwidth.


- SOAP Thoughts -

To end off, I want to rant about SOAP:

SOAP is bloated and you can't find many people that actually like it. Sure, some businesses/people are using it, but the implementations don't work like they're supposed to. SOAP is confusing. It isn't easy to figure out what the standards are or what the standards are trying to say. Microsoft and Sun claim to be working off the same standards, but I'm not convinced they interpret them the same way. SOAP is complicated. You need compatible generation tools, WSDL files, SOAP web applications, and web clients for anything to even work. The interoperability it's designed for still isn't quite there because there are many different standards out there or the implementations of SOAP don't follow the standards correctly. I'm not convinced that it will remain popular for very long. SOAP services are incredibly difficult to create unless you have tools to do most of the work for you. If you have the right tools, it's not too hard to write applications, but the learning curve is pretty steep if you actually want to know what's going on. And you will need to know what's going on if you're writing anything more complicated than a stock-quote example. And it will be very difficult to troubleshoot any problems. SOAP still isn't very mature. A lot about it has changed in the past year and there's not much to suggest that it won't radically change in the next year.

I wonder if some of the other stuff (REST or something else altogether) will eventually replace it. I am impressed with how much web services have developed, but a lot of this development has added a lot of complexity. Web Services are easier to make (thanks to the tools) and more official standards are taking form, but they are more complicated than ever to understand and make by hand (which means they are not easy to debug.) Of course, none of this means that SOAP won't gain popularity and become increasingly important. It seems like the most in-use, buzzed up thing right now, which is good for lastibility.

[A Fun Read]
SOAP dialogue: http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple/


- Conclusion -

And that's it. Sorry if it's fragmented sounding, I hope you were able to learn something useful. Like to look into REST. For more fun, look into the latest javascript advancements, as well as Adobe Flex.

Wednesday, May 23, 2007

Of Wiki

My wiki software of choice is currently dokuwiki. It is true that I haven't put much research into it, but I mean, once you find one good solution, do you really want to look for others? Well, I guess if it's really important... but wiki's (especially the internal project wikis we need) generally aren't. Dokuwiki is very feature-rich. It's based around PHP. My favorite template for it is battlehorse. There really anything else I need to say about it, I just wanted to mention it since I've had good success with it. I'm currently using it for our project's homepage at work and I've had no problems doing everything I want with it. It took me maybe a half hour to set up completely to my liking and I haven't had to mess with its internals since. So Dokuwiki is a big yay.

I was using JSP Wiki at first, which is also pretty nice. It was also convenient since Apache Tomcat was already all set up on our server. However, there aren't that many good looking templates for it and I didn't have the time to make my own. But JSP Wiki is a yay if you don't mind the lack of template options and want a jsp solution. But be warned, the default template isn't really pretty at all, at best I'd call it functional.

If neither of those are your cup of tea or you really want to do some serious comparisons, this is a website that compares wikis. And if you really like wikipedia, here's a guide to set up MediaWiki. And that concludes my short advice on wikis.

Tuesday, May 15, 2007

CDisplay

MySettings

Edit: Since writing this post, I've switched over to Manga Meeya, which is much, much better.

In my opinion, there's (edit: almost) no program better than CDisplay for reading downloaded sequential art (that's comics!) I use it for photos and other image browsing too. My favorite features are the smart look ahead, ability to show two pages at once, ability to view pages either left-to-right or right-to-left, automatic resizing, smart preloading, ability to automatically deal with compressed files, and easy commands. I can't think of a better sequential image viewing program. I'll tell you how to set it up and use it.

- Setting Up -

First, download CDisplay here. Extract it into "C:\Program Files\CDisplay\". Double Click on CDisplay.exe. You can press 'w' to show or hide the menu bar, whichever you prefer. I like to keep it hidden to maximize the viewing area. Now you have to customize the program. Press 'c' to open up the configuration options. Customize them however you like, these are my setting changes from the default:

MySettings
Notice the option "Japanese Mode" under Program Settings. It's used for going right-to-left instead of left-to-right, in case you're reading asian sequential art. After this is done, start enjoying CDisplay! 'l' (lowercase L) will allow you to choose the files you want to open.

- My Most Used Commands -

l: Allows you to select a file to open. It's a lowercase 'L', not a one.
Ctrl+l: Goes to the next directory or compressed file. It's a lowercase 'L', not a one.
Ctrl+Shift+l: Goes to the preview directory or compressed file. It's a lowercase 'L', not a one.
Space: Goes to the next section or page.
Ctrl+Shift+Space: Goes to the previous section or page.

- Context Menu -

I think it's very convenient to add CDisplay to the Windows XP right click context menu for zip/rar files and folder icons. This is how to do it:

- For Zip/Rar Files -
1. Open "My Computer"
2. In the menu bar, go to Tools->Folder Options.
3. Click on the "File Types" tab.
4. On the "Registered file types:" list, find and click on "ZIP"
5. In the "Details for 'ZIP' extension" area, click the advanced button. An "Edit File Type" windows will pop up.
6. Click the "New..." Button
7. For Action, type: CDisplay. For application, type: "C:\Program Files\CDisplay\" "%1"
8. Close up. Now, whenever you right click a zip file, you can choose CDisplay to open it in CDisplay. To do this for rar files, repeat steps 1-7, switching the word ZIP with RAR.

- For Folders -

1. Create "C:\Program Files\CDisplay\CDisplayFolder.bat" with the contents:
setlocal EnableDelayedExpansion
cd %1
for %%i in (*) do set name="%~1\%%i" !name!
%2 %name%
2. Open "My Computer"
3. In the menu bar, go to Tools->Folder Options.
4. Click on the "File Types" tab.
5. On the "Registered file types:" list, find and click on "Folder" (under the File Types column)
6. In the "Details for 'Folder' extension" area, click the advanced button. An "Edit File Type" windows will pop up.
7. Click the "New..." Button
8. For Action, type: CDisplay. For application, type: "C:\Program Files\CDisplay\CDisplayFolder.bat" "%1" "C:\Program Files\CDisplay\CDisplay.exe"
9. Close up. Now whenever you you right click a folder, you can choose CDisplay to open the images.

You can not edit a folder context command using the above directions. If you need to edit the newly created CDisplay context command for folders do the following. This is playing with the registry, so you shouldn't do this unless you really have to:

1. Press "win+r" for Run and type: regedit
2. Navigate to HKEY_LOCAL_MACHINE/Software/Classes/Folder/shell/CDisplay/command. Be careful to not go to ".Folder".
3. Double Click the (Default) file to the right.
4. You can now edit the command, it's the value field of the pop up window.

- Closing Notes -

The CDisplay project is no longer being actively developed and the author vanished off the face of the earth (or something ^_^.) Others try to continue his work, but I haven't given them a try yet. You can find links to them here, if you want to try them. Anyways, that's all I have to say about CDisplay. After all this explaining effort on my part, you better go try the program out! It's really nifty. ^_^ Have fun.

Thursday, March 01, 2007

And I'm Back

Wow, it's been a while since I blogged last. I got a new job which has been keeping me busy and tired. Put me in weird moods. Y'know, the kinds of moods that encourages playing Twilight Princess and not the kind of mood that encourages writing blogs that aren't read by other people. But things are calming down now, and my desire to get more stuff done has risen again. I've got a lot to post about, mostly stuff that I've learned while working at my new job. But that stuff is for later. Today, I just wanted to say that I was alive, and say I'd be posting again. Now let's see if this blog'll ever show up on google searches for Jonathan Discar.

Tuesday, December 05, 2006

Interview Notes 1

Three of my old interview logs, maybe you can use them to help you prepare for one of your early career software programming job interviews. Maybe I'll put a more recent batch of these up later.


4/16


I had a phone screen recently, man those things are fun. First one in a while, though mostly just for fun, and I wasn't well prepared at all since it came out of the blue. I actually took notes afterwards, so I thought I'd briefly discuss the interview.

First we talked about Java's Access Control modifiers (public, private, protected, package) and about which each modifier did what. I couldn't remember package though. I feel stupid, because after I said I couldn't remember the last modifier, we talked about packages and I didn't make the connection for a while. We talked about what packages are, why we use them, and how to classes to a package. That's when I finally made that connection.

Then we talked about Interfaces. What they are, what they're used for, and why you would use them versus standard inheritance.

Next, we talked about Exceptions. The two types of exceptions, why to use throw versus try/catch, and how the Method Call Stack was used with Exceptions.

Then we went into Threads. He had me give an explanation of them, how to use them. I gave him some code of how to create a new thread and gave him some examples of when we use them without explicitly creating (in someone else's code, like with Swing, as well as when processing http sessions).

We talked about Reflection, what it is used for, and why it is used. I had to give some code using the refection package.

Next we went over databases. He had me give him code to make a simple query on a table and print the results out. He asked me a little about SQL also, like how to insert and delete stuff.

We then talked about Unit Testing and Functional Testing. I didn't know this. It turns out unit testing tests one class while funtional testing tests an entire project. He also asked me if I'd used Ant before. I told him I used Make instead, but I think I'll look into Ant now.

Lastly, we talked about J2EE. Three types (servlets, JMS, web services). We didn't go much into it since I didn't know much. And that was the end of the interview.


4/20

I had another interview; the people were very laid back there. The first interviewer mostly asked me about what I had done before. The coding questions were to write the code for a page of boxes with text in them, design a database layout for certain information, and then usin Javascript to resize a box when a button was clicked. With the second guy, we mostly talked about a card shuffling algorithm I brought up when I said I made a card game before. He told me about a "Perfect Shuffle", when cards interleave one by one. 7 (or 8) straight perfect shuffles result in the cards being in their original position, which is a technique used by card sharks. He asked me what kind of stuff I wanted to work on before letting me go. It was a pretty fun interview, all in all.


4/25

First stage interview today; went through three people in about an hour and a half.

First guy mostly talked to me about data structures. Started off with asking me how I would index all the pictures on the internet and make sure not to index pictures multiple time. I said to use a hash table. Then he had me do some pointer logic in c. How to reverse a string in place and how to copy one file to another.

The second guy asked me a lot about my old work experience. At the end he asked me one programming question, which was to write code copying

The third guy mostly gave me puzzles to solve. He asked me how many sugar cubes were in a cube that was 10 sugar cubes across and 10 sugar cubes high. Then he asked me some kind of math problem about finding out how long it would take to run across a field. Then, for some reason, he had me do some recusive programming: Just the Fibonacci code and traversing a tree. He ended by asking me a badly worded problem.

That problem ended up being this: Imagine you and your friend are on other sides of a river. There is a box with two locks: you have the key to one of the locks and your friend has the key to the other lock. Both locks need to be unlocked to open the box and the locks don't touch each other. You want to deliver an important message to your friend, but you can't do it yourself and you don't want to risk anyone else seeing the message. What do you do?

Of course, once I clarified the problem, I realized it was an encryption abstraction and answered: "Put the message in the box, lock your lock, and have a messenger bring it to the friend. He locks his lock and has the messenger return it to you. You unlock your lock and have the messenger return it to your friend. Now the friend unlocks his lock and takes out the document." And that was the end of the interview.

Wednesday, November 22, 2006

SQLite 3 and Java

The other day, I went off about how great SQLite was and everything, as well as how to use it with Ruby. Today I'll tell you how to use SQLite with Java. Just download SQLite JDBC drivers from here. Figure out where sqlite.jar and sqlite_jni.dll (native file) are, allow your java program to find them, and then access your sqlite database using JDBC. If you aren't familiar with jni and you're using windows, you can throw that DLL file into C:/WINDOWS. Support is cake for anyone who has used Java before. The documentation for the SQLite JDBC project can be found over here. As I said before, SQLite is a good database, especially for personal projects (where running your own database server is overkill) and quick testing. Also, the SQLite SQL implementation supports more than the in-memory database HSQLdb does, which I feel is the other good alernative. I'm liking SQLite more than HSQLdb. But I'm probably especially whiny about HSQLdb right now, since it didn't support the SQL case-when statement that I wanted to use for my last project.

As for examples... well, it's JDBC: the beauty of it is I don't need to give examples. But since I have examples, here's some very brief code to create a connection. If you don't know JDBC, read the JDBC documentation from Sun, it's probably worth knowing regardless of what you program for. With that, following this brief example (for which requires importing java.sql.Connection and having sqlite.jar and sqlite_jni.dll on your paths), I'm all done.

// Load the Database Engine JDBC driver
Class.forName( "SQLite.JDBCDriver");

// connect to the database
Connection conn = DriverManager.getConnection( "jdbc:sqlite:/filename", "", "" );

//close the connection. So pointless.
conn.close();

Monday, November 20, 2006

SQLite 3 and Ruby

As per my wife's request, I built a financial management spreadsheet application, because "we" needed to keep better track of our finances.. I'll probably go into that program some other day as it's actually proven useful. But enough about that, today I want to talk about the database I used for it. This database was SQLite 3. If you haven't heard of it, SQLite is an ACID-compliant relational database management system contained in a relatively small C library where the SQLite library is linked in and thus becomes an integral part of the program with the database accessed through simple function calls. Yes, that long run-on sentence was courtesy of wikipedia, copy, and paste. In my words: SQLite is a database that exists as an easy to access text file (via c function calls) instead of requiring an external database server to be running somewhere waiting for requests. A free and tiny embedded database with great SQL support.

My program was written in ruby. For database access, I used the sqlite3-ruby gem, which wraps up those c function calls with ruby. If you're unfamiliar with gems, they're simply packaged ruby applications that allow easy installs. Simply go to your command prompt and type in "gem install sqlite3." This will work as long as you've installed ruby with gems and have an internet connection.

Once you've installed the gem, you're all set. To show how easy it is to use, I'll go through a short example. This example creates a database with a table describing teams and a table describing how a certain team scored on a certain game. It then queries the database in order to print out team rankings. Yeah, it's an odd way to get that information, but it was part of a homework assignment I had. I'm unsure whether the query is very good, but it's going to serve as my example.

First, create your connection and (possibly) insert information thusly.
require 'sqlite3'

if( !File.exists?( 'test.db' ) )
db = SQLite3::Database.new( 'test.db' ) #The database is automatically created
db.execute( "create table team ( id INTEGER PRIMARY KEY, name VARCHAR(255) )" )
db.execute( "create table team_gm ( id INTEGER PRIMARY KEY, game_id INTEGER, team_id INTEGER, score INTEGER )" )
db.execute( "insert into team_gm values( 1, 1, 1, 5 )" )
db.execute( "insert into team_gm values( 2, 1, 2, 5 )" )
db.execute( "insert into team_gm values( 3, 2, 1, 3 )" )
db.execute( "insert into team_gm values( 4, 2, 2, 6 )" )
else
db = SQLite3::Database.new( 'test.db' )
end
Then query and manipulate data thusly. You've got lots of freedom here. I suggest to at least read the FAQ if you don't want to read all the documentation.
query = "select z.name, sum(case when x.score > y.score then 1 else 0 end) as wins, " +
"sum(case when x.score < y.score then 1 else 0 end) as losses, sum(case when x.score = y.score then 1 else 0 end) as ties from team_gm x " +
"join team z on x.team_id = z.id " +
"join team_gm y on x.game_id = y.game_id AND x.team_id <> y.team_id group by x.team_id " +
"order by wins-losses-ties desc"

db.execute( query ) do |row|
print row[0],": ",row[2]," Wins, ",row[3]," Losses, ",row[4]," Ties\n"
end
And finally close your connection thusly.
db.close
This database was exactly what I wanted and the sqlite ruby access is very simple. Granted, I'm probably way behind for not having used this before (I've been using HSQLDB for my "easy" databases), but at least I know now. I bet I'll be using it a lot now.

Monday, November 13, 2006

Regular Expressions and Dates

Regular expressions are great and I think programmers should always keep in practice with them because you really never know when it'll be useful to parse through text. When I was first learning Regular Expressions, I practised with dates. Eventually, I made myself a short program in ruby. It takes a string as input and if the string suggests a date, the program is supposed to figure out which date. Lots of stuff can be done with that date, such as a report of the day of the week, how far in days the date is from today, or when the end of the month is. All the calculations are trivial if a date is given. The tricky part was determining if a string specified a date, and if so, extracting the date.

As I said, I used regular expressions for figuring out what the date meant. I thought of all the formats a user might use and made a case for each of them. This has actually been a useful exercise and I've used the results of it a lot. The following are all the cases that I could think of... I very much doubt that I got all of them. Remember, this is for ruby, so the reg-exp formatting may be different for you. The i means ignore case and \A and \Z can be used to specify the beginning and end of the string respectively. The only way I can think of improving the recognition for now is to allow for spelling errors. Can you think of any other ways a person might reasonably suggest a date as a string? Here goes.

1. Of the format MM/DD/YY, MM-DD-YY, or MM\DD\YY. YY may be YYYY in any of the cases. This is the trickiest pattern, since the user may mean either Year/Month/Day or Month/Day/Year. Two digits for the year makes it difficult to assume what the user meant. I chose to use the Month/Day/Year form, unless the user uses four digits to specify the year, in which point it is easy to figure out what they meant. Therefore, YYYY/MM/DD is also a valid format . As for the year, if four digits are not specified, then I assume that they are specifying the current millineum (2000).
/\A(\d+)\s*(-|\/|\\)\s*(\d+)\s*((-|\/|\\)\s*(\d+))?/

2. Of the format "June 27, 1983", "Jun 27, 1983", or "June 27" (in which the current year is implied). Granted Junileropwf 27, 1983 would also be valid here, but I didn't think such cases were important enough to detect and were instead a waste the readibility of the expression. In specifying the month, a minimum of 3 characters are required. The comma is optional, but at least one space must separate the tokens. If a day and year are not specified, then day one of the specified month in the current year should be used.
/(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)([^\s]* (\d+)(.*))?/i

3. Of the format YYYYMMDD. It has to be in that order, I didn't make allowances in this case.
/(\d\d\d\d)(\d\d)(\d\d)/

4. Of the format YYYY. The date is interpreted as Jan 1 of the year YYYY.
/(\d\d\d\d)/

5. Last or Next or Current Day of the Week (ie last Thu, next Thursday, or Thursday). I used a minimum of three letters for the weekday name to avoid matching cases I didn't want it to match. Once again, I didn't test that the letters following the first three were correct because I didn't think it improved the match any more.
/(last |next |this |)(sun|mon|tue|wed|thu|fri|sat).*/i

6. Yesterday, today, tomorrow. Also, my wife and I made up words Yupterday (the day before yesterday) and Threemorrow (the day after tomorrow.) [--We wanted to make up for the lack of an English word for these common references. Yes, we're pretty goofy people. Please feel free to adopt the words.] The test for these is really simple and reg-exp isn't even really needed. It's actually less effecient if you want single matches, O(nm) instead of O(n). Here's the case for the heck of it:
/(today|tomorrow|yesterday|yupterday|threemorrow)/i

If you think the program I described might be useful, here's the whole current version as html. Do whatever you want with it. I've found it useful and added a bunch of date converting methods for flavor (like get the end of the month, return day statistics, or get number of days between two dates) , but the heart of the whole thing is still the regular expressions.

Wednesday, November 08, 2006

Some Funny Links

Today, I (probably stupidly) gave away the link to my blog to more people. To make up for the low quality of my previous posts, I offer some of the funnier links I've come across. Of course, they are probably the kind of humor that only I'd enjoy. But at least I tried. Yeah, these are all pretty old.

General
An old He-Man storybook with commentary
English Papers
How stupid Superfriends is looking back. Specifically, the Riddler.
Retitled Romance Novels

++ Images
Did I get the job?
Find X
My favorite web comic strip.
Bunny

# Some Programming Humor
1. Stupid Hacker
2. Evolution of a Software Engineer
3. Clock in Perl

Quotation of the day: "I like to throw sandwiches at the homeless. It satisfies both my altruistic and sadistic urges."

Monday, November 06, 2006

Good Free Reads

Stories are an important part of life. Not only are they entertaining, but they can effect your life if you let them. A good story will not only spark your imagination, but will give you new pespectives about the world. Of course, there are a lot of times where stories just take too long to read. I had a friend who brought books to work to read which he never ended up liking. It took months to finish each book and along the way my friend would lose interest. Good short stories would be way better for short bursts of reading, so I suggested some to him and he seemed to enjoy them a lot more. It worked well. And so I'll share with the internet in general.

The following is a list of online stories (that probably don't justify this really long introduction.) Although a bit on the computer geeky side, these are all stories that I think are especially good reads (which is why I wanted to share them.) They are all free, excellent quick reads that focus on ideas and characters rather than visualization and are located on fairly unsuspicious urls. In other words, they're ideal for fun short break or lunch time reading. If you know of anything else you think I should add to this list, please please please e-mail me. ^_^


Stories

(1) Orson Scott Card
Without doubt, Orson Scott Card is my favorite author. At his website, many short stories are provided. Here are my favorites.
   (a) Atlantis
It's very long and takes a bit before it's interesting, but it's really good once it does. If you've read Pastwatch, you might think you already read this... but you haven't, keep reading.
   (b) Ender's Game
If you like the book and haven't read this, I think it's still worthwhile. If you haven't heard of Ender's Game... after reading this, I'm sure you'll want to pick up the full novel.
   (c) Homeless in Hell
It's a Christmas story about an interesting interpretation of Hell and Santa Clause.
   (d) Missed
It's kinda on the sad side about a guy coping with death, please keep that in mind. Quite short though. One short break's worth.
   (e) Prior Restraint
This is a pretty interesting story, but I can't say anything about it without kind of ruining it.

(2) Neal Stephenson
   (a) Jipi and the Paranoid Chip
Lots of very cool ideas, flow of thoughts, and character interaction. As with Neal Stephenson's stuff, it has an abrupt ending.
   (b) The Great Simolean Caper
Interesting, it touches upon some of his normal themes. Smart characters, cool capers. Ending isn't as abrupt as normal, I think.

(3) Wizardry
Rick Cook wrote a series that blends fantasy with programming. Sound strange? It really isn't that strange and it's actually really quite cool. If you don't like fantasy or programming... then... maybe you should keep away. The first two novels (of five) were made free. They're the best ones anyways, in my opinion. These novels are pretty short, but it should still take a few hours to get through them. Maybe a week of lunches alone.

(4) Suzumiya Haruhi no Yutsu
This is a translation of a series of Japanese light novels. Some chapters are long, but it's not difficult at all to find constant good stopping points. This story is about a normal high school guy trying to deal with a very eccentric classmate who seems to unknowingly control the world and a bunch of supernatural people drawn to her. It's a comedy, mostly. Wiki for more information, but if you like Japanese comics/animation then this is an excellent find. There's also an anime of this series.

(5) Densha Otoko original posts
Umm... this is the black sheep of the list. It's not really a story, although it does tell a story. It's an organized, edited version of a forum thread that chronicles the relationship between an otaku (japanese super geek) at the thread asking for help and a non-otaku woman he had helped. It's pretty fun to read though... a very geeky romance story. Also, a Japanese drama came out of this (also called Densha Otoko), and it's pretty funny.

(6) The Book and the Sword
A great Chinese story to complement the Japanese stories. While the book is very long, the story arcs in the book are actually very episodic and pretty short. The Book and the Sword is a kung fu novel by Jin Yong and it's a really fun read.

(7) The Last Question
I can't really say I like Asimov's writing. I mean, I like his ideas and I do understand why he's important to sci-fi, but I don't like his writing style and so I rarely have fun reading his stuff. The ideas carry this story pretty well though. Since this was a pretty well thought out story, very famous, and a very quick read I decided to list it here. Passes the time on a very slow day, at the very least.


Essays

The following is a list of my favorite online essays. Any programmer and many non-programmers should find many excellent reads in this list. What's here deals primarily with introductions to ideas, examples of thought flows, productivity boosters, and springboards to interesting topics. While some are technical, they don't delve very deeply into the actual technology, instead giving you enough information to decide if you want to devote the time to really learn the topic. With all that said, here's the list. All good reads. If you know of anything else you think I should add to this list, please please please e-mail me. ^_^

(1) Orson Scott Card
Yep, my favorite author again. In addition to novels, he also does a lot of reviews and world commentaries on his web site. I find them interesting, even if I don't agree with everything that he says. These essays were carefully chosen by me as the ones that were the most interesting and thought-provoking to me. Read more of them if you'd like, as most of them are quite interesting.
   (a) Why Making Choices is So Hard
This is the first of OSC's essays that resonated with me. This talks about making choices.
   (b) Freakonomics
A review of Freakonomics, which is an interesting book. It also takes an example from the book and expands upon it, reaching another theory. I like seeing people's thoughts flow and this essay has a lot of very nice examples of thinking about cause and effect, as well as morality.
   (c) Weapons of Mass Destruction
This one provides interesting thoughts about what makes a weapon a WMD as well as some commentary about how OSC thinks the balance in the world works.
   (d) Taking Animals Seriously
This one is very interesting. It contains a lot of ideas about how people think, as well as how different people see the world. It does this by focusing on an autistic author who has devoted her life to making animal slaughterhouses more humane.

(2) Steve Yegge's Essay Collection
Link to his current blog
Steve Yegge writes a lot. His writings made me begin to really improve my programming and they constantly cause me to evaluate the way I think about things. That's why I believe these are very important. I think every programmer should read these because after reading, whether or not you agree, you will have thought a lot. Especially the fresher programmers, like me. Plus, they're pretty entertaining and he says funny stuff. I chose to list my favorite essays. Narrowing them down is difficult since I found it very worthwhile reading them all.
   (a) Tour De Babel
   (b) You Should Write Blogs
   (c) Five Essential Phone Screen Questions
   (d) Practicing Programming
   (e) Saving Time
   (f) Practical Magic

(3) In the Beginning, there was the Command Line by Neal Stephenson
In the End, I find this horribly long, boring in places, and a little out of date. But since I didn't grow up during the era, I ended up learning a huge amount from this. Some of the ideas are interesting, especially if you're pretty new computers. If you really enjoyed this, Mother Earth Mother Board is freely available too. This is another monstrously long essay... it might as well be a novel. It's about Neal Stephenson following FLAG, a global undersea fiber optic cable. He comments a lot about the history and politics around FLAG, as well as about his surroundings. But some spots are way too slow for me.

(4) Joel on Software: Best Software Writing
Essay Links for Best Software Writing
Archive Links
Joel on Software is one of those famous blogs with lots of entries worth reading. I can't think of anything in particular, except maybe this post. He released a compilation of what he felt were the best programming related essays of the year 2005. They really are some of the best software essays. Plus he talked about what makes writing good. The second link I've provided gives links to all the essays he chose. The last link is to his archives for his major blog entries. You may as well just start with the first essay there and work your way down.

(5) Random Tech Essays
   (a) 10 Question, 8 Programmers
This was a very interesting interview. 10 questions which 8 well-known programmers answer. Very, very interesting and a very cool idea. Everyone aspiring to be a good programmer should give this a read because it's good to know how those among "the best" view the field.
   (b) Lisp for Imperative Programmers
This is an introduction to functional programming where the reader is assumed to know only about procedural programming. Anyways, if you're a purely procedural programmer (C, Java, Ruby, etc..) and wanted to know what functional programming was all about, I can't think of any better read than this.
   (c) The Best 46 Free Utilities
This is a list of what the author considers the best windows free utilities for various tasks. I like his suggestions and this is the first place I will go if I want to find a new tool. Hey, it's kind of like an essay.
   (d) Programming Rock Solid Code
This is an interesting piece about the work environment of a place that must write the code to launch and run a multi-billion dollar shuttle.
   (e) No Silver Bullet
A classic CS essay about programming tools and languages.

Saturday, November 04, 2006

Jin Yong's Wuxia

Quick Summary of Links:
Romance of the Book and Sword (Buy the translation)
Sword of the Yueh Maiden
Return of the Condor Heroes (Divine Eagle, Gallant Hero)
Wuxia English Forum
Wuxia Fan Translations

Actual Entry:
I've been reading Jin Yong's (aka Louis Cha) Wuxia novels recently. Jin Yong is known as one of the best Wuxia writers. He created 15 Wuxia stories that are famous throughout a lot of the world. I've read three of the stories (soon to be four), but that's only because it's all the translated-into-english text I can find. If I could read Chinese, I could just read it all from here (but it's all simplified.)

Maybe I'm getting ahead of myself. Wuxia is a genre that comes out of China and literally means "martial arts heroes." They take place in China's past, usually among real events, but everyone's abilities are hyper exaggerated. It's a blend of philosophy, conflicting honor codes, and fantasy martial arts. The best I can compare it to in western culture would be modern takes on Arthurian or Robin Hood stories. I guess Westerns are kind of similar also. If you've seen "Crouching Tiger, Hidden Dragon", that's an example of a wuxia story. Except Jin Yong's stories are much better than these examples, and a lot more stuff happens involving much cooler characters.

If you like shonen japanese stories, there is no doubt you'll love the stories Jin Yong has written. In fact, you'll very likely like the novels more than those comics. I'm pretty sure almost all the really good anime fighting ideas (with the chi or martial arts moves) were stolen from China. The fighting used is really interesting and very well imagined. The novels have lots of romance elements, political plots, and technique-laden action. The characters are all really cool and interesting.

So far, I've read the Book and the Sword, Return of Condor Heroes, and Sword of the Yueh Maiden. I've ordered Deer and the Cauldron... but it's pretty pricey at $35 for each of the three books that make the story up. Each book I've read has been very good. Read Sword of the Yueh Maiden if you're doubtful. It's the only short story of Jin Yong's novels and it's a great taste of what the genre is like. For a full listing of his stories, please consult his wikipedia entry, from which you can also get summaries. Beware of spoiling yourself though. I'm going to go over the works that are completely available in English. There are a lot of translations of his, but most of them are in progress works.

Sword of the Yueh Maiden is a short story about two nations at war with each other. You can read it in English here. The weaker nation isn't weaker by much: its only problem is that the swordsmen of the other nation are far stronger. The story is about one of the court advisors looking for a way to overcome this weakness.

The Book and the Sword can be read here and bought here. It's about the actions of a very heroic secret society. It starts with several rescue plots until the "big secret" is uncovered. It has a large cast of characters, such as Chen who fights using go stones and a whip to hit accupoints. There's also the lightning fast one-armed brother and the Mastermind strategist brother. These characters are naturally all ranked in their organization. There are great and powerful female characters as well. It's all great fun.

Return of Condor Heroes follows the growth of a boy named Yang Guo and his relationship with his teacher Xiaolongnu. Yang Guo is the brilliant son of a defeated villian and no one wants him to grow up like his father. However, all his masters treat him poorly so he runs away to a cave where he becomes the student of Xiaolongnu. Lots and lots of stuff happen from there and Yang Guo grows stronger and stronger even despite bad things happening all the time. It's been fan translated and that translation can be found here.

The Deer and the Cauldron was translated into English and released as three installments. Book one can be purchased here, book two can be purchased here, and book three can be purchased here. I haven't read it yet, but it's supposed to be funny. I will update this when I get to read it.

The Fox Volant of the Snowy Mountain was also translated into english and can be purchased here. However, I've heard that the translation was really bad.

Unfortunately for me, these books have been adapted into TV series, which I've been spending a lot of energy recently obtaining and then a lot of time watching. These series all last about 40 episodes and it's still not really enough time to show all the events from the novels. Furthermore, these things are pretty much corny and horrible as far as I've seen. They try to rely on cg effects that would be embarrassing in a old playstation game and really has no business in a live action film. I also don't like all the unnatural sounding voice dubs. Despite all my problems with them, I keep watching and am slowly beginning to enjoy it. The stories are good and every once in a while, things are done right (read: not ridiculously poorly.) The only one I've seen like that so far is Tian Long Ba Bu 2002. Return of Condor Heroes 2006 was ridiculous, but the actors looked too cool to complain too much. Okay, mostly Liu Yifei.

Tian Long Ba Bu follows three fairly different heroes whose paths constantly intertwine. There are a lot of characters here and a lot of twists. It's a fun series to watch and no segment really drags for very long. Some story arcs are especially gripping. The best thing is that there are so many characters that are very likable and all the different storylines are equally interesting. The thing that makes this a good tv series is the (relatively) low use of CG, the good casting, and the actually fun to watch fight scenes. I hope I can find another adaptation like this.

I want to mention that, so far, Jin Yong's stories are the only wuxia I've read that I'd really recommend at this point. I've gone through The Sword and the Exquisiteness and Sentimental Swordsman, Ruthless Sword by another very famous wuxia author, Gu Long. While I did read through them both, I didn't like them very much. I couldn't relate to his characters and I felt that they were very one dimensional - a few very good, many very bad, or some inconsequential. I do not feel that he built a very compelling or deep world for his stories to take place. I read his wiki entry, and I think that the differences I saw between Gu Long and Jin Yong are reflected in the ways that they led their lives.

And that's all I've got to say. I just wanted you to give this genre a try if you haven't already, y'know, bring it to your attention. I had no idea about the quality of this stuff until I happened by it after reading the wiki entry on the movie Kung Fu hustle. I mean, you want to open your horizons and see what popular Chinese fiction is like, right? I tried to explain it, but there was no way I could do the stories justice. So please just follow any of the links I gave earlier and give it a try. If you'd like more information, read Jin Yong's wikipedia entry, the fan translation base, and this forum. I'll update this entry as I get more information and as more translations are completed.

Oh, and one last thing slightly related thing. I recently found a freely available translation of the Romance of the Three Kingdoms. If that interests you, take a look over here.