Lyle Johnson | 1 Mar 2003 01:06
Picon

Re: FXRuby Reference

Frank Thomas wrote:

> I've just begun working with Ruby and now i'm looking for a good command
> reference that explains all FX commands and their parameters.

It is a work in progress, but you can check this out:

     http://www.fxruby.org/doc/api

For any gaps in that documentation (and there are still many!) you will 
have to resort to the C++ library's API docs, e.g.

     http://www.fifthplanet.net/foxdoc-stable/index.html

Hope this helps,

Lyle

Josef 'Jupp' Schugt | 1 Mar 2003 01:26
Picon
Picon
Gravatar

Re: Internationalization (Re: embedded docs)

On Fri, 28 Feb 2003 04:38:45 +0000 (UTC),
   Ethan Blanton <eblanton+news <at> cs.purdue.edu> wrote:

> You would be far better off to look for a native character set to
> English converter ... much of the meaning of a Japanese sentence is
> lost or becomes somewhat ambiguous when the kanji are removed.

I only did suggest the program because it takes lot of training to
read Kanji so it can be helpful to read the text in a simpler writing
and only take a look at the original text if the meaning is unclear.

> As far as automated Japanese-to-English conversion, I've not seen a
> free tool that does a good job. I'd be thrilled if someone would
> correct me here.  ;-)

Translations are even a problem in one of the easiest cases:
German -> Dutch. From a linguistic point of view Dutch and German are
one language (from a practical point of view they are two).
Nevertheless it is not very easy to translate Dutch to German or
German to Dutch. If this is already a problem, there is little chance
that a good *free* automatic translation software from Japanese to
English is feasible without spending lots of time and money.

I recently saw "Hotaru no Haka" in Japanese with German subtitles.
One time 'kamikaze' was left as 'Kamikaze' whereas in another
situation it was translated as 'der goettliche Wind' (the devine
wind). If one would exchange these two translations they would be
inappropriate because in the first case there were kamikaze up in the
sky whereas in the second case a man did say "Now not even a devine
wind will help us any more".
(Continue reading)

Jim Weirich | 1 Mar 2003 01:50
Picon

Re: Test Unit help

On Fri, 2003-02-28 at 16:05, James Davis wrote:
> I'm new to unit testing, and test-first development.  Sometimes I
> would like to run tests from within other tests rather than recoding
> and maintaining a test in two places.  Sometimes it helps to pass in
> an argument as shown below.  In Test::Unit 0.1.4, the first example
> test_do_some_work(w= <at> worker) worked fine, but the second
> test_do_more_work(w= <at> worker) failed to run.  Now, in 0.1.8, both fail
> to run.  I'm using ruby 1.6.8 on Windows.  Questions:  Is this
> behavior by design?  Why?  Is it a bad idea to do what I am trying?
> Thanks,
> 
> 
> require 'test/unit'
> require 'work.rb'
> 
> class TC_Work < Test::Unit::TestCase
>   def setup
>      <at> worker = Worker.new
>   end
> 
>   def test_do_some_work(w= <at> worker)
>     s = 'a'
>     i = 25
>     assert_equal('abcdefghijklmnopqrstuvwxyz', w.do_some_work(s, i))
>   end
>     
>   def test_do_more_work(w= <at> worker)
>     s = 'abc'
>     i = 4
>     assert_equal('zbczbczbczbc', w.do_more_work(s, i)) 
(Continue reading)

NAKAMURA, Hiroshi | 1 Mar 2003 02:44
Picon

Re: XmlConfigFile usage

Hi,

> From: <jbritt <at> ruby-doc.org>
> Sent: Saturday, March 01, 2003 2:02 AM

> > So this isn't a very good situation to be in: if I write (say) Ruby code to
> > implement the first case, and then I need to import the XML into (say) Perl,
> > I will have to rewrite everything from scratch in Perl, save the actual
> > low-level parsing of the XML.

You can use SOAP and XML-RPC for over-language interoperability
though XML-RPC is has several constraints about interoperable object
as said in this thread (multi-ref object graph, multi-byte char like
Japanese, user defined type, nil and empty string).

> > With YAML, it's defined for you: and therefore, it will interoperate with
> > other YAML implementations, in the sense that a hash created on machine A
> > will be turned into the same hash on machine B. It also defines ways of
> > encoding common scalar data types, graph structures where the same object
> > appears at several points, user-defined types, and so forth.

SOAP as well.  From data serialization point of view,
YAML is XML + XML Namespace(sort-of) + SAX(stream model) +
DOM(tree model) + XML Schema Datatypes Part2(build-in types) +
SOAP Encoding(Collection and Mapping), all-in-one spec. [ruby-talk:54657]

> The comparisons between XML and YAML miss the mark because one is a general syntax specification for
creating markup languages,
and
> the other is a specific markup language format.  It makes more sense, perhaps, to compare YAML with
(Continue reading)

Albert Chou | 1 Mar 2003 02:46
Favicon

Re: Convert python script in ruby

I've been working on a Ruby script that does a great deal of the translation from Python to Ruby, but it's by no means a complete solution, and I don't know whether it ever will be.

Al


-----Original Message-----
From: gp [mailto:gp <at> NOSPAM.le.isac.cnr.it]
Sent: Friday, February 28, 2003 3:23 AM
To: ruby-talk ML
Subject: Convert python script in ruby

Hi,

Is there any software to convert python script in ruby?

Thanks!

gp-

NAKAMURA, Hiroshi | 1 Mar 2003 02:54
Picon

Re: XmlConfigFile usage

Hi,

Here's SOAP!  Is there somebody listening?!

> From: "why the lucky stiff" <ruby-talk <at> whytheluckystiff.net>
> Sent: Saturday, March 01, 2003 1:40 AM

> Note that the array in the below XML-RPC call would look like so in YAML:
>
>   - Name: Joe Bloggs
>     Address: 1 Disk Drive
>
> The RPC call itself is expressed by YAML.rb's RPC protocol like so:
>
>   --- !okay/rpc
>   addcust:
>     - Name: Joe Bloggs
>       Address: 1 Disk Drive

> > And here is the version which XML RPC would give:
> >
> > irb(main):002:0> require 'xmlrpc/marshal'
> > true
> > irb(main):003:0> XMLRPC::Marshal.dump_call('addcust',[{"Name"=>"Joe
> > Bloggs","Address"=>"1 Disk Drive"}])
> >
> > <?xml version="1.0" ?>
> > <methodCall>
> >  <methodName>addcust</methodName>
> >  <params>
> >   <param>
> >    <value>
> >     <array>
> >      <data>
> >       <value>
> >        <struct>
> >         <member>
> >          <name>Name</name>
> >          <value>
> >           <string>Joe Bloggs</string>
> >          </value>
> >         </member>
> >         <member>
> >          <name>Address</name>
> >          <value>
> >           <string>1 Disk Drive</string>
> >          </value>
> >         </member>
> >        </struct>
> >       </value>
> >      </data>
> >     </array>
> >    </value>
> >   </param>
> >  </params>
> > </methodCall>

$ ruby -rsoap/marshal -e 'puts SOAPMarshal.dump({"Name"=>"Joe Bloggs", "Address"=>"1 Disk Drive"})'
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<Hash xmlns:n1="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:n2="http://xml.apache.org/xml-soap" xsi:type="n2:Map"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<item>
<key xsi:type="xsd:string">Name</key>
<value xsi:type="xsd:string">Joe Bloggs</value>
</item>
<item>
<key xsi:type="xsd:string">Address</key>
<value xsi:type="xsd:string">1 Disk Drive</value>
</item>
</Hash>
</env:Body>
</env:Envelope>

Ugly?  Indented by hand.

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope ...>
  <env:Body>
    <Hash ...>
      <item>
        <key xsi:type="xsd:string">Name</key>
        <value xsi:type="xsd:string">Joe Bloggs</value>
      </item>
      <item>
        <key xsi:type="xsd:string">Address</key>
        <value xsi:type="xsd:string">1 Disk Drive</value>
      </item>
    </Hash>
  </env:Body>
</env:Envelope>

In Hash, key might be an object so <Key>value</Key> and
<item key="...">value</item> are not enough for general usage.
(I agree these are enough for configfile.)

Regards,
// NaHi

James Davis | 1 Mar 2003 05:46

Re: Test Unit help

>Help is just a simple refactoring away.  Since the test_xxx methods are
>called by the framework, changing their signatures is a questionable
>tactic (although one /would/ think that the default argument would
>work).
>
>Basically you just need to break the code into separate functions and
>then call those functions from the test methods.  For example ...
>
>class TC_Work < Test::Unit::TestCase
>  def setup
>     <at> worker = Worker.new
>  end
>
>  def test_do_some_work
>    check_some_work( <at> worker)
>  end
>
>  def check_some_work(w)
>    s = 'a'
>    i = 25
>    assert_equal('abcdefghijklmnopqrstuvwxyz', w.do_some_work(s, i))
>  end
>    
>end

Yes.  Two important realizations here:
1) Assertions need not be placed in 'test_xxx' methods.
2) Refactor mercilessly!

Thanks,

- Jim Davis -

ccos | 1 Mar 2003 07:41

how is ruby's timing?

hi,

i'm thinking of using ruby as a scripting
language for a multimedia system that i'm
writing in C++. not to go into too much detail,
the general idea is to have sound and image synthesis
very closely tied, sharing buffers and what not. it's still very very 
much
in the design stages.

i would like it to eventually be capable of real-time and non-real-time
operation. my question is about real time useage, because for
non real time stuff ruby would be perfect i'm sure.

for real time use i would need millisecond accurate timing,
and i'm concerned about unwanted dropouts and timing
variations imposed by memory management and
threading in the ruby interpreter.

i've also considered three implementation options and am leaning
strongly towards the last:

embedding the language interpreter
into the app.

extending the interpreter,
using ruby's bindings to C

having the ruby interpreter as a network client
to a media server written entirely in C++

just wondering if anybody could give any advice
on which route they would recommend, and also give some
general advice on ruby's gc and threading, all in the light
of my real-time requirements.

anybody done anything remotely similar in ruby?

thanks much,
c

Hal E. Fulton | 1 Mar 2003 07:55

Idea for a small app

Hello, all.

Here's an idea in case someone wants to run
with it.

I might even do it, except that there are 
a couple of pieces of critical info I don't 
have.

I'm using a KVM switcher between my Linux box
and my Windows box.

I'm constantly finding that I want to cut-and-
paste from one to the other. (Psychologically
it "seems" I should be able to do this, because
the keyboard/monitor.mouse are shared -- even
though my brain knows better.)

Assuming only two machines, I'd like a little
app that would (in each case) copy the clipboard
contents to the other machine on demand. Probably
add an extra step making it manual, since we don't
*always* want to keep the clipboards in sync.
(Something similar to the way Exceed handles C&P
would be acceptable, though I find that interface
a little clunky.)

Writing a little druby app for the communication
would be easy. Especially if you could live without
a GUI.

I don't know how to manipulate the clipboard at 
all, though, neither on the Windows nor Linux
sides. And on the Linux side, I don't even know
if it's an X issue or GNOME or KDE or what.

Just another random thought.

Hal

Robert Feldt | 1 Mar 2003 08:00
Picon
Picon

Re: Convert python script in ruby

On Sat, 1 Mar 2003, Albert Chou wrote:

> I've been working on a Ruby script that does a great deal of the
> translation from Python to Ruby, but it's by no means a complete
> solution, and I don't know whether it ever will be.
>
Interesting, do you have a Python parser in there?

I have the starts of a python-to-ruby translator in Python (don't throw
rotten tomatoes please, I wanted to check it out). Its very simple to do
that in Python since they export an API to the internal parser so you get
a full Python parser with AST representation "for free" (hint, hint matz
and I know you have it in the TODO).

I think our community would really benefit from such a tool; when we find
some extension they have that we want the tool would give a head start in
translating.

If your tool is close to complete I don't want to put more effort into
mine. It was really just a hack I did when checking out Python. Is there a
way we can join forces and get something more complete faster?

Regards,

Robert Feldt


Gmane