[#407177] Downloading a CSV using URI - mechanize — Rochit Sen <lists@...>

Hi All,

13 messages 2013/05/06

[#407178] %tempdir% location and folder clean up? — "Abinash Y." <lists@...>

Hi Guys,

12 messages 2013/05/06

[#407187] Gem Help - Newbie Question — Michael Tepfer <lists@...>

Hi,

17 messages 2013/05/07

[#407234] Problem with FileUtils move command. — Peter Bailey <lists@...>

Hello,

25 messages 2013/05/08
[#407235] Re: Problem with FileUtils move command. — Joel Pearson <lists@...> 2013/05/08

"no implicit conversion of nil into String" means you're probably

[#407236] Re: Problem with FileUtils move command. — Peter Bailey <lists@...> 2013/05/08

Joel Pearson wrote in post #1108209:

[#407238] Re: Problem with FileUtils move command. — Chris Hulan <chris.hulan@...> 2013/05/08

how is the script invoked?

[#407239] Re: Problem with FileUtils move command. — Peter Bailey <lists@...> 2013/05/08

Chris Hulan wrote in post #1108213:

[#407242] Re: Problem with FileUtils move command. — Daniel Stephens <danny.a.stephens@...> 2013/05/08

can you post some of the script?

[#407246] Re: Problem with FileUtils move command. — Love U Ruby <lists@...> 2013/05/08

Daniel Stephens wrote in post #1108224:

[#407250] Re: Problem with FileUtils move command. — Daniel Stephens <danny.a.stephens@...> 2013/05/08

What do you get if you puts "ARGV == #{ARGV[0]}" ?

[#407251] Re: Problem with FileUtils move command. — Peter Bailey <lists@...> 2013/05/08

Daniel Stephens wrote in post #1108238:

[#407252] Re: Problem with FileUtils move command. — Daniel Stephens <danny.a.stephens@...> 2013/05/08

So it's like the other guys mentioned, there appears to be no file(or

[#407255] Re: Problem with FileUtils move command. — Peter Bailey <lists@...> 2013/05/08

Daniel Stephens wrote in post #1108240:

[#407257] Re: Problem with FileUtils move command. — Hassan Schroeder <hassan.schroeder@...> 2013/05/08

On Wed, May 8, 2013 at 6:54 AM, Peter Bailey <lists@ruby-forum.com> wrote:

[#407261] Re: Problem with FileUtils move command. — Peter Bailey <lists@...> 2013/05/08

Hassan Schroeder wrote in post #1108253:

[#407263] Re: Problem with FileUtils move command. — Hassan Schroeder <hassan.schroeder@...> 2013/05/08

On Wed, May 8, 2013 at 8:22 AM, Peter Bailey <lists@ruby-forum.com> wrote:

[#407265] Re: Problem with FileUtils move command. — Peter Bailey <lists@...> 2013/05/08

Hassan Schroeder wrote in post #1108265:

[#407258] Connect to a switch with SSH — "Rudá G." <lists@...>

I need connect to a Cisco Switch with SSH and Ruby. The main problem is

17 messages 2013/05/08

[#407298] Trucking All Http Request from a web page — Ja Tse <lists@...>

Hi,

10 messages 2013/05/09

[#407383] Enum#each issue — Love U Ruby <lists@...>

I am not able to understand why I am getting the error for the method

26 messages 2013/05/13

[#407464] Is it 'safe' to upgrade to ruby 2.0 by now? — Panagiotis Atmatzidis <atma@...>

Hello,

11 messages 2013/05/16

[#407471] Could you give me some Website for Learning Ruby — haxuan lac <lists@...>

I'm learning Ruby and I search some Website for learning Ruby

10 messages 2013/05/16

[#407517] Ruby Programming Practice — "buzz k." <lists@...>

Hey guys have been learning the basics of ruby and practicing some

30 messages 2013/05/19
[#407725] Re: Ruby Programming Practice — "buzz k." <lists@...> 2013/05/29

@Chad Perrin

[#407726] Re: Ruby Programming Practice — Stu <stu@...> 2013/05/29

On Wed, May 29, 2013 at 2:37 AM, buzz k. <lists@ruby-forum.com> wrote:

[#407740] Re: Ruby Programming Practice — Chad Perrin <code@...> 2013/05/29

On Wed, May 29, 2013 at 05:26:44PM +0900, Stu wrote:

[#407742] Re: Ruby Programming Practice — Brandon Weaver <keystonelemur@...> 2013/05/29

Skip FreeBSD and put armored plating on that bike by going OpenBSD.

[#407743] Re: Ruby Programming Practice — Chad Perrin <code@...> 2013/05/29

On Thu, May 30, 2013 at 02:54:51AM +0900, Brandon Weaver wrote:

[#407523] new, with an idea, and not sure what to learn next — Wendy Randquist <lists@...>

Hi. I've been going through the CodeAcademy courses for Ruby over the

13 messages 2013/05/19

[#407527] How to run shoes built via gem — Ruby Student <ruby.student@...>

This is perhaps a silly question.

14 messages 2013/05/19

[#407565] RubyDNS - asynchronous DNS client and server for Ruby. — Samuel Williams <space.ship.traveller@...>

Hi,

15 messages 2013/05/21
[#407567] Re: [ANN] RubyDNS - asynchronous DNS client and server for Ruby. — botp <botpena@...> 2013/05/21

On Tue, May 21, 2013 at 9:05 PM, Samuel Williams <

[#407585] Re: [ANN] RubyDNS - asynchronous DNS client and server for Ruby. — Samuel Williams <space.ship.traveller@...> 2013/05/21

Hi botp, you can create any configuration of DNS you like. RubyDNS doesn't

[#407586] Re: [ANN] RubyDNS - asynchronous DNS client and server for Ruby. — botp <botpena@...> 2013/05/22

On Wed, May 22, 2013 at 7:02 AM, Samuel Williams <

[#407587] Re: [ANN] RubyDNS - asynchronous DNS client and server for Ruby. — Samuel Williams <space.ship.traveller@...> 2013/05/22

Hi, you can use geo-ip for finding the location, geographically speaking.

[#407621] Regular expression to find a break in a pattern — Joel Pearson <lists@...>

I have a large file which lots of gibberish in and I'm trying to find

10 messages 2013/05/23

[#407639] On Green Shoes, do we have a broken arrow? — Ruby Student <ruby.student@...>

Team,

12 messages 2013/05/24

[#407715] AAARRRRGH! s="#$" => SyntaxError: compile error — Tadeusz Bochan <lists@...>

Hi.

13 messages 2013/05/28

[#407738] sending a gmail using ruby — David Munyaka <lists@...>

please help analyzing this code and please give me some recommendations.

26 messages 2013/05/29

[#407763] I can't unsubscribe, please help — Matthew Westerberg <matthew@...>

Hi,

11 messages 2013/05/29

[#407820] Eloquent Ruby Kaprekar's Number — Alphonse 23 <lists@...>

Which way is the eloquent ruby way to write this algorithm?

18 messages 2013/05/30

Re: Advice for simple client/server application

From: Panagiotis Atmatzidis <atma@...>
Date: 2013-05-30 19:45:41 UTC
List: ruby-talk #407816
Hello,

On 18 =CE=9D=CE=BF=CE=B5 2012, at 09:04 , Carlo E. Prelz =
<fluido@fluido.as> wrote:

> 	Subject: Advice for simple client/server application
> 	Date: Sun 18 Nov 12 06:09:42AM +0900
>=20
> Quoting Panagiotis Atmatzidis (atma@convalesco.org):
>=20
>> I need to write a client/server application and I'd like to some
>> advice from more experienced users. =20
>>=20
>> There will be multiple clients and one server. Every client should
>> automatically identify to the server and give some details
>> (client_id, date, time, etc). The identification needs to be at very
>> basic level, just to avoid *strange things* from happening, since
>> the server is going to listen on the internet (firewall rules will
>> be applied, but some clients may have dynamic ip's, so some subnets
>> might be able to connect). =20
>>=20
>> The server will dig for data from a database, at each client's
>> request will send an array (list of words) to the client. Then the
>> server will receive a hash with detailed info from the client about
>> the each element of the array and will dump the results into the
>> database. These arrays will be formed only when requested by
>> clients. The server will make sure clients don't get the same arrays
>> and make a check to the given results and that's about it.=20
>>=20
>> It's a fairly simple application. I was thinking of using sinatra +
>> routes, to create the list in 'txt' format to the client but I'm not
>> sure how to send the results back to the sinatra server yet.=20
>>=20
>> So I'd like to ask more advanced users if there's any protocol, gem
>> and/or framework that would make this task easier since I've never
>> done anything similar before. I know there's a variety of protocols
>> which can be used. I'd like to keep things simple & clean as much as
>> possible.=20
>=20
> You do not specify if the clients are also written in Ruby. When I
> have to do inter-process communications, on the same machine or
> between remote machines, I use DRb (Distributed Ruby), which is
> included in MRI. I certainly had to pour some sweat to gain confidence
> with it, but it was worth the effort. You can even set it up to use
> SSL, so the traffic will be encrypted.
>=20
> Let's say you have a server based on this scaffold (engine.rb):
>=20
> =
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
> require 'drb/drb'
> require 'drb/ssl'
>=20
> class Engine
>  HOST=3D'yourhost.xxx'
>  PORT=3D21212
>  URI=3D"drbssl://#{HOST}:#{PORT}"
>  CERTNAME=3D[['C',HOST.split('.')[-1]],['O',HOST],['CN',self.to_s]]
>=20
>  def initialize
>    config=3D{:verbose=3D>false,:SSLCertName=3D>CERTNAME}
>    @srv=3DDRb::start_service(URI,self,config)
>=20
>    #
>    # Your inits
>    #
>=20
>    @para1=3Drand(1000)
>    @para2=3Drand(1000)
>  end
>=20
>  def runme
>    DRb::thread.join()
>  end
>=20
>  #
>  # Remote-callable methdos
>  #
>=20
>  def method1(a)
>    "#{@para1} #{@para2} method 1 returns #{a.to_s}"
>  end
>=20
>  def method2(a)
>    "#{@para1} #{@para2} method 2 returns #{a.to_s} #{a.to_s}"
>  end
>=20
>  def Engine::remote
>    config=3D{:verbose=3D>false}
>=20
>    DRb.start_service(nil,nil,config)
>    DRbObject.new(nil,URI)
>  end
> end
>=20
> if($0=3D=3D__FILE__)
>  Engine::new.runme
> end
> =
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
>=20
> Your client may be something like this:
>=20
> =
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
> require 'engine.rb'
>=20
> class Client
>  def initialize
>    @engine=3DEngine::remote
>  end
>=20
>  def runme
>    puts @engine.method1(rand(1000))
>    puts @engine.method1('test')
>    puts @engine.method2(rand(1000))
>    puts @engine.method2('test')
>  end
> end
>=20
> Client::new.runme
> =
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
>=20
> Your engine can provide an identify method (you may have a hash of
> user ids/passwords associated to one or more address, for
> example). Then, you would have a 'dig' method that would provide the
> desired list of words.
>=20
> For me, DRb has cut the cake several times (you can also base it on
> Unix sockets, for intra-machine communications).=20
>=20
> There are some snags. The biggest is that methods of the DRb-exported
> objects are executed remotely, but if your client receives remote
> objects, it will receive LOCAL COPIES of them. Let's say your engine
> has object @ob, which has method meth. If your engine has this method
>=20
> def m
>  @ob.meth
> end=09
>=20
> meth is executed remotely, by the engine process. But if your
> methods just returns @ob:
>=20
> def m
>  @ob
> end=09
>=20
> and in your client you have
>=20
> ob=3D@engine.m
> ob.meth
>=20
> meth is executed in the client's thread (and thus, for example, it
> won't be able to access the database opened by the remote engine).
>=20
> I hope this is of help.
>=20
> Carlo
>=20
> --=20
>  *         Se la Strada e la sua Virtu' non fossero state messe da =
parte,
> * K * Carlo E. Prelz - fluido@fluido.as             che bisogno ci =
sarebbe
>  *               di parlare tanto di amore e di rettitudine? =
(Chuang-Tzu)
>=20

I'm playing with druby. Some concepts are hard to grasp for now. What =
I'm trying to do is:

1) Send results to server
2) Run some methods with these results from the server
3) Return the values to the server so it can perform the final =
operation.

I don't get how can I get results from the client back to the server...?

How can I send back data to the server? :-/

Thanks

Panagiotis (atmosx) Atmatzidis

email:	atma@convalesco.org
URL:	http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5
--
The wise man said: "Never argue with an idiot. They bring you down to =
their level and beat you with experience."



In This Thread