soxinbox | 1 Nov 01:22 2005
Picon

Re: USB device

rubyScript2exe rocks. Thanks to whoever wrote it.

"Rene Davila" <rene.davila <at> gmail.com> wrote in message 
news:e627b75a0510310941r383ddb64x <at> mail.gmail.com...
Thank you so much, it's what I need, even better that the solution I was
thinking

2005/10/31, Kevin Brown <blargity <at> gmail.com>:
>
> On Monday 31 October 2005 11:05, Rene Davila wrote:
> > Hi, I would like to know how I can reduce de size of the Ruby
> distribution.
> > This is because I want to make a aplication that run from a USB memory
> and
> > I don't want to drag all the ruby distrubution. I'm asking if there are
> > some files in the Ruby distribution that I can erase and keeping the
> basic
> > function of ruby.
> >
> > --
> > Rene Y. Davila Barrios
>
> If you're just looking to distribute a single ruby application, then
> Ruby2Exe
> will package up only what is needed to run the application, including a
> ruby
> executable. That might be what you're looking for.
>
>

(Continue reading)

Harold Hausman | 1 Nov 01:21 2005
Picon

Re: Newbie: How to format a number to always show two decimals?

Alternatively there's this code from Phrogz's library (
http://phrogz.net/rubylibs) which to me is more rubyish than sprintf.
Everytime you use sprintf, God kills a kitten.

-Harold

#Code Follows:

class Numeric
# Rounds to the specified number of decimal places, returning a string
value.
#
# (1.234).round_to(2) => '1.23'
# (-1.234).round_to(2) => '-1.23'
# (-0.007).round_to(2) => '-0.01'
# (-0.007).round_to(1) => '0.0'
def round_to(decimals)
if self<0 then
s='-';
x=-self;
else
s='';
x=self;
end
if x>=1.0e15 then
m=x.to_s;
else
m=(x*10**decimals).round.to_s
if (decimals!=0) then
k=m.length;
(Continue reading)

David A. Black | 1 Nov 01:41 2005
Picon

Re: Newbie: How to format a number to always show two decimals?

Hi --

On Tue, 1 Nov 2005, Harold Hausman wrote:

> Alternatively there's this code from Phrogz's library (
> http://phrogz.net/rubylibs) which to me is more rubyish than sprintf.
> Everytime you use sprintf, God kills a kitten.
>
> -Harold
>
> #Code Follows:
>
> class Numeric
> # Rounds to the specified number of decimal places, returning a string
> value.
> #
> # (1.234).round_to(2) => '1.23'
> # (-1.234).round_to(2) => '-1.23'
> # (-0.007).round_to(2) => '-0.01'
> # (-0.007).round_to(1) => '0.0'
> def round_to(decimals)
> if self<0 then
> s='-';
> x=-self;
> else
> s='';
> x=self;
> end
> if x>=1.0e15 then
> m=x.to_s;
(Continue reading)

Adeodato Simó | 1 Nov 01:52 2005
Picon

Re: qtruby problems now on linux

<posted & mailed>

* Richard Dale [Monday, October 31, 2005 08:22] {comp.lang.ruby}: 

> Maybe regenerate and rebuild the Smoke library against the Qt 3.3.4
> headers. It has a version of '4:3.3.2-1' which sounds like it was
> generated against the Qt 3.3.2 headers, which would be too old. Change to
> the qtruby/smoke/qt directory and type 'make clean; make' to rebuild the
> library, then install it.

The 3.3.2 there makes reference to the version of KDE that smoke came from
(in the kdebindings module, obviously), not to the version of Qt it was
compiled against.

FWIW, this that Hans report is reproducable for me with libsmokeqt and
qtruby as shipped in KDE 3.4.2, compiled against Qt 3.3.5. (Tested using
the Debian packages in the unstable branch, which I uploaded.) I can't
really thing of un-standard procedures when preparing these packages.

Cheers,

--

-- 
Adeodato Simó
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621

James Edward Gray II | 1 Nov 01:54 2005
Picon

Re: Newbie: How to format a number to always show two decimals?

On Oct 31, 2005, at 6:21 PM, Harold Hausman wrote:

> Alternatively there's this code from Phrogz's library (
> http://phrogz.net/rubylibs) which to me is more rubyish than sprintf.

Hmm, it's certainly not Ruby length...

James Edward Gray II

Raymond Brigleb | 1 Nov 02:16 2005

[OT] Why the Lucky Stiff on Noboto

I wanted to mention to the Ruby list that Why the Lucky Stiff, author  
of the Poignant Guide and a very excellent storyteller, appears on  
the latest episode of Noboto. Noboto is a podcast but it's really  
quite friendly.

http://noboto.com/

I hope that you will enjoy it.

-raymond

Ara.T.Howard | 1 Nov 02:26 2005
Picon

Re: Newbie: How to format a number to always show two decimals?

On Tue, 1 Nov 2005, Harold Hausman wrote:

> Alternatively there's this code from Phrogz's library (
> http://phrogz.net/rubylibs) which to me is more rubyish than sprintf.
> Everytime you use sprintf, God kills a kitten.

that quote is absolutely beautiful - though i __much__ prefer printf to cout
;-)

>
> -Harold
>
> #Code Follows:
>
> class Numeric
> # Rounds to the specified number of decimal places, returning a string
> value.
> #
> # (1.234).round_to(2) => '1.23'
> # (-1.234).round_to(2) => '-1.23'
> # (-0.007).round_to(2) => '-0.01'
> # (-0.007).round_to(1) => '0.0'
> def round_to(decimals)
> if self<0 then
> s='-';
> x=-self;
> else
> s='';
> x=self;
> end
(Continue reading)

Yukihiro Matsumoto | 1 Nov 02:52 2005

Re: Anonymous methods, blocks etc. (Cont. 'default block params')

Hi,

In message "Re: Anonymous methods, blocks etc. (Cont. 'default block params')"
    on Tue, 1 Nov 2005 03:52:13 +0900, Zach Dennis <zdennis <at> mktec.com> writes:

|Is the -> syntax still open for debate Matz? I agree with Austin on 
|this. The syntax here is just ugly.

It's always open.  But define "ugly" first.

							matz.

Richard Dale | 1 Nov 02:52 2005
Picon
Picon

Re: qtruby problems now on linux

Hans  Fugal wrote:

> Another update: this has also been reported as a bug on the debian
> libqt0-ruby1.8 package:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=335876 which I did not
> realize was the same bug at first, until I had done my puts test.
> 
> I'm going to send a link to this discussion to that debian bug and
> carry on there.
I've never had an error where the second puts in this code is never
executed, as described in the bug report:

require 'Qt'

class ConfigDatabase < Qt::Dialog
  def initialize(*k)
    puts("init in CD")
    super(*k)
    puts("after Qt::Dialog's init")
  end
end

$app = Qt::Application.new(ARGV)
cd = ConfigDatabase.new

In the QtRuby constructor code, it throws an exception after getting part of
the way through constructing the instance, and tries again. This means that
the first puts will actually get executed twice. Normally this doesn't
matter as there isn't any code before the super call in the initialize()
method.
(Continue reading)

nobuyoshi nakada | 1 Nov 03:22 2005
Picon

Re: utime bug help?

Hi,

At Tue, 1 Nov 2005 05:42:12 +0900,
Axel Friedrich wrote in [ruby-talk:163542]:
> in some cases, utime does not set the mtime correctly. AFAIK, this 
> bug is known for quite a while. - Anybody knows, if it will be fixed 
> in the near future or if there is a patch or any other help?

I guess it has been fixed:

Tue May 17 11:52:18 2005  NAKAMURA Usaku  <usa <at> ruby-lang.org>

	* win32/win32.c (unixtime_to_filetime): use localtime() instead of
	  gmtime() when using FileLocalTimeToFileTime().

--

-- 
Nobu Nakada


Gmane