<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2809566437250696584</id><updated>2011-04-21T15:42:23.927-04:00</updated><category term='samba'/><category term='domain server'/><category term='xml'/><category term='Vista'/><category term='xslt'/><category term='parallels'/><category term='windows xp'/><category term='ubuntu'/><category term='organizing'/><category term='http'/><category term='rant'/><category term='hardware'/><title type='text'>Out dot Print</title><subtitle type='html'>Programming and other interesting tidbits about life in the CMH.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-5393931972541092701</id><published>2007-07-22T23:22:00.000-04:00</published><updated>2007-07-24T23:48:11.975-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='http'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>HTTP POST</title><content type='html'>Have you ever wanted to create/access a web service, but found solutions like SOAP just too slow?  We ran into this problem at work not too long ago.  With some help, I had created a web service accessible via SOAP.  However, when we deployed and ran it in production for a couple of weeks, we were not satisfied with the speed and memory performance of the entire process.  Since the service was (potentially) a high volume call, we determined that the overhead of using SOAP was a big hang up.  The wrapping and unwrapping of the SOAP envelope for each call was really bogging down the server's processor.  Another solution was needed.&lt;br /&gt;&lt;br /&gt;We caught a break in that the service was strictly an internal call, therefore conforming to some silly (kidding!) standard to support external customers was not needed.  We turned to something pretty basic, a bare-bones HTTP POST.  The service would accept incoming XML, perform it's function and output XML as a response.&lt;br /&gt;&lt;br /&gt;What we need: a Java servlet.  Yep, that's it, just have the servlet respond via POST and you can rig it to capture incoming XML and pass it along to your business logic to do the dirty work.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class PostServlet extends HttpServlet {&lt;br /&gt;public void doPost(HttpServletRequest request, HttpServletResponse response)&lt;br /&gt; throws ServletException, IOException {&lt;br /&gt;BufferedReader in = null;&lt;br /&gt;PrintWriter out = null;&lt;br /&gt;&lt;br /&gt;try {&lt;br /&gt; in = request.getReader();&lt;br /&gt; out = response.getWriter();&lt;br /&gt;&lt;br /&gt; // Set the response content-type&lt;br /&gt; response.setContentType("text/plain");&lt;br /&gt;&lt;br /&gt; // Read the incoming data from the request&lt;br /&gt; String line = null;&lt;br /&gt; StringBuffer inData = new StringBuffer();&lt;br /&gt; while ((line = in.readLine()) != null) {&lt;br /&gt;  inData.append(line + "\n");&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; // Send the email message&lt;br /&gt; BusinessLogicObject bc = new BusinessLogicObject();&lt;br /&gt; String returnValue = bc.executeBusinessLogic(inData.toString());&lt;br /&gt;&lt;br /&gt; // Write the return value to the response&lt;br /&gt; out.print(returnValue);&lt;br /&gt;}&lt;br /&gt;catch (Throwable e) {&lt;br /&gt; out.close();&lt;br /&gt; in.close();&lt;br /&gt; e.printStackTrace();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;To test the servlet, we can create a simple JSP page:&lt;br /&gt;&lt;pre&gt;&amp;lt;%@ page language = "java"&lt;br /&gt;import = "java.text.*, java.util.*, java.io.*, java.net.*, java.sql.*"&lt;br /&gt;%&amp;gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;String submitted = request.getParameter("submitted");&lt;br /&gt;String templateId = "";&lt;br /&gt;String xmlDoc = "";&lt;br /&gt;String servletResponse = "";&lt;br /&gt;if ("1".equals(submitted)) {&lt;br /&gt;// Process the form and send the emailer message&lt;br /&gt;templateId = request.getParameter("templateId");&lt;br /&gt;xmlDoc = request.getParameter("xmlDoc");&lt;br /&gt;&lt;br /&gt;// Compose the HTTP POST&lt;br /&gt;PropertyManager.load("/emailer");&lt;br /&gt;String emailerWebServiceHost = PropertyManager.getProperty("web_service_host");&lt;br /&gt;String urlString = "http://" + emailerWebServiceHost + "/servlets/PostServlet";&lt;br /&gt;URL url = new URL(urlString);&lt;br /&gt;HttpURLConnection con = (HttpURLConnection)url.openConnection();&lt;br /&gt;con.setAllowUserInteraction(true);&lt;br /&gt;con.setDoInput(true);&lt;br /&gt;con.setDoOutput(true);&lt;br /&gt;con.setUseCaches(true);&lt;br /&gt;con.setFollowRedirects(false);&lt;br /&gt;con.setRequestMethod("POST");&lt;br /&gt;con.connect();&lt;br /&gt;&lt;br /&gt;// Set the request info (XML)&lt;br /&gt;PrintWriter output = new PrintWriter(new OutputStreamWriter(con.getOutputStream()));&lt;br /&gt;output.print(xmlDoc);&lt;br /&gt;output.flush();&lt;br /&gt;output.close();&lt;br /&gt;&lt;br /&gt;// Get the response (String)&lt;br /&gt;BufferedReader input = new BufferedReader(new InputStreamReader(con.getInputStream()));&lt;br /&gt;String line = null;&lt;br /&gt;StringBuffer inputData = new StringBuffer();&lt;br /&gt;while ((line = input.readLine()) != null) {&lt;br /&gt; inputData.append(line + "\n");&lt;br /&gt;}&lt;br /&gt;servletResponse = inputData.toString();&lt;br /&gt;}&lt;br /&gt;%&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Send Email Servlet Test Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Send Email Servlet Test Page&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form action="servletTest.jsp" method="post"&amp;gt;&lt;br /&gt;&amp;lt;table border="0" align="center"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td&amp;gt;Select the template ID to use:&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td&amp;gt;&lt;br /&gt;  &amp;lt;select name="templateId"&amp;gt;&lt;br /&gt;   &amp;lt;option value="XMLType1"&amp;gt;XMLType1&amp;lt;/option&amp;gt;&lt;br /&gt;   &amp;lt;option value="XMLType2"&amp;gt;XMLType2&amp;lt;/option&amp;gt;&lt;br /&gt;   &amp;lt;option value="XMLType3"&amp;gt;XMLType3&amp;lt;/option&amp;gt;&lt;br /&gt;   &amp;lt;option value="XMLType4"&amp;gt;XMLType4&amp;lt;/option&amp;gt;&lt;br /&gt;  &amp;lt;/select&amp;gt;&lt;br /&gt; &amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td&amp;gt;Specify the XML file to use:&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td&amp;gt;&amp;lt;textarea name="xmlDoc" cols="100" rows="20"&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td align="center"&amp;gt;&lt;br /&gt;  &amp;lt;input type="submit" name="submitButton" value="Submit" /&amp;gt;&lt;br /&gt;  &amp;lt;input type="reset" name="resetButton" value="Reset" /&amp;gt;&lt;br /&gt;  &amp;lt;input type="hidden" name="submitted" value="1" /&amp;gt;&lt;br /&gt; &amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;table border="0" align="left"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td colspan="2"&amp;gt;&amp;lt;b&amp;gt;Output&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt; &amp;lt;td&amp;gt;Template ID:&amp;lt;/td&amp;gt;&lt;br /&gt; &amp;lt;td&amp;gt;&amp;lt;%= templateId %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;br clear="all" /&amp;gt;&lt;br /&gt;&amp;lt;br clear="all" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Servlet Output&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;&amp;lt;%= servletResponse %&amp;gt;&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;Boom, done, that's all she wrote.  Until next time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-5393931972541092701?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/5393931972541092701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2809566437250696584&amp;postID=5393931972541092701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/5393931972541092701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/5393931972541092701'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/07/http-post.html' title='HTTP POST'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-213981719725377887</id><published>2007-07-16T00:40:00.000-04:00</published><updated>2007-07-16T00:52:06.376-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rant'/><category scheme='http://www.blogger.com/atom/ns#' term='organizing'/><title type='text'>Organization</title><content type='html'>So here I am, I'd rather be sleeping, but my body doesn't seem to want to agree with me.  I thought I'd give some writing to calm my mind down and hopefully be off in la-la land soon.&lt;br /&gt;&lt;br /&gt;Lately, I've been trying to re-organize and tidy up my apartment in the hopes of giving it less of that bachelor-pad feel.  I've made small progresses here and there, but I'm realizing just how much stuff I have.  I started by emptying out my office (mostly) into my living room and just one look tells me that I'm a) going to have to get rid of the junk I don't need anymore and b) get a lot more storage bits to keep myself sane.  My main need is more shelving/bookcases, so it looks like a trip to Target, Bed Bath &amp; Beyond, Staples and the like is in the works.  In the meantime, my office is mostly empty while my living and bed rooms are complete disasters... what have I gotten myself into?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-213981719725377887?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/213981719725377887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2809566437250696584&amp;postID=213981719725377887' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/213981719725377887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/213981719725377887'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/07/organization.html' title='Organization'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-3929773960294789518</id><published>2007-06-17T22:52:00.000-04:00</published><updated>2007-06-17T23:40:22.858-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows xp'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>Compy issues</title><content type='html'>The last few weeks have been pretty rough from a computer stand point.  A little while back my computer just died, I tried a restart and got nothing, no POST beep or beep error codes.  Nothing.  Awesome.  A little diagnosis later and I determine that the motherboard had died.  Joy.  In an age of rapidly progressing hardware, this pretty much meant I had to replace the "holy trinity" of computer parts: motherboard, CPU and RAM.  Just to pile onto the fun, my perfectly good video card had to be replaced as well, since the AGP slot is basically extinct.  A quick trip to &lt;a href="http://www.newegg.com/"&gt;newegg.com&lt;/a&gt; and a couple days of going stir-crazy, my computer is rebuilt.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;I sit down in my chair, fire up the compy and... Windows won't start.  @!#$  Not in safe mode, not in any mode.  In all honesty, that's not a huge surprise considering I just replace most of the innards.  I try to repair the installation, nada.  *sigh*  I break out my XP disks and resign myself to doing a complete reinstall... time passes...  Finally, XP is installed, I go to activate it... "you have exceeded the number of times you can activate XP using this key"... grr...  So I call customer support, go through their convoluted process to get my version of XP activated and finally have a fully function computer again.  (Side note: I wonder what's going to happen when support for XP officially ends?  Am I going to be able to activate my legit copy of Windows when I need to?)&lt;br /&gt;&lt;br /&gt;Suffice to say, I'm mostly back up and running normally.  I'm in the processes of getting everything "lived in" again  In the meantime, I'm a bit stuck in neutral.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-3929773960294789518?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/3929773960294789518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2809566437250696584&amp;postID=3929773960294789518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/3929773960294789518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/3929773960294789518'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/06/compy-issues.html' title='Compy issues'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-8639663058856389819</id><published>2007-05-18T20:36:00.000-04:00</published><updated>2007-05-18T21:42:55.573-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='domain server'/><category scheme='http://www.blogger.com/atom/ns#' term='samba'/><title type='text'>Samba (cont.)</title><content type='html'>As I said in my previous post, I finally got around to getting a Samba domain server up and running in my little home office.  This post will be a brief rundown of how I managed to get a Samba server up and running.  After all kinds of reading and getting to know Google quite well, it turned out to be quite a bit easier to set up than I originally anticipated.  Some links that came in handy:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.howtoforge.com/samba_setup_ubuntu_5.10"&gt;SAMBA (Domain Controller) Server For Small Workgroups With Ubuntu 5.10&lt;/a&gt;&lt;br /&gt;&lt;a href="https://help.ubuntu.com/community/SettingUpSambaPDC"&gt;SettingUpSambaPDC&lt;/a&gt;&lt;br /&gt;&lt;a href="http://doc.gwos.org/index.php/LightweightGnome"&gt;Lightweight Gnome&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Machine:&lt;br /&gt;Athlon 1GHz&lt;br /&gt;32MB RAM (going to upgrade this soon)&lt;br /&gt;4 GB HDD (holds the OS, mounted as /)&lt;br /&gt;80 GB HDD (to setup as a share, mounted as /share)&lt;br /&gt;&lt;br /&gt;Step 1: Install Ubuntu&lt;br /&gt;I went with the server install just to avoid all the extra stuff that normally comes with the default desktop install.  I needed to save space since I was going to squeeze the entire OS onto a 4 GB hard drive.&lt;br /&gt;&lt;br /&gt;Step 2: Install Gnome&lt;br /&gt;Using the link above as a guide, I installed as minimal a Gnome desktop as I could.  I like Linux, but I'm not &lt;span style="font-weight: bold;"&gt;that&lt;/span&gt; hardcore to want to work from a text interface.  One little problem I had after I got Gnome up and going was that I was stuck in a 1024x768 screen resolution, despite picking other larger resolutions in the configuration.  A solution I found was to re-run the setup program.&lt;br /&gt;&lt;pre&gt;sudo dpkg-reconfigure xserver-xorg&lt;br /&gt;&lt;/pre&gt;After choosing all the defaults, I had to choose the "Medium" monitor detection instead of the default selection (Automatic I believe).  Blessed again with a 1200x1024 resolutions, I was ready to move on to the next step.&lt;br /&gt;&lt;br /&gt;Step 3: Installing/Configure Samba&lt;br /&gt;With Gnome up and going and the Ubuntu package manager up and going, I simply fired up Synaptic Package Manager (System &gt; Administration &gt; Synaptic Package Manager) and installed samba and it's dependencies.&lt;br /&gt;&lt;br /&gt;With Samba installed I used the information on the links above as a guide to setup my Samba configuration.&lt;br /&gt;&lt;pre&gt;# Samba configuration file (/etc/samba/smb.conf)&lt;br /&gt;[global]&lt;br /&gt; workgroup = CEREBRO&lt;br /&gt; server string = Samba %v on %L&lt;br /&gt; netbios name = professorx&lt;br /&gt; wins support = yes&lt;br /&gt; dns proxy = no&lt;br /&gt;&lt;br /&gt; log file = /var/log/samba/log.%m&lt;br /&gt; log level = 1&lt;br /&gt; max log size = 1000&lt;br /&gt; syslog = 0&lt;br /&gt;&lt;br /&gt; admin users = root&lt;br /&gt; security = user&lt;br /&gt; username map = /etc/samba/smbusers&lt;br /&gt; guest account = nobody&lt;br /&gt; encrypt passwords = yes&lt;br /&gt; passdb backend = tdbsam&lt;br /&gt; obey pam restrictions = yes&lt;br /&gt; invalid users =&lt;br /&gt; unix password sync = yes&lt;br /&gt; passwd program = /usr/bin/passwd %u&lt;br /&gt; passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .&lt;br /&gt; map to guest = Bad Password&lt;br /&gt; password level = 0&lt;br /&gt;&lt;br /&gt; add user script = /usr/sbin/useradd -m '%u' -g smbusers -G smbusers&lt;br /&gt; delete user script = /usr/sbin/userdel -r '%u'&lt;br /&gt; add group script = /usr/sbin/groupadd '%g'&lt;br /&gt; delete group script = /usr/sbin/groupdel '%g'&lt;br /&gt; add user to group script = /usr/sbin/usermod -G '%g' '%u'&lt;br /&gt; add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody %u&lt;br /&gt;&lt;br /&gt; logon path =&lt;br /&gt; logon home =&lt;br /&gt; logon drive = H:&lt;br /&gt;&lt;br /&gt; domain logons = yes&lt;br /&gt; os level = 65&lt;br /&gt; domain master = yes&lt;br /&gt; preferred master = yes&lt;br /&gt; local master = yes&lt;br /&gt; logon script =&lt;br /&gt;&lt;br /&gt; printcap = cups&lt;br /&gt; printers = cups&lt;br /&gt; load printers = yes&lt;br /&gt;&lt;br /&gt; socket options = TCP_NODELAY&lt;br /&gt; time server = no&lt;br /&gt;&lt;br /&gt;[share]&lt;br /&gt; path = /share&lt;br /&gt; comment = Network Share&lt;br /&gt; volume = Network_Share&lt;br /&gt; writeable = yes&lt;br /&gt;&lt;/pre&gt;The links above spell out more of the Samba installation/configuration which can be followed with no additional information coming from me (though in the future I may come back and flush these steps out some more).&lt;br /&gt;&lt;br /&gt;Step 4: Add machine to the domain&lt;br /&gt;The machine I wanted to add to the domain is my Windows XP machine.  This is done fairly easily by:&lt;br /&gt;&lt;br /&gt;right click My Computer &gt; Properties &gt; Computer Name tab &gt; Change&lt;br /&gt;&lt;br /&gt;Choose the Domain radio button and specify the domain name.  A dialog box should pop up, specify the Administrator username/password and you should get added to the domain.  Restart the machine and boom, you are now part of the domain.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-8639663058856389819?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/8639663058856389819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2809566437250696584&amp;postID=8639663058856389819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/8639663058856389819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/8639663058856389819'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/05/samba-cont.html' title='Samba (cont.)'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-2063330182454307760</id><published>2007-05-15T23:18:00.000-04:00</published><updated>2007-05-15T23:26:32.007-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='domain server'/><category scheme='http://www.blogger.com/atom/ns#' term='samba'/><title type='text'>Samba... not the dance</title><content type='html'>Well after a lot of reading and procrastination I finally got a Ubuntu server running Samba set up as a domain controller.  I'm still tweaking on the config file a bit, I will post it as soon as I get it finalized.  Overall the process went pretty smoothly, but it did take me a couple of attempts.  My first try I think I managed to jack things up pretty badly trying to get SWAT to run (web gui interface to the Samba config file).  So I just cut bait and re-installed everything.&lt;br /&gt;&lt;br /&gt;One quick note on the Ubuntu server, by default it runs in text mode after installation, but I still wanted some kind of gui interface.  I managed to find a how-to (link to come) that walks through how to install a minimal Gnome interface.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-2063330182454307760?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/2063330182454307760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2809566437250696584&amp;postID=2063330182454307760' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/2063330182454307760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/2063330182454307760'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/05/samba-not-dance.html' title='Samba... not the dance'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-2545083951626426265</id><published>2007-04-22T23:15:00.000-04:00</published><updated>2007-04-22T23:21:30.430-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vista'/><title type='text'>Vista broke my website...</title><content type='html'>... so it appears.  One of our websites at work doesn't appear to work with this new fangled Windows Vista.  Lately we've been getting complains of the site not working properly, customers would log in, click through a page or two and then boom, back to the login page.  From where I sit, the site is acting line the Session is being invalidated.  It appears that everyone experiencing the problem is running Vista and IE7.  I've tested it on IE6, IE7 and Firefox on XP and the site works just fine, so last variable appears to be Vista.  At the moment, we do not have a Vista box (we've also been told not to install IE7 yet), but there is one on the way.  Hopefully there's a setting somewhere in their new security "features" that will get the site working again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-2545083951626426265?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/2545083951626426265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2809566437250696584&amp;postID=2545083951626426265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/2545083951626426265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/2545083951626426265'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/04/vista-broke-my-website.html' title='Vista broke my website...'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-3012459448177269522</id><published>2007-04-08T22:33:00.000-04:00</published><updated>2007-04-08T22:52:31.312-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='domain server'/><category scheme='http://www.blogger.com/atom/ns#' term='parallels'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>That Tinkering Feeling</title><content type='html'>A friend of mine recently bought a new Mac desktop machine, his first such venture into the arena.  I got to play around with it over the weekend and came away impressed.  The neatest thing I got to see was the &lt;a href="http://www.parallels.com/"&gt;Parallels Desktop&lt;/a&gt;, a virtualization solution in which he setup Windows XP and was working on getting &lt;a href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt; up and going.&lt;br /&gt;&lt;br /&gt;While I don't see myself buying a Mac anytime soon, it did get me thinking about my little home network.  I am strongly thinking about creating a new domain/file server based on Ubuntu and Samba, but first I'm going to need more hard drive space.  And then, of course, I'll have to follow through.  Updates to come... hopefully...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-3012459448177269522?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/3012459448177269522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2809566437250696584&amp;postID=3012459448177269522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/3012459448177269522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/3012459448177269522'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/04/that-tinkering-feeling.html' title='That Tinkering Feeling'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-6533935231142842153</id><published>2007-04-04T22:47:00.000-04:00</published><updated>2007-04-05T20:19:19.236-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='xslt'/><title type='text'>XSL Transformers: More Than Meets The Eye</title><content type='html'>I don't know how your workplace functions but mine has one glaring flaw, a lack of centralization.  Take a look around and you can see a few places in which common tasks are being preformed across multiple teams.  With the hope of starting a trend, work presented us with a fun little problem to solve.  How can we centralize our outgoing e-mail messages?  We have a handful of websites, some in .NET others in Java, each responsible for composing and sending their own e-mails (mostly confirmations and reminders).&lt;br /&gt;&lt;br /&gt;To meet the centralization requirement we decided on setting up a web service that was then exposed to all development teams.  Ok, one problem solved, but we still had to figure out how compose our data-centric e-mails and then send them out the door. Enter &lt;a href="http://www.w3.org/TR/xslt"&gt;XSLT&lt;/a&gt;, in a nutshell what XSLT allows us to do is transform an XML document into some other format, in our case HTML and/or text.  This will allow our web service to take an incoming XML document and transform it into an HTML page.  In order to do these transformations programatically we will use the &lt;a href="http://xml.apache.org/xalan-j/"&gt;Xalan&lt;/a&gt; XSLT processor.  Before we get started with the Java code, we will also need some XML and an XSLT template.&lt;br /&gt;&lt;br /&gt;First the XML:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;emailMessage.xml&lt;br /&gt;----------------&lt;br /&gt;&amp;lt;EmailMessage&amp;gt;&lt;br /&gt;    &amp;lt;Customer&amp;gt;&lt;br /&gt;        &amp;lt;customerFirstName&amp;gt;Joe&amp;lt;/customerFirstName&amp;gt;&lt;br /&gt;        &amp;lt;customerLastName&amp;gt;Customer&amp;lt;/customerLastName&amp;gt;&lt;br /&gt;        &amp;lt;customerEmail&amp;gt;joe.customer@somewhere.com&amp;lt;/customerEmail&amp;gt;&lt;br /&gt;    &amp;lt;/Customer&amp;gt;&lt;br /&gt;    &amp;lt;Service&amp;gt;&lt;br /&gt;        &amp;lt;confirmationNumber&amp;gt;12345-67&amp;lt;/confirmationNumber&amp;gt;&lt;br /&gt;        &amp;lt;price&amp;gt;59.99&amp;lt;/price&amp;gt;&lt;br /&gt;        &amp;lt;date&amp;gt;2007-04-04&amp;lt;/date&amp;gt;&lt;br /&gt;    &amp;lt;/Service&amp;gt;&lt;br /&gt;&amp;lt;/EmailMessage&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now the XSLT:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;emailMessage_html.xslt&lt;br /&gt;----------------------&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;br /&gt;&amp;lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template match="/EmailMessage"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Email Message Sample&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;        &amp;lt;p&amp;gt;Thank you for your order.  The information we have on file is below:&amp;lt;/p&amp;gt;&lt;br /&gt;        &amp;lt;p&amp;gt;&lt;br /&gt;        &amp;lt;b&amp;gt;Customer Information&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        First Name: &amp;lt;xsl:value-of select="Customer/customerFirstName" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        Last Name: &amp;lt;xsl:value-of select="Customer/customerLastName" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        E-mail: &amp;lt;xsl:value-of select="Customer/customerEmail" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        &amp;lt;/p&amp;gt;&lt;br /&gt;   &lt;br /&gt;        &amp;lt;p&amp;gt;&lt;br /&gt;        &amp;lt;b&amp;gt;Service Information&amp;lt;/b&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        Confirmation Number: &amp;lt;xsl:value-of select="Service/confirmationNumber" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        Price: &amp;lt;xsl:value-of select="Service/price" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        Date: &amp;lt;xsl:value-of select="Service/date" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        &amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And finally the Xalan transformer class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;TemplateTransformer.java&lt;br /&gt;------------------------&lt;br /&gt;import java.io.*;&lt;br /&gt;import javax.xml.transform.*;&lt;br /&gt;import javax.xml.transform.stream.*;&lt;br /&gt;&lt;br /&gt;public class TemplateTransformer {&lt;br /&gt;    // constructors&lt;br /&gt;    public TemplateTransformer() {}&lt;br /&gt;&lt;br /&gt;    // methods&lt;br /&gt;    public String transform(String xml, String xsltStyleSheetPath) {&lt;br /&gt;        String text = "";&lt;br /&gt;&lt;br /&gt;        TransformerFactory tFactory = TransformerFactory.newInstance();&lt;br /&gt;&lt;br /&gt;        // Define the source XSL&lt;br /&gt;        StreamSource source = new StreamSource(new File(xsltStyleSheetPath));&lt;br /&gt;        // Define the source XML&lt;br /&gt;        StreamSource sourceXML = new StreamSource(new StringReader(xml));&lt;br /&gt;        // Define the result destination&lt;br /&gt;        StreamResult result = new StreamResult(new StringWriter());&lt;br /&gt;&lt;br /&gt;        try {&lt;br /&gt;            // Tranform the XML using the XSL&lt;br /&gt;            Transformer transformer = tFactory.newTransformer(source);&lt;br /&gt;            transformer.transform(sourceXML, result);&lt;br /&gt; &lt;br /&gt;            StringWriter writer = (StringWriter)result.getWriter();&lt;br /&gt;            text = writer.toString();&lt;br /&gt;        }&lt;br /&gt;        catch (TransformerException te) {&lt;br /&gt;            return "";  // yeah, I'm being lazy&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return text;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And you're done, it's essentially four lines of code.  Specify the source XSL, the source XML and the destination.  Then call the transform method, simple as that.&lt;br /&gt;&lt;br /&gt;Now some testing code.  The following is a simple JSP page that can be used to see the results of the transformation, for simplicity sake I'm assuming the XSLT and XML files are on the local hard drive.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ page language = "java"&lt;br /&gt;    import = "java.text.*, java.util.*, java.io.*"&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;String xmlPath = "c:\\temp\\xslt\\emailMessage.xml";&lt;br /&gt;String xslPath = "c:\\temp\\xslt\\emailMessage_html.xslt";&lt;br /&gt;&lt;br /&gt;TemplateTransformer t = new TemplateTransformer();&lt;br /&gt;String result = t.transform(xmlPath, xslPath);&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;XSLT/Xalan Test Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;b&amp;gt;XSL Path:&amp;lt;/b&amp;gt;&amp;nbsp;&amp;lt;%= xslPath %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;    &amp;lt;b&amp;gt;XML Path:&amp;lt;/b&amp;gt;&amp;nbsp;&amp;lt;%= xmlPath %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;    &amp;lt;br /&amp;gt;&lt;br /&gt; &lt;br /&gt;    &amp;lt;b&amp;gt;Result:&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;    &amp;lt;pre&amp;gt;&lt;br /&gt;    &amp;lt;%= result %&amp;gt;&lt;br /&gt;    &amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Well, hopefully all of that worked and made a little bit of sense.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-6533935231142842153?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/6533935231142842153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/6533935231142842153'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/04/xsl-transformers-more-than-meets-eye.html' title='XSL Transformers: More Than Meets The Eye'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2809566437250696584.post-6704979168036915375</id><published>2007-04-03T21:23:00.000-04:00</published><updated>2007-04-03T21:51:17.373-04:00</updated><title type='text'>Beginnings</title><content type='html'>So... I suppose I should say a few words.  This is my first go with this type of thing so bear with me through the rough bits.  I haven't totally decided on the overall direction of this blog, but I think to start I am going to use it to post topics related to software development.  Chances are there will be some other random things thrown in there from time to time, so hopefully I won't bore everybody to tears.  Worst case, this will turn into an archive of code snippets at which point I will bore you all.&lt;br /&gt;&lt;br /&gt;Now, can I keep this place from getting stagnating?  We shall see.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2809566437250696584-6704979168036915375?l=uchoumx.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uchoumx.blogspot.com/feeds/6704979168036915375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2809566437250696584&amp;postID=6704979168036915375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/6704979168036915375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2809566437250696584/posts/default/6704979168036915375'/><link rel='alternate' type='text/html' href='http://uchoumx.blogspot.com/2007/04/beginnings.html' title='Beginnings'/><author><name>Michael Chou</name><uri>http://www.blogger.com/profile/04773506891918380338</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
