<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Gmiller's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 08 Aug 2008 20:16:07 GMT</pubDate>
    <description>DZone Snippets: Gmiller's Code Snippets</description>
    <item>
      <title>Get MD5 hash in a few lines of Java</title>
      <link>http://snippets.dzone.com/posts/show/3686</link>
      <description>// MD5 in Java, short and sweet version.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;    1 import java.security.*;&lt;br /&gt;    2 import java.math.*;&lt;br /&gt;    3 &lt;br /&gt;    4 public class MD5 {&lt;br /&gt;    5    public static void main(String args[]) throws Exception{&lt;br /&gt;    6       String s="This is a test";&lt;br /&gt;    7       MessageDigest m=MessageDigest.getInstance("MD5");&lt;br /&gt;    8       m.update(s.getBytes(),0,s.length());&lt;br /&gt;    9       System.out.println("MD5: "+new BigInteger(1,m.digest()).toString(16));&lt;br /&gt;   10    }&lt;br /&gt;   11 }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 18 Mar 2007 05:49:03 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3686</guid>
      <author>gmiller (Greg Miller)</author>
    </item>
    <item>
      <title>Get the Unix Epoch time in one line of C#</title>
      <link>http://snippets.dzone.com/posts/show/3236</link>
      <description>&lt;code&gt;&lt;br /&gt;int epoch = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 03 Jan 2007 21:55:59 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3236</guid>
      <author>gmiller (Greg Miller)</author>
    </item>
    <item>
      <title>Query and join tables across server instances.</title>
      <link>http://snippets.dzone.com/posts/show/3218</link>
      <description>Use the following to query or join tables on remote servers.  The query must be executed on a system running SQL Server, but the remote system can be pretty much anything an ODBC driver exists for:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;select * from OpenDataSource(&#8217;SQLOLEDB&#8216;,&#8217;Data Source=server.asdf.com;User ID=yourusername;Password=yourpassword&#8216;).somedatabase.dbo.sometable;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 31 Dec 2006 09:53:17 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3218</guid>
      <author>gmiller (Greg Miller)</author>
    </item>
    <item>
      <title>MD5 hash in one line of .Net code</title>
      <link>http://snippets.dzone.com/posts/show/2771</link>
      <description>// Get an MD5 hash of a string in only one line of code.&lt;br /&gt;// This requires no "using" clauses other than System, and&lt;br /&gt;// produces a string encoded in base64 of the hash.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;string hash = Convert.ToBase64String(new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(System.Text.Encoding.Default.GetBytes(SomeString)));&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 03 Oct 2006 00:34:36 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2771</guid>
      <author>gmiller (Greg Miller)</author>
    </item>
  </channel>
</rss>
