André Olsson | 1 Sep 2010 01:33
Picon

Local Area Play

Hello.

I'm working on a school project and creating a game. It will not be
something super advanced but i still want some cool features. One of
those features is multiplayer on network, a client and server based.
Though I am new to ruby(by the way is a great language!) and pretty new
to programming overall. I've searched the internet for ways to complete
this feature. I found something about Socketing. I don't know if its the
right way to go? I've also founded a rubygem called eventmachine. will
eventmachine work good? The game is similiar to the game example you get
to gosu.

If someone know any good tutorials to do this i would be more then
pleased to get it, and some tips wont hurt either. Thanks!
--

-- 
Posted via http://www.ruby-forum.com/.

Daniel Phillips | 1 Sep 2010 01:54
Favicon

Ruby DBI

Hello everyone, this is my first post here.

I've always been interested in Ruby and I'm finally starting to get my
hands dirty.

I'm having trouble getting a script connected to a MySQL database, I've
followed tutorials and downloaded the files from
http://rubyforge.org/projects/ruby-dbi and I ran the three commands to
config, setup and install the DBI.

But in my main ruby script when I require 'dbi' it fails and tells me
that the file couldn't be found, now obviously I can understand that my
script can't see the file I'm telling me to include, but I can't see any
explanation anywhere on which file I'm supposed to include, and some
tutorials have require 'mysql' - so Can anyone tell me what I'm doing
wrong ?

I'm on a UNIX system.
--

-- 
Posted via http://www.ruby-forum.com/.

brabuhr | 1 Sep 2010 02:05
Picon

Re: Local Area Play

On Tue, Aug 31, 2010 at 7:33 PM, André Olsson <andre_olsson <at> live.se> wrote:
> I'm working on a school project and creating a game. It will not be
> something super advanced but i still want some cool features. One of
> those features is multiplayer on network, a client and server based.
> Though I am new to ruby(by the way is a great language!) and pretty new
> to programming overall.

Proof-of-concept on how to setup a shared screen client-server game with Gosu:
http://github.com/sandropaganotti/Gosu-Multiplayer-Shared-Screen

Jack Christensen | 1 Sep 2010 02:09

Ruby constant lookup for classes in modules

  What's the difference between defining a class inside of a module and 
using the module as a prefix?

module Foo
   class Bar
   end
end

module Foo
   class Works
     def f
       Bar.new
     end
   end
end

class Foo::Fails
   def f
     Bar.new
   end
end

Foo::Works.new.f
Foo::Fails.new.f

The last line fails:

lookup.rb:16:in `f': uninitialized constant Foo::Fails::Bar (NameError)
     from lookup.rb:21

(Continue reading)

Daniel Phillips | 1 Sep 2010 02:15
Favicon

Re: Ruby DBI

Daniel Phillips wrote:
> Hello everyone, this is my first post here.
> 
> I've always been interested in Ruby and I'm finally starting to get my
> hands dirty.
> 
> I'm having trouble getting a script connected to a MySQL database, I've
> followed tutorials and downloaded the files from
> http://rubyforge.org/projects/ruby-dbi and I ran the three commands to
> config, setup and install the DBI.
> 
> But in my main ruby script when I require 'dbi' it fails and tells me
> that the file couldn't be found, now obviously I can understand that my
> script can't see the file I'm telling me to include, but I can't see any
> explanation anywhere on which file I'm supposed to include, and some
> tutorials have require 'mysql' - so Can anyone tell me what I'm doing
> wrong ?
> 
> I'm on a UNIX system.

I have installed the correct module now, and this is the error I am 
getting when requiring the 'dbi' module:

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in 
`gem_original_require': no such file to load -- deprecated (LoadError)
  from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
  from /Library/Ruby/Site/1.8/dbi.rb:48
  from test.rb:5:in `require'
  from test.rb:5

(Continue reading)

André Olsson | 1 Sep 2010 02:16
Picon

Re: Local Area Play

unknown wrote:
> On Tue, Aug 31, 2010 at 7:33 PM, Andr� Olsson <andre_olsson <at> live.se> 
> wrote:
>> I'm working on a school project and creating a game. It will not be
>> something super advanced but i still want some cool features. One of
>> those features is multiplayer on network, a client and server based.
>> Though I am new to ruby(by the way is a great language!) and pretty new
>> to programming overall.
> 
> Proof-of-concept on how to setup a shared screen client-server game with 
> Gosu:
> http://github.com/sandropaganotti/Gosu-Multiplayer-Shared-Screen

Thanks alot, that really helped me.

--

-- 
Posted via http://www.ruby-forum.com/.

Pen Ttt | 1 Sep 2010 03:29
Picon
Favicon

how to use proxy?

here is my code:
require 'rubygems'
require 'net/http'
require 'open-uri'
$proxy_addr = '128.59.20.226'
$proxy_port = '3124'
Net::HTTP::Proxy($proxy_addr,
$proxy_port).start('http://www.ruby-forum.com/') {|http|
  http.get('http://www.ruby-forum.com/')
}
the output is :
#<Net::HTTPServiceUnavailable 503 Service Unavailable readbody=true>
what's wrong?
i can ping 128.59.20.226

pt <at> pt-laptop:~$ ping 128.59.20.226
PING 128.59.20.226 (128.59.20.226) 56(84) bytes of data.
64 bytes from 128.59.20.226: icmp_seq=1 ttl=45 time=286 ms
64 bytes from 128.59.20.226: icmp_seq=2 ttl=45 time=286 ms
64 bytes from 128.59.20.226: icmp_seq=3 ttl=45 time=290 ms
64 bytes from 128.59.20.226: icmp_seq=4 ttl=45 time=289 ms
64 bytes from 128.59.20.226: icmp_seq=5 ttl=45 time=285 ms
64 bytes from 128.59.20.226: icmp_seq=6 ttl=45 time=288 ms
64 bytes from 128.59.20.226: icmp_seq=7 ttl=45 time=291 ms
64 bytes from 128.59.20.226: icmp_seq=8 ttl=45 time=289 ms
64 bytes from 128.59.20.226: icmp_seq=9 ttl=45 time=290 ms
64 bytes from 128.59.20.226: icmp_seq=10 ttl=45 time=285 ms
64 bytes from 128.59.20.226: icmp_seq=11 ttl=45 time=285 ms
64 bytes from 128.59.20.226: icmp_seq=12 ttl=45 time=286 ms
64 bytes from 128.59.20.226: icmp_seq=13 ttl=45 time=289 ms
(Continue reading)

Ralph Shnelvar | 1 Sep 2010 03:37

KIlling a process inside a thread

I have

     <at> child_thread = Thread.new do
      # puts "#{__FILE__}  <at>  #{__LINE__} #{Time.now}"

      stdout = `#{the_command}`
       <at> child_thread_return_status = $?
    end

and later

    #child_thread.kill

This apearrs to kill the thread but not the command surrounded by the back tick.

How do I kill the comand that is the backticked executable?
Intransition | 1 Sep 2010 06:11
Picon
Gravatar

Moderation of Mialing List

Up until yesterday I have been moderating all messages by first time
posters. It hasn't been too bad, about one post a day. But it was
something I had to attend to and it meant the occasional delay before
people could see their first post. To free me of the daily necessity I
have now turned this moderation off. This means posts will appear
right away, which is good, but it also means we may start to see some
spam on the list from time to time too. Google Groups is pretty good
at catching spam, though obviously not perfect. If anyone wants to
take over new post moderation, and thus prevent any possibility of
spam, let me know. Otherwise I hope others are ok with a little
unwanted noise. Of course, if it gets real bad I will turn moderation
back on, but I help manage a number of other lists and it's not been a
major issue.

Yours,
Trans

Ryan Davis | 1 Sep 2010 07:00
Gravatar

Re: Ruby / Rails Training


On Aug 31, 2010, at 14:07 , ironmanusa <at> hushmail.com wrote:

> - An hour every other week check-in using Skype (although I am in 
> Seattle so Zoka or something might make more sense) to review 
> exercises and go over things having challenges with

you DO know that we meet every week at vivace on capitol hill... right?

you can just show up and learn by osmosis (technically diffusion).


Gmane