Permalink
Browse files

changed "get it" link & re-rendered site

  • Loading branch information...
1 parent e7497d1 commit b3feb0be58d7eba2767840f12f6df278a38dc8e1 @adrianomitre committed Jan 7, 2011
Showing with 132 additions and 6 deletions.
  1. +0 −1 .gitignore
  2. +127 −2 index.html
  3. +4 −2 script/txt2html
  4. +1 −1 website/doc/created.rid
View
@@ -1,4 +1,3 @@
-older_versions/*
coverage/*
pkg/*
doc/*
View
@@ -1,3 +1,128 @@
-<html>
-<meta http-equiv="Refresh" content="0; url=http://adrianomitre.github.com/cartesian/website/index.html">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>
+
+ </title>
+ <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
+<style>
+
+</style>
+ <script type="text/javascript">
+ window.onload = function() {
+ settings = {
+ tl: { radius: 10 },
+ tr: { radius: 10 },
+ bl: { radius: 10 },
+ br: { radius: 10 },
+ antiAlias: true,
+ autoPad: true,
+ validTags: ["div"]
+ }
+ var versionBox = new curvyCorners(settings, document.getElementById("version"));
+ versionBox.applyCornersToAll();
+ }
+ </script>
+</head>
+<body>
+<div id="main">
+
+ <h1></h1>
+ <div id="version" class="clickable" onclick='document.location = "http://github.com/adrianomitre/cartesian"; return false'>
+ <p>Get Version</p>
+ <a href="http://github.com/adrianomitre/cartesian" class="numbers">0.6.0</a>
+ </div>
+ <script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script><h1>cartesian</h1>
+<h3>Cartesian products in Ruby</h3>
+<h2>What</h2>
+<p>Provides methods for the calculation of the cartesian producted between<br />
+two or more enumerable objects. Includes grid search optimization methods.<br />
+It can also be easily and conveniently mixed-in into any enumerable class.</p>
+<h2>Installing</h2>
+<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">cartesian</span></pre></p>
+<h2>The basics</h2>
+<p><pre class='syntax'><span class="constant">Cartesian</span><span class="punct">::</span><span class="ident">product</span> <span class="punct">[</span><span class="number">1</span><span class="punct">,</span><span class="number">2</span><span class="punct">],[</span><span class="number">3</span><span class="punct">,</span><span class="number">4</span><span class="punct">]</span> <span class="comment">#=&gt; [[1, 3], [1, 4], [2, 3], [2, 4]]</span></pre></p>
+<h2>Demonstration of usage</h2>
+<p>One can use the Cartesian module directly<br />
+<pre class='syntax'>
+<span class="ident">require</span> <span class="punct">'</span><span class="string">cartesian</span><span class="punct">'</span>
+<span class="ident">foo</span> <span class="punct">=</span> <span class="punct">[</span><span class="number">1</span><span class="punct">,</span> <span class="number">2</span><span class="punct">]</span>
+<span class="ident">bar</span> <span class="punct">=</span> <span class="punct">[&quot;</span><span class="string">a</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">b</span><span class="punct">&quot;]</span>
+<span class="constant">Cartesian</span><span class="punct">::</span><span class="ident">product</span><span class="punct">(</span><span class="ident">foo</span><span class="punct">,</span> <span class="ident">bar</span><span class="punct">)</span> <span class="comment">#=&gt; [[1, &quot;a&quot;], [1, &quot;b&quot;], [2, &quot;a&quot;], [2, &quot;b&quot;]]</span>
+</pre></p>
+<p>or use the methods provided by the mixin in the Array class</p>
+<p><pre class='syntax'>
+<span class="ident">foo</span><span class="punct">.</span><span class="ident">cartesian</span><span class="punct">(</span><span class="ident">bar</span><span class="punct">)</span> <span class="comment">#=&gt; [[1, &quot;a&quot;], [1, &quot;b&quot;], [2, &quot;a&quot;], [2, &quot;b&quot;]]</span>
+</pre></p>
+<p>which include the short&#8217;n&#8217;sweet <em>x</em> method</p>
+<p><pre class='syntax'>
+<span class="ident">v</span> <span class="punct">=</span> <span class="punct">[]</span> <span class="comment">#=&gt; []</span>
+<span class="keyword">for</span> <span class="ident">a</span><span class="punct">,</span> <span class="ident">b</span> <span class="keyword">in</span> <span class="punct">[</span><span class="number">1</span><span class="punct">,</span><span class="number">2</span><span class="punct">].</span><span class="ident">x</span> <span class="punct">[</span><span class="number">3</span><span class="punct">,</span><span class="number">4</span><span class="punct">]</span>
+ <span class="ident">v</span> <span class="punct">&lt;&lt;</span> <span class="punct">[</span><span class="ident">a</span><span class="punct">,</span><span class="ident">b</span><span class="punct">]</span>
+<span class="keyword">end</span> <span class="comment">#=&gt; true</span>
+<span class="ident">v</span> <span class="comment">#=&gt; [[1, 3], [1, 4], [2, 3], [2, 4]]</span>
+</pre></p>
+<p>The &#8216;**&#8217; operator provides a convenient way of iterating multi-dimensionally over the same array or range</p>
+<p><pre class='syntax'>
+<span class="ident">u</span> <span class="punct">=</span> <span class="punct">[</span><span class="number">0</span><span class="punct">,</span> <span class="number">1</span><span class="punct">]**</span><span class="number">3</span> <span class="comment">#=&gt; #&lt;CartesianIterator:0x7f2fb8e54978 @tot_iter=8, \</span>
+ <span class="comment"># @lists=[[0, 1], [0, 1], [0, 1]]&gt;</span>
+<span class="ident">u</span><span class="punct">.</span><span class="ident">to_a</span> <span class="comment">#=&gt; [[0, 0, 0], [0, 0, 1], [0, 1, 0], \</span>
+ <span class="comment"># [0, 1, 1], [1, 0, 0], [1, 0, 1], \</span>
+ <span class="comment"># [1, 1, 0], [1, 1, 1]]</span>
+</pre></p>
+<p>Finally, the grid search methods</p>
+<p><pre class='syntax'>
+<span class="ident">require</span> <span class="punct">'</span><span class="string">grid_search</span><span class="punct">'</span>
+<span class="punct">[-</span><span class="number">1</span><span class="punct">,</span> <span class="number">0</span><span class="punct">,</span> <span class="number">1</span><span class="punct">,</span> <span class="number">2</span><span class="punct">].</span><span class="ident">argmax</span> <span class="punct">{|</span><span class="ident">x</span><span class="punct">|</span> <span class="ident">x</span><span class="punct">**</span><span class="number">2</span> <span class="punct">}</span> <span class="comment">#=&gt; 2</span>
+<span class="punct">[-</span><span class="number">1</span><span class="punct">,</span> <span class="number">0</span><span class="punct">,</span> <span class="number">1</span><span class="punct">,</span> <span class="number">2</span><span class="punct">].</span><span class="ident">argmin</span> <span class="punct">{|</span><span class="ident">x</span><span class="punct">|</span> <span class="ident">x</span><span class="punct">.</span><span class="ident">abs</span> <span class="punct">}</span> <span class="comment">#=&gt; 0</span></pre><br />
+</pre></p>
+<p>For more examples and details, see the RDoc-generated documentation <a href="doc/index.html">here</a>.</p>
+<h2>How to submit patches</h2>
+<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people&#8217;s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
+<p>You can fetch the source from:</p>
+<ul>
+ <li>github: <a href="http://github.com/adrianomitre/cartesian/tree/master">http://github.com/adrianomitre/cartesian/tree/master</a></li>
+</ul>
+<pre>git clone git@github.com:adrianomitre/cartesian.git</pre>
+<h3>Build and test instructions</h3>
+<pre>cd cartesian
+rake test
+rake install_gem</pre>
+<h2>License</h2>
+<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
+<h2>Contact</h2>
+<p>Comments are welcome. Send an email to <a href="mailto:adriano.mitre@gmail.com">Adriano Mitre</a>.</p>
+<div align=right>
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input type="hidden" name="cmd" value="_s-xclick">
+<input type="hidden" name="hosted_button_id" value="9ABWULT73Y7AC">
+<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+<p><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></p>
+</form>
+</div>
+ <p class="coda">
+ <a href="http://github.com/adrianomitre">Adriano Mitre</a>, 7th January 2011<br>
+ Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
+ </p>
+</div>
+
+<!-- insert site tracking codes here, like Google Urchin -->
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-20605454-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script>
+
+</body>
</html>
View
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
GEM_NAME = 'cartesian' # what ppl will type to install your gem
-RUBYFORGE_PROJECT = 'cartesian'
+GITHUB_PROJECT = 'cartesian'
require 'rubygems'
begin
@@ -18,11 +18,13 @@ require 'erb'
require File.dirname(File.expand_path(__FILE__)) + "/../lib/#{GEM_NAME}.rb"
version = Cartesian::VERSION
-download = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
+download = "http://github.com/adrianomitre/#{GITHUB_PROJECT}"
+=begin
def rubyforge_project_id
RubyForge.new.autoconfig["group_ids"][RUBYFORGE_PROJECT]
end
+=end
class Fixnum
def ordinal
View
@@ -1,4 +1,4 @@
-Fri, 07 Jan 2011 04:52:32 -0200
+Fri, 07 Jan 2011 05:00:34 -0200
README.rdoc Fri, 07 Jan 2011 02:46:43 -0200
lib/cartesian.rb Fri, 07 Jan 2011 02:46:43 -0200
lib/cartesian_iterator.rb Fri, 07 Jan 2011 02:46:43 -0200

0 comments on commit b3feb0b

Please sign in to comment.