Search Results - JustLinux Forums


Search:

Type: Posts; User: tony_yum

Search: Search took 0.05 seconds.

  1. Replies
    278
    Views
    668,909

    Oh yeah :) that's for the correction

    Oh yeah :) that's for the correction
  2. Replies
    278
    Views
    668,909

    Here's my little function :), assuming the...

    Here's my little function :), assuming the integer 0 is the least significant bit in the unsigned char.



    void flip (unsigned char *c, int i)
    {

    unsigned char p = (unsigned char)pow(2.0,...
  3. Replies
    278
    Views
    668,909

    A slightly cheating version in ruby :D . Doesn't...

    A slightly cheating version in ruby :D . Doesn't take into account that there might be more then one space between words.



    #!/usr/bin/ruby

    sentences = 'whats the matter with kansas. I like...
  4. Replies
    278
    Views
    668,909

    (100000..999999).each { | x | (2..9).each...

    (100000..999999).each { | x |

    (2..9).each { |y |
    if x.to_s == (x*y).to_s.reverse then
    print "#{x} * #{y} = #{x*y}\n"
    end
    }
    }
  5. Replies
    278
    Views
    668,909

    Haha or ruby irb(main):001:0> "She sells seas...

    Haha or ruby

    irb(main):001:0> "She sells seas shells on the sea shore".split.sort
    => ["She", "on", "sea", "seas", "sells", "shells", "shore", "the"]
  6. Replies
    278
    Views
    668,909

    How about: echo 'She sells sea shells by the...

    How about:

    echo 'She sells sea shells by the sea shore' | sed -e 's/[[:space:]]/\n/g' | sort

    :)
Results 1 to 6 of 6