<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:s="http://www.techrepublic.com/search" xmlns:dc="http://purl.org/dc/elements/1.1/"  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
    <title><![CDATA[Discussion on My first IronRuby application ]]></title>
    <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649]]></link>
    <atom:link rel="hub" type="application/rss+xml" href="http://pubsubhubbub.appspot.com/" />
    <atom:link rel="self" type="application/rss+xml" href="http://www.techrepublic.com/forum/discussions/102-340649/rss" />

    <description><![CDATA[]]></description>
    <language>en-us</language>
    <lastBuildDate>2013-05-24T16:35:10-07:00</lastBuildDate>
             

    <item>
        <title><![CDATA[Ah, much better...]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413745]]></link>
        <description><![CDATA[http://www.chipstips.com/?p=593]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413745]]></guid>
        <dc:creator><![CDATA[Sterling "chip" Camden]]></dc:creator>
        <pubDate>Thu, 27 Jan 2011 13:31:15 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[different uses]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413712]]></link>
        <description><![CDATA[I think what  oldbaritone  actually meant to address was higher-order code -- that is, code that produces or modifies code -- rather than self-modifying code per se.  The growth of metaprogramming in many modern languages starts to blur the line between self-modifying code and other higher-order code, too, so depending on the specifics of how you define &quot;self-modifying&quot;, it is entirely possible that people can reasonably disagree on what constitutes &quot;self-modifying&quot; code.  Consider, for example, the case of a class in Ruby that contains a method whose use creates new methods for that class.  It is possible, though a work-alike using  method_missing  is a much easier way to achieve the same effect, generally speaking.In any case, my response to  oldbaritone just addressed the concept of metaprogramming in general, though it allowed for the possibility of self-modifying code in particular, because I was more interested in addressing that than whether the wrong term was used.  I think it's generally a good thing that you brought up the terminology issue, though, because it provides an opportunity for people to consider the implications of the term's formal and practical meaning.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413712]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Thu, 27 Jan 2011 12:05:59 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[What self-modifying code?]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413571]]></link>
        <description><![CDATA[[[ Edit: this is supposed to be in response to 'oldbaritone' -- is there a way of moving a reply under the initial post? If not, I apologize, still getting used to the new interface... ]]Unless I'm missing something rather Basic (that's a pun... get it?  ) there's no self-modifying code either in the existing example or could (easily) be derived from the eval() scenarios given by the author.Self-modifying code (by the definition I've always understood it) needs to modify the original program memory, Perl's eval() doesn't modify program memory. Depending on the underlying operating system, it may even start a thread of its own.I have written self-modifying code in 6800/6809 assembler, several flavors of Basic, and in packed Basic09; the last example was a *lot* more work than it was worth. (I did it just to see if it could be done -- Possible? Yes. Useful? Not particularly.  ) In some instances - especially where memory is at a premium, I can see where it may be considered a viable programming practice. However, in today's computing environment (GBytes of RAM, etc.)  I'm not sure I could ever imagine an actual need for it -- most languages nowadays would require such voodoo to make it happen that I don't see where it could be considered useful, let alone readable.Nowadays, in some instances self-modifying code may not even be possible - some processors implement memory protection where program memory may be read-only once the process starts. [[ Don't quote me on the specifics of this, I haven't done a ton of research on it. ]] Wading through memory / allocation areas on Intel processors is also something I wouldn't call &quot;fun&quot;...Laterz!]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413571]]></guid>
        <dc:creator><![CDATA[rmerchberger@...]]></dc:creator>
        <pubDate>Thu, 27 Jan 2011 06:29:05 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[thx!]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413412]]></link>
        <description><![CDATA[it looks really good.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413412]]></guid>
        <dc:creator><![CDATA[eseprimo]]></dc:creator>
        <pubDate>Wed, 26 Jan 2011 16:12:01 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[Your code is nigh-unreadable.]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413394]]></link>
        <description><![CDATA[The problem is not a lack of familiarity with Ruby.  It appears to be a lack of familiarity with the concept of writing self-documenting code, and an unwillingness to write explicit comments to make up for that.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413394]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Wed, 26 Jan 2011 14:50:59 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[I don't think so.]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413405]]></link>
        <description><![CDATA[The code seems singularly written to be unclear, using variable names like &quot;array&quot;.  Introducing another class will not help much.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413405]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Wed, 26 Jan 2011 14:49:42 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[a second attempt]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413404]]></link>
        <description><![CDATA[Evidently, my first attempt at a response to you was deemed too abrasive, and has been deleted.  I'll try again:I have no idea what you're talking about.  You made vague, hand-wavy statements about wanting to see my code, divested of any placement within the context of discussion.  I made the only code I thought you might mean at that point -- my minimal reorganizing of your code for readability -- available in a blogstrapping essay,  Fast Die Roll Permutations Still Elusive.  Now you're acting like I'm an idiot and a bad person for thinking that's what you meant.I find your attitude offensive.Try rephrasing so that you do not come off like a corrupt politician trying to cast all blame for your own failings on someone else, and maybe I'll discuss the matter with you.  Otherwise, I want nothing to do with you and your offensive, accusatory behavior.  Go away.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413404]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Wed, 26 Jan 2011 14:48:25 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[You might try...]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413376]]></link>
        <description><![CDATA[... Ruby's Matrix class: http://www.ensta.fr/~diam/ruby/online/ruby-doc-stdlib/libdoc/matrix/rdoc/classes/Matrix.htmlDon't know if it will speed things up at all, but it might make the code more clear.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413376]]></guid>
        <dc:creator><![CDATA[Sterling "chip" Camden]]></dc:creator>
        <pubDate>Wed, 26 Jan 2011 14:24:19 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[cutting corners...]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413169]]></link>
        <description><![CDATA[I figured out how to rewrite the same algorithm without using matrices at all.  It will only take two functions to handle simple 1-d arrays of integers, which eventually also makes the code &quot;a little&quot; faster.  My ruby skills are not too good, though (I just learned ruby for this problem!) mind helping me out figuring out how to do it?  This is a first attempt #!/usr/bin/rubydice = ARGV[0].to_isides= ARGV[1].to_ioriginal_permutation=Array.new(sides) {1}# helper adds to the array &quot;target&quot; n shifted # versions of the array &quot;pattern&quot;, for n=size# see blancosilva.wordpress.com/puzzles/unusual-dice/def helper(pattern,target,step,size)  if step==1    return target  else    target+=[0]    pattern.each_index{ |x| target[x+1-step+size] += pattern[x] }    return helper(pattern,target,step-1,size)  endenddef get_permutations(dice,sides,ary)  if dice==1    return ary  else    return get_permutations(dice-1, sides, helper(ary, ary, sides, sides))  endendget_permutations(dice,sides,original_permutation)hey, and gratz on todays good news.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413169]]></guid>
        <dc:creator><![CDATA[eseprimo]]></dc:creator>
        <pubDate>Wed, 26 Jan 2011 07:05:51 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[confusing]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413176]]></link>
        <description><![CDATA[Yes, please by all means, post *your* code anywhere; I don't need a re-write of mine with those minor changes.  How long does it take for yours to do a 50 50, for example?  Quit stalling, or we are going to start thinking that you don't have any code, dude.  I hate doing somebody else's homework.And your explanation gets more and more confusing; but I am intrigued: bell curve... really?  Let us start from scratch again: what is for you a &quot;given diagonal of the Pascal Triangle&quot;?]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413176]]></guid>
        <dc:creator><![CDATA[eseprimo]]></dc:creator>
        <pubDate>Wed, 26 Jan 2011 05:35:45 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[Are you asking me?]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413108]]></link>
        <description><![CDATA[I suspect you're replying to me, though in the TR interface (as of today, at least) your reply appears out of place.What code do you mean -- the minor rewrite of your code that I did?  If so, I might post it at  blogstrapping instead, where this entire exercise actually started.What I mean by &quot;the series of numbers in a given diagonal of the triangle is a progression and not a curve&quot; is that numbers increase at an easily predictable rate, infinitely growing, where what's needed for the dice roll probabilities is a bell curve.  My earlier point was that the progression and the curve are identical until it reaches the point where the rate of increase starts angling toward deceleration, but a generalized function for calculating the rate of deceleration relative to the rate of progression escapes me so far.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413108]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Wed, 26 Jan 2011 01:11:06 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[about 70 seconds]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413127]]></link>
        <description><![CDATA[blancosilva.wordpress.com/puzzles/unusual-dice/Mind sending us your code?  You can drop it as a comment in that other blog, if it makes sharing simpler.  Also, a quick question about one of your previous comments: What do you mean with &quot;the series of numbers in a given diagonal of the triangle is a progression and not a curve&quot;?]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413127]]></guid>
        <dc:creator><![CDATA[eseprimo]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 23:39:57 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[effectively instant with Pascal's Triangle]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413126]]></link>
        <description><![CDATA[The weird thing about it is that, until you get past the number of results equal to the number of faces on a single die, a diagonal series from Pascal's Triangle will perfectly match the number of permutations that will produce each of those results.  It really feels like there should be some kind of generalized function that can be used to adjust numbers to match the curve.  Unfortunately, after writing a program that worked for up to three dice, I realized that though I thought I had been on to something it simply didn't work for four dice.  . . . and it would be wonderful if it worked, because that version worked in what appeared to be constant time (effectively instantly) for any number of virtual dice up to 100.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413126]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 23:36:31 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[eleven minutes]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413123]]></link>
        <description><![CDATA[I'd like to see that strategy write-up when you're done with it.  It does not seem to me to be as quick as you seem to think.  I rewrote it slightly to make it a bit more understandable to me.  I don't see anything in the changes I made (mostly changes in variable names, though I did replace a  for  loop and a  cycle(1)  message with each iterators) that should affect performance overmuch, unless a  for  loop is significantly faster than an  each  iterator for some reason.  Using the  time  utility, though, it shows just over eleven minutes to complete a run for one hundred dice with one hundred sides each.  Maybe you're using a much faster computer than me, but I'd hate to see what happens if I double the number of virtual dice.  Before I started writing this, I started the  time  utility to time the run of the unmodified version.  It's still going.  edit: The unmodified version finished its run, and took about twelve and a half minutes.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413123]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 23:22:23 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[yup]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413037]]></link>
        <description><![CDATA[I'll let y'all experts figure out how to reduce the memory usage, and polish the style and all that jazz.  I am writing a post in my blog explaining the solution strategy.  I am sure you can get to a nicer code with the ideas from there.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413037]]></guid>
        <dc:creator><![CDATA[eseprimo]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 20:56:32 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[Nice!]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413049]]></link>
        <description><![CDATA[Great work! That is blazingly fast. It does, however, use a ton of RAM... well over 1 GB on my system (IronRuby, your mileage may vary). My recursive version uses practically none, once I moved the data array to be a global variable.J.Ja]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3413049]]></guid>
        <dc:creator><![CDATA[Justin James]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 20:52:10 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[yeah... not relevant]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3412992]]></link>
        <description><![CDATA[at least for this problem.   Thanks for the implementation of the Pascal Triangle, though ]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3412992]]></guid>
        <dc:creator><![CDATA[eseprimo]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 17:50:47 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[100 100 in about a minute]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3412991]]></link>
        <description><![CDATA[#!/usr/bin/rubydice = ARGV[0].to_isides= ARGV[1].to_idef printarray(array)  array.cycle(1) {|x| print x,&quot; &quot;}  putsenddef sumarray(array)  array.inject(0) {|su,item| su+item}enddef mda(width,height)  return Array.new(width) {Array.new(height) {0}}enddef helper(size,stack,step)  if step==1    return stack  else    a=mda(size,size+stack.length-1)    for k in 0...size      a[k][k...stack.length+k]=stack    end    b=a.transpose    return helper(size,Array.new(size+stack.length-1) {|x| sumarray(b[x])},step-1)  endenddef function(n,size)  origen=Array.new(size) {1}  if n==1    return origen  else    return helper(size,origen,n)  endendprintarray(function(dice,sides))]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3412991]]></guid>
        <dc:creator><![CDATA[eseprimo]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 17:43:33 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[two problems]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3412920]]></link>
        <description><![CDATA[As Justin pointed out, your two points are actually two problems. I'll reiterate his points for you.   Automation is good, all else being equal. Self-modifying code in Ruby or Lisp is often more readable than a Hello World in Java (assuming you can read Ruby or Lisp), so your point about self-modifying code being a &quot;no-no&quot; is kinda less than valid in this case.  It's trivial to implement something that meets only the most basic requirements. The problem is making it  usable  I don't have thirty-seven years to wait around for the program to generate the values for one hundred dice. Do you?   edit: Wow, did I underestimate that!  It turns out that the actual amount of time would be significantly more than 37 years.  In fact, the last time I checked how quickly the program runs on my laptop, it would actually take  4.77160969118485e+57  millennia.  I would rather spend the first month of that time finding a better implementation than all that time waiting for the results of one run of the program.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3412920]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 13:30:16 -0800</pubDate>
    </item>
             

    <item>
        <title><![CDATA[TR needs horizontal scroll bars for code blocks.]]></title>
        <link><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3412900]]></link>
        <description><![CDATA[Frankly, the only reasonable answer to display on the page with such narrow content constraints is horizontal scroll bars.  You don't want wrapping if you can avoid it, and you don't want lines cut off if you can avoid it.  Luckily, horizontal scroll bars solve both problems.  It only takes one line of CSS.]]></description>
        <guid><![CDATA[http://www.techrepublic.com/forum/discussions/102-340649-3412900]]></guid>
        <dc:creator><![CDATA[apotheon]]></dc:creator>
        <pubDate>Tue, 25 Jan 2011 13:25:01 -0800</pubDate>
    </item>
    </channel>
</rss>

