[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: ActiveRecord through Drb: problem with ids

Ezra Zygmuntowicz

8/25/2006 11:17:00 PM


On Aug 25, 2006, at 1:32 PM, Philippe Lang wrote:

> Ezra Zygmuntowicz wrote:
>
>>> Hi,
>>>
>>> Thanks for your answer. I see now where the problem comes from, but
>>> your "trick" is apparently not sufficient. The code...
>>>
>>> class Garden < ActiveRecord::Base
>>> include DRbUndumped
>>> has_many :flowers
>>> alias :id__ :id
>>> end
>>>
>>> class Flower < ActiveRecord::Base
>>> include DRbUndumped
>>> belongs_to :garden
>>> alias :id__ :id
>>> End
>>>
>>> ... Still does not work...
>>
>>
>> Hey Philip-
>>
>> I have dealt alot with ActiveRecord over drb, I use it
>> in this plugin for rails[1] . The way around this is to use a
>> different notation to get the id of the AR object. So with
>> your client example change it to this and you will be fine:
>>
>> #!/usr/local/bin/ruby
>> require 'drb'
>>
>> DRb.start_service()
>> obj = DRbObject.new(nil, 'druby://localhost:9000')
>>
>> g = obj.find(1)
>> puts "#{g[:id]} | #{g.name}"
>> g.flowers.each do |f|
>> puts "#{f[:if]} | #{f[:id]} | #{f.name}"
>> end
>>
>> So by using arinstance[:id] instead of arinstance.id
>> you will avoid this problem all together.
>
> Hey thanks a lot Erza, it works great!
>
> I have one more question if you don't mind... Now that I can get
> ActiveRecords through Drb, I intend to use them in order to
> populate FOX widgets on a fat client, and send the changes back to
> the server when the user decides to apply the changes.
>
> Do you think performances will be OK for a relatively complex GUI,
> through a low-bandwith network? Does a DrbUndumped ActiveRecord
> object generate a lot of round-trips when reading and writing the
> data in the object?


Hey Philip-

My first guess would be that it should be fine. But without knowing
more details it is hard to say for sure. I think the best thing you
could do is run some simulations and benchmark it to see if it is
acceptable to you. Run it over the same slow networks you would be in
the real version and just use irb on the client side to crete and
edit a bunch of AR objects over drb and monitor the network traffic
with netstat or something and benchmark with the built in benchmark
class. This should give yopu a good idea about what you can expect
performance wise.

Cheers-
-Ezra





7 Answers

Bill Williams

6/17/2012 4:45:00 PM

0

I assume by “pick up etc” you mean apart from woodshedding or gig preparation.

I have a guitar to hand in most rooms and for me it’s usually:
50% chord melody or other solo stuff (just for the pleasure really and to regularly recharge my failing memory cells)
50% improvise over whatever happens to come up on my mp3 player or on the radio, usually a local mainstream jazz program - I enjoy trying to react to the changes on the fly.

TD

6/17/2012 5:28:00 PM

0

On Jun 17, 12:44 pm, Bill Williams <bwbillwilliam...@gmail.com> wrote:
> I assume by “pick up etc” you mean apart from woodshedding or gig preparation.
>
> I have a guitar to hand in most rooms and for me it’s usually:
> 50% chord melody or other solo stuff (just for the pleasure really and to regularly recharge my failing memory cells)
> 50% improvise over whatever happens to come up on my mp3 player or on the radio, usually a local mainstream jazz  program - I enjoy trying to react to the changes on the fly.

Exactly, sometimes it's good to leave your fly open.

fazzer

6/17/2012 7:26:00 PM

0

On Sun, 17 Jun 2012 08:06:23 -0700 (PDT), Jim Soloway
<jim@jimsoloway.com> wrote:

>On Saturday, June 16, 2012 3:12:08 PM UTC-7, (unknown) wrote:
>> ..........what do you play over? Anything in particular, nothing in
>> particular, just go for something melodic with no particualr chord sequence
>> in mind? Go for something rhythmic with no harmonic or melodic structure?
>> All of these? None of these?
>> --
>>
>> icarusi
>
>It's a polyphonic instrument capable of playing complex harmonies and moving lines. Why not just play complete music rather than playing "over" something as though it's a saxaphone?
But a guitarist, especially a jazz guitarist, is a frustrated sax
player. Either he was told by the doctor to avoid wind instruments
becasue of a chrnoic ear infectin, or he had an overly-critical
father, or neighbor, when he would try playing the sax.
Some of the greatest guitar lines I've ever heard came through a sax.
I often say that Gerry Mulligan and Stan Getz were the greatest Jazz
guitarists ever.
(Maybe I better leave town.......!!!!!)
(Boy, am I going to get answers on that one!!!!)

terrasbeest@gmail.com

6/17/2012 7:59:00 PM

0

Op zondag 17 juni 2012 21:25:54 UTC+2 schreef (onbekend) het volgende:
> On Sun, 17 Jun 2012 08:06:23 -0700 (PDT), Jim Soloway
> <jim@jimsoloway.com> wrote:
>
> >On Saturday, June 16, 2012 3:12:08 PM UTC-7, (unknown) wrote:
> >> ..........what do you play over? Anything in particular, nothing in
> >> particular, just go for something melodic with no particualr chord sequence
> >> in mind? Go for something rhythmic with no harmonic or melodic structure?
> >> All of these? None of these?
> >> --
> >>
> >> icarusi
> >
> >It's a polyphonic instrument capable of playing complex harmonies and moving lines. Why not just play complete music rather than playing "over" something as though it's a saxaphone?
> But a guitarist, especially a jazz guitarist, is a frustrated sax
> player. Either he was told by the doctor to avoid wind instruments
> becasue of a chrnoic ear infectin, or he had an overly-critical
> father, or neighbor, when he would try playing the sax.
> Some of the greatest guitar lines I've ever heard came through a sax.
> I often say that Gerry Mulligan and Stan Getz were the greatest Jazz
> guitarists ever.
> (Maybe I better leave town.......!!!!!)
> (Boy, am I going to get answers on that one!!!!)

And how is YOUR asthma these days ?

Gerry

6/17/2012 8:31:00 PM

0

On 2012-06-17 19:25:54 +0000, fazzer@bebop.org said:

> But a guitarist, especially a jazz guitarist, is a frustrated sax
> player.

I'm not. But then I'm also not one of those many many guitarists who
think the only way to learn to play guitar is by listening to sax
players. That's probably got something to do with it.

--
If one plays good music, people don't listen and if one plays bad music
people don't talk. -- Oscar Wilde

Bill Williams

6/18/2012 12:58:00 PM

0

> Exactly, sometimes it's good to leave your fly open.

Weeell, yes ...I expect it is.

ic

6/19/2012 12:11:00 AM

0

"Jim Soloway" <jim@jimsoloway.com> wrote in message
news:9c21a874-332a-4d27-bdb2-15f29a307b2c@googlegroups.com...

> It's a polyphonic instrument capable of playing complex harmonies and
> moving lines. Why not just play complete music rather than playing "over"
> something as though it's a saxaphone?

Probably because I have the skill level to improvise monophonically but not
polyphonically, plus I do play sax and I like to play monophonically and
also vocally which has similarities to sax, horn and violin playing. Can't
do much of that very well polyphonically, although I can do some. Guitar
polyphonics usaully sounds pianistic to me, so tend to use it most if I want
to sound pianistic, which isn't most of the time.
--

icarusi