<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: unique code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 06:36:08 GMT</pubDate>
    <description>DZone Snippets: unique code</description>
    <item>
      <title>SPLIT-UNIQUE - split a block into unique and duplicate values</title>
      <link>http://snippets.dzone.com/posts/show/2948</link>
      <description>&lt;code&gt;&lt;br /&gt;    split-unique: func [block [any-block!] /local uniq dupe dest] [&lt;br /&gt;        uniq: copy []&lt;br /&gt;        dupe: copy []&lt;br /&gt;        foreach item block [&lt;br /&gt;            dest: either find/only uniq item [dupe] [uniq]&lt;br /&gt;            append/only dest item&lt;br /&gt;        ]&lt;br /&gt;        reduce [uniq dupe]&lt;br /&gt;    ]&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 01 Nov 2006 21:35:34 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2948</guid>
      <author>gregg.irwin (Gregg Irwin)</author>
    </item>
    <item>
      <title>C# &amp; Databases - Creating a unique identifer</title>
      <link>http://snippets.dzone.com/posts/show/2009</link>
      <description>Creating a new GUID in C# is not as straightforward as one would think.  Calling the constructor of System.Guid() will produce a GUID of all zeroes.  Using System.Guid.NewGuid() will produce the desired effect of a new, unique identifier.  &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;// produces a "blank" GUID: '00000000-0000-0000-0000-000000000000'&lt;br /&gt;System.Guid blankGuid = new System.Guid(); &lt;br /&gt;&lt;br /&gt;// produces a new, unique GUID: '96d36892-6eed-400c-91f8-a194f3522fae'&lt;br /&gt;System.Guid desiredGuid = System.Guid.NewGuid(); &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 11 May 2006 00:40:13 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2009</guid>
      <author>Ozymandias ()</author>
    </item>
    <item>
      <title>unique random array</title>
      <link>http://snippets.dzone.com/posts/show/980</link>
      <description>// &#230;&#8212;&#160;&#233;&#8225;?&#229;&#164;?&#233;&#353;?&#230;&#339;&#186;&#230;&#8226;&#176;&#231;&#187;&#8222;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;import java.util.Random;&lt;br /&gt;public class Util&lt;br /&gt;{&lt;br /&gt; private static Random rd = null;&lt;br /&gt; &lt;br /&gt;  public static int[] random(int[] src)&lt;br /&gt; {&lt;br /&gt;    if(src == null){&lt;br /&gt;   return null; &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  rd = new Random();&lt;br /&gt;   int[] tmp = new int[src.length];&lt;br /&gt;  &lt;br /&gt;  int num = src.length;&lt;br /&gt;  &lt;br /&gt; &lt;br /&gt;  int index;&lt;br /&gt;&lt;br /&gt;  for(int i = 0;i &lt; src.length;i++)&lt;br /&gt;  {&lt;br /&gt;  &lt;br /&gt;   index = Math.abs(rd.nextInt()) % num;&lt;br /&gt;    tmp[i] = src[index];&lt;br /&gt;      src[index] = src[num - 1];&lt;br /&gt;      num--;&lt;br /&gt;  }&lt;br /&gt;  return tmp;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public static void main(String[] args)&lt;br /&gt; {&lt;br /&gt;  int[] test = {1,2,3,4,5,6,7,8,9};&lt;br /&gt;  int a[] = random(test);&lt;br /&gt;  &lt;br /&gt;  for(int i = 0;i &lt; a.length;i++){&lt;br /&gt;   System.out.println(a[i]); &lt;br /&gt;  } &lt;br /&gt; }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 15 Dec 2005 12:01:32 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/980</guid>
      <author>mornlee (mornlee)</author>
    </item>
  </channel>
</rss>
