From lawwton at gmail.com Tue Feb 3 12:20:20 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Tue, 3 Feb 2009 12:20:20 -0500 Subject: [raleigh.rb] Find Query - Associations Help Message-ID: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> All: I am trying to create a query using rails and I am not quite sure how to do it. I could get this done using plane old sql with no problem and was even planning on doing that until I ran into a little issue with find_by_sql. It seems that this does not preserve order. What I need using Rails Active Record is the following: I have a series of tables as follows: tickets users tables here: tickets tickets_users users I also have: users roles tables here: users roles_users roles What I need is a query where I can filter by roles. Essentially saying ... give me all the tickets for users whose role is 'foo'. Thanks in advance, Alfredo From seancribbs at gmail.com Tue Feb 3 13:25:12 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Tue, 03 Feb 2009 13:25:12 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> Message-ID: <49888C08.6000507@gmail.com> Start from the role, then traverse to the tickets: Role.find_by_name('foo').users.map(&:tickets).flatten Sean Alfredo Quiroga-Villamil wrote: > All: > > I am trying to create a query using rails and I am not quite sure how > to do it. I could get this done using plane old sql with no problem > and was even planning on doing that until I ran into a little issue > with find_by_sql. It seems that this does not preserve order. > > What I need using Rails Active Record is the following: > > I have a series of tables as follows: > > tickets users > > tables here: > > tickets > tickets_users > users > > I also have: > > users roles > > tables here: > > users > roles_users > roles > > What I need is a query where I can filter by roles. Essentially saying > ... give me all the tickets for users whose role is 'foo'. > > Thanks in advance, > > Alfredo > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > From mark.bennett.mail at gmail.com Tue Feb 3 13:39:51 2009 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Tue, 3 Feb 2009 13:39:51 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> Message-ID: You could pull back the user objects with all the tickets attached. User.find :include => {:tickets, roles } :conditions => "roles.name = 'analyst'" for: Bob -ticket 1 -ticket 3 Jim -ticket 2 -ticket 4 I'm not sure what order you are trying to preserve. Mark On Tue, Feb 3, 2009 at 12:20 PM, Alfredo Quiroga-Villamil wrote: > All: > > I am trying to create a query using rails and I am not quite sure how > to do it. I could get this done using plane old sql with no problem > and was even planning on doing that until I ran into a little issue > with find_by_sql. It seems that this does not preserve order. > > What I need using Rails Active Record is the following: > > I have a series of tables as follows: > > tickets users > > tables here: > > tickets > tickets_users > users > > I also have: > > users roles > > tables here: > > users > roles_users > roles > > What I need is a query where I can filter by roles. Essentially saying > ... give me all the tickets for users whose role is 'foo'. > > Thanks in advance, > > Alfredo > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lawwton at gmail.com Tue Feb 3 14:10:23 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Tue, 3 Feb 2009 14:10:23 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: <49888C08.6000507@gmail.com> References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> <49888C08.6000507@gmail.com> Message-ID: <5fe6fa8f0902031110yfba7747uf74155fd7cc571d0@mail.gmail.com> Thank you guys, appreciate it, let me give it a try. Regards, Alfredo On Tue, Feb 3, 2009 at 1:25 PM, Sean Cribbs wrote: > Start from the role, then traverse to the tickets: > > Role.find_by_name('foo').users.map(&:tickets).flatten > > Sean > > Alfredo Quiroga-Villamil wrote: >> >> All: >> >> I am trying to create a query using rails and I am not quite sure how >> to do it. I could get this done using plane old sql with no problem >> and was even planning on doing that until I ran into a little issue >> with find_by_sql. It seems that this does not preserve order. >> >> What I need using Rails Active Record is the following: >> >> I have a series of tables as follows: >> >> tickets users >> >> tables here: >> >> tickets >> tickets_users >> users >> >> I also have: >> >> users roles >> >> tables here: >> >> users >> roles_users >> roles >> >> What I need is a query where I can filter by roles. Essentially saying >> ... give me all the tickets for users whose role is 'foo'. >> >> Thanks in advance, >> >> Alfredo >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From jon.list+rb at gmail.com Tue Feb 3 14:25:23 2009 From: jon.list+rb at gmail.com (Jonathon Brenner) Date: Tue, 3 Feb 2009 14:25:23 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: <49888C08.6000507@gmail.com> References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> <49888C08.6000507@gmail.com> Message-ID: I would marry that method chain. On Tue, Feb 3, 2009 at 1:25 PM, Sean Cribbs wrote: > Start from the role, then traverse to the tickets: > > Role.find_by_name('foo').users.map(&:tickets).flatten > > Sean > > Alfredo Quiroga-Villamil wrote: >> >> All: >> >> I am trying to create a query using rails and I am not quite sure how >> to do it. I could get this done using plane old sql with no problem >> and was even planning on doing that until I ran into a little issue >> with find_by_sql. It seems that this does not preserve order. >> >> What I need using Rails Active Record is the following: >> >> I have a series of tables as follows: >> >> tickets users >> >> tables here: >> >> tickets >> tickets_users >> users >> >> I also have: >> >> users roles >> >> tables here: >> >> users >> roles_users >> roles >> >> What I need is a query where I can filter by roles. Essentially saying >> ... give me all the tickets for users whose role is 'foo'. >> >> Thanks in advance, >> >> Alfredo >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From martin.streicher at gmail.com Thu Feb 5 13:32:19 2009 From: martin.streicher at gmail.com (Martin Streicher) Date: Thu, 5 Feb 2009 13:32:19 -0500 Subject: [raleigh.rb] Ruby extensions? Message-ID: <3B1DC019-FEDF-4D89-9D5B-9D0321D65CCA@gmail.com> I am having an issue with a Ruby extension I wrote. I pass the extension ASCII and it runs DES-ECB to encypt the data. The data comes back as a series of characters. However, since the data it is being treated as a string in Ruby and it includes (sometimes) NULL characters, Ruby is truncating the data whenever I try to manipulate it. Any ideas? Has anyone written an extension that returns bytes? Martin From ruby at bandkbroom.com Fri Feb 6 11:23:08 2009 From: ruby at bandkbroom.com (Brian Broom) Date: Fri, 06 Feb 2009 11:23:08 -0500 Subject: [raleigh.rb] Ruby extensions? In-Reply-To: <3B1DC019-FEDF-4D89-9D5B-9D0321D65CCA@gmail.com> References: <3B1DC019-FEDF-4D89-9D5B-9D0321D65CCA@gmail.com> Message-ID: <498C63EC.8010008@bandkbroom.com> I haven't written one that uses bytes, but did do some with arrays a while ago. As I recall there is some strangeness between getting the C and ruby sides to agree on types. Have you tried sending the data back as an array instead of a string? You might also want to double check how you are casting things on the C side. I remember it not being really obvious how to get it setup. I remember looking through the header file to see what else was available from a type standpoint, not sure if that would help. Brian Broom Martin Streicher wrote: > > I am having an issue with a Ruby extension I wrote. I pass the > extension ASCII and it runs DES-ECB to encypt the data. The data comes > back as a series of characters. > > However, since the data it is being treated as a string in Ruby and it > includes (sometimes) NULL characters, Ruby is truncating the data > whenever I try to manipulate it. > > Any ideas? Has anyone written an extension that returns bytes? > > Martin > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From lawwton at gmail.com Fri Feb 6 15:37:27 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Fri, 6 Feb 2009 15:37:27 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> <49888C08.6000507@gmail.com> Message-ID: <5fe6fa8f0902061237x6c9a1124m5aa9792da3c44c1a@mail.gmail.com> I had to put this on hold and do something else and just got back to it now. Thanks so much for the help guys. I was able to use both ideas and based on what I needed created the correct query. Appreciate the responses. Alfredo On Tue, Feb 3, 2009 at 2:25 PM, Jonathon Brenner wrote: > I would marry that method chain. > > On Tue, Feb 3, 2009 at 1:25 PM, Sean Cribbs wrote: >> Start from the role, then traverse to the tickets: >> >> Role.find_by_name('foo').users.map(&:tickets).flatten >> >> Sean >> >> Alfredo Quiroga-Villamil wrote: >>> >>> All: >>> >>> I am trying to create a query using rails and I am not quite sure how >>> to do it. I could get this done using plane old sql with no problem >>> and was even planning on doing that until I ran into a little issue >>> with find_by_sql. It seems that this does not preserve order. >>> >>> What I need using Rails Active Record is the following: >>> >>> I have a series of tables as follows: >>> >>> tickets users >>> >>> tables here: >>> >>> tickets >>> tickets_users >>> users >>> >>> I also have: >>> >>> users roles >>> >>> tables here: >>> >>> users >>> roles_users >>> roles >>> >>> What I need is a query where I can filter by roles. Essentially saying >>> ... give me all the tickets for users whose role is 'foo'. >>> >>> Thanks in advance, >>> >>> Alfredo >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From brandan at bclennox.com Tue Feb 10 09:14:38 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Tue, 10 Feb 2009 09:14:38 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch Message-ID: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> Hey list, This seems like it would be a common pattern, but it's not quite making sense to me. I'm gisting some example code here: http://gist.github.com/61064 I have a single Address model that I'd like to use for any other model that might have an address, say Event and Contact. This means that Events and Contacts have to reference Addresses, so they contain the address_id column in the database and the belongs_to declaration in the class (which is where it starts to feel weird to me). I build my form appropriately and call @event.update_attributes(params[:event]) in the controller, and I get an AssociationTypeMismatch ? Address(#31131890) expected, got HashWithIndifferentAccess(#9690560). Am I approaching the problem incorrectly? It makes more intuitive sense to me that an Event has_one :address, but the docs say that the model with the foreign key must contain the belongs_to declaration. At any rate, I feel like the code I have should be working and it's probably something really simple to fix it. Thanks! Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan.daigle at gmail.com Tue Feb 10 09:22:31 2009 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Tue, 10 Feb 2009 09:22:31 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> Message-ID: <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> Might you want to use a polymorphic association? http://gist.github.com/61400 -Ryan On Tue, Feb 10, 2009 at 9:14 AM, Brandan Lennox wrote: > Hey list, > This seems like it would be a common pattern, but it's not quite making > sense to me. I'm gisting some example code here: > > http://gist.github.com/61064 > > I have a single Address model that I'd like to use for any other model that > might have an address, say Event and Contact. This means that Events and > Contacts have to reference Addresses, so they contain the address_id column > in the database and the belongs_to declaration in the class (which is where > it starts to feel weird to me). > > I build my form appropriately and call > @event.update_attributes(params[:event]) in the controller, and I get > an AssociationTypeMismatch ? Address(#31131890) expected, got > HashWithIndifferentAccess(#9690560). > > Am I approaching the problem incorrectly? It makes more intuitive sense to > me that an Event has_one :address, but the docs say that the model with the > foreign key must contain the belongs_to declaration. At any rate, I feel > like the code I have should be working and it's probably something really > simple to fix it. > > Thanks! > > Brandan L. > -- > brandan at bclennox.com > http://www.bclennox.com > +1 (919) 274.7565 > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brandan at bclennox.com Tue Feb 10 09:42:34 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Tue, 10 Feb 2009 09:42:34 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> Message-ID: <4BA7508E-126F-42B4-82B8-C5BD130CD0BC@bclennox.com> This is exactly what I wanted! I just didn't know what it was called. It's even the example on the wiki. Thanks Ryan. Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 On Feb 10, 2009, at 9:22 AM, Ryan Daigle wrote: > Might you want to use a polymorphic association? > > http://gist.github.com/61400 > > -Ryan > > On Tue, Feb 10, 2009 at 9:14 AM, Brandan Lennox > wrote: > Hey list, > > This seems like it would be a common pattern, but it's not quite > making sense to me. I'm gisting some example code here: > > http://gist.github.com/61064 > > I have a single Address model that I'd like to use for any other > model that might have an address, say Event and Contact. This means > that Events and Contacts have to reference Addresses, so they > contain the address_id column in the database and the belongs_to > declaration in the class (which is where it starts to feel weird to > me). > > I build my form appropriately and call > @event.update_attributes(params[:event]) in the controller, and I > get an AssociationTypeMismatch ? Address(#31131890) expected, got > HashWithIndifferentAccess(#9690560). > > Am I approaching the problem incorrectly? It makes more intuitive > sense to me that an Event has_one :address, but the docs say that > the model with the foreign key must contain the belongs_to > declaration. At any rate, I feel like the code I have should be > working and it's probably something really simple to fix it. > > Thanks! > > Brandan L. > -- > brandan at bclennox.com > http://www.bclennox.com > +1 (919) 274.7565 > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From brentmc79 at gmail.com Tue Feb 10 09:38:30 2009 From: brentmc79 at gmail.com (Brent Collier) Date: Tue, 10 Feb 2009 09:38:30 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> Message-ID: Yeah, I think the polymorphic association would be a good idea, but that doesn't really solve his problem. If you're on edge rails, then check out this. If not, then I would consider updating your form to not nest the address and then explicitly create the address in your controller, like so . I'm sure there's probably a better way to do the object creation in the controller (perhaps a transaction), but this should be enough to get you moving forward. -Brent On Tue, Feb 10, 2009 at 9:22 AM, Ryan Daigle wrote: > Might you want to use a polymorphic association? > http://gist.github.com/61400 > > -Ryan > > On Tue, Feb 10, 2009 at 9:14 AM, Brandan Lennox wrote: > >> Hey list, >> This seems like it would be a common pattern, but it's not quite making >> sense to me. I'm gisting some example code here: >> >> http://gist.github.com/61064 >> >> I have a single Address model that I'd like to use for any other model >> that might have an address, say Event and Contact. This means that Events >> and Contacts have to reference Addresses, so they contain the address_id >> column in the database and the belongs_to declaration in the class (which is >> where it starts to feel weird to me). >> >> I build my form appropriately and call >> @event.update_attributes(params[:event]) in the controller, and I get >> an AssociationTypeMismatch ? Address(#31131890) expected, got >> HashWithIndifferentAccess(#9690560). >> >> Am I approaching the problem incorrectly? It makes more intuitive sense to >> me that an Event has_one :address, but the docs say that the model with the >> foreign key must contain the belongs_to declaration. At any rate, I feel >> like the code I have should be working and it's probably something really >> simple to fix it. >> >> Thanks! >> >> Brandan L. >> -- >> brandan at bclennox.com >> http://www.bclennox.com >> +1 (919) 274.7565 >> >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Brent Collier | 919.564.6915 | www.BrentCollier.com | www.acts-as-blogr.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at iannopollo.com Tue Feb 10 09:45:48 2009 From: steve at iannopollo.com (Steve Iannopollo) Date: Tue, 10 Feb 2009 09:45:48 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> Message-ID: <9A9C719A-B919-47CE-94AF-21F3EA0360CA@iannopollo.com> I think the problem that you're running into is what is solved by the nested model support in edge (and 2.3) rails: http://weblog.rubyonrails.org/2009/2/6/this-week-in-edge-rails You're model is expecting to recieve an ActiveRecord object as an :address attribute, not a hash, and that is why it blows up. Without the nested form support, I've always had to write stuff like: class Event < ActiveRecord::Base def attributes=(attrs) address_attributes = attrs.delete(:address) address = self.address || Address.new address.attributes = address_attributes attrs[:address] = address super attrs end end But that stuff goes away with the nested form support. So you're not doing anything wrong, you're just coding for the future! -Steve On Feb 10, 2009, at 9:14 AM, Brandan Lennox wrote: > Hey list, > > This seems like it would be a common pattern, but it's not quite > making sense to me. I'm gisting some example code here: > > http://gist.github.com/61064 > > I have a single Address model that I'd like to use for any other > model that might have an address, say Event and Contact. This means > that Events and Contacts have to reference Addresses, so they > contain the address_id column in the database and the belongs_to > declaration in the class (which is where it starts to feel weird to > me). > > I build my form appropriately and call > @event.update_attributes(params[:event]) in the controller, and I > get an AssociationTypeMismatch ? Address(#31131890) expected, got > HashWithIndifferentAccess(#9690560). > > Am I approaching the problem incorrectly? It makes more intuitive > sense to me that an Event has_one :address, but the docs say that > the model with the foreign key must contain the belongs_to > declaration. At any rate, I feel like the code I have should be > working and it's probably something really simple to fix it. > > Thanks! > > Brandan L. > -- > brandan at bclennox.com > http://www.bclennox.com > +1 (919) 274.7565 > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.denatale at gmail.com Tue Feb 10 09:50:37 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 10 Feb 2009 09:50:37 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> Message-ID: On Tue, Feb 10, 2009 at 9:22 AM, Ryan Daigle wrote: > Might you want to use a polymorphic association? > http://gist.github.com/61400 > Seems to me that this makes each address instance have a 1-1 relationship with 1 event or contact or... So, if we had multiple events at the same address, there would be an address row for each of those event, in which case I'm not sure what's gained by having a separate address model. In this simple case, I'd consider just moving the address fields to the event and contact models, perhaps considering STI for those two models if it makes sense. If preserving the identity of an address is important, then I think that we might need to get into a join model or two, which probably gets Brandon further away from his original problem of ActiveRecord not recognizing the nested hash as being a nested model attribute. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.denatale at gmail.com Tue Feb 10 10:06:37 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 10 Feb 2009 10:06:37 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: <9A9C719A-B919-47CE-94AF-21F3EA0360CA@iannopollo.com> References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <9A9C719A-B919-47CE-94AF-21F3EA0360CA@iannopollo.com> Message-ID: On Tue, Feb 10, 2009 at 9:45 AM, Steve Iannopollo wrote: > I think the problem that you're running into is what is solved by the > nested model support in edge (and 2.3) rails: > http://weblog.rubyonrails.org/2009/2/6/this-week-in-edge-rails > > Which is a "beautiful thing!" -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From brandan at bclennox.com Tue Feb 10 11:01:47 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Tue, 10 Feb 2009 11:01:47 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: <9A9C719A-B919-47CE-94AF-21F3EA0360CA@iannopollo.com> References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <9A9C719A-B919-47CE-94AF-21F3EA0360CA@iannopollo.com> Message-ID: <3EE28801-5E0E-49D8-B552-CE34D98E9B5D@bclennox.com> You're right. I have two different problems. Polymorphic association seems to solve the first problem. Nested model support looks like it'll solve the second. I'll try to move to edge later this week. Thanks! Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 On Feb 10, 2009, at 9:45 AM, Steve Iannopollo wrote: > I think the problem that you're running into is what is solved by > the nested model support in edge (and 2.3) rails: > > http://weblog.rubyonrails.org/2009/2/6/this-week-in-edge-rails > > You're model is expecting to recieve an ActiveRecord object as > an :address attribute, not a hash, and that is why it blows up. > > Without the nested form support, I've always had to write stuff like: > > class Event < ActiveRecord::Base > def attributes=(attrs) > address_attributes = attrs.delete(:address) > address = self.address || Address.new > address.attributes = address_attributes > attrs[:address] = address > super attrs > end > end > > But that stuff goes away with the nested form support. So you're not > doing anything wrong, you're just coding for the future! > > -Steve > > > On Feb 10, 2009, at 9:14 AM, Brandan Lennox wrote: > >> Hey list, >> >> This seems like it would be a common pattern, but it's not quite >> making sense to me. I'm gisting some example code here: >> >> http://gist.github.com/61064 >> >> I have a single Address model that I'd like to use for any other >> model that might have an address, say Event and Contact. This means >> that Events and Contacts have to reference Addresses, so they >> contain the address_id column in the database and the belongs_to >> declaration in the class (which is where it starts to feel weird to >> me). >> >> I build my form appropriately and call >> @event.update_attributes(params[:event]) in the controller, and I >> get an AssociationTypeMismatch ? Address(#31131890) expected, got >> HashWithIndifferentAccess(#9690560). >> >> Am I approaching the problem incorrectly? It makes more intuitive >> sense to me that an Event has_one :address, but the docs say that >> the model with the foreign key must contain the belongs_to >> declaration. At any rate, I feel like the code I have should be >> working and it's probably something really simple to fix it. >> >> Thanks! >> >> Brandan L. >> -- >> brandan at bclennox.com >> http://www.bclennox.com >> +1 (919) 274.7565 >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From brandan at bclennox.com Tue Feb 10 11:06:06 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Tue, 10 Feb 2009 11:06:06 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> Message-ID: We have at least 5 models that reference addresses, possibly more in the future, so I was trying to keep from duplicating address fields all over the various other models. I was also trying to use the Address model for helper-ish methods like address.to_s, but now that I think about it, I could probably stick those in a module and mixin to the appropriate models. Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 On Feb 10, 2009, at 9:50 AM, Rick DeNatale wrote: > On Tue, Feb 10, 2009 at 9:22 AM, Ryan Daigle > wrote: > Might you want to use a polymorphic association? > > http://gist.github.com/61400 > > Seems to me that this makes each address instance have a 1-1 > relationship with 1 event or contact or... > > So, if we had multiple events at the same address, there would be an > address row for each of those event, in which case I'm not sure > what's gained by having a separate address model. > > In this simple case, I'd consider just moving the address fields to > the event and contact models, perhaps considering STI for those two > models if it makes sense. > > If preserving the identity of an address is important, then I think > that we might need to get into a join model or two, which probably > gets Brandon further away from his original problem of ActiveRecord > not recognizing the nested hash as being a nested model attribute. > > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Twitter: http://twitter.com/RickDeNatale > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.denatale at gmail.com Tue Feb 10 11:24:53 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 10 Feb 2009 11:24:53 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> Message-ID: On Tue, Feb 10, 2009 at 11:06 AM, Brandan Lennox wrote: > We have at least 5 models that reference addresses, possibly more in the > future, so I was trying to keep from duplicating address fields all over the > various other models. I was also trying to use the Address model for > helper-ish methods like address.to_s, but now that I think about it, I could > probably stick those in a module and mixin to the appropriate models. > You might also consider making the addresses aggregate attributes using composed_of -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.streicher at gmail.com Tue Feb 10 11:25:08 2009 From: martin.streicher at gmail.com (Martin Streicher) Date: Tue, 10 Feb 2009 11:25:08 -0500 Subject: [raleigh.rb] raleigh-rb-members Digest, Vol 39, Issue 2 In-Reply-To: References: Message-ID: <50B0A168-277E-4864-A8D9-8D925A0F774E@gmail.com> I did get my extension to work, although I have one test case that is a strange anomaly. I used SWIG to generate the framework for the extension. One of the SWIG type maps allows you to pass a string, but SWIG in turn counts the actual bytes -- different than passing a string where a NULL character would terminate the string abruptly -- and calls C with a char * and the count of bytes. That does the trick. And yes, when the data comes back, it has to be brought in as an array and unpacked. I can post the solution if people are interested. Martin On Feb 10, 2009, at 9:22 AM, raleigh-rb-members-request at rubyforge.org wrote: > I haven't written one that uses bytes, but did do some with arrays a > while ago. As I recall there is some strangeness between getting > the C and ruby sides to agree on types. Have you tried sending the > data back as an array instead of a string? You might also want to > double check how you are casting things on the C side. I remember it > not being really obvious how to get it setup. I remember looking > through the header file to see what else was available from a type > standpoint, not sure if that would help. > > Brian Broom From info at lojic.com Tue Feb 10 11:43:23 2009 From: info at lojic.com (Brian Adkins) Date: Tue, 10 Feb 2009 11:43:23 -0500 Subject: [raleigh.rb] raleigh-rb-members Digest, Vol 39, Issue 2 In-Reply-To: <50B0A168-277E-4864-A8D9-8D925A0F774E@gmail.com> References: <50B0A168-277E-4864-A8D9-8D925A0F774E@gmail.com> Message-ID: <4991AEAB.80509@lojic.com> Martin Streicher wrote, On 2/10/09 11:25 AM: > > I did get my extension to work, although I have one test case that is a > strange anomaly. > > I used SWIG to generate the framework for the extension. One of the SWIG > type maps allows you to pass a string, but SWIG in turn counts the > actual bytes -- different than passing a string where a NULL character > would terminate the string abruptly -- and calls C with a char * and the > count of bytes. That does the trick. > > And yes, when the data comes back, it has to be brought in as an array > and unpacked. > > I can post the solution if people are interested. That'd be great. > > Martin > > > On Feb 10, 2009, at 9:22 AM, raleigh-rb-members-request at rubyforge.org > wrote: > >> I haven't written one that uses bytes, but did do some with arrays a >> while ago. As I recall there is some strangeness between getting the >> C and ruby sides to agree on types. Have you tried sending the data >> back as an array instead of a string? You might also want to double >> check how you are casting things on the C side. I remember it not >> being really obvious how to get it setup. I remember looking through >> the header file to see what else was available from a type standpoint, >> not sure if that would help. >> >> Brian Broom > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ 919-946-7547 (mobile) From brandan at bclennox.com Wed Feb 11 10:28:40 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Wed, 11 Feb 2009 10:28:40 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> Message-ID: <6E5B85E3-0BBA-439D-B513-FFE2EE0187F4@bclennox.com> Interesting. Never knew about composed_of. I'll have to look into it. Thanks everyone for all the help. Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 On Feb 10, 2009, at 11:24 AM, Rick DeNatale wrote: > On Tue, Feb 10, 2009 at 11:06 AM, Brandan Lennox > wrote: > We have at least 5 models that reference addresses, possibly more in > the future, so I was trying to keep from duplicating address fields > all over the various other models. I was also trying to use the > Address model for helper-ish methods like address.to_s, but now that > I think about it, I could probably stick those in a module and mixin > to the appropriate models. > > You might also consider making the addresses aggregate attributes > using composed_of > > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Twitter: http://twitter.com/RickDeNatale > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at lojic.com Wed Feb 11 11:07:08 2009 From: info at lojic.com (Brian Adkins) Date: Wed, 11 Feb 2009 11:07:08 -0500 Subject: [raleigh.rb] belongs_to and AssociationTypeMismatch In-Reply-To: <6E5B85E3-0BBA-439D-B513-FFE2EE0187F4@bclennox.com> References: <9D1C39ED-1456-4365-ADE1-FA192CC2E80E@bclennox.com> <748ff3ff0902100622m465fe638sf65b000c5d3eeb79@mail.gmail.com> <6E5B85E3-0BBA-439D-B513-FFE2EE0187F4@bclennox.com> Message-ID: <4992F7AC.9040104@lojic.com> Brandan Lennox wrote, On 2/11/09 10:28 AM: > Interesting. Never knew about composed_of. I'll have to look into it. I *think* you can't modify the sub attributes individually though, but maybe that has changed. Your idea of a module for the functionality and allowing duplication of fields/columns has much merit. > Thanks everyone for all the help. > > Brandan L. > -- brandan at bclennox.com > http://www.bclennox.com > +1 (919) 274.7565 > > > > > > > On Feb 10, 2009, at 11:24 AM, Rick DeNatale wrote: > >> On Tue, Feb 10, 2009 at 11:06 AM, Brandan Lennox >> wrote: >> We have at least 5 models that reference addresses, possibly more in >> the future, so I was trying to keep from duplicating address fields >> all over the various other models. I was also trying to use the >> Address model for helper-ish methods like address.to_s, but now that I >> think about it, I could probably stick those in a module and mixin to >> the appropriate models. >> >> You might also consider making the addresses aggregate attributes >> using composed_of >> >> >> -- >> Rick DeNatale >> >> Blog: http://talklikeaduck.denhaven2.com/ >> Twitter: http://twitter.com/RickDeNatale >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > ------------------------------------------------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ 919-946-7547 (mobile) From jareds.lists at gmail.com Wed Feb 11 16:32:34 2009 From: jareds.lists at gmail.com (Jared) Date: Wed, 11 Feb 2009 16:32:34 -0500 Subject: [raleigh.rb] RubyRX: Send five locally, and get five free passes to the DC RubyRX in September Message-ID: <0DD45DA5-022E-417E-B8ED-581596603824@gmail.com> Hi all, We're offering a special to our local teams... if you send your team to Ruby RX here in Raleigh, you'll get free passes to the Ruby RX show in DC. It'll be this September 4th and 5th. Btw, we've had to switch up the local schedule a bit. We've dropped to two tracks instead of three. We also thought we'd have to switch the venue, but we're back at the Marriott. No more drama, we promise. :) The speaker list now includes Glenn Vanderburg, Chad Fowler, Yehuda Katz, Carl Lerche, Neal Ford, Kevin Smith, Nathaniel Talbott, Stuart Halloway, David Bock, Matthew Bass, and Rick DeNatale. Let me now if you've got any questions! Jared http://NFJSOne.com http://AgileArtisans.com From lawwton at gmail.com Thu Feb 12 10:48:21 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Thu, 12 Feb 2009 10:48:21 -0500 Subject: [raleigh.rb] Association Question - Rails Message-ID: <5fe6fa8f0902120748s1b8470a8m1c7921e7417b6617@mail.gmail.com> Hello All: So I have another question regarding associations. This one is very closely related to a question I had a few days ago. I'll try to describe it here the best I can. I have the following tables. Please note that I am only mentioning the relevant fields. users -------- id firstname roles -------- id name roles_users ----------------- user_id role_id tickets ---------- id ticket_number ticket_status_id tickets_users -------------------- ticket_id user_id ticket_statuses ---------------------- id The issue I currently have that is creating all sorts of problems for me is the following. I would like to list all the tickets with their associated owners(users). As you can see from the tables above, a ticket habtm users. What I end up with now using a sql query is a list of tickets but with multiple rows for the same ticket since I could have multiple users or owners for that record. So I end up with: (fake table below, just used as an example) --------------------------------------------- ticket id | description | owner --------------------------------------------- 1 foo Alfredo 1 foo RaleighUser I could try to get a list of tickets, then iterate over those and find out the users assigned to that specific ticket, concatenate them, etc... and format the data. That's fine, most of the time. However when I try to do pagination, dynamically filter by other ticket properties such as status, ticket number etc... things get very ugly very quickly. So what I am looking for is the correct approach on how to handle all these tables using the associations I've already created and end up with a query that allows me to add conditions to it so I can do filtering in a nice clean way. I appreciate any help, guidance regarding this. I apologize for the long email. Regards, Alfredo From lawwton at gmail.com Thu Feb 12 11:42:49 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Thu, 12 Feb 2009 11:42:49 -0500 Subject: [raleigh.rb] Association Question - Rails In-Reply-To: <5fe6fa8f0902120748s1b8470a8m1c7921e7417b6617@mail.gmail.com> References: <5fe6fa8f0902120748s1b8470a8m1c7921e7417b6617@mail.gmail.com> Message-ID: <5fe6fa8f0902120842g3a665f05y6f1111cfe399748@mail.gmail.com> Ok, so I am very close I think to getting this to work. I currently have: tickets = Ticket.find( :all, :include => [:users, :pvr_status, :priority] ) In there I can have the :conditions clause allowing me to dynamically filter properties with a limit at the end for pagination. One last thing to put it all together, how can I also add the roles into the mix? Thanks in advance, Alfredo On Thu, Feb 12, 2009 at 10:48 AM, Alfredo Quiroga-Villamil wrote: > Hello All: > > So I have another question regarding associations. This one is very > closely related to a question I had a few days ago. I'll try to > describe it here the best I can. > > I have the following tables. Please note that I am only mentioning the > relevant fields. > > users > -------- > id > firstname > > roles > -------- > id > name > > roles_users > ----------------- > user_id > role_id > > tickets > ---------- > id > ticket_number > ticket_status_id > > > tickets_users > -------------------- > ticket_id > user_id > > ticket_statuses > ---------------------- > id > > The issue I currently have that is creating all sorts of problems for > me is the following. I would like to list all the tickets with their > associated owners(users). As you can see from the tables above, a > ticket habtm users. What I end up with now using a sql query is a list > of tickets but with multiple rows for the same ticket since I could > have multiple users or owners for that record. > > So I end up with: (fake table below, just used as an example) > > --------------------------------------------- > ticket id | description | owner > --------------------------------------------- > 1 foo Alfredo > 1 foo RaleighUser > > I could try to get a list of tickets, then iterate over those and find > out the users assigned to that specific ticket, concatenate them, > etc... and format the data. That's fine, most of the time. However > when I try to do pagination, dynamically filter by other ticket > properties such as status, ticket number etc... things get very ugly > very quickly. > > So what I am looking for is the correct approach on how to handle all > these tables using the associations I've already created and end up > with a query that allows me to add conditions to it so I can do > filtering in a nice clean way. > > I appreciate any help, guidance regarding this. I apologize for the long email. > > Regards, > > Alfredo > From mark.bennett.mail at gmail.com Thu Feb 12 13:00:36 2009 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Thu, 12 Feb 2009 13:00:36 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> Message-ID: Alfredo, >From my previous post ... On Tue, Feb 3, 2009 at 1:39 PM, Mark Bennett wrote: > You could pull back the user objects with all the tickets attached. > > User.find :include => {:tickets, roles } :conditions => "roles.name = > 'analyst'" > > for: > > Bob > -ticket 1 > -ticket 3 > Jim > -ticket 2 > -ticket 4 > > I'm not sure what order you are trying to preserve. > > Mark > > > > On Tue, Feb 3, 2009 at 12:20 PM, Alfredo Quiroga-Villamil < > lawwton at gmail.com> wrote: > >> All: >> >> I am trying to create a query using rails and I am not quite sure how >> to do it. I could get this done using plane old sql with no problem >> and was even planning on doing that until I ran into a little issue >> with find_by_sql. It seems that this does not preserve order. >> >> What I need using Rails Active Record is the following: >> >> I have a series of tables as follows: >> >> tickets users >> >> tables here: >> >> tickets >> tickets_users >> users >> >> I also have: >> >> users roles >> >> tables here: >> >> users >> roles_users >> roles >> >> What I need is a query where I can filter by roles. Essentially saying >> ... give me all the tickets for users whose role is 'foo'. >> >> Thanks in advance, >> >> Alfredo >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lawwton at gmail.com Thu Feb 12 13:18:00 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Thu, 12 Feb 2009 13:18:00 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> Message-ID: <5fe6fa8f0902121018t57b1654evf57e6cc8735ae8e3@mail.gmail.com> Thanks Mark, appreciate it. I need to list based on tickets and most of the filtering will be for ticket items. I think I've managed to get what I wanted by having this. tickets = Ticket.find( :all, :include => [:users, :ticket_status, :priority], :joins => "LEFT OUTER JOIN roles_users on roles_users.user_id = users.id LEFT OUTER JOIN roles on roles.id = roles_users.role_id", :conditions => " roles.name in ('analyst')" ) I think this way I can add conditions dynamically in a nice clean way, at the same time I can also handle pagination by throwing the offsets and limit in there. Please let me know what you think or if that query could be improved, changed, see a problem with it, etc... Thanks a bunch for the help. Alfredo On Thu, Feb 12, 2009 at 1:00 PM, Mark Bennett wrote: > Alfredo, > > From my previous post ... > > On Tue, Feb 3, 2009 at 1:39 PM, Mark Bennett wrote: > >> You could pull back the user objects with all the tickets attached. >> >> User.find :include => {:tickets, roles } :conditions => "roles.name = >> 'analyst'" >> >> for: >> >> Bob >> -ticket 1 >> -ticket 3 >> Jim >> -ticket 2 >> -ticket 4 >> >> I'm not sure what order you are trying to preserve. >> >> Mark >> >> >> >> On Tue, Feb 3, 2009 at 12:20 PM, Alfredo Quiroga-Villamil < >> lawwton at gmail.com> wrote: >> >>> All: >>> >>> I am trying to create a query using rails and I am not quite sure how >>> to do it. I could get this done using plane old sql with no problem >>> and was even planning on doing that until I ran into a little issue >>> with find_by_sql. It seems that this does not preserve order. >>> >>> What I need using Rails Active Record is the following: >>> >>> I have a series of tables as follows: >>> >>> tickets users >>> >>> tables here: >>> >>> tickets >>> tickets_users >>> users >>> >>> I also have: >>> >>> users roles >>> >>> tables here: >>> >>> users >>> roles_users >>> roles >>> >>> What I need is a query where I can filter by roles. Essentially saying >>> ... give me all the tickets for users whose role is 'foo'. >>> >>> Thanks in advance, >>> >>> Alfredo >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >> >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.denatale at gmail.com Thu Feb 12 15:23:15 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Thu, 12 Feb 2009 15:23:15 -0500 Subject: [raleigh.rb] Association Question - Rails In-Reply-To: <5fe6fa8f0902120842g3a665f05y6f1111cfe399748@mail.gmail.com> References: <5fe6fa8f0902120748s1b8470a8m1c7921e7417b6617@mail.gmail.com> <5fe6fa8f0902120842g3a665f05y6f1111cfe399748@mail.gmail.com> Message-ID: On Thu, Feb 12, 2009 at 11:42 AM, Alfredo Quiroga-Villamil < lawwton at gmail.com> wrote: > Ok, so I am very close I think to getting this to work. I currently have: > > tickets = Ticket.find( :all, :include => [:users, :pvr_status, :priority] ) > > In there I can have the :conditions clause allowing me to dynamically > filter properties with a limit at the end for pagination. One last > thing to put it all together, how can I also add the roles into the > mix? you can use hashes or nested hashes in :include to eager load deeper associations. tickets = Ticket.find(:all, :include => [{:users => :roles} , :pvr_status, :priority] -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.denatale at gmail.com Thu Feb 12 15:44:40 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Thu, 12 Feb 2009 15:44:40 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: <5fe6fa8f0902121018t57b1654evf57e6cc8735ae8e3@mail.gmail.com> References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> <5fe6fa8f0902121018t57b1654evf57e6cc8735ae8e3@mail.gmail.com> Message-ID: On Thu, Feb 12, 2009 at 1:18 PM, Alfredo Quiroga-Villamil wrote: > Thanks Mark, appreciate it. I need to list based on tickets and most of the > filtering will be for ticket items. I think I've managed to get what I > wanted by having this. > > tickets = Ticket.find( > :all, > :include => [:users, :ticket_status, :priority], > :joins => "LEFT OUTER JOIN roles_users on roles_users.user_id = > users.id LEFT OUTER JOIN roles on > roles.id = roles_users.role_id", :conditions => " > roles.name in ('analyst')" > ) > > I don't think you need the joins clause, :include will generate the right join for you. tickets = Ticket.find(:all, :include => [{:users => :roles}, :ticket_status, :priority], :conditions => "roles.name in ("analyst")" ) alternatively if you don't really need to instantiate the users, roles, etc and only want the other table(s) joined to participate in the where clause generated by conditions, you can use the same syntax in the :joins parameter tickets = Ticket.find(:all, :join => {:users => :roles}, :conditions => "roles.name in ("analyst")" ) -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From lawwton at gmail.com Thu Feb 12 16:02:37 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Thu, 12 Feb 2009 16:02:37 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> <5fe6fa8f0902121018t57b1654evf57e6cc8735ae8e3@mail.gmail.com> Message-ID: <5fe6fa8f0902121302v59a986f5i6467cbe6bd10f477@mail.gmail.com> Very very cool, and very logical too. In fact I tried to achieve something like that but with the wrong syntax. I am very happy to see that there is way to simplify it even more, making the code more readable. {:users => :roles} (That right there is really cool.) in conjunction with the include statement. Appreciate all the help guys. Alfredo On Thu, Feb 12, 2009 at 3:44 PM, Rick DeNatale wrote: > On Thu, Feb 12, 2009 at 1:18 PM, Alfredo Quiroga-Villamil < > lawwton at gmail.com> wrote: > >> Thanks Mark, appreciate it. I need to list based on tickets and most of >> the filtering will be for ticket items. I think I've managed to get what I >> wanted by having this. >> >> tickets = Ticket.find( >> :all, >> :include => [:users, :ticket_status, :priority], >> :joins => "LEFT OUTER JOIN roles_users on roles_users.user_id = >> users.id LEFT OUTER JOIN roles on >> roles.id = roles_users.role_id", :conditions => " >> roles.name in ('analyst')" >> ) >> >> > I don't think you need the joins clause, :include will generate the right > join for you. > > > tickets = Ticket.find(:all, > :include => [{:users => :roles}, > :ticket_status, :priority], > :conditions => "roles.name in ("analyst")" > ) > > alternatively if you don't really need to instantiate the users, roles, etc > and only want the other table(s) joined to participate in the where clause > generated by conditions, you can use the same syntax in the :joins parameter > > tickets = Ticket.find(:all, > :join => {:users => :roles}, > :conditions => "roles.name in ("analyst")" > ) > > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Twitter: http://twitter.com/RickDeNatale > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at jimvanfleet.com Fri Feb 13 07:49:48 2009 From: jim at jimvanfleet.com (Jim Van Fleet) Date: Fri, 13 Feb 2009 07:49:48 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: <5fe6fa8f0902121302v59a986f5i6467cbe6bd10f477@mail.gmail.com> References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> <5fe6fa8f0902121018t57b1654evf57e6cc8735ae8e3@mail.gmail.com> <5fe6fa8f0902121302v59a986f5i6467cbe6bd10f477@mail.gmail.com> Message-ID: As one final note, my own recommendation (perhaps after you come up with something that works, and are ready for a new milestone) is to investigate turning this kind of finder either into a named scope entirely or part of its components into a named scope. I have found those scopes extremely powerful tools to expose expressiveness and power at minimal to low costs-- both development time cost and performance cost. Cheers, Jim On Thu, Feb 12, 2009 at 4:02 PM, Alfredo Quiroga-Villamil wrote: > Very very cool, and very logical too. In fact I tried to achieve something > like that but with the wrong syntax. I am very happy to see that there is > way to simplify it even more, making the code more readable. > > {:users => :roles} (That right there is really cool.) in conjunction with > the include statement. > > Appreciate all the help guys. > > Alfredo > > On Thu, Feb 12, 2009 at 3:44 PM, Rick DeNatale wrote: > >> On Thu, Feb 12, 2009 at 1:18 PM, Alfredo Quiroga-Villamil < >> lawwton at gmail.com> wrote: >> >>> Thanks Mark, appreciate it. I need to list based on tickets and most of >>> the filtering will be for ticket items. I think I've managed to get what I >>> wanted by having this. >>> >>> tickets = Ticket.find( >>> :all, >>> :include => [:users, :ticket_status, :priority], >>> :joins => "LEFT OUTER JOIN roles_users on roles_users.user_id = >>> users.id LEFT OUTER JOIN roles on >>> roles.id = roles_users.role_id", :conditions => " >>> roles.name in ('analyst')" >>> ) >>> >>> >> I don't think you need the joins clause, :include will generate the right >> join for you. >> >> >> tickets = Ticket.find(:all, >> :include => [{:users => :roles}, >> :ticket_status, :priority], >> :conditions => "roles.name in ("analyst")" >> ) >> >> alternatively if you don't really need to instantiate the users, roles, >> etc and only want the other table(s) joined to participate in the where >> clause generated by conditions, you can use the same syntax in the :joins >> parameter >> >> tickets = Ticket.find(:all, >> :join => {:users => :roles}, >> :conditions => "roles.name in ("analyst")" >> ) >> >> >> -- >> Rick DeNatale >> >> Blog: http://talklikeaduck.denhaven2.com/ >> Twitter: http://twitter.com/RickDeNatale >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lawwton at gmail.com Fri Feb 13 08:20:34 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Fri, 13 Feb 2009 08:20:34 -0500 Subject: [raleigh.rb] Find Query - Associations Help In-Reply-To: References: <5fe6fa8f0902030920o2be34fbbs41e111cf013d86ea@mail.gmail.com> <5fe6fa8f0902121018t57b1654evf57e6cc8735ae8e3@mail.gmail.com> <5fe6fa8f0902121302v59a986f5i6467cbe6bd10f477@mail.gmail.com> Message-ID: <5fe6fa8f0902130520m78a28e39v83f26724f24ce3c5@mail.gmail.com> Thank you Jim, will def. look into it. Appreciate it. Alfredo On Fri, Feb 13, 2009 at 7:49 AM, Jim Van Fleet wrote: > As one final note, my own recommendation (perhaps after you come up with > something that works, and are ready for a new milestone) is to investigate > turning this kind of finder either into a named scope entirely or part of > its components into a named scope. I have found those scopes extremely > powerful tools to expose expressiveness and power at minimal to low costs-- > both development time cost and performance cost. > > Cheers, > > Jim > > > On Thu, Feb 12, 2009 at 4:02 PM, Alfredo Quiroga-Villamil < > lawwton at gmail.com> wrote: > >> Very very cool, and very logical too. In fact I tried to achieve something >> like that but with the wrong syntax. I am very happy to see that there is >> way to simplify it even more, making the code more readable. >> >> {:users => :roles} (That right there is really cool.) in conjunction with >> the include statement. >> >> Appreciate all the help guys. >> >> Alfredo >> >> On Thu, Feb 12, 2009 at 3:44 PM, Rick DeNatale wrote: >> >>> On Thu, Feb 12, 2009 at 1:18 PM, Alfredo Quiroga-Villamil < >>> lawwton at gmail.com> wrote: >>> >>>> Thanks Mark, appreciate it. I need to list based on tickets and most of >>>> the filtering will be for ticket items. I think I've managed to get what I >>>> wanted by having this. >>>> >>>> tickets = Ticket.find( >>>> :all, >>>> :include => [:users, :ticket_status, :priority], >>>> :joins => "LEFT OUTER JOIN roles_users on roles_users.user_id = >>>> users.id LEFT OUTER JOIN roles on >>>> roles.id = roles_users.role_id", :conditions => " >>>> roles.name in ('analyst')" >>>> ) >>>> >>>> >>> I don't think you need the joins clause, :include will generate the right >>> join for you. >>> >>> >>> tickets = Ticket.find(:all, >>> :include => [{:users => :roles}, >>> :ticket_status, :priority], >>> :conditions => "roles.name in ("analyst")" >>> ) >>> >>> alternatively if you don't really need to instantiate the users, roles, >>> etc and only want the other table(s) joined to participate in the where >>> clause generated by conditions, you can use the same syntax in the :joins >>> parameter >>> >>> tickets = Ticket.find(:all, >>> :join => {:users => :roles}, >>> :conditions => "roles.name in ("analyst")" >>> ) >>> >>> >>> -- >>> Rick DeNatale >>> >>> Blog: http://talklikeaduck.denhaven2.com/ >>> Twitter: http://twitter.com/RickDeNatale >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lawwton at gmail.com Fri Feb 13 14:50:51 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Fri, 13 Feb 2009 14:50:51 -0500 Subject: [raleigh.rb] Association Question - Rails In-Reply-To: <5fe6fa8f0902130430p35507dafi4a3470cfc97a330d@mail.gmail.com> References: <5fe6fa8f0902120748s1b8470a8m1c7921e7417b6617@mail.gmail.com> <5fe6fa8f0902120842g3a665f05y6f1111cfe399748@mail.gmail.com> <5fe6fa8f0902130430p35507dafi4a3470cfc97a330d@mail.gmail.com> Message-ID: <5fe6fa8f0902131150l405a7cedm14f9aa87021bac4e@mail.gmail.com> So here we go again, with another question. Btw, I hope it's not a problem asking so many questions, I usually try to exhaust all my options before I ask for help here. So this time I would like to group by the ticket status, hence allowing me to see a total count for the different types. I have been trying to do this with: tickets = Ticket.find( :all, :select => "ticket_statuses.name, count(ticket_statuses.name)", :include => [ {:users => :roles}, :ticket_status], :conditions => "roles.name in ('foo')", :group => "ticket_statuses.name" ) The weird thing here is that my select is completely being ignored. I could even put something else in there if I wanted to and it wouldn't even complaint. It's simply bypassing it and not generating the correct query. Select with no associations though works just fine. I am sure I am missing something, just not sure what it is at this point or where the issue is. Any guidance/help is really appreciated. Regards, Alfredo On Fri, Feb 13, 2009 at 7:30 AM, Alfredo Quiroga-Villamil wrote: > Thanks, really appreciate it. > > On Thu, Feb 12, 2009 at 3:23 PM, Rick DeNatale wrote: > >> >> >> On Thu, Feb 12, 2009 at 11:42 AM, Alfredo Quiroga-Villamil < >> lawwton at gmail.com> wrote: >> >>> Ok, so I am very close I think to getting this to work. I currently have: >>> >>> tickets = Ticket.find( :all, :include => [:users, :pvr_status, :priority] >>> ) >>> >>> In there I can have the :conditions clause allowing me to dynamically >>> filter properties with a limit at the end for pagination. One last >>> thing to put it all together, how can I also add the roles into the >>> mix? >> >> >> you can use hashes or nested hashes in :include to eager load deeper >> associations. >> >> tickets = Ticket.find(:all, :include => [{:users => :roles} , :pvr_status, >> :priority] >> >> -- >> Rick DeNatale >> >> Blog: http://talklikeaduck.denhaven2.com/ >> Twitter: http://twitter.com/RickDeNatale >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lawwton at gmail.com Fri Feb 13 16:34:55 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Fri, 13 Feb 2009 16:34:55 -0500 Subject: [raleigh.rb] Association Question - Rails In-Reply-To: <5fe6fa8f0902131150l405a7cedm14f9aa87021bac4e@mail.gmail.com> References: <5fe6fa8f0902120748s1b8470a8m1c7921e7417b6617@mail.gmail.com> <5fe6fa8f0902120842g3a665f05y6f1111cfe399748@mail.gmail.com> <5fe6fa8f0902130430p35507dafi4a3470cfc97a330d@mail.gmail.com> <5fe6fa8f0902131150l405a7cedm14f9aa87021bac4e@mail.gmail.com> Message-ID: <5fe6fa8f0902131334x5af6dae3j9f71ec706180dcc3@mail.gmail.com> I think I found the answer in slide 14 of this presentation. http://www.slideshare.net/RowanHick/how-to-avoid-hanging-yourself-with-rails Ummm, that is interesting, so in this case, there is just no way to accomplish a group by with a count using active record using a :select? Query from my previous email: tickets = Ticket.find( :all, :select => "ticket_statuses.name, count(ticket_statuses.name)", :include => [ {:users => :roles}, :ticket_status], :conditions => "roles.name in ('foo')", :group => "ticket_statuses.name" ) Is there a solution, work around for this? Thanks, Alfredo On Fri, Feb 13, 2009 at 2:50 PM, Alfredo Quiroga-Villamil wrote: > So here we go again, with another question. Btw, I hope it's not a problem > asking so many questions, I usually try to exhaust all my options before I > ask for help here. > So this time I would like to group by the ticket status, hence allowing me > to see a total count for the different types. > > I have been trying to do this with: > > tickets = Ticket.find( > :all, > :select => "ticket_statuses.name, count(ticket_statuses.name)", > :include => [ {:users => :roles}, :ticket_status], > :conditions => "roles.name in ('foo')", > :group => "ticket_statuses.name" > ) > > The weird thing here is that my select is completely being ignored. I could > even put something else in there if I wanted to and it wouldn't even > complaint. It's simply bypassing it and not generating the correct query. > Select with no associations though works just fine. > > I am sure I am missing something, just not sure what it is at this point or > where the issue is. > > Any guidance/help is really appreciated. > > Regards, > > Alfredo > > > On Fri, Feb 13, 2009 at 7:30 AM, Alfredo Quiroga-Villamil < > lawwton at gmail.com> wrote: > >> Thanks, really appreciate it. >> >> On Thu, Feb 12, 2009 at 3:23 PM, Rick DeNatale wrote: >> >>> >>> >>> On Thu, Feb 12, 2009 at 11:42 AM, Alfredo Quiroga-Villamil < >>> lawwton at gmail.com> wrote: >>> >>>> Ok, so I am very close I think to getting this to work. I currently >>>> have: >>>> >>>> tickets = Ticket.find( :all, :include => [:users, :pvr_status, >>>> :priority] ) >>>> >>>> In there I can have the :conditions clause allowing me to dynamically >>>> filter properties with a limit at the end for pagination. One last >>>> thing to put it all together, how can I also add the roles into the >>>> mix? >>> >>> >>> you can use hashes or nested hashes in :include to eager load deeper >>> associations. >>> >>> tickets = Ticket.find(:all, :include => [{:users => :roles} , >>> :pvr_status, :priority] >>> >>> -- >>> Rick DeNatale >>> >>> Blog: http://talklikeaduck.denhaven2.com/ >>> Twitter: http://twitter.com/RickDeNatale >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lawwton at gmail.com Fri Feb 13 17:32:19 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Fri, 13 Feb 2009 17:32:19 -0500 Subject: [raleigh.rb] Association Question - Rails In-Reply-To: <5fe6fa8f0902131334x5af6dae3j9f71ec706180dcc3@mail.gmail.com> References: <5fe6fa8f0902120748s1b8470a8m1c7921e7417b6617@mail.gmail.com> <5fe6fa8f0902120842g3a665f05y6f1111cfe399748@mail.gmail.com> <5fe6fa8f0902130430p35507dafi4a3470cfc97a330d@mail.gmail.com> <5fe6fa8f0902131150l405a7cedm14f9aa87021bac4e@mail.gmail.com> <5fe6fa8f0902131334x5af6dae3j9f71ec706180dcc3@mail.gmail.com> Message-ID: <5fe6fa8f0902131432x4b35eef0ga486eba4ff43b62f@mail.gmail.com> I knew there had to be a way to do this. This seems to generate the query I wanted. tickets = Ticket.count( "ticket_status.name", :include => [ {:users => :roles}, :ticket_status ], :conditions => "roles.name in ('foo', 'bar')", :group => "ticket_statuses.name" ) Regards, Alfredo On Fri, Feb 13, 2009 at 4:34 PM, Alfredo Quiroga-Villamil wrote: > I think I found the answer in slide 14 of this presentation. > > http://www.slideshare.net/RowanHick/how-to-avoid-hanging-yourself-with-rails > > Ummm, that is interesting, so in this case, there is just no way to > accomplish a group by with a count using active record using a :select? > > Query from my previous email: > > tickets = Ticket.find( > :all, > :select => "ticket_statuses.name, count(ticket_statuses.name)", > :include => [ {:users => :roles}, :ticket_status], > :conditions => "roles.name in ('foo')", > :group => "ticket_statuses.name" > ) > > Is there a solution, work around for this? > > Thanks, > > Alfredo > > > On Fri, Feb 13, 2009 at 2:50 PM, Alfredo Quiroga-Villamil < > lawwton at gmail.com> wrote: > >> So here we go again, with another question. Btw, I hope it's not a problem >> asking so many questions, I usually try to exhaust all my options before I >> ask for help here. >> So this time I would like to group by the ticket status, hence allowing me >> to see a total count for the different types. >> >> I have been trying to do this with: >> >> tickets = Ticket.find( >> :all, >> :select => "ticket_statuses.name, count(ticket_statuses.name)", >> :include => [ {:users => :roles}, :ticket_status], >> :conditions => "roles.name in ('foo')", >> :group => "ticket_statuses.name" >> ) >> >> The weird thing here is that my select is completely being ignored. I >> could even put something else in there if I wanted to and it wouldn't even >> complaint. It's simply bypassing it and not generating the correct query. >> Select with no associations though works just fine. >> >> I am sure I am missing something, just not sure what it is at this point >> or where the issue is. >> >> Any guidance/help is really appreciated. >> >> Regards, >> >> Alfredo >> >> >> On Fri, Feb 13, 2009 at 7:30 AM, Alfredo Quiroga-Villamil < >> lawwton at gmail.com> wrote: >> >>> Thanks, really appreciate it. >>> >>> On Thu, Feb 12, 2009 at 3:23 PM, Rick DeNatale wrote: >>> >>>> >>>> >>>> On Thu, Feb 12, 2009 at 11:42 AM, Alfredo Quiroga-Villamil < >>>> lawwton at gmail.com> wrote: >>>> >>>>> Ok, so I am very close I think to getting this to work. I currently >>>>> have: >>>>> >>>>> tickets = Ticket.find( :all, :include => [:users, :pvr_status, >>>>> :priority] ) >>>>> >>>>> In there I can have the :conditions clause allowing me to dynamically >>>>> filter properties with a limit at the end for pagination. One last >>>>> thing to put it all together, how can I also add the roles into the >>>>> mix? >>>> >>>> >>>> you can use hashes or nested hashes in :include to eager load deeper >>>> associations. >>>> >>>> tickets = Ticket.find(:all, :include => [{:users => :roles} , >>>> :pvr_status, :priority] >>>> >>>> -- >>>> Rick DeNatale >>>> >>>> Blog: http://talklikeaduck.denhaven2.com/ >>>> Twitter: http://twitter.com/RickDeNatale >>>> >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at carrborocoworking.com Mon Feb 16 13:02:14 2009 From: brian at carrborocoworking.com (Brian Russell - CCC) Date: Mon, 16 Feb 2009 13:02:14 -0500 Subject: [raleigh.rb] Get Paid to Teach Ruby In-Reply-To: References: Message-ID: <4999AA26.9060101@carrborocoworking.com> There are lots of people who could use a more in-depth understanding of Ruby. So if your a Ruby pro, can develop a training outline, and like to help others learn please contact me. Lets get together and develop a paid training that will take people to the next level. We recently held a training called Hands-On Erlang taught by Kevin Smith. It went really well. I'd like to reproduce this success with Ruby, Rails, SCRUM, Agile Dev, etc. Thanks! -Brian Carrboro Creative Coworking 205 Lloyd Street, Suite 101 Carrboro, NC 27510 (919) 442-5300 http://www.carrborocoworking.com/contact From nathaniel at talbott.ws Tue Feb 17 11:42:13 2009 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Tue, 17 Feb 2009 11:42:13 -0500 Subject: [raleigh.rb] Pre-Meeting Chow Message-ID: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> As usual, anyone who's available is invited to join us at 5:30 tonight at Baja Burrito (http://tinyurl.com/2o2luk) to grab dinner and some Ruby chatter before heading over to Red Hat for the meeting. Looking forward to it, -- Nathaniel Talbott <:((>< From aaron at aaronbedra.com Tue Feb 17 11:48:06 2009 From: aaron at aaronbedra.com (Aaron Bedra) Date: Tue, 17 Feb 2009 11:48:06 -0500 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> References: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> Message-ID: <08BA0B7B-A425-4F84-B44E-244773AEDED8@aaronbedra.com> I'll be there On Feb 17, 2009, at 11:42 AM, Nathaniel Talbott wrote: > As usual, anyone who's available is invited to join us at 5:30 tonight > at Baja Burrito (http://tinyurl.com/2o2luk) to grab dinner and some > Ruby chatter before heading over to Red Hat for the meeting. > > Looking forward to it, > > > -- > Nathaniel Talbott > <:((>< > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.bennett.mail at gmail.com Tue Feb 17 11:53:32 2009 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Tue, 17 Feb 2009 11:53:32 -0500 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> References: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> Message-ID: Yup. On Tue, Feb 17, 2009 at 11:42 AM, Nathaniel Talbott wrote: > As usual, anyone who's available is invited to join us at 5:30 tonight > at Baja Burrito (http://tinyurl.com/2o2luk) to grab dinner and some > Ruby chatter before heading over to Red Hat for the meeting. > > Looking forward to it, > > > -- > Nathaniel Talbott > <:((>< > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at 37signals.com Tue Feb 17 11:54:13 2009 From: mark at 37signals.com (Mark Imbriaco) Date: Tue, 17 Feb 2009 11:54:13 -0500 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> References: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> Message-ID: <89075701-AF61-46C3-85D1-5D3CDFD3E794@37signals.com> Mmm, burritos. Count. Me. In. On Feb 17, 2009, at 11:42 AM, Nathaniel Talbott wrote: > As usual, anyone who's available is invited to join us at 5:30 tonight > at Baja Burrito (http://tinyurl.com/2o2luk) to grab dinner and some > Ruby chatter before heading over to Red Hat for the meeting. > > Looking forward to it, > > > -- > Nathaniel Talbott > <:((>< > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2419 bytes Desc: not available URL: From mike at hales.ws Tue Feb 17 13:21:32 2009 From: mike at hales.ws (Michael Hale) Date: Tue, 17 Feb 2009 13:21:32 -0500 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> References: <4ce336a20902170842p29152acbwde33a8ebd425202@mail.gmail.com> Message-ID: <60190a730902171021qb863090s88e0f37487a2b025@mail.gmail.com> In. On Tue, Feb 17, 2009 at 11:42 AM, Nathaniel Talbott wrote: > As usual, anyone who's available is invited to join us at 5:30 tonight > at Baja Burrito (http://tinyurl.com/2o2luk) to grab dinner and some > Ruby chatter before heading over to Red Hat for the meeting. > > Looking forward to it, > > > -- > Nathaniel Talbott > <:((>< > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Michael Hale mikehale at gmail.com m: 919.961.7171 jabber: mikehale at gmail.com skype: mhale2243 From pelargir at gmail.com Tue Feb 17 14:15:01 2009 From: pelargir at gmail.com (Matthew Bass) Date: Tue, 17 Feb 2009 14:15:01 -0500 Subject: [raleigh.rb] Recording the meeting tonight Message-ID: Is anyone available to record the meeting tonight for the podcast? I'm sick and can't make it. I can provide instructions on what to do. Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From mshiltonj at gmail.com Tue Feb 17 14:34:03 2009 From: mshiltonj at gmail.com (Steven Hilton) Date: Tue, 17 Feb 2009 14:34:03 -0500 Subject: [raleigh.rb] File upload progress bar? Message-ID: <8308260d0902171134y35e8a9adwb4821292fcf4b23b@mail.gmail.com> On occasion, our users will need to upload large files. We'd like a progress bar to show the current status of the upload. Googling shows me: http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html And mentions: http://mongrel.rubyforge.org/wiki/UploadProgress and this, while referenced frequently, is 404ing: http://sean.treadway.info/articles/2005/07/18/upload-progress-checklist Any thoughts or suggestions? Am I missing something obvious? We're running mongrel, so the UploadProgress plugin seems the first choice for investigation. -- Steven Hilton From mriffe at gmail.com Tue Feb 17 14:57:19 2009 From: mriffe at gmail.com (Mel Riffe) Date: Tue, 17 Feb 2009 14:57:19 -0500 Subject: [raleigh.rb] Recording the meeting tonight In-Reply-To: References: Message-ID: <43362a720902171157t5f5f529j91332b00ca189955@mail.gmail.com> Hey Matthew, I'm interested in learning so I can apply it to the CVREG Meetings. Cheers, Mel On Tue, Feb 17, 2009 at 2:15 PM, Matthew Bass wrote: > Is anyone available to record the meeting tonight for the podcast? I'm sick > and can't make it. > I can provide instructions on what to do. > > Matthew > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From korebantic at gmail.com Tue Feb 17 15:12:37 2009 From: korebantic at gmail.com (korebantic) Date: Tue, 17 Feb 2009 15:12:37 -0500 Subject: [raleigh.rb] Recording the meeting tonight In-Reply-To: References: Message-ID: <16e20a2b0902171212y5efd74e7n9f03777b93ae2b85@mail.gmail.com> That would be great. I'm not going to be able to make it but would appreciate being able to hear the audio. On Tue, Feb 17, 2009 at 2:15 PM, Matthew Bass wrote: > Is anyone available to record the meeting tonight for the podcast? I'm sick > and can't make it. > I can provide instructions on what to do. > > Matthew > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From mshiltonj at gmail.com Tue Feb 17 15:40:46 2009 From: mshiltonj at gmail.com (Steven Hilton) Date: Tue, 17 Feb 2009 15:40:46 -0500 Subject: [raleigh.rb] File upload progress bar? In-Reply-To: <8308260d0902171134y35e8a9adwb4821292fcf4b23b@mail.gmail.com> References: <8308260d0902171134y35e8a9adwb4821292fcf4b23b@mail.gmail.com> Message-ID: <8308260d0902171240p31ea3114y1407f50996091938@mail.gmail.com> On Tue, Feb 17, 2009 at 2:34 PM, Steven Hilton wrote: [snip] > Any thoughts or suggestions? Am I missing something obvious? > > We're running mongrel, so the UploadProgress plugin seems the first > choice for investigation. [snip] I didn't realize that drb hadn't been updated in almost 5 years. :-/ -- Steven Hilton From ahwatts at gmail.com Tue Feb 17 16:35:46 2009 From: ahwatts at gmail.com (Andrew Herr Watts) Date: Tue, 17 Feb 2009 16:35:46 -0500 Subject: [raleigh.rb] File upload progress bar? In-Reply-To: <8308260d0902171240p31ea3114y1407f50996091938@mail.gmail.com> References: <8308260d0902171134y35e8a9adwb4821292fcf4b23b@mail.gmail.com> <8308260d0902171240p31ea3114y1407f50996091938@mail.gmail.com> Message-ID: On ReverbNation, we use the upload_progress plugin for most cases: http://agilewebdevelopment.com/plugins/upload_progress It's reasonably easy to set up and use, and doesn't require too much in the way of infrastructure to handle it. It hacks in to CGI#read_multipart and stores the progress data in the user's session. We use FastCGI in production, but I think it works with Mongrel, although it might not be optimal in that case -- it might unnecessarily tie up a Mongrel process while tracking an upload. Andrew Watts ahwatts at gmail.com On Tue, Feb 17, 2009 at 3:40 PM, Steven Hilton wrote: > On Tue, Feb 17, 2009 at 2:34 PM, Steven Hilton wrote: > [snip] >> Any thoughts or suggestions? Am I missing something obvious? >> >> We're running mongrel, so the UploadProgress plugin seems the first >> choice for investigation. > [snip] > > I didn't realize that drb hadn't been updated in almost 5 years. :-/ > > -- > Steven Hilton > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From seancribbs at gmail.com Tue Feb 17 17:43:05 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Tue, 17 Feb 2009 17:43:05 -0500 Subject: [raleigh.rb] File upload progress bar? In-Reply-To: References: <8308260d0902171134y35e8a9adwb4821292fcf4b23b@mail.gmail.com> <8308260d0902171240p31ea3114y1407f50996091938@mail.gmail.com> Message-ID: <499B3D79.5020403@gmail.com> You might also consider SWFUpload, which does progress tracking on the client-side. Sean Andrew Herr Watts wrote: > On ReverbNation, we use the upload_progress plugin for most cases: > > http://agilewebdevelopment.com/plugins/upload_progress > > It's reasonably easy to set up and use, and doesn't require too much > in the way of infrastructure to handle it. It hacks in to > CGI#read_multipart and stores the progress data in the user's session. > We use FastCGI in production, but I think it works with Mongrel, > although it might not be optimal in that case -- it might > unnecessarily tie up a Mongrel process while tracking an upload. > > Andrew Watts > ahwatts at gmail.com > > On Tue, Feb 17, 2009 at 3:40 PM, Steven Hilton wrote: > >> On Tue, Feb 17, 2009 at 2:34 PM, Steven Hilton wrote: >> [snip] >> >>> Any thoughts or suggestions? Am I missing something obvious? >>> >>> We're running mongrel, so the UploadProgress plugin seems the first >>> choice for investigation. >>> >> [snip] >> >> I didn't realize that drb hadn't been updated in almost 5 years. :-/ >> >> -- >> Steven Hilton >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin at hypotheticalabs.com Wed Feb 18 09:06:46 2009 From: kevin at hypotheticalabs.com (Kevin A. Smith) Date: Wed, 18 Feb 2009 09:06:46 -0500 Subject: [raleigh.rb] Accountant Recommendations Message-ID: Can anyone recommend a good small business accountant in the area? Bonus points if they're in North Raleigh :) --Kevin From aaron at aaronbedra.com Wed Feb 18 09:13:20 2009 From: aaron at aaronbedra.com (Aaron Bedra) Date: Wed, 18 Feb 2009 09:13:20 -0500 Subject: [raleigh.rb] Slides from last night's talk Message-ID: Hey Everyone, Here are the slides from last night's talk. Feel free to ask any questions. Cheers, Aaron -------------- next part -------------- A non-text attachment was scrubbed... Name: rails-authentication-solutions.pdf Type: application/pdf Size: 5113862 bytes Desc: not available URL: -------------- next part -------------- From thurisaz at gmail.com Wed Feb 18 09:34:04 2009 From: thurisaz at gmail.com (Rich Davis) Date: Wed, 18 Feb 2009 09:34:04 -0500 Subject: [raleigh.rb] Slides from last night's talk In-Reply-To: References: Message-ID: <53d383650902180634t1e9caaa9k47e616e3b46f0b4b@mail.gmail.com> Thanks so much for the edifying and provocative talk, Aaron! I was just thinking this morning how cool it would be if really big third-party apps that want to consume a project, e.g. Spree, could be isolated and authenticated with a CAS-based authentication service like Castronaut. Now if only said support were as ubiquitous as open id... Rich On Wed, Feb 18, 2009 at 9:13 AM, Aaron Bedra wrote: > Hey Everyone, > > Here are the slides from last night's talk. Feel free to ask any questions. > > Cheers, > > Aaron > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From nwalls at ismedia.org Wed Feb 18 09:28:11 2009 From: nwalls at ismedia.org (Nathan L. Walls) Date: Wed, 18 Feb 2009 09:28:11 -0500 Subject: [raleigh.rb] Accountant Recommendations In-Reply-To: References: Message-ID: <93AE714E-930E-4764-85EA-C98D86C713B7@ismedia.org> I've only met with him in person once, but the gent at Tanas Accounting is who we're doing business with. 7000 Harps Mill Rd, Ste 101 919-848-8582 Nathan On Feb 18, 2009, at 9:06 AM, Kevin A. Smith wrote: > Can anyone recommend a good small business accountant in the area? > Bonus points if they're in North Raleigh :) > > --Kevin > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nospam at tonyspencer.com Wed Feb 18 10:15:57 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Wed, 18 Feb 2009 10:15:57 -0500 Subject: [raleigh.rb] Disable logging of sensitive data Message-ID: <8D9FC2DB-B6C5-4867-BF60-EA5D1A7752D1@tonyspencer.com> We are in the midst of adding some credit card payment features on a project and one of my developers brought up something that hadn't occurred to me and posed a security risk for some projects we already have in production that accept credit cards. By default Rails logs all post data in production but its very easy to disable this from the controller. Just thought I'd pass this to the group in case someone else had overlooked this as I did: http://www.robbyonrails.com/articles/2007/07/16/rails-code-audit-tips-filtered-parameter-logging From javery at infozerk.com Wed Feb 18 11:12:27 2009 From: javery at infozerk.com (James Avery) Date: Wed, 18 Feb 2009 11:12:27 -0500 Subject: [raleigh.rb] Accountant Recommendations In-Reply-To: <93AE714E-930E-4764-85EA-C98D86C713B7@ismedia.org> References: <93AE714E-930E-4764-85EA-C98D86C713B7@ismedia.org> Message-ID: <20af90580902180812s43dff712h507d7569acb74a51@mail.gmail.com> I met with Jeff Roscoe yesterday (from Nathaniel's recommendation) and like him so far. He is in Apex though. -James On Wed, Feb 18, 2009 at 9:28 AM, Nathan L. Walls wrote: > I've only met with him in person once, but the gent at Tanas Accounting is > who we're doing business with. > > 7000 Harps Mill Rd, Ste 101 > 919-848-8582 > > Nathan > > On Feb 18, 2009, at 9:06 AM, Kevin A. Smith wrote: > >> Can anyone recommend a good small business accountant in the area? Bonus >> points if they're in North Raleigh :) >> >> --Kevin >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- James Avery Zerk Media - http://zerkmedia.com Infozerk Inc. - http://www.infozerk.com From jeffm.keating at gmail.com Wed Feb 18 11:29:59 2009 From: jeffm.keating at gmail.com (Jeff Keating) Date: Wed, 18 Feb 2009 11:29:59 -0500 Subject: [raleigh.rb] Disable logging of sensitive data In-Reply-To: <8D9FC2DB-B6C5-4867-BF60-EA5D1A7752D1@tonyspencer.com> References: <8D9FC2DB-B6C5-4867-BF60-EA5D1A7752D1@tonyspencer.com> Message-ID: A thought: In general, if you're thinking about integrating payment card processing, stop and ask yourself if you can outsource this to a vendor with an API and all the necessary storage in place... If you get successful, or make a mistake, the costs of doing it yourself go up tremendously. If it's not your core competency, double-think whether you want to write a line of code at all... There is quite a bit more than worrying about logging sensitive data to consider. If anyone on the list is planning this type of work, feel free to ping me -- I'm just completing a several-month-long PCI DSS compliance project for my current employer... expensive... I'd be happy to share thoughts and stories. -jeff On Wed, Feb 18, 2009 at 10:15 AM, Tony Spencer wrote: > We are in the midst of adding some credit card payment features on a > project and one of my developers brought up something that hadn't occurred > to me and posed a security risk for some projects we already have in > production that accept credit cards. By default Rails logs all post data in > production but its very easy to disable this from the controller. Just > thought I'd pass this to the group in case someone else had overlooked this > as I did: > > > http://www.robbyonrails.com/articles/2007/07/16/rails-code-audit-tips-filtered-parameter-logging > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nospam at tonyspencer.com Wed Feb 18 12:23:26 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Wed, 18 Feb 2009 12:23:26 -0500 Subject: [raleigh.rb] Disable logging of sensitive data In-Reply-To: References: <8D9FC2DB-B6C5-4867-BF60-EA5D1A7752D1@tonyspencer.com> Message-ID: We have 7 years of experience with dealing with integration with payment processor gateways and indeed have learned a lot along the way. We use API's from Authorize.net and TrustCommerce and never store the credit card number on our server. Nonetheless I agree with you. Anyone thinking of taking on payment processing would be wise to consult with someone that has been doing it for some time. There are a lot of risks. On Feb 18, 2009, at 11:29 AM, Jeff Keating wrote: > A thought: > > In general, if you're thinking about integrating payment card > processing, stop and ask yourself if you can outsource this to a > vendor with an API and all the necessary storage in place... If you > get successful, or make a mistake, the costs of doing it yourself go > up tremendously. If it's not your core competency, double-think > whether you want to write a line of code at all... There is quite a > bit more than worrying about logging sensitive data to consider. > > If anyone on the list is planning this type of work, feel free to > ping me -- I'm just completing a several-month-long PCI DSS > compliance project for my current employer... expensive... I'd be > happy to share thoughts and stories. > > -jeff > > On Wed, Feb 18, 2009 at 10:15 AM, Tony Spencer > wrote: > We are in the midst of adding some credit card payment features on a > project and one of my developers brought up something that hadn't > occurred to me and posed a security risk for some projects we > already have in production that accept credit cards. By default > Rails logs all post data in production but its very easy to disable > this from the controller. Just thought I'd pass this to the group > in case someone else had overlooked this as I did: > > http://www.robbyonrails..com/articles/2007/07/16/rails-code-audit- > tips-filtered-parameter-logging > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From kandrews at hirenetworks.com Wed Feb 18 12:23:12 2009 From: kandrews at hirenetworks.com (Kendra Andrews) Date: 18 Feb 2009 12:23:12 -0500 Subject: [raleigh.rb] 3 - 6 week Rails contract Message-ID: <16996669.1234977792750.JavaMail.cfservice@webserver61> I'm looking for a Rails developer for a short-term contract in RTP. The requirements and UI specs are done, client just needs someone to come in and do the work. There isn't another Rails person on site so need to be comfortable jumping in and getting started. Please contact me if interested or if you know anyone who might be. Thanks! Kendra Andrews Recruiting Manager HireNetworks 919-981-6200 x313 888-334-3145 kandrews at hirenetworks.com www.hirenetworks.com Connect with me on LinkedIn: http://www.linkedin.com/in/kendraandrews -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at 37signals.com Wed Feb 18 12:40:52 2009 From: mark at 37signals.com (Mark Imbriaco) Date: Wed, 18 Feb 2009 12:40:52 -0500 Subject: [raleigh.rb] Disable logging of sensitive data In-Reply-To: References: <8D9FC2DB-B6C5-4867-BF60-EA5D1A7752D1@tonyspencer.com> Message-ID: <938DE710-6B82-46AE-851F-E5EB36EA6E9F@37signals.com> As an aside, it's not enough not to store the cards on your servers. If the card data ever passes through your servers on the way to the payment gateway's storage, your servers are required to be PCI compliant. The absolute best solution if you don't want to deal with the nightmare of true PCI compliance (and who really does?) is to use a third party provider who has an offering that allows you to outsource even the capturing of the card number so that your servers never have access to the number, even when it's in transit. An example of this is the Transparent Redirect service from Braintree: http://dev.braintreepaymentsolutions.com/vault/transparent-redirect/ -Mark On Feb 18, 2009, at 12:23 PM, Tony Spencer wrote: > We have 7 years of experience with dealing with integration with > payment processor gateways and indeed have learned a lot along the > way. We use API's from Authorize.net and TrustCommerce and never > store the credit card number on our server. Nonetheless I agree with > you. Anyone thinking of taking on payment processing would be wise > to consult with someone that has been doing it for some time. There > are a lot of risks. > > > On Feb 18, 2009, at 11:29 AM, Jeff Keating wrote: > >> A thought: >> >> In general, if you're thinking about integrating payment card >> processing, stop and ask yourself if you can outsource this to a >> vendor with an API and all the necessary storage in place... If you >> get successful, or make a mistake, the costs of doing it yourself >> go up tremendously. If it's not your core competency, double-think >> whether you want to write a line of code at all... There is quite a >> bit more than worrying about logging sensitive data to consider. >> >> If anyone on the list is planning this type of work, feel free to >> ping me -- I'm just completing a several-month-long PCI DSS >> compliance project for my current employer... expensive... I'd be >> happy to share thoughts and stories. >> >> -jeff >> >> On Wed, Feb 18, 2009 at 10:15 AM, Tony Spencer > > wrote: >> We are in the midst of adding some credit card payment features on >> a project and one of my developers brought up something that hadn't >> occurred to me and posed a security risk for some projects we >> already have in production that accept credit cards. By default >> Rails logs all post data in production but its very easy to disable >> this from the controller. Just thought I'd pass this to the group >> in case someone else had overlooked this as I did: >> >> http://www.robbyonrails..com/articles/2007/07/16/rails-code-audit- >> tips-filtered-parameter-logging >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2419 bytes Desc: not available URL: From nospam at tonyspencer.com Wed Feb 18 12:50:10 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Wed, 18 Feb 2009 12:50:10 -0500 Subject: [raleigh.rb] Disable logging of sensitive data In-Reply-To: <938DE710-6B82-46AE-851F-E5EB36EA6E9F@37signals.com> References: <8D9FC2DB-B6C5-4867-BF60-EA5D1A7752D1@tonyspencer.com> <938DE710-6B82-46AE-851F-E5EB36EA6E9F@37signals.com> Message-ID: It is a pain in the arse but I just finished PCI compliance with one server and it feels good to have complete control of the transaction. Worth it if you are doing heavy volume IMO. I would like to see what an integration with the Braintree service looks like on a live site though. On Feb 18, 2009, at 12:40 PM, Mark Imbriaco wrote: > > As an aside, it's not enough not to store the cards on your > servers. If the card data ever passes through your servers on the > way to the payment gateway's storage, your servers are required to > be PCI compliant. The absolute best solution if you don't want to > deal with the nightmare of true PCI compliance (and who really > does?) is to use a third party provider who has an offering that > allows you to outsource even the capturing of the card number so > that your servers never have access to the number, even when it's in > transit. > > An example of this is the Transparent Redirect service from Braintree: > http://dev.braintreepaymentsolutions.com/vault/transparent-redirect/ > > -Mark > > On Feb 18, 2009, at 12:23 PM, Tony Spencer wrote: > >> We have 7 years of experience with dealing with integration with >> payment processor gateways and indeed have learned a lot along the >> way. We use API's from Authorize.net and TrustCommerce and never >> store the credit card number on our server. Nonetheless I agree >> with you. Anyone thinking of taking on payment processing would be >> wise to consult with someone that has been doing it for some time. >> There are a lot of risks. >> >> >> On Feb 18, 2009, at 11:29 AM, Jeff Keating wrote: >> >>> A thought: >>> >>> In general, if you're thinking about integrating payment card >>> processing, stop and ask yourself if you can outsource this to a >>> vendor with an API and all the necessary storage in place... If >>> you get successful, or make a mistake, the costs of doing it >>> yourself go up tremendously. If it's not your core competency, >>> double-think whether you want to write a line of code at all... >>> There is quite a bit more than worrying about logging sensitive >>> data to consider. >>> >>> If anyone on the list is planning this type of work, feel free to >>> ping me -- I'm just completing a several-month-long PCI DSS >>> compliance project for my current employer... expensive... I'd be >>> happy to share thoughts and stories. >>> >>> -jeff >>> >>> On Wed, Feb 18, 2009 at 10:15 AM, Tony Spencer >> > wrote: >>> We are in the midst of adding some credit card payment features on >>> a project and one of my developers brought up something that >>> hadn't occurred to me and posed a security risk for some projects >>> we already have in production that accept credit cards. By default >>> Rails logs all post data in production but its very easy to >>> disable this from the controller. Just thought I'd pass this to >>> the group in case someone else had overlooked this as I did: >>> >>> http://www.robbyonrails..com/articles/2007/07/16/rails-code-audit- >>> tips-filtered-parameter-logging >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From belucid at acm.org Wed Feb 18 13:44:58 2009 From: belucid at acm.org (Sean Johnson) Date: Wed, 18 Feb 2009 13:44:58 -0500 Subject: [raleigh.rb] 3 - 6 week Rails contract In-Reply-To: <16996669.1234977792750.JavaMail.cfservice@webserver61> References: <16996669.1234977792750.JavaMail.cfservice@webserver61> Message-ID: <076B0E34-3447-4E3D-98C8-490CE0C6FF7C@acm.org> Kendra, Hi. Depending on the details of the project, I might be interested if I could do the bulk of the work at home. Any reason the bulk of the development work needs to be done on site? Other than meetings and what not. This is me: http://snootymonkey.com/ http://visualcv.com/seanjohnson Thanks, Sean On Feb 18, 2009, at 12:23 PM, Kendra Andrews wrote: > I'm looking for a Rails developer for a short-term contract in RTP. > The requirements and UI specs are done, client just needs someone to > come in and do the work. There isn't another Rails person on site > so need to be comfortable jumping in and getting started. Please > contact me if interested or if you know anyone who might be. > > Thanks! > > > Kendra Andrews > Recruiting Manager > HireNetworks > 919-981-6200 x313 > 888-334-3145 > kandrews at hirenetworks.com > www.hirenetworks.com > > Connect with me on LinkedIn: http://www.linkedin.com/in/kendraandrews > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members __________ Sean Johnson belucid at acm.org Snooty Monkey - Ruby on Rails, Mac and iPhone development http://snootymonkey.com/ BubbleTimer - Achieve your goals through better time management. http://bubbletimer.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From belucid at acm.org Wed Feb 18 13:58:52 2009 From: belucid at acm.org (Sean Johnson) Date: Wed, 18 Feb 2009 13:58:52 -0500 Subject: [raleigh.rb] MacRuby Talk? Message-ID: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> Fellows, Anyone interested in a talk on MacRuby for the raleigh.rb? I'd be happy to do one if there is interest. Thanks, Sean __________ Sean Johnson belucid at acm.org Snooty Monkey - Ruby on Rails, Mac and iPhone development http://snootymonkey.com/ BubbleTimer - Achieve your goals through better time management. http://bubbletimer.com/ From rick.denatale at gmail.com Wed Feb 18 14:07:19 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Wed, 18 Feb 2009 14:07:19 -0500 Subject: [raleigh.rb] Accountant Recommendations In-Reply-To: References: Message-ID: On Wed, Feb 18, 2009 at 9:06 AM, Kevin A. Smith wrote: > Can anyone recommend a good small business accountant in the area? Bonus > points if they're in North Raleigh :) > It's more than just accounting, but if you are a freelancer, you might want to consider, as I'm doing at the moment, Rothwell International. http://www.rothwell-international.com/home.html Some might remember that they gave a pitch at the raleigh.rb meeting some months back. Basically, assuming that you are making anything reasonable as far as revenue goes, they seem to provide some great financial benefits. You still need to find your own work, but you invoice clients through them. They give you W2, rather than 1099 status as far as the IRS is concerned, i.e. you are effectively their employee for tax purposes, with a status kind of like a salesman whose income is 100% commission with a 100% commission rate. For $300/month for months in which you have revenue they: * Withhold your personal income and self-employment tax payments, and get them to the IRS on time. * Cover you with their liability, workmen's comp, and errors and omissions insurance. * Allow you to charge business expenses (travel, lunches, office supplies, ...) making them tax-deductible rather than personal income. * Allow equipment you buy with business income to be leased back again making any income used to purchase it not subject to income tax. They told me that you still own the equipment. * Offer an option of Blue Cross/Blue Shield medical insurance. Although the rates seem similar to buying it yourself, there are supposed to be tax advantages, since part or perhaps all of the premium can be charged as business expense. They also offer optional Dental benefits. * Optionally offer something like the Flexible Savings Account which larger companies sometimes provide. This lets you set aside a certain amount of tax-free money each year to be used for medical expenses. They claimed that unlike most of these accounts there is no "use it or lose it" aspect. I'm not sure I completely understand exactly how that works. * Provide a W2 documenting all deductions at the end of the year. * Do your 1040 for you if you have had enough months of revenue billed through them (I can't remember the exact number of months required). This make sense since they have all of your business related deduction info already. Now, I'm sure that most, if not all of this can be done by yourself, a CPA and a lawyer to set up the right personal business, but this looks like it might be less hassle free. They seem to be quite willing to tailor their services. I learned yesterday that although there US Headquarters is in Raleigh (the base company is South African), their current US freelancers are all in Texas. They seem eager to grow their business locally. Since I'm still considering this, I'd appreciate any comments. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon.list+rb at gmail.com Wed Feb 18 14:27:17 2009 From: jon.list+rb at gmail.com (Jonathon Brenner) Date: Wed, 18 Feb 2009 14:27:17 -0500 Subject: [raleigh.rb] MacRuby Talk? In-Reply-To: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> References: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> Message-ID: mos def. On Wed, Feb 18, 2009 at 1:58 PM, Sean Johnson wrote: > Fellows, > > Anyone interested in a talk on MacRuby for the raleigh.rb? I'd be > happy to do one if there is interest. > > Thanks, > Sean > __________ > Sean Johnson > belucid at acm.org > > Snooty Monkey - Ruby on Rails, Mac and iPhone development > http://snootymonkey.com/ > > BubbleTimer - Achieve your goals through better time management. > http://bubbletimer.com/ > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From javery at infozerk.com Wed Feb 18 14:32:26 2009 From: javery at infozerk.com (James Avery) Date: Wed, 18 Feb 2009 14:32:26 -0500 Subject: [raleigh.rb] Accountant Recommendations In-Reply-To: References: Message-ID: <20af90580902181132o7a5a88efj3d4b6a0da68aa93@mail.gmail.com> There are a number of offerings like that around, a friend of mine has worked with one called iProfessional for years. My main issue with them has always been that they seem very geared towards people who are just doing consulting and I have aspirations to build a product (like I am sure 95% of independent consultants do) and it seems like you could end up with some potential issues around doing product development while technically being an employee of that company. For instance you will need a real business if you want to process credit cards, shield yourself from liability, etc. I use Paychex to handle all of my payroll taxes and a CPA to handle the end of year stuff. I pay for insurance myself which sucks, but it is all tax deductible. I pay for all expenses out of the business account so accounting for them at the end of the year really isn't an issue. Paychex charges about $70/month but it is worth it just not have to deal with the monthly and quarterly forms and payments. I used to do it all manually and I spent at least an hour a month doing it, so Paychex was worth it. -James On Wed, Feb 18, 2009 at 2:07 PM, Rick DeNatale wrote: > On Wed, Feb 18, 2009 at 9:06 AM, Kevin A. Smith > wrote: >> >> Can anyone recommend a good small business accountant in the area? Bonus >> points if they're in North Raleigh :) > > It's more than just accounting, but if you are a freelancer, you might want > to consider, as I'm doing at the moment, > Rothwell International. http://www.rothwell-international.com/home.html > > Some might remember that they gave a pitch at the raleigh.rb meeting some > months back. > > Basically, assuming that you are making anything reasonable as far as > revenue goes, they seem to provide some great financial benefits. You still > need to find your own work, but you invoice clients through them. They give > you W2, rather than 1099 status as far > as the IRS is concerned, i.e. you are effectively their employee for tax > purposes, with a status kind of like a salesman whose income is 100% > commission with a 100% commission rate. For $300/month for months in which > you have revenue they: > > * Withhold your personal income and self-employment tax payments, and get > them to the IRS on time. > * Cover you with their liability, workmen's comp, and errors and > omissions insurance. > * Allow you to charge business expenses (travel, lunches, office > supplies, ...) making them tax-deductible rather than personal income. > * Allow equipment you buy with business income to be leased back again > making any income used to purchase it not subject to income tax. They told > me that you still own the equipment. > * Offer an option of Blue Cross/Blue Shield medical insurance. Although > the rates seem similar to buying it yourself, there are supposed to be tax > advantages, since part or perhaps all of the premium can be charged as > business expense. They also offer optional Dental benefits. > * Optionally offer something like the Flexible Savings Account which > larger companies sometimes provide. This lets you set aside a certain amount > of tax-free money each year to be used for medical expenses. They claimed > that unlike most of these accounts there is no "use it or lose it" aspect. > I'm not sure I completely understand exactly how that works. > * Provide a W2 documenting all deductions at the end of the year. > * Do your 1040 for you if you have had enough months of revenue billed > through them (I can't remember the exact number of months required). This > make sense since they have all of your business related deduction info > already. > > Now, I'm sure that most, if not all of this can be done by yourself, a CPA > and a lawyer to set up the right personal business, but this looks like it > might be less hassle free. They seem to be quite willing to tailor their > services. I learned yesterday that although there US Headquarters is in > Raleigh (the base company is South African), their current US freelancers > are all in Texas. They seem eager to grow their business locally. > > Since I'm still considering this, I'd appreciate any comments. > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Twitter: http://twitter.com/RickDeNatale > WWR: http://www.workingwithrails.com/person/9021-rick-denatale > LinkedIn: http://www.linkedin.com/in/rickdenatale > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- James Avery Zerk Media - http://zerkmedia.com Infozerk Inc. - http://www.infozerk.com From belucid at acm.org Wed Feb 18 14:48:04 2009 From: belucid at acm.org (Sean Johnson) Date: Wed, 18 Feb 2009 14:48:04 -0500 Subject: [raleigh.rb] MacRuby Talk? In-Reply-To: References: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> Message-ID: <767D7114-7654-44C9-B8A3-93F6DFD9B9F7@acm.org> Thanks Jonathan. I also realize I should have put a little more context into my message. For those that may not know, MacRuby is the heir apparent to RubyCocoa and allows developers to use Ruby to do native (Cocoa) development on the Mac w/o the use of any bridging/brokering between Ruby objects and Objective-C objects. The reason I ask about interest level is that I noticed about a 50/50 split in Mac/PC use at the meetings and I'm not sure how everyone feels about platform specific talks. Thanks, Sean On Feb 18, 2009, at 2:27 PM, Jonathon Brenner wrote: > mos def. > > On Wed, Feb 18, 2009 at 1:58 PM, Sean Johnson wrote: > Fellows, > > Anyone interested in a talk on MacRuby for the raleigh.rb? > I'd be happy to do one if there is interest. > > Thanks, > Sean > __________ > Sean Johnson > belucid at acm.org > > Snooty Monkey - Ruby on Rails, Mac and iPhone development > http://snootymonkey.com/ > > BubbleTimer - Achieve your goals through better time management. > http://bubbletimer.com/ > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members __________ Sean Johnson belucid at acm.org Snooty Monkey - Ruby on Rails, Mac and iPhone development http://snootymonkey.com/ BubbleTimer - Achieve your goals through better time management. http://bubbletimer.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.fischer at smokejumperit.com Wed Feb 18 15:06:38 2009 From: robert.fischer at smokejumperit.com (Robert Fischer) Date: Wed, 18 Feb 2009 15:06:38 -0500 Subject: [raleigh.rb] MacRuby Talk? In-Reply-To: <767D7114-7654-44C9-B8A3-93F6DFD9B9F7@acm.org> References: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> <767D7114-7654-44C9-B8A3-93F6DFD9B9F7@acm.org> Message-ID: <499C6A4E.30704@smokejumperit.com> I'd be very interested in learning about that. ~~ Robert. Sean Johnson wrote: > Thanks Jonathan. > > I also realize I should have put a little more context into my message. > For those that may not know, MacRuby is the heir apparent to RubyCocoa > and allows developers to use Ruby to do native (Cocoa) development on > the Mac w/o the use of any bridging/brokering between Ruby objects and > Objective-C objects. > > The reason I ask about interest level is that I noticed about a 50/50 > split in Mac/PC use at the meetings and I'm not sure how everyone feels > about platform specific talks. > > Thanks, > Sean > > On Feb 18, 2009, at 2:27 PM, Jonathon Brenner wrote: > >> mos def. >> >> On Wed, Feb 18, 2009 at 1:58 PM, Sean Johnson > > wrote: >> >> Fellows, >> >> Anyone interested in a talk on MacRuby for the raleigh.rb? >> I'd be happy to do one if there is interest. >> >> Thanks, >> Sean >> __________ >> Sean Johnson >> belucid at acm.org >> >> Snooty Monkey - Ruby on Rails, Mac and iPhone development >> http://snootymonkey.com/ >> >> BubbleTimer - Achieve your goals through better time management. >> http://bubbletimer.com/ >> >> >> >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > __________ > Sean Johnson > belucid at acm.org > > Snooty Monkey - Ruby on Rails, Mac and iPhone development > http://snootymonkey.com/ > > BubbleTimer - Achieve your goals through better time management. > http://bubbletimer.com/ > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -- ~~ Robert Fischer. Grails Training http://GroovyMag.com/training Smokejumper Consulting http://SmokejumperIT.com Enfranchised Mind Blog http://EnfranchisedMind.com/blog Check out my book, "Grails Persistence with GORM and GSQL"! http://www.smokejumperit.com/redirect.html From nathaniel at talbott.ws Wed Feb 18 15:09:38 2009 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Wed, 18 Feb 2009 15:09:38 -0500 Subject: [raleigh.rb] Open RubyRX Mixer Message-ID: <4ce336a20902181209l322ceea0v42c1fca305af2bea@mail.gmail.com> RubyRX opens tomorrow night, and even if you're not coming to the conference proper, you're still invited to come out to the pre-conference mixer. It'll get rolling around 8 with a speaker panel, and then there will be time for lightning talks starting around 8:30 (non-conference attendees are welcome to present lightning talks as well). If you're not able to make the conference but would like to come say "Hey!" to all the speakers, out-of-towners and locals, we'd love to see you tomorrow! When: Thursday, 2/19, at 8pm Where: http://www.nfjsone.com/conference/raleigh/2009/02/travel.html Who: Everybody! Can't wait, -- Nathaniel Talbott <:((>< From nathaniel at talbott.ws Wed Feb 18 15:15:32 2009 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Wed, 18 Feb 2009 15:15:32 -0500 Subject: [raleigh.rb] MacRuby Talk? In-Reply-To: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> References: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> Message-ID: <4ce336a20902181215k1a5ad1acm521d8f6a8f23eb95@mail.gmail.com> On Wed, Feb 18, 2009 at 1:58 PM, Sean Johnson wrote: > Anyone interested in a talk on MacRuby for the raleigh.rb? I'd be > happy to do one if there is interest. YES. Drop me an email directly and we'll work out details :-) -- Nathaniel Talbott <:((>< From curtismitchell at gmail.com Wed Feb 18 15:23:44 2009 From: curtismitchell at gmail.com (Curtis Mitchell) Date: Wed, 18 Feb 2009 20:23:44 +0000 Subject: [raleigh.rb] MacRuby Talk? In-Reply-To: References: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> Message-ID: <2136093073-1234988454-cardhu_decombobulator_blackberry.rim.net-886713576-@bxe1008.bisx.prod.on.blackberry> +1 for mos def Sent from my mobile -----Original Message----- From: Jonathon Brenner Date: Wed, 18 Feb 2009 14:27:17 To: The mailing list of raleigh.rb Subject: Re: [raleigh.rb] MacRuby Talk? _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nwalls at ismedia.org Wed Feb 18 15:39:14 2009 From: nwalls at ismedia.org (Nathan L. Walls) Date: Wed, 18 Feb 2009 15:39:14 -0500 Subject: [raleigh.rb] MacRuby Talk? In-Reply-To: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> References: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> Message-ID: +1 On Feb 18, 2009, at 1:58 PM, Sean Johnson wrote: > Fellows, > > Anyone interested in a talk on MacRuby for the raleigh.rb? I'd be > happy to do one if there is interest. > > Thanks, > Sean From info at lojic.com Thu Feb 19 00:03:06 2009 From: info at lojic.com (Brian Adkins) Date: Thu, 19 Feb 2009 00:03:06 -0500 Subject: [raleigh.rb] Static web site generator Message-ID: <499CE80A.3070809@lojic.com> Can anyone recommend a nice tool for generating static web sites? Thanks, Brian -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ From jon.list+rb at gmail.com Thu Feb 19 00:12:55 2009 From: jon.list+rb at gmail.com (Jonathon Brenner) Date: Thu, 19 Feb 2009 00:12:55 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: <499CE80A.3070809@lojic.com> References: <499CE80A.3070809@lojic.com> Message-ID: Though I never used it, Webby comes to mind. http://github.com/TwP/webby/tree/master On Thu, Feb 19, 2009 at 12:03 AM, Brian Adkins wrote: > Can anyone recommend a nice tool for generating static web sites? > > Thanks, > Brian > > -- > Brian Adkins > Lojic Technologies, LLC > http://lojic.com/ > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tj at stank.us Thu Feb 19 00:15:46 2009 From: tj at stank.us (TJ Stankus) Date: Thu, 19 Feb 2009 00:15:46 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: <499CE80A.3070809@lojic.com> References: <499CE80A.3070809@lojic.com> Message-ID: This may be archaic, but in the past I've built little static sites with Rails, then just used wget against the locally running app to extract a set of static files. I extracted the wget stuff into a rake task. If this interests you at all, ping me and I'll put the rake task in a gist or something. -TJ On Thu, Feb 19, 2009 at 12:03 AM, Brian Adkins wrote: > Can anyone recommend a nice tool for generating static web sites? > > Thanks, > Brian > > -- > Brian Adkins > Lojic Technologies, LLC > http://lojic.com/ > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From tj at stank.us Thu Feb 19 00:23:54 2009 From: tj at stank.us (TJ Stankus) Date: Thu, 19 Feb 2009 00:23:54 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: References: <499CE80A.3070809@lojic.com> Message-ID: I went ahead and gist'ed it up anyway. There's some app-specific stuff in there, but tweaking it to fit a different app shouldn't be too difficult: http://gist.github.com/66738 On Thu, Feb 19, 2009 at 12:15 AM, TJ Stankus wrote: > This may be archaic, but in the past I've built little static sites > with Rails, then just used wget against the locally running app to > extract a set of static files. I extracted the wget stuff into a rake > task. If this interests you at all, ping me and I'll put the rake task > in a gist or something. > > -TJ > > On Thu, Feb 19, 2009 at 12:03 AM, Brian Adkins wrote: >> Can anyone recommend a nice tool for generating static web sites? >> >> Thanks, >> Brian >> >> -- >> Brian Adkins >> Lojic Technologies, LLC >> http://lojic.com/ >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > From adam at thewilliams.ws Thu Feb 19 00:28:28 2009 From: adam at thewilliams.ws (Adam Williams) Date: Thu, 19 Feb 2009 00:28:28 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: References: <499CE80A.3070809@lojic.com> Message-ID: <52A3AD3A-22F9-49CC-B342-02E9D5C515CF@thewilliams.ws> I'm hoping to see http://github.com/fivepointssolutions/serve get more use. You use erb, haml, sass (HTML and CSS) and Ruby in a directory/ file structure similar to a Rails view directory, get helpers, render partial, stuff like that. Then, you do something to make something like the ServerController module's show method work in passenger (Nathaniel did some work with rack) so the ResponseCache (from Radiant) works like it does when you use that serve gem as a Rails plugin, then BAM! you've got super fast content. Let me know if you'd like to know more. We need to get it packaged up/ tested a bit more and merged back into Serve proper... adam On Feb 19, 2009, at 12:15 AM, TJ Stankus wrote: > This may be archaic, but in the past I've built little static sites > with Rails, then just used wget against the locally running app to > extract a set of static files. I extracted the wget stuff into a rake > task. If this interests you at all, ping me and I'll put the rake task > in a gist or something. > > -TJ > > On Thu, Feb 19, 2009 at 12:03 AM, Brian Adkins wrote: >> Can anyone recommend a nice tool for generating static web sites? >> >> Thanks, >> Brian >> >> -- >> Brian Adkins >> Lojic Technologies, LLC >> http://lojic.com/ >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From mshiltonj at gmail.com Thu Feb 19 07:11:59 2009 From: mshiltonj at gmail.com (Steven Hilton) Date: Thu, 19 Feb 2009 07:11:59 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: <499CE80A.3070809@lojic.com> References: <499CE80A.3070809@lojic.com> Message-ID: <8308260d0902190411m4034a0fbl9730287c27f041f2@mail.gmail.com> I tinkered around with StaticMatic a few months ago: http://staticmatic.rubyforge.org/ It seemed useful. - Steven On Thu, Feb 19, 2009 at 12:03 AM, Brian Adkins wrote: > Can anyone recommend a nice tool for generating static web sites? > > Thanks, > Brian > > -- > Brian Adkins > Lojic Technologies, LLC > http://lojic.com/ > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Steven Hilton From chad.humphries at gmail.com Thu Feb 19 07:27:43 2009 From: chad.humphries at gmail.com (Chad Humphries) Date: Thu, 19 Feb 2009 07:27:43 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: <8308260d0902190411m4034a0fbl9730287c27f041f2@mail.gmail.com> References: <499CE80A.3070809@lojic.com> <8308260d0902190411m4034a0fbl9730287c27f041f2@mail.gmail.com> Message-ID: I've had good luck with jekyll. It's pretty flexible about what you can write in, and simple enough to get started with. -- Chad On Feb 19, 2009, at 7:11 AM, Steven Hilton wrote: > I tinkered around with StaticMatic a few months ago: > > http://staticmatic.rubyforge.org/ > > It seemed useful. > > - Steven > > On Thu, Feb 19, 2009 at 12:03 AM, Brian Adkins wrote: >> Can anyone recommend a nice tool for generating static web sites? >> >> Thanks, >> Brian >> >> -- >> Brian Adkins >> Lojic Technologies, LLC >> http://lojic.com/ >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > > -- > Steven Hilton > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From steve.pinkham at gmail.com Thu Feb 19 09:30:33 2009 From: steve.pinkham at gmail.com (Steve Pinkham) Date: Thu, 19 Feb 2009 09:30:33 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: <499CE80A.3070809@lojic.com> References: <499CE80A.3070809@lojic.com> Message-ID: <499D6D09.5030100@gmail.com> Brian Adkins wrote: > Can anyone recommend a nice tool for generating static web sites? > > Thanks, > Brian > I like webgen (http://webgen.rubyforge.org/). It is built around a very flexible pipeline of filters your content can go through during creation. Compared to webby, webgen has more useful features like a tag system similar to the one in radiant, and a auto-rebuild feature for quick testing as you build. Steve -- | Steven E. Pinkham | | GPG public key ID CD31CAFB | From info at lojic.com Thu Feb 19 11:02:55 2009 From: info at lojic.com (Brian Adkins) Date: Thu, 19 Feb 2009 11:02:55 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: <499CE80A.3070809@lojic.com> References: <499CE80A.3070809@lojic.com> Message-ID: <499D82AF.8000406@lojic.com> Thanks for all the tips guys! Lots to chew on now :) Brian Adkins wrote, On 2/19/09 12:03 AM: > Can anyone recommend a nice tool for generating static web sites? > > Thanks, > Brian > -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ From nospam at tonyspencer.com Thu Feb 19 11:08:30 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 11:08:30 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS Message-ID: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> I'm stumped by this one and hope someone can give me some ideas on debugging it. We have one relatively low traffic rails app (~1150 pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk I have received 3 warnings via email from slicehost complaining "...your slice, spainrealestate.co.uk, is showing a considerable amount of consistent swapping activity..." and they are threatening to cancel the slice. Everytime I ssh in the slice is happy as a clam: root at spainrealestate:~# uptime 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 root at spainrealestate:~# free -m total used free shared buffers cached Mem: 1022 779 242 0 117 227 -/+ buffers/cache: 435 587 Swap: 2047 5 2042 The slicehost support told me : "From what I can see, your Slice's I/O usage is incredibly high: Swap read rate: 868.5205, write rate: 1275.6448 Root read rate: 130803.8933, write rate: 65973.9669 Those numbers are "reads/writes per second." Your Slice is making almost 131,000 reads and 66,000 writes per second - which is a very high number and could cause performance issues." We are running Passenger and Rails 2.1. If I could somehow be notified by the server when it began to happen perhaps I could find some way to make my Mac blare loud music and wake me up so I could see what process was chewing up memory. Oh and I've verified that we have no entries in any user's crontab. I'd be grateful for any tips. Finally here is what top sorted by memory looks like: 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 ApplicationPool 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From otto.hammersmith at gmail.com Thu Feb 19 11:21:37 2009 From: otto.hammersmith at gmail.com (Otto Hammersmith) Date: Thu, 19 Feb 2009 11:21:37 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> Message-ID: Check /var/log/messages or /var/log/kern.log for any processes that might be getting killed for too much memory. We've had that happen on some of our VMs but mongrel gets restarted quickly enough that munin only notices the PID changed. After the fact everything looks honky dory like your system. Hardly any load. Are you doing anything like using image_science to process images or uploading big files like videos? On Thu, Feb 19, 2009 at 11:08 AM, Tony Spencer wrote: > I'm stumped by this one and hope someone can give me some ideas on > debugging it. We have one relatively low traffic rails app (~1150 pageviews > a day) running on a 1GB slice at slicehost.com: > http://www.spainrealestate.co.uk > > I have received 3 warnings via email from slicehost complaining "...your > slice, spainrealestate.co.uk, is showing a considerable amount of > consistent swapping activity..." and they are threatening to cancel the > slice. Everytime I ssh in the slice is happy as a clam: > > root at spainrealestate:~# uptime > 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 > > root at spainrealestate:~# free -m > total used free shared buffers cached > Mem: 1022 779 242 0 117 227 > -/+ buffers/cache: 435 587 > Swap: 2047 5 2042 > > The slicehost support told me : > > *"From what I can see, your Slice's I/O usage is incredibly high:* > > - *Swap read rate: 868.5205, write rate: 1275.6448* > - *Root read rate: 130803.8933, write rate: 65973.9669* > > * > * > > *Those numbers are "reads/writes per second." Your Slice is making almost > 131,000 reads and 66,000 writes per second - which is a very high number and > could cause performance issues."* > > We are running Passenger and Rails 2.1. If I could somehow be notified by > the server when it began to happen perhaps I could find some way to make my > Mac blare loud music and wake me up so I could see what process was chewing > up memory. > > Oh and I've verified that we have no entries in any user's crontab. > > I'd be grateful for any tips. > > Finally here is what top sorted by memory looks like: > > 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 > > > 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby > > > 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 > > > 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld > > > 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 > > > 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 > > > 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 > > > 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 > > > 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 > > > 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 > > > 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 > ApplicationPool > > 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seancribbs at gmail.com Thu Feb 19 11:24:07 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Thu, 19 Feb 2009 11:24:07 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> Message-ID: <499D87A7.5090505@gmail.com> My suggestion is to look in your slice management panel and see if the slice is actually doing as he says (under statistics). Sounds like a mistake to me! Sean Tony Spencer wrote: > I'm stumped by this one and hope someone can give me some ideas on > debugging it. We have one relatively low traffic rails app (~1150 > pageviews a day) running on a 1GB slice at slicehost.com: > http://www.spainrealestate.co.uk > > I have received 3 warnings via email from slicehost complaining > "...your slice, spainrealestate.co.uk, is showing a considerable > amount of consistent swapping activity..." and they are threatening to > cancel the slice. Everytime I ssh in the slice is happy as a clam: > > root at spainrealestate:~# uptime > 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 > > root at spainrealestate:~# free -m > total used free shared buffers cached > Mem: 1022 779 242 0 117 227 > -/+ buffers/cache: 435 587 > Swap: 2047 5 2042 > > The slicehost support told me : > > /"From what I can see, your Slice's I/O usage is incredibly high:/ > > * /Swap read rate: 868.5205, write rate: 1275.6448/ > * /Root read rate: 130803.8933, write rate: 65973.9669/ > > / > / > > /Those numbers are "reads/writes per second." Your Slice is making > almost 131,000 reads and 66,000 writes per second - which is a very > high number and could cause performance issues."/ > > > We are running Passenger and Rails 2.1. If I could somehow be notified > by the server when it began to happen perhaps I could find some way to > make my Mac blare loud music and wake me up so I could see what > process was chewing up memory. > > Oh and I've verified that we have no entries in any user's crontab. > > I'd be grateful for any tips. > > > Finally here is what top sorted by memory looks like: > > 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 > > > 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby > > > 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 > > > 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld > > > 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 > > > 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 > > > 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 > > > 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 > > > 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 > > > 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 > > > 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 > ApplicationPool > > 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 > > ------------------------------------------------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at hales.ws Thu Feb 19 11:30:39 2009 From: mike at hales.ws (Michael Hale) Date: Thu, 19 Feb 2009 11:30:39 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> Message-ID: <60190a730902190830vb47a771u3eef1f0b5ab679c6@mail.gmail.com> You could setup monit to watch apache and your overall box. Monit can send you email, restart processes etc when a process has reached a defined memory or cpu limit. You could also try using ab or httperf to simulate some load and test your setup. Also maybe reducing the number of passenger workers would keep you from swapping. You should have no more than N workers: passenger_worker_memory * N = total memory - (memory used by other processes). On Thu, Feb 19, 2009 at 11:08 AM, Tony Spencer wrote: > I'm stumped by this one and hope someone can give me some ideas on debugging > it. We have one relatively low traffic rails app (~1150 pageviews a day) > running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk > > I have received 3 warnings via email from slicehost complaining "...your > slice, spainrealestate.co.uk, is showing a considerable amount of consistent > swapping activity..." and they are threatening to cancel the slice. > Everytime I ssh in the slice is happy as a clam: > > root at spainrealestate:~# uptime > 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 > > root at spainrealestate:~# free -m > total used free shared buffers cached > Mem: 1022 779 242 0 117 227 > -/+ buffers/cache: 435 587 > Swap: 2047 5 2042 > The slicehost support told me : > > "From what I can see, your Slice's I/O usage is incredibly high: > > Swap read rate: 868.5205, write rate: 1275.6448 > Root read rate: 130803.8933, write rate: 65973.9669 > > > > Those numbers are "reads/writes per second." Your Slice is making almost > 131,000 reads and 66,000 writes per second - which is a very high number and > could cause performance issues." > > We are running Passenger and Rails 2.1. If I could somehow be notified by > the server when it began to happen perhaps I could find some way to make my > Mac blare loud music and wake me up so I could see what process was chewing > up memory. > > Oh and I've verified that we have no entries in any user's crontab. > > I'd be grateful for any tips. > > Finally here is what top sorted by memory looks like: > 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 > > > 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby > > > 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 > > > 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld > > > 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 > > > 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 > > > 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 > > > 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 > > > 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 > > > 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 > > > 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 ApplicationPool > > > 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Michael Hale mikehale at gmail.com m: 919.961.7171 jabber: mikehale at gmail.com skype: mhale2243 From nospam at tonyspencer.com Thu Feb 19 11:49:56 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 11:49:56 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> Message-ID: <467CE093-8911-4E5D-8AD5-41934762B840@tonyspencer.com> No there currently isn't any image processing going on on this app. There are images generated occassionally when we pull in a feed of properties but that is rare and we initiate the rake task manually so I know when that occurs. The slice is using less than half of its physical memory now. I guess I'm going to install this bash script to notify me when swap usage rises. I really don't want to upgrade to 2GB at twice the cost. I did read others complaining about high memory usage on these slices b/ c of the fact that they are all 64 bit at slicehost: http://forum.slicehost.com/comments.php?DiscussionID=2875&page=1 On Feb 19, 2009, at 11:21 AM, Otto Hammersmith wrote: > Check /var/log/messages or /var/log/kern.log for any processes that > might be getting killed for too much memory. We've had that happen > on some of our VMs but mongrel gets restarted quickly enough that > munin only notices the PID changed. After the fact everything looks > honky dory like your system. Hardly any load. > > Are you doing anything like using image_science to process images or > uploading big files like videos? > > On Thu, Feb 19, 2009 at 11:08 AM, Tony Spencer > wrote: > I'm stumped by this one and hope someone can give me some ideas on > debugging it. We have one relatively low traffic rails app (~1150 > pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk > > I have received 3 warnings via email from slicehost complaining > "....your slice, spainrealestate.co.uk, is showing a considerable > amount of consistent swapping activity..." and they are threatening > to cancel the slice. Everytime I ssh in the slice is happy as a clam: > > root at spainrealestate:~# uptime > 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 > > root at spainrealestate:~# free -m > total used free shared buffers > cached > Mem: 1022 779 242 0 > 117 227 > -/+ buffers/cache: 435 587 > Swap: 2047 5 2042 > > The slicehost support told me : > > "From what I can see, your Slice's I/O usage is incredibly high: > > Swap read rate: 868.5205, write rate: 1275.6448 > Root read rate: 130803.8933, write rate: 65973.9669 > > Those numbers are "reads/writes per second." Your Slice is making > almost 131,000 reads and 66,000 writes per second - which is a very > high number and could cause performance issues." > > > We are running Passenger and Rails 2.1. If I could somehow be > notified by the server when it began to happen perhaps I could find > some way to make my Mac blare loud music and wake me up so I could > see what process was chewing up memory. > > Oh and I've verified that we have no entries in any user's crontab. > > I'd be grateful for any tips. > > > Finally here is what top sorted by memory looks like: > > 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 > 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby > 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 > 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld > 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 > 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 > 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 > 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 > 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 > 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 > 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 > ApplicationPool > 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From nospam at tonyspencer.com Thu Feb 19 12:06:41 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 12:06:41 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <499D87A7.5090505@gmail.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> Message-ID: <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> This is what stats say currently when I check them. I still don't understand how that can be if I have roughly 600MB of free physical memory: Diagnostics * Your slice is currently running. * The host server is up. * Your swap IO usage over the last 4 hours is high: 869.0001 reads/s, 1276.3531 writes/s. (Read more about swap here) * Your root IO usage over the last 4 hours is high: 130876.76 reads/s, 66013.7694 writes/s. * The host server's load is nominal: 0.18, 0.19, 0.10. One thing that does come to mind: we have contact forms on each property that send email when filled out. I have seen on some of my other sites that there are bots that fill in forms and sometimes rather ruthlessly. Perhaps there are large spikes from this. I think I'll download access logs from apache and run them through an analyzer. On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: > My suggestion is to look in your slice management panel and see if > the slice is actually doing as he says (under statistics). Sounds > like a mistake to me! > > Sean > > Tony Spencer wrote: >> >> I'm stumped by this one and hope someone can give me some ideas on >> debugging it. We have one relatively low traffic rails app (~1150 >> pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk >> >> I have received 3 warnings via email from slicehost complaining >> "...your slice, spainrealestate.co.uk, is showing a considerable >> amount of consistent swapping activity..." and they are threatening >> to cancel the slice. Everytime I ssh in the slice is happy as a >> clam: >> >> root at spainrealestate:~# uptime >> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 >> >> root at spainrealestate:~# free -m >> total used free shared buffers >> cached >> Mem: 1022 779 242 0 >> 117 227 >> -/+ buffers/cache: 435 587 >> Swap: 2047 5 2042 >> >> The slicehost support told me : >> >> "From what I can see, your Slice's I/O usage is incredibly high: >> >> Swap read rate: 868.5205, write rate: 1275.6448 >> Root read rate: 130803.8933, write rate: 65973.9669 >> >> Those numbers are "reads/writes per second." Your Slice is making >> almost 131,000 reads and 66,000 writes per second - which is a very >> high number and could cause performance issues." >> >> >> We are running Passenger and Rails 2.1. If I could somehow be >> notified by the server when it began to happen perhaps I could find >> some way to make my Mac blare loud music and wake me up so I could >> see what process was chewing up memory. >> >> Oh and I've verified that we have no entries in any user's crontab. >> >> I'd be grateful for any tips. >> >> >> Finally here is what top sorted by memory looks like: >> >> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 >> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 >> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld >> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 >> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 >> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 >> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 >> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 >> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 >> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >> ApplicationPool >> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at 37signals.com Thu Feb 19 12:18:37 2009 From: mark at 37signals.com (Mark Imbriaco) Date: Thu, 19 Feb 2009 12:18:37 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> Message-ID: <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> There is absolutely no way that your slice has done 130k writes/second and 66k reads/second over the last 4 hours. If that's in bytes or is the number of I/O operations _in total_ over the last 4 hours, I can believe it, but not I/O operations per second. The disk subsystems in their servers aren't fast enough to support those numbers otherwise. -Mark On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: > This is what stats say currently when I check them. I still don't > understand how that can be if I have roughly 600MB of free physical > memory: > > Diagnostics > > * Your slice is currently running. > * The host server is up. > * Your swap IO usage over the last 4 hours is high: 869.0001 > reads/s, 1276.3531 writes/s. (Read more about swap here) > * Your root IO usage over the last 4 hours is high: 130876.76 > reads/s, 66013.7694 writes/s. > * The host server's load is nominal: 0.18, 0.19, 0.10. > > > One thing that does come to mind: we have contact forms on each > property that send email when filled out. I have seen on some of my > other sites that there are bots that fill in forms and sometimes > rather ruthlessly. Perhaps there are large spikes from this. I > think I'll download access logs from apache and run them through an > analyzer. > > > On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: > >> My suggestion is to look in your slice management panel and see if >> the slice is actually doing as he says (under statistics). Sounds >> like a mistake to me! >> >> Sean >> >> Tony Spencer wrote: >>> >>> I'm stumped by this one and hope someone can give me some ideas on >>> debugging it. We have one relatively low traffic rails app (~1150 >>> pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk >>> >>> I have received 3 warnings via email from slicehost complaining >>> "...your slice, spainrealestate.co.uk, is showing a considerable >>> amount of consistent swapping activity..." and they are >>> threatening to cancel the slice. Everytime I ssh in the slice is >>> happy as a clam: >>> >>> root at spainrealestate:~# uptime >>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, >>> 0.00 >>> >>> root at spainrealestate:~# free -m >>> total used free shared buffers >>> cached >>> Mem: 1022 779 242 0 >>> 117 227 >>> -/+ buffers/cache: 435 587 >>> Swap: 2047 5 2042 >>> >>> The slicehost support told me : >>> >>> "From what I can see, your Slice's I/O usage is incredibly high: >>> >>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>> >>> Those numbers are "reads/writes per second." Your Slice is making >>> almost 131,000 reads and 66,000 writes per second - which is a >>> very high number and could cause performance issues." >>> >>> >>> We are running Passenger and Rails 2.1. If I could somehow be >>> notified by the server when it began to happen perhaps I could >>> find some way to make my Mac blare loud music and wake me up so I >>> could see what process was chewing up memory. >>> >>> Oh and I've verified that we have no entries in any user's crontab. >>> >>> I'd be grateful for any tips. >>> >>> >>> Finally here is what top sorted by memory looks like: >>> >>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 >>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 >>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld >>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 >>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 >>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 >>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 >>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 >>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 >>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>> ApplicationPool >>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2419 bytes Desc: not available URL: From lawwton at gmail.com Thu Feb 19 12:23:11 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Thu, 19 Feb 2009 12:23:11 -0500 Subject: [raleigh.rb] Project Tool Question Message-ID: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> Any recommendations for a tool/application that you have used to create the entire project from scratch as part of the design process (Design Document). Example: gui views details, database schema description, NTH, MH, etc ... What do you typically use when you need to design/architect a new site from scratch? Thanks in advance, Alfredo From nospam at tonyspencer.com Thu Feb 19 12:36:57 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 12:36:57 -0500 Subject: [raleigh.rb] Project Tool Question In-Reply-To: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> References: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> Message-ID: This might sound arcane but I've had great success over the past 2 years by drawing interfaces on paper with notes about behavior highlighted. I then feed them in a multi page scanner and upload to Basecamp. The team meets via Skype to review the drawings and poke holes in it. Next step, a developer designs the initial DB just by typing the models and columns and we meet once more to poke at it. Next he loads the initial DB with migrations and begins developing the app around the drawings. Finally my designer gets tickets assigned to him as views are completed and he makes them pretty as he has a Rails stack running on his design machine and understands basics about how to update from SVN. I review and engage in back and forth with developer and designer until an interface is right and the ticket gets closed. This may not be the cool way to do it but it sure has worked great for us. On Feb 19, 2009, at 12:23 PM, Alfredo Quiroga-Villamil wrote: > Any recommendations for a tool/application that you have used to > create the entire project from scratch as part of the design process > (Design Document). Example: gui views details, database schema > description, NTH, MH, etc ... > > What do you typically use when you need to design/architect a new site > from scratch? > > Thanks in advance, > > Alfredo > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From nospam at tonyspencer.com Thu Feb 19 12:48:17 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 12:48:17 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> Message-ID: <6F88FA05-9894-45C1-9FA2-19E41654ADB4@tonyspencer.com> Thanks very much for giving me this sanity check. I'll bring it up with the owner. He has agreed to help me with this issue. On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: > > There is absolutely no way that your slice has done 130k writes/ > second and 66k reads/second over the last 4 hours. If that's in > bytes or is the number of I/O operations _in total_ over the last 4 > hours, I can believe it, but not I/O operations per second. The > disk subsystems in their servers aren't fast enough to support those > numbers otherwise. > > -Mark > > On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: > >> This is what stats say currently when I check them. I still don't >> understand how that can be if I have roughly 600MB of free physical >> memory: >> >> Diagnostics >> >> * Your slice is currently running. >> * The host server is up. >> * Your swap IO usage over the last 4 hours is high: 869.0001 >> reads/s, 1276.3531 writes/s. (Read more about swap here) >> * Your root IO usage over the last 4 hours is high: 130876.76 >> reads/s, 66013.7694 writes/s. >> * The host server's load is nominal: 0.18, 0.19, 0.10. >> >> >> One thing that does come to mind: we have contact forms on each >> property that send email when filled out. I have seen on some of >> my other sites that there are bots that fill in forms and sometimes >> rather ruthlessly. Perhaps there are large spikes from this. I >> think I'll download access logs from apache and run them through an >> analyzer. >> >> >> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >> >>> My suggestion is to look in your slice management panel and see if >>> the slice is actually doing as he says (under statistics). Sounds >>> like a mistake to me! >>> >>> Sean >>> >>> Tony Spencer wrote: >>>> >>>> I'm stumped by this one and hope someone can give me some ideas >>>> on debugging it. We have one relatively low traffic rails app >>>> (~1150 pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk >>>> >>>> I have received 3 warnings via email from slicehost complaining >>>> "...your slice, spainrealestate.co.uk, is showing a considerable >>>> amount of consistent swapping activity..." and they are >>>> threatening to cancel the slice. Everytime I ssh in the slice is >>>> happy as a clam: >>>> >>>> root at spainrealestate:~# uptime >>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, >>>> 0.00 >>>> >>>> root at spainrealestate:~# free -m >>>> total used free shared buffers >>>> cached >>>> Mem: 1022 779 242 0 >>>> 117 227 >>>> -/+ buffers/cache: 435 587 >>>> Swap: 2047 5 2042 >>>> >>>> The slicehost support told me : >>>> >>>> "From what I can see, your Slice's I/O usage is incredibly high: >>>> >>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>> >>>> Those numbers are "reads/writes per second." Your Slice is >>>> making almost 131,000 reads and 66,000 writes per second - which >>>> is a very high number and could cause performance issues." >>>> >>>> >>>> We are running Passenger and Rails 2.1. If I could somehow be >>>> notified by the server when it began to happen perhaps I could >>>> find some way to make my Mac blare loud music and wake me up so I >>>> could see what process was chewing up memory. >>>> >>>> Oh and I've verified that we have no entries in any user's crontab. >>>> >>>> I'd be grateful for any tips. >>>> >>>> >>>> Finally here is what top sorted by memory looks like: >>>> >>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 >>>> ruby1.8 >>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 >>>> ruby1.8 >>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld >>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 >>>> ruby1.8 >>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 >>>> ruby1.8 >>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 >>>> apache2 >>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 >>>> apache2 >>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 >>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 >>>> ruby1.8 >>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>> ApplicationPool >>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 >>>> apache2 >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nwalls at ismedia.org Thu Feb 19 13:07:39 2009 From: nwalls at ismedia.org (Nathan L. Walls) Date: Thu, 19 Feb 2009 13:07:39 -0500 Subject: [raleigh.rb] Project Tool Question In-Reply-To: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> References: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> Message-ID: I'm not sure I follow, but perhaps in answering, some clarification will emerge: - GUI views / HTML I use BBEdit for generally everything text related. For my moonlit business, I build HTML for my views, admin and public on a local virtual host. That leads into hooking up controllers and ERb pretty easily once I figure out how the app needs to act. - Database schema I use OmniGraffle to build a visual representation of my schema and relationships. An absolute joy to use. - Notes / tasks Since I'm working largely solo on the tech side, I keep misc notes in OmniOutliner and tasks in OmniFocus. On Feb 19, 2009, at 12:23 PM, Alfredo Quiroga-Villamil wrote: > Any recommendations for a tool/application that you have used to > create the entire project from scratch as part of the design process > (Design Document). Example: gui views details, database schema > description, NTH, MH, etc ... > > What do you typically use when you need to design/architect a new site > from scratch? > > Thanks in advance, > > Alfredo > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From lawwton at gmail.com Thu Feb 19 13:32:25 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Thu, 19 Feb 2009 13:32:25 -0500 Subject: [raleigh.rb] Project Tool Question In-Reply-To: References: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> Message-ID: <5fe6fa8f0902191032w37b6cb0dyad06943618fe5b46@mail.gmail.com> Nathan: That's pretty much what I am looking for. To be more specific, I currently use the following. a) To get a general idea of what the application will do, I usually start off with a white board. b) Some of the stuff in the white board, ends up being mapped with FreeMind. c) For my database I use MySql Workbench d) The design document ends up being old M. Word with some images from FreeMind, Database Schema and other information regarding the Design Document. What I am looking for: An application that will allow me to do all that with a for example pre-defined set of templates that will contain Design Document items that are repetitive and applicable to all the projects I'll be working on. To get an idea, check out: http://readyset.tigris.org/nonav/templates/frameset.html It's an open source project that allows you to re-use the same set of templates for all your projects. I was wondering if there is a tool out there that sort of combines all these ideas and merge them all into a single application. Also providing me with the ability to mock up some of my views and their respective flows. The view won't look of course like the actual finished product; but it would allow me to place things such as forms for login, a grid, accordion layouts, etc ... Essentially allowing me to sketch out the entire application flow. Thanks for the response, appreciate it. On Thu, Feb 19, 2009 at 1:07 PM, Nathan L. Walls wrote: > I'm not sure I follow, but perhaps in answering, some clarification will > emerge: > > - GUI views / HTML > > I use BBEdit for generally everything text related. For my moonlit business, > I build HTML for my views, admin and public on a local virtual host. That > leads into hooking up controllers and ERb pretty easily once I figure out > how the app needs to act. > > - Database schema > > I use OmniGraffle to build a visual representation of my schema and > relationships. An absolute joy to use. > > - Notes / tasks > > Since I'm working largely solo on the tech side, I keep misc notes in > OmniOutliner and tasks in OmniFocus. > > > On Feb 19, 2009, at 12:23 PM, Alfredo Quiroga-Villamil wrote: > >> Any recommendations for a tool/application that you have used to >> create the entire project from scratch as part of the design process >> (Design Document). Example: gui views details, database schema >> description, NTH, MH, etc ... >> >> What do you typically use when you need to design/architect a new site >> from scratch? >> >> Thanks in advance, >> >> Alfredo >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From nospam at tonyspencer.com Thu Feb 19 13:39:31 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 13:39:31 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> Message-ID: <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> Phew. Thanks again Mark. Looks like I have their attention now: ------------------- Hi Tony, I wanted to let you know that I am consulting with our developers on your issue (as those I/O numbers seem outragously high to me) to see if there is perhaps a bug in our system that may be affecting you. I will let you know as soon as I know more. Regards, Ben B - Slicehost Support ----------------------- On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: > > There is absolutely no way that your slice has done 130k writes/ > second and 66k reads/second over the last 4 hours. If that's in > bytes or is the number of I/O operations _in total_ over the last 4 > hours, I can believe it, but not I/O operations per second. The > disk subsystems in their servers aren't fast enough to support those > numbers otherwise. > > -Mark > > On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: > >> This is what stats say currently when I check them. I still don't >> understand how that can be if I have roughly 600MB of free physical >> memory: >> >> Diagnostics >> >> * Your slice is currently running. >> * The host server is up. >> * Your swap IO usage over the last 4 hours is high: 869.0001 >> reads/s, 1276.3531 writes/s. (Read more about swap here) >> * Your root IO usage over the last 4 hours is high: 130876.76 >> reads/s, 66013.7694 writes/s. >> * The host server's load is nominal: 0.18, 0.19, 0.10. >> >> >> One thing that does come to mind: we have contact forms on each >> property that send email when filled out. I have seen on some of >> my other sites that there are bots that fill in forms and sometimes >> rather ruthlessly. Perhaps there are large spikes from this. I >> think I'll download access logs from apache and run them through an >> analyzer. >> >> >> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >> >>> My suggestion is to look in your slice management panel and see if >>> the slice is actually doing as he says (under statistics). Sounds >>> like a mistake to me! >>> >>> Sean >>> >>> Tony Spencer wrote: >>>> >>>> I'm stumped by this one and hope someone can give me some ideas >>>> on debugging it. We have one relatively low traffic rails app >>>> (~1150 pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk >>>> >>>> I have received 3 warnings via email from slicehost complaining >>>> "...your slice, spainrealestate.co.uk, is showing a considerable >>>> amount of consistent swapping activity..." and they are >>>> threatening to cancel the slice. Everytime I ssh in the slice is >>>> happy as a clam: >>>> >>>> root at spainrealestate:~# uptime >>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, >>>> 0.00 >>>> >>>> root at spainrealestate:~# free -m >>>> total used free shared buffers >>>> cached >>>> Mem: 1022 779 242 0 >>>> 117 227 >>>> -/+ buffers/cache: 435 587 >>>> Swap: 2047 5 2042 >>>> >>>> The slicehost support told me : >>>> >>>> "From what I can see, your Slice's I/O usage is incredibly high: >>>> >>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>> >>>> Those numbers are "reads/writes per second." Your Slice is >>>> making almost 131,000 reads and 66,000 writes per second - which >>>> is a very high number and could cause performance issues." >>>> >>>> >>>> We are running Passenger and Rails 2.1. If I could somehow be >>>> notified by the server when it began to happen perhaps I could >>>> find some way to make my Mac blare loud music and wake me up so I >>>> could see what process was chewing up memory. >>>> >>>> Oh and I've verified that we have no entries in any user's crontab. >>>> >>>> I'd be grateful for any tips. >>>> >>>> >>>> Finally here is what top sorted by memory looks like: >>>> >>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 >>>> ruby1.8 >>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 >>>> ruby1.8 >>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld >>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 >>>> ruby1.8 >>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 >>>> ruby1.8 >>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 >>>> apache2 >>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 >>>> apache2 >>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 >>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 >>>> ruby1.8 >>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>> ApplicationPool >>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 >>>> apache2 >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From lawwton at gmail.com Thu Feb 19 14:21:33 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Thu, 19 Feb 2009 14:21:33 -0500 Subject: [raleigh.rb] Project Tool Question In-Reply-To: References: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> Message-ID: <5fe6fa8f0902191121l7b2cb2b7qcb54e687c4a74251@mail.gmail.com> Thanks Tony, that works. s is in tune with what I had in mind: Thi http://www.conceptdraw.com/en/products/webwave/applications.php Thanks all for your help, Alfredo On Thu, Feb 19, 2009 at 12:36 PM, Tony Spencer wrote: > This might sound arcane but I've had great success over the past 2 years by > drawing interfaces on paper with notes about behavior highlighted. I then > feed them in a multi page scanner and upload to Basecamp. The team meets via > Skype to review the drawings and poke holes in it. > > Next step, a developer designs the initial DB just by typing the models and > columns and we meet once more to poke at it. > > Next he loads the initial DB with migrations and begins developing the app > around the drawings. > > Finally my designer gets tickets assigned to him as views are completed and > he makes them pretty as he has a Rails stack running on his design machine > and understands basics about how to update from SVN. > > I review and engage in back and forth with developer and designer until an > interface is right and the ticket gets closed. > > This may not be the cool way to do it but it sure has worked great for us. > > > On Feb 19, 2009, at 12:23 PM, Alfredo Quiroga-Villamil wrote: > >> Any recommendations for a tool/application that you have used to >> create the entire project from scratch as part of the design process >> (Design Document). Example: gui views details, database schema >> description, NTH, MH, etc ... >> >> What do you typically use when you need to design/architect a new site >> from scratch? >> >> Thanks in advance, >> >> Alfredo >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From info at lojic.com Thu Feb 19 14:34:18 2009 From: info at lojic.com (Brian Adkins) Date: Thu, 19 Feb 2009 14:34:18 -0500 Subject: [raleigh.rb] Project Tool Question In-Reply-To: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> References: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> Message-ID: <499DB43A.9070200@lojic.com> Alfredo Quiroga-Villamil wrote, On 2/19/09 12:23 PM: > Any recommendations for a tool/application that you have used to > create the entire project from scratch as part of the design process > (Design Document). Example: gui views details, database schema > description, NTH, MH, etc ... > > What do you typically use when you need to design/architect a new site > from scratch? For design work involving UML diagrams, database schema, etc. I really like Magic Draw. After using it for a while, I found the UI to be intuitive and flexible. If you create many class diagrams, subtle differences in drawing tools can make a *big* difference. It's written in Java so you can run on Mac OSX, Linux, Windows. I think I paid $129 for a personal version - worth every penny: http://www.magicdraw.com/ I use it in "sketch" mode primarily for transferring design ideas to a visual form i.e. no roundtrip. > Thanks in advance, > > Alfredo > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ 919-946-7547 (mobile) From nospam at tonyspencer.com Thu Feb 19 14:51:51 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 14:51:51 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> Message-ID: <5D720DE6-CEB0-4C43-8248-8E6BF388A95C@tonyspencer.com> Final message from the founder of slicehost: -------------------- Tony looks like an error on our part. One of our lead admins and developers looked at it and the problem should be fixed, it has pretty minimal IO. My apologies. matt -------------------- On Feb 19, 2009, at 1:39 PM, Tony Spencer wrote: > Phew. Thanks again Mark. Looks like I have their attention now: > > ------------------- > Hi Tony, > > > I wanted to let you know that I am consulting with our developers on > your issue (as those I/O numbers seem outragously high to me) to see > if there is perhaps a bug in our system that may be affecting you. > I will let you know as soon as I know more. > > > Regards, > > > Ben B - Slicehost Support > > ----------------------- > > > > > > > > On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: > >> >> There is absolutely no way that your slice has done 130k writes/ >> second and 66k reads/second over the last 4 hours. If that's in >> bytes or is the number of I/O operations _in total_ over the last 4 >> hours, I can believe it, but not I/O operations per second. The >> disk subsystems in their servers aren't fast enough to support >> those numbers otherwise. >> >> -Mark >> >> On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: >> >>> This is what stats say currently when I check them. I still don't >>> understand how that can be if I have roughly 600MB of free >>> physical memory: >>> >>> Diagnostics >>> >>> * Your slice is currently running. >>> * The host server is up. >>> * Your swap IO usage over the last 4 hours is high: 869.0001 >>> reads/s, 1276.3531 writes/s. (Read more about swap here) >>> * Your root IO usage over the last 4 hours is high: 130876.76 >>> reads/s, 66013.7694 writes/s. >>> * The host server's load is nominal: 0.18, 0.19, 0.10. >>> >>> >>> One thing that does come to mind: we have contact forms on each >>> property that send email when filled out. I have seen on some of >>> my other sites that there are bots that fill in forms and >>> sometimes rather ruthlessly. Perhaps there are large spikes from >>> this. I think I'll download access logs from apache and run them >>> through an analyzer. >>> >>> >>> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >>> >>>> My suggestion is to look in your slice management panel and see >>>> if the slice is actually doing as he says (under statistics). >>>> Sounds like a mistake to me! >>>> >>>> Sean >>>> >>>> Tony Spencer wrote: >>>>> >>>>> I'm stumped by this one and hope someone can give me some ideas >>>>> on debugging it. We have one relatively low traffic rails app >>>>> (~1150 pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk >>>>> >>>>> I have received 3 warnings via email from slicehost complaining >>>>> "...your slice, spainrealestate.co.uk, is showing a considerable >>>>> amount of consistent swapping activity..." and they are >>>>> threatening to cancel the slice. Everytime I ssh in the slice >>>>> is happy as a clam: >>>>> >>>>> root at spainrealestate:~# uptime >>>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, >>>>> 0.00 >>>>> >>>>> root at spainrealestate:~# free -m >>>>> total used free shared buffers >>>>> cached >>>>> Mem: 1022 779 242 0 >>>>> 117 227 >>>>> -/+ buffers/cache: 435 587 >>>>> Swap: 2047 5 2042 >>>>> >>>>> The slicehost support told me : >>>>> >>>>> "From what I can see, your Slice's I/O usage is incredibly high: >>>>> >>>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>>> >>>>> Those numbers are "reads/writes per second." Your Slice is >>>>> making almost 131,000 reads and 66,000 writes per second - which >>>>> is a very high number and could cause performance issues." >>>>> >>>>> >>>>> We are running Passenger and Rails 2.1. If I could somehow be >>>>> notified by the server when it began to happen perhaps I could >>>>> find some way to make my Mac blare loud music and wake me up so >>>>> I could see what process was chewing up memory. >>>>> >>>>> Oh and I've verified that we have no entries in any user's >>>>> crontab. >>>>> >>>>> I'd be grateful for any tips. >>>>> >>>>> >>>>> Finally here is what top sorted by memory looks like: >>>>> >>>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 >>>>> ruby1.8 >>>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >>>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 >>>>> ruby1.8 >>>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 >>>>> mysqld >>>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 >>>>> ruby1.8 >>>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 >>>>> ruby1.8 >>>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 >>>>> apache2 >>>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 >>>>> apache2 >>>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 >>>>> apache2 >>>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 >>>>> ruby1.8 >>>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>>> ApplicationPool >>>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 >>>>> apache2 >>>>> _______________________________________________ >>>>> raleigh-rb-members mailing list >>>>> raleigh-rb-members at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From lawwton at gmail.com Thu Feb 19 15:20:29 2009 From: lawwton at gmail.com (Alfredo Quiroga-Villamil) Date: Thu, 19 Feb 2009 15:20:29 -0500 Subject: [raleigh.rb] Project Tool Question In-Reply-To: <499DB43A.9070200@lojic.com> References: <5fe6fa8f0902190923p606ff118n6fd913729e7750cc@mail.gmail.com> <499DB43A.9070200@lojic.com> Message-ID: <5fe6fa8f0902191220o2511f737ga34abffa9ec145bc@mail.gmail.com> Cool, going to check that one out. Tx, appreciate it. Alfredo On Thu, Feb 19, 2009 at 2:34 PM, Brian Adkins wrote: > Alfredo Quiroga-Villamil wrote, On 2/19/09 12:23 PM: >> >> Any recommendations for a tool/application that you have used to >> create the entire project from scratch as part of the design process >> (Design Document). Example: gui views details, database schema >> description, NTH, MH, etc ... >> >> What do you typically use when you need to design/architect a new site >> from scratch? > > For design work involving UML diagrams, database schema, etc. I really like > Magic Draw. After using it for a while, I found the UI to be intuitive and > flexible. If you create many class diagrams, subtle differences in drawing > tools can make a *big* difference. > > It's written in Java so you can run on Mac OSX, Linux, Windows. I think I > paid $129 for a personal version - worth every penny: > > http://www.magicdraw.com/ > > I use it in "sketch" mode primarily for transferring design ideas to a > visual form i.e. no roundtrip. > >> Thanks in advance, >> >> Alfredo >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > -- > Brian Adkins > Lojic Technologies, LLC > http://lojic.com/ > 919-946-7547 (mobile) > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From info at lojic.com Thu Feb 19 16:17:17 2009 From: info at lojic.com (Brian Adkins) Date: Thu, 19 Feb 2009 16:17:17 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <5D720DE6-CEB0-4C43-8248-8E6BF388A95C@tonyspencer.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> <5D720DE6-CEB0-4C43-8248-8E6BF388A95C@tonyspencer.com> Message-ID: <499DCC5D.1090507@lojic.com> Tony Spencer wrote, On 2/19/09 2:51 PM: > Final message from the founder of slicehost: > > -------------------- > Tony looks like an error on our part. One of our lead admins and > developers looked at it and the problem should be fixed, it has pretty > minimal IO. My apologies. Glad to see they're able to plainly admit a mistake and apologize instead of spin :) > matt > -------------------- > > On Feb 19, 2009, at 1:39 PM, Tony Spencer wrote: > >> Phew. Thanks again Mark. Looks like I have their attention now: >> >> ------------------- >> Hi Tony, >> >> >> I wanted to let you know that I am consulting with our developers on >> your issue (as those I/O numbers seem outragously high to me) to see >> if there is perhaps a bug in our system that may be affecting you. I >> will let you know as soon as I know more. >> >> >> Regards, >> >> >> Ben B - Slicehost Support >> >> ----------------------- >> >> >> >> >> >> >> >> On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: >> >>> >>> There is absolutely no way that your slice has done 130k >>> writes/second and 66k reads/second over the last 4 hours. If that's >>> in bytes or is the number of I/O operations _in total_ over the last >>> 4 hours, I can believe it, but not I/O operations per second. The >>> disk subsystems in their servers aren't fast enough to support those >>> numbers otherwise. >>> >>> -Mark >>> >>> On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: >>> >>>> This is what stats say currently when I check them. I still don't >>>> understand how that can be if I have roughly 600MB of free physical >>>> memory: >>>> >>>> Diagnostics >>>> >>>> * Your slice is currently running. >>>> * The host server is up. >>>> * Your swap IO usage over the last 4 hours is high: 869.0001 >>>> reads/s, 1276.3531 writes/s. (Read more about swap here) >>>> * Your root IO usage over the last 4 hours is high: 130876.76 >>>> reads/s, 66013.7694 writes/s. >>>> * The host server's load is nominal: 0.18, 0.19, 0.10. >>>> >>>> >>>> One thing that does come to mind: we have contact forms on each >>>> property that send email when filled out. I have seen on some of my >>>> other sites that there are bots that fill in forms and sometimes >>>> rather ruthlessly. Perhaps there are large spikes from this. I >>>> think I'll download access logs from apache and run them through an >>>> analyzer. >>>> >>>> >>>> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >>>> >>>>> My suggestion is to look in your slice management panel and see if >>>>> the slice is actually doing as he says (under statistics). Sounds >>>>> like a mistake to me! >>>>> >>>>> Sean >>>>> >>>>> Tony Spencer wrote: >>>>>> >>>>>> I'm stumped by this one and hope someone can give me some ideas on >>>>>> debugging it. We have one relatively low traffic rails app (~1150 >>>>>> pageviews a day) running on a 1GB slice at slicehost.com: >>>>>> http://www.spainrealestate.co.uk >>>>>> >>>>>> I have received 3 warnings via email from slicehost complaining >>>>>> "...your slice, spainrealestate.co.uk, is showing a considerable >>>>>> amount of consistent swapping activity..." and they are >>>>>> threatening to cancel the slice. Everytime I ssh in the slice is >>>>>> happy as a clam: >>>>>> >>>>>> root at spainrealestate:~# uptime >>>>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 >>>>>> >>>>>> root at spainrealestate:~# free -m >>>>>> total used free shared buffers >>>>>> cached >>>>>> Mem: 1022 779 242 0 >>>>>> 117 227 >>>>>> -/+ buffers/cache: 435 587 >>>>>> Swap: 2047 5 2042 >>>>>> >>>>>> The slicehost support told me : >>>>>> >>>>>> "From what I can see, your Slice's I/O usage is incredibly high: >>>>>> >>>>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>>>> >>>>>> Those numbers are "reads/writes per second." Your Slice is making >>>>>> almost 131,000 reads and 66,000 writes per second - which is a >>>>>> very high number and could cause performance issues." >>>>>> >>>>>> >>>>>> We are running Passenger and Rails 2.1. If I could somehow be >>>>>> notified by the server when it began to happen perhaps I could >>>>>> find some way to make my Mac blare loud music and wake me up so I >>>>>> could see what process was chewing up memory. >>>>>> >>>>>> Oh and I've verified that we have no entries in any user's crontab. >>>>>> >>>>>> I'd be grateful for any tips. >>>>>> >>>>>> >>>>>> Finally here is what top sorted by memory looks like: >>>>>> >>>>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 >>>>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >>>>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 >>>>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld >>>>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 >>>>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 >>>>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 >>>>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 >>>>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 >>>>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 >>>>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>>>> ApplicationPool >>>>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 >>>>>> _______________________________________________ >>>>>> raleigh-rb-members mailing list >>>>>> raleigh-rb-members at rubyforge.org >>>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>>> >>>>> _______________________________________________ >>>>> raleigh-rb-members mailing list >>>>> raleigh-rb-members at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ 919-946-7547 (mobile) From nospam at tonyspencer.com Thu Feb 19 17:10:08 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 17:10:08 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <499DCC5D.1090507@lojic.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> <5D720DE6-CEB0-4C43-8248-8E6BF388A95C@tonyspencer.com> <499DCC5D.1090507@lojic.com> Message-ID: <5E3E6E35-8995-4F7F-B81F-497B22DD4604@tonyspencer.com> Yep. Slicehost comes through again. Man I'm really hoping their business doesn't change now that they are part of theplanet. On Feb 19, 2009, at 4:17 PM, Brian Adkins wrote: > Tony Spencer wrote, On 2/19/09 2:51 PM: >> Final message from the founder of slicehost: >> -------------------- >> Tony looks like an error on our part. One of our lead admins and >> developers looked at it and the problem should be fixed, it has >> pretty minimal IO. My apologies. > > Glad to see they're able to plainly admit a mistake and apologize > instead of spin :) > >> matt >> -------------------- >> On Feb 19, 2009, at 1:39 PM, Tony Spencer wrote: >>> Phew. Thanks again Mark. Looks like I have their attention now: >>> >>> ------------------- >>> Hi Tony, >>> >>> >>> I wanted to let you know that I am consulting with our developers >>> on your issue (as those I/O numbers seem outragously high to me) >>> to see if there is perhaps a bug in our system that may be >>> affecting you. I will let you know as soon as I know more. >>> >>> >>> Regards, >>> >>> >>> Ben B - Slicehost Support >>> >>> ----------------------- >>> >>> >>> >>> >>> >>> >>> >>> On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: >>> >>>> >>>> There is absolutely no way that your slice has done 130k writes/ >>>> second and 66k reads/second over the last 4 hours. If that's in >>>> bytes or is the number of I/O operations _in total_ over the last >>>> 4 hours, I can believe it, but not I/O operations per second. >>>> The disk subsystems in their servers aren't fast enough to >>>> support those numbers otherwise. >>>> >>>> -Mark >>>> >>>> On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: >>>> >>>>> This is what stats say currently when I check them. I still >>>>> don't understand how that can be if I have roughly 600MB of free >>>>> physical memory: >>>>> >>>>> Diagnostics >>>>> >>>>> * Your slice is currently running. >>>>> * The host server is up. >>>>> * Your swap IO usage over the last 4 hours is high: 869.0001 >>>>> reads/s, 1276.3531 writes/s. (Read more about swap here) >>>>> * Your root IO usage over the last 4 hours is high: 130876.76 >>>>> reads/s, 66013.7694 writes/s. >>>>> * The host server's load is nominal: 0.18, 0.19, 0.10. >>>>> >>>>> >>>>> One thing that does come to mind: we have contact forms on each >>>>> property that send email when filled out. I have seen on some >>>>> of my other sites that there are bots that fill in forms and >>>>> sometimes rather ruthlessly. Perhaps there are large spikes from >>>>> this. I think I'll download access logs from apache and run >>>>> them through an analyzer. >>>>> >>>>> >>>>> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >>>>> >>>>>> My suggestion is to look in your slice management panel and see >>>>>> if the slice is actually doing as he says (under statistics). >>>>>> Sounds like a mistake to me! >>>>>> >>>>>> Sean >>>>>> >>>>>> Tony Spencer wrote: >>>>>>> >>>>>>> I'm stumped by this one and hope someone can give me some >>>>>>> ideas on debugging it. We have one relatively low traffic >>>>>>> rails app (~1150 pageviews a day) running on a 1GB slice at >>>>>>> slicehost.com: http://www.spainrealestate.co.uk >>>>>>> >>>>>>> I have received 3 warnings via email from slicehost >>>>>>> complaining "...your slice, spainrealestate.co.uk, is showing >>>>>>> a considerable amount of consistent swapping activity..." and >>>>>>> they are threatening to cancel the slice. Everytime I ssh in >>>>>>> the slice is happy as a clam: >>>>>>> >>>>>>> root at spainrealestate:~# uptime >>>>>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, >>>>>>> 0.01, 0.00 >>>>>>> >>>>>>> root at spainrealestate:~# free -m >>>>>>> total used free shared >>>>>>> buffers cached >>>>>>> Mem: 1022 779 242 0 >>>>>>> 117 227 >>>>>>> -/+ buffers/cache: 435 587 >>>>>>> Swap: 2047 5 2042 >>>>>>> >>>>>>> The slicehost support told me : >>>>>>> >>>>>>> "From what I can see, your Slice's I/O usage is incredibly high: >>>>>>> >>>>>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>>>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>>>>> >>>>>>> Those numbers are "reads/writes per second." Your Slice is >>>>>>> making almost 131,000 reads and 66,000 writes per second - >>>>>>> which is a very high number and could cause performance issues." >>>>>>> >>>>>>> >>>>>>> We are running Passenger and Rails 2.1. If I could somehow be >>>>>>> notified by the server when it began to happen perhaps I could >>>>>>> find some way to make my Mac blare loud music and wake me up >>>>>>> so I could see what process was chewing up memory. >>>>>>> >>>>>>> Oh and I've verified that we have no entries in any user's >>>>>>> crontab. >>>>>>> >>>>>>> I'd be grateful for any tips. >>>>>>> >>>>>>> >>>>>>> Finally here is what top sorted by memory looks like: >>>>>>> >>>>>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 >>>>>>> ruby1.8 >>>>>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 >>>>>>> ruby >>>>>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 >>>>>>> ruby1.8 >>>>>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 >>>>>>> mysqld >>>>>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 >>>>>>> ruby1.8 >>>>>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 >>>>>>> ruby1.8 >>>>>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 >>>>>>> apache2 >>>>>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 >>>>>>> apache2 >>>>>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 >>>>>>> apache2 >>>>>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 >>>>>>> ruby1.8 >>>>>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>>>>> ApplicationPool >>>>>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 >>>>>>> apache2 >>>>>>> _______________________________________________ >>>>>>> raleigh-rb-members mailing list >>>>>>> raleigh-rb-members at rubyforge.org >>>>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>>>> >>>>>> _______________________________________________ >>>>>> raleigh-rb-members mailing list >>>>>> raleigh-rb-members at rubyforge.org >>>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>>> >>>>> _______________________________________________ >>>>> raleigh-rb-members mailing list >>>>> raleigh-rb-members at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -- > Brian Adkins > Lojic Technologies, LLC > http://lojic.com/ > 919-946-7547 (mobile) > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From davidbogus at gmail.com Thu Feb 19 18:15:59 2009 From: davidbogus at gmail.com (David Bogus) Date: Thu, 19 Feb 2009 18:15:59 -0500 Subject: [raleigh.rb] Static web site generator In-Reply-To: <8308260d0902190411m4034a0fbl9730287c27f041f2@mail.gmail.com> References: <499CE80A.3070809@lojic.com> <8308260d0902190411m4034a0fbl9730287c27f041f2@mail.gmail.com> Message-ID: StaticMatic++ I've been using StaticMatic on a small project recently. Its pretty feature lite. If all you need is templates and layouts and helpers it is quick to understand. I like that it has a server mode so that you don't need to rebuild to see changes. On Thu, Feb 19, 2009 at 7:11 AM, Steven Hilton wrote: > I tinkered around with StaticMatic a few months ago: > > http://staticmatic.rubyforge.org/ > > It seemed useful. > > - Steven > > On Thu, Feb 19, 2009 at 12:03 AM, Brian Adkins wrote: >> Can anyone recommend a nice tool for generating static web sites? >> >> Thanks, >> Brian >> >> -- >> Brian Adkins >> Lojic Technologies, LLC >> http://lojic.com/ >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > > -- > Steven Hilton > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Dave's Definitions: Morning, is after I've slept for more than four hours. Lunch is the second meal of the day no matter the hour of consumption. A long drive is one longer then you have last slept. Ineffable, if you don't understand I couldn't possibly explain it. From korebantic at gmail.com Thu Feb 19 18:27:58 2009 From: korebantic at gmail.com (korebantic) Date: Thu, 19 Feb 2009 18:27:58 -0500 Subject: [raleigh.rb] MacRuby Talk? In-Reply-To: <2136093073-1234988454-cardhu_decombobulator_blackberry.rim.net-886713576-@bxe1008.bisx.prod.on.blackberry> References: <7FF32FC5-4220-4360-B66B-B648660EE16E@acm.org> <2136093073-1234988454-cardhu_decombobulator_blackberry.rim.net-886713576-@bxe1008.bisx.prod.on.blackberry> Message-ID: <16e20a2b0902191527l7cf2f97fkab1342056f303bab@mail.gmail.com> +1 From rick.denatale at gmail.com Thu Feb 19 18:48:14 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Thu, 19 Feb 2009 18:48:14 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> Message-ID: Well I was going to send this just to Tony, but because of his email address, I figured it wouldn't get through. I probably had a bit to do with this. Ben's a former colleague who went to Slicehost. When I saw this thread I IMed him to see if he was aware of the thread, and when he wasn't pointed him to the archives for the list. On Thu, Feb 19, 2009 at 1:39 PM, Tony Spencer wrote: > Phew. Thanks again Mark. Looks like I have their attention now: > > ------------------- > Hi Tony, > > > I wanted to let you know that I am consulting with our developers on your > issue (as those I/O numbers seem outragously high to me) to see if there is > perhaps a bug in our system that may be affecting you. I will let you know > as soon as I know more. > > > Regards, > > > Ben B - Slicehost Support > > ----------------------- > > > > > > > > On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: > > >> There is absolutely no way that your slice has done 130k writes/second and >> 66k reads/second over the last 4 hours. If that's in bytes or is the number >> of I/O operations _in total_ over the last 4 hours, I can believe it, but >> not I/O operations per second. The disk subsystems in their servers aren't >> fast enough to support those numbers otherwise. >> >> -Mark >> >> On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: >> >> This is what stats say currently when I check them. I still don't >>> understand how that can be if I have roughly 600MB of free physical memory: >>> >>> Diagnostics >>> >>> * Your slice is currently running. >>> * The host server is up. >>> * Your swap IO usage over the last 4 hours is high: 869.0001 reads/s, >>> 1276.3531 writes/s. (Read more about swap here) >>> * Your root IO usage over the last 4 hours is high: 130876.76 reads/s, >>> 66013.7694 writes/s. >>> * The host server's load is nominal: 0.18, 0.19, 0.10. >>> >>> >>> One thing that does come to mind: we have contact forms on each property >>> that send email when filled out. I have seen on some of my other sites that >>> there are bots that fill in forms and sometimes rather ruthlessly. Perhaps >>> there are large spikes from this. I think I'll download access logs from >>> apache and run them through an analyzer. >>> >>> >>> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >>> >>> My suggestion is to look in your slice management panel and see if the >>>> slice is actually doing as he says (under statistics). Sounds like a >>>> mistake to me! >>>> >>>> Sean >>>> >>>> Tony Spencer wrote: >>>> >>>>> >>>>> I'm stumped by this one and hope someone can give me some ideas on >>>>> debugging it. We have one relatively low traffic rails app (~1150 pageviews >>>>> a day) running on a 1GB slice at slicehost.com: >>>>> http://www.spainrealestate.co.uk >>>>> >>>>> I have received 3 warnings via email from slicehost complaining >>>>> "...your slice, spainrealestate.co.uk, is showing a considerable >>>>> amount of consistent swapping activity..." and they are threatening to >>>>> cancel the slice. Everytime I ssh in the slice is happy as a clam: >>>>> >>>>> root at spainrealestate:~# uptime >>>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 >>>>> >>>>> root at spainrealestate:~# free -m >>>>> total used free shared buffers cached >>>>> Mem: 1022 779 242 0 117 >>>>> 227 >>>>> -/+ buffers/cache: 435 587 >>>>> Swap: 2047 5 2042 >>>>> >>>>> The slicehost support told me : >>>>> >>>>> "From what I can see, your Slice's I/O usage is incredibly high: >>>>> >>>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>>> >>>>> Those numbers are "reads/writes per second." Your Slice is making >>>>> almost 131,000 reads and 66,000 writes per second - which is a very high >>>>> number and could cause performance issues." >>>>> >>>>> >>>>> We are running Passenger and Rails 2.1. If I could somehow be notified >>>>> by the server when it began to happen perhaps I could find some way to make >>>>> my Mac blare loud music and wake me up so I could see what process was >>>>> chewing up memory. >>>>> >>>>> Oh and I've verified that we have no entries in any user's crontab. >>>>> >>>>> I'd be grateful for any tips. >>>>> >>>>> >>>>> Finally here is what top sorted by memory looks like: >>>>> >>>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 >>>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >>>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 >>>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld >>>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 >>>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 >>>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 >>>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 >>>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 >>>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 >>>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>>> ApplicationPool >>>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 >>>>> _______________________________________________ >>>>> raleigh-rb-members mailing list >>>>> raleigh-rb-members at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>>> >>>> >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From nospam at tonyspencer.com Thu Feb 19 19:17:48 2009 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 19 Feb 2009 19:17:48 -0500 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> Message-ID: Oh well thanks for that Rick. I do appreciate it. I also expressed some concern on Twitter which got the attention of the founder. Twitter is great for that kind of thing (when companies have discovered its power for reputation management). On Feb 19, 2009, at 6:48 PM, Rick DeNatale wrote: > Well I was going to send this just to Tony, but because of his email > address, I figured it wouldn't get through. > > I probably had a bit to do with this. Ben's a former colleague who > went to Slicehost. When I saw this thread I IMed him to see if he > was aware of the thread, and when he wasn't pointed him to the > archives for the list. > > On Thu, Feb 19, 2009 at 1:39 PM, Tony Spencer > wrote: > Phew. Thanks again Mark. Looks like I have their attention now: > > ------------------- > Hi Tony, > > > I wanted to let you know that I am consulting with our developers on > your issue (as those I/O numbers seem outragously high to me) to see > if there is perhaps a bug in our system that may be affecting you. > I will let you know as soon as I know more. > > > Regards, > > > Ben B - Slicehost Support > > ----------------------- > > > > > > > > > On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: > > > There is absolutely no way that your slice has done 130k writes/ > second and 66k reads/second over the last 4 hours. If that's in > bytes or is the number of I/O operations _in total_ over the last 4 > hours, I can believe it, but not I/O operations per second. The > disk subsystems in their servers aren't fast enough to support those > numbers otherwise. > > -Mark > > On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: > > This is what stats say currently when I check them. I still don't > understand how that can be if I have roughly 600MB of free physical > memory: > > Diagnostics > > * Your slice is currently running. > * The host server is up. > * Your swap IO usage over the last 4 hours is high: 869.0001 reads/ > s, 1276.3531 writes/s. (Read more about swap here) > * Your root IO usage over the last 4 hours is high: 130876.76 > reads/s, 66013.7694 writes/s. > * The host server's load is nominal: 0.18, 0.19, 0.10. > > > One thing that does come to mind: we have contact forms on each > property that send email when filled out. I have seen on some of my > other sites that there are bots that fill in forms and sometimes > rather ruthlessly. Perhaps there are large spikes from this. I > think I'll download access logs from apache and run them through an > analyzer. > > > On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: > > My suggestion is to look in your slice management panel and see if > the slice is actually doing as he says (under statistics). Sounds > like a mistake to me! > > Sean > > Tony Spencer wrote: > > I'm stumped by this one and hope someone can give me some ideas on > debugging it. We have one relatively low traffic rails app (~1150 > pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk > > I have received 3 warnings via email from slicehost complaining > "...your slice, spainrealestate.co.uk, is showing a considerable > amount of consistent swapping activity..." and they are threatening > to cancel the slice. Everytime I ssh in the slice is happy as a clam: > > root at spainrealestate:~# uptime > 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, 0.00 > > root at spainrealestate:~# free -m > total used free shared buffers > cached > Mem: 1022 779 242 0 > 117 227 > -/+ buffers/cache: 435 587 > Swap: 2047 5 2042 > > The slicehost support told me : > > "From what I can see, your Slice's I/O usage is incredibly high: > > ? Swap read rate: 868.5205, write rate: 1275.6448 > ? Root read rate: 130803.8933, write rate: 65973.9669 > > Those numbers are "reads/writes per second." Your Slice is making > almost 131,000 reads and 66,000 writes per second - which is a very > high number and could cause performance issues." > > > We are running Passenger and Rails 2.1. If I could somehow be > notified by the server when it began to happen perhaps I could find > some way to make my Mac blare loud music and wake me up so I could > see what process was chewing up memory. > > Oh and I've verified that we have no entries in any user's crontab. > > I'd be grateful for any tips. > > > Finally here is what top sorted by memory looks like: > > 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 ruby1.8 > 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby > 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 ruby1.8 > 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 mysqld > 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 ruby1.8 > 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 ruby1.8 > 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 apache2 > 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 apache2 > 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 apache2 > 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 ruby1.8 > 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 > ApplicationPool > 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 apache2 > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Twitter: http://twitter.com/RickDeNatale > WWR: http://www.workingwithrails.com/person/9021-rick-denatale > LinkedIn: http://www.linkedin.com/in/rickdenatale > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From minter at lunenburg.org Thu Feb 19 21:13:03 2009 From: minter at lunenburg.org (H. Wade Minter) Date: Thu, 19 Feb 2009 20:13:03 -0600 Subject: [raleigh.rb] Random massive memory usage on a VPS In-Reply-To: <5E3E6E35-8995-4F7F-B81F-497B22DD4604@tonyspencer.com> References: <9316010E-85C5-4ED3-9682-302404A53C48@tonyspencer.com> <499D87A7.5090505@gmail.com> <31149658-9CA6-4516-937A-92FC96CD5C60@tonyspencer.com> <21209D6C-2167-4AE9-9084-57AD80DC385A@37signals.com> <80E95634-4D20-44F4-8F11-BF413D1A52DE@tonyspencer.com> <5D720DE6-CEB0-4C43-8248-8E6BF388A95C@tonyspencer.com> <499DCC5D.1090507@lojic.com> <5E3E6E35-8995-4F7F-B81F-497B22DD4604@tonyspencer.com> Message-ID: <17E24C3E-13DC-4F8F-A765-D8F3F6D9C39F@lunenburg.org> FWIW, Slicehost is part of Rackspace now, not The Planet. --Wade On Feb 19, 2009, at 4:10 PM, Tony Spencer wrote: > Yep. Slicehost comes through again. Man I'm really hoping their > business doesn't change now that they are part of theplanet. > > > On Feb 19, 2009, at 4:17 PM, Brian Adkins wrote: > >> Tony Spencer wrote, On 2/19/09 2:51 PM: >>> Final message from the founder of slicehost: >>> -------------------- >>> Tony looks like an error on our part. One of our lead admins and >>> developers looked at it and the problem should be fixed, it has >>> pretty minimal IO. My apologies. >> >> Glad to see they're able to plainly admit a mistake and apologize >> instead of spin :) >> >>> matt >>> -------------------- >>> On Feb 19, 2009, at 1:39 PM, Tony Spencer wrote: >>>> Phew. Thanks again Mark. Looks like I have their attention now: >>>> >>>> ------------------- >>>> Hi Tony, >>>> >>>> >>>> I wanted to let you know that I am consulting with our developers >>>> on your issue (as those I/O numbers seem outragously high to me) >>>> to see if there is perhaps a bug in our system that may be >>>> affecting you. I will let you know as soon as I know more. >>>> >>>> >>>> Regards, >>>> >>>> >>>> Ben B - Slicehost Support >>>> >>>> ----------------------- >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: >>>> >>>>> >>>>> There is absolutely no way that your slice has done 130k writes/ >>>>> second and 66k reads/second over the last 4 hours. If that's in >>>>> bytes or is the number of I/O operations _in total_ over the >>>>> last 4 hours, I can believe it, but not I/O operations per >>>>> second. The disk subsystems in their servers aren't fast enough >>>>> to support those numbers otherwise. >>>>> >>>>> -Mark >>>>> >>>>> On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: >>>>> >>>>>> This is what stats say currently when I check them. I still >>>>>> don't understand how that can be if I have roughly 600MB of >>>>>> free physical memory: >>>>>> >>>>>> Diagnostics >>>>>> >>>>>> * Your slice is currently running. >>>>>> * The host server is up. >>>>>> * Your swap IO usage over the last 4 hours is high: 869.0001 >>>>>> reads/s, 1276.3531 writes/s. (Read more about swap here) >>>>>> * Your root IO usage over the last 4 hours is high: 130876.76 >>>>>> reads/s, 66013.7694 writes/s. >>>>>> * The host server's load is nominal: 0.18, 0.19, 0.10. >>>>>> >>>>>> >>>>>> One thing that does come to mind: we have contact forms on each >>>>>> property that send email when filled out. I have seen on some >>>>>> of my other sites that there are bots that fill in forms and >>>>>> sometimes rather ruthlessly. Perhaps there are large spikes >>>>>> from this. I think I'll download access logs from apache and >>>>>> run them through an analyzer. >>>>>> >>>>>> >>>>>> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >>>>>> >>>>>>> My suggestion is to look in your slice management panel and >>>>>>> see if the slice is actually doing as he says (under >>>>>>> statistics). Sounds like a mistake to me! >>>>>>> >>>>>>> Sean >>>>>>> >>>>>>> Tony Spencer wrote: >>>>>>>> >>>>>>>> I'm stumped by this one and hope someone can give me some >>>>>>>> ideas on debugging it. We have one relatively low traffic >>>>>>>> rails app (~1150 pageviews a day) running on a 1GB slice at >>>>>>>> slicehost.com: http://www.spainrealestate.co.uk >>>>>>>> >>>>>>>> I have received 3 warnings via email from slicehost >>>>>>>> complaining "...your slice, spainrealestate.co.uk, is showing >>>>>>>> a considerable amount of consistent swapping activity..." and >>>>>>>> they are threatening to cancel the slice. Everytime I ssh in >>>>>>>> the slice is happy as a clam: >>>>>>>> >>>>>>>> root at spainrealestate:~# uptime >>>>>>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, >>>>>>>> 0.01, 0.00 >>>>>>>> >>>>>>>> root at spainrealestate:~# free -m >>>>>>>> total used free shared >>>>>>>> buffers cached >>>>>>>> Mem: 1022 779 242 0 >>>>>>>> 117 227 >>>>>>>> -/+ buffers/cache: 435 587 >>>>>>>> Swap: 2047 5 2042 >>>>>>>> >>>>>>>> The slicehost support told me : >>>>>>>> >>>>>>>> "From what I can see, your Slice's I/O usage is incredibly >>>>>>>> high: >>>>>>>> >>>>>>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>>>>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>>>>>> >>>>>>>> Those numbers are "reads/writes per second." Your Slice is >>>>>>>> making almost 131,000 reads and 66,000 writes per second - >>>>>>>> which is a very high number and could cause performance >>>>>>>> issues." >>>>>>>> >>>>>>>> >>>>>>>> We are running Passenger and Rails 2.1. If I could somehow be >>>>>>>> notified by the server when it began to happen perhaps I >>>>>>>> could find some way to make my Mac blare loud music and wake >>>>>>>> me up so I could see what process was chewing up memory. >>>>>>>> >>>>>>>> Oh and I've verified that we have no entries in any user's >>>>>>>> crontab. >>>>>>>> >>>>>>>> I'd be grateful for any tips. >>>>>>>> >>>>>>>> >>>>>>>> Finally here is what top sorted by memory looks like: >>>>>>>> >>>>>>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 >>>>>>>> ruby1.8 >>>>>>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 >>>>>>>> ruby >>>>>>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 >>>>>>>> ruby1.8 >>>>>>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 >>>>>>>> mysqld >>>>>>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 >>>>>>>> ruby1.8 >>>>>>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 >>>>>>>> ruby1.8 >>>>>>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 >>>>>>>> apache2 >>>>>>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 >>>>>>>> apache2 >>>>>>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 >>>>>>>> apache2 >>>>>>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 >>>>>>>> ruby1.8 >>>>>>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>>>>>> ApplicationPool >>>>>>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 >>>>>>>> apache2 >>>>>>>> _______________________________________________ >>>>>>>> raleigh-rb-members mailing list >>>>>>>> raleigh-rb-members at rubyforge.org >>>>>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>>>>> >>>>>>> _______________________________________________ >>>>>>> raleigh-rb-members mailing list >>>>>>> raleigh-rb-members at rubyforge.org >>>>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>>>> >>>>>> _______________________________________________ >>>>>> raleigh-rb-members mailing list >>>>>> raleigh-rb-members at rubyforge.org >>>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>>> >>>>> _______________________________________________ >>>>> raleigh-rb-members mailing list >>>>> raleigh-rb-members at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> -- >> Brian Adkins >> Lojic Technologies, LLC >> http://lojic.com/ >> 919-946-7547 (mobile) >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From jivirtual at gmail.com Fri Feb 20 19:19:30 2009 From: jivirtual at gmail.com (Jose Ignacio) Date: Fri, 20 Feb 2009 19:19:30 -0500 Subject: [raleigh.rb] raleigh-rb-members Digest, Vol 39, Issue 18 In-Reply-To: References: Message-ID: <90917A94-F7E6-4E41-A3D3-D08ADC37AABF@gmail.com> Hello Alfredo, I use gliffy.com, works specially well to plan the workflow of an App, but they also have html objects such as drop-downs and other user interface icons.. It is a flash app, so needs saving and refreshing after each update. The drawing and scanner seems better, I just mention this because OmniGraffle was mentioned. I switched from omnigraffle to gliffy for flowcharts because it was easier for collaboration. cheers, Jose On Feb 19, 2009, at 2:27 PM, raleigh-rb-members-request at rubyforge.org wrote a > Send raleigh-rb-members mailing list submissions to > raleigh-rb-members at rubyforge.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > or, via email, send a message with subject or body 'help' to > raleigh-rb-members-request at rubyforge.org > > You can reach the person managing the list at > raleigh-rb-members-owner at rubyforge.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of raleigh-rb-members digest..." > > > Today's Topics: > > 1. Re: Project Tool Question (Tony Spencer) > 2. Re: Random massive memory usage on a VPS (Tony Spencer) > 3. Re: Project Tool Question (Nathan L. Walls) > 4. Re: Project Tool Question (Alfredo Quiroga-Villamil) > 5. Re: Random massive memory usage on a VPS (Tony Spencer) > 6. Re: Project Tool Question (Alfredo Quiroga-Villamil) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 19 Feb 2009 12:36:57 -0500 > From: Tony Spencer > Subject: Re: [raleigh.rb] Project Tool Question > To: "The mailing list of raleigh.rb" > > Message-ID: > Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes > > This might sound arcane but I've had great success over the past 2 > years by drawing interfaces on paper with notes about behavior > highlighted. I then feed them in a multi page scanner and upload to > Basecamp. The team meets via Skype to review the drawings and poke > holes in it. > > Next step, a developer designs the initial DB just by typing the > models and columns and we meet once more to poke at it. > > Next he loads the initial DB with migrations and begins developing the > app around the drawings. > > Finally my designer gets tickets assigned to him as views are > completed and he makes them pretty as he has a Rails stack running on > his design machine and understands basics about how to update from > SVN. > > I review and engage in back and forth with developer and designer > until an interface is right and the ticket gets closed. > > This may not be the cool way to do it but it sure has worked great for > us. > > > On Feb 19, 2009, at 12:23 PM, Alfredo Quiroga-Villamil wrote: > >> Any recommendations for a tool/application that you have used to >> create the entire project from scratch as part of the design process >> (Design Document). Example: gui views details, database schema >> description, NTH, MH, etc ... >> >> What do you typically use when you need to design/architect a new >> site >> from scratch? >> >> Thanks in advance, >> >> Alfredo >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > > ------------------------------ > > Message: 2 > Date: Thu, 19 Feb 2009 12:48:17 -0500 > From: Tony Spencer > Subject: Re: [raleigh.rb] Random massive memory usage on a VPS > To: "The mailing list of raleigh.rb" > > Message-ID: <6F88FA05-9894-45C1-9FA2-19E41654ADB4 at tonyspencer.com> > Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; > delsp=yes > > Thanks very much for giving me this sanity check. I'll bring it up > with the owner. He has agreed to help me with this issue. > > On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: > >> >> There is absolutely no way that your slice has done 130k writes/ >> second and 66k reads/second over the last 4 hours. If that's in >> bytes or is the number of I/O operations _in total_ over the last 4 >> hours, I can believe it, but not I/O operations per second. The >> disk subsystems in their servers aren't fast enough to support those >> numbers otherwise. >> >> -Mark >> >> On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: >> >>> This is what stats say currently when I check them. I still don't >>> understand how that can be if I have roughly 600MB of free physical >>> memory: >>> >>> Diagnostics >>> >>> * Your slice is currently running. >>> * The host server is up. >>> * Your swap IO usage over the last 4 hours is high: 869.0001 >>> reads/s, 1276.3531 writes/s. (Read more about swap here) >>> * Your root IO usage over the last 4 hours is high: 130876.76 >>> reads/s, 66013.7694 writes/s. >>> * The host server's load is nominal: 0.18, 0.19, 0.10. >>> >>> >>> One thing that does come to mind: we have contact forms on each >>> property that send email when filled out. I have seen on some of >>> my other sites that there are bots that fill in forms and sometimes >>> rather ruthlessly. Perhaps there are large spikes from this. I >>> think I'll download access logs from apache and run them through an >>> analyzer. >>> >>> >>> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >>> >>>> My suggestion is to look in your slice management panel and see if >>>> the slice is actually doing as he says (under statistics). Sounds >>>> like a mistake to me! >>>> >>>> Sean >>>> >>>> Tony Spencer wrote: >>>>> >>>>> I'm stumped by this one and hope someone can give me some ideas >>>>> on debugging it. We have one relatively low traffic rails app >>>>> (~1150 pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk >>>>> >>>>> I have received 3 warnings via email from slicehost complaining >>>>> "...your slice, spainrealestate.co.uk, is showing a considerable >>>>> amount of consistent swapping activity..." and they are >>>>> threatening to cancel the slice. Everytime I ssh in the slice is >>>>> happy as a clam: >>>>> >>>>> root at spainrealestate:~# uptime >>>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, >>>>> 0.00 >>>>> >>>>> root at spainrealestate:~# free -m >>>>> total used free shared buffers >>>>> cached >>>>> Mem: 1022 779 242 0 >>>>> 117 227 >>>>> -/+ buffers/cache: 435 587 >>>>> Swap: 2047 5 2042 >>>>> >>>>> The slicehost support told me : >>>>> >>>>> "From what I can see, your Slice's I/O usage is incredibly high: >>>>> >>>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>>> >>>>> Those numbers are "reads/writes per second." Your Slice is >>>>> making almost 131,000 reads and 66,000 writes per second - which >>>>> is a very high number and could cause performance issues." >>>>> >>>>> >>>>> We are running Passenger and Rails 2.1. If I could somehow be >>>>> notified by the server when it began to happen perhaps I could >>>>> find some way to make my Mac blare loud music and wake me up so I >>>>> could see what process was chewing up memory. >>>>> >>>>> Oh and I've verified that we have no entries in any user's >>>>> crontab. >>>>> >>>>> I'd be grateful for any tips. >>>>> >>>>> >>>>> Finally here is what top sorted by memory looks like: >>>>> >>>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 >>>>> ruby1.8 >>>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >>>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 >>>>> ruby1.8 >>>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 >>>>> mysqld >>>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 >>>>> ruby1.8 >>>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 >>>>> ruby1.8 >>>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 >>>>> apache2 >>>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 >>>>> apache2 >>>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 >>>>> apache2 >>>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 >>>>> ruby1.8 >>>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>>> ApplicationPool >>>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 >>>>> apache2 >>>>> _______________________________________________ >>>>> raleigh-rb-members mailing list >>>>> raleigh-rb-members at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > ------------------------------ > > Message: 3 > Date: Thu, 19 Feb 2009 13:07:39 -0500 > From: "Nathan L. Walls" > Subject: Re: [raleigh.rb] Project Tool Question > To: "The mailing list of raleigh.rb" > > Message-ID: > Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes > > I'm not sure I follow, but perhaps in answering, some clarification > will emerge: > > - GUI views / HTML > > I use BBEdit for generally everything text related. For my moonlit > business, I build HTML for my views, admin and public on a local > virtual host. That leads into hooking up controllers and ERb pretty > easily once I figure out how the app needs to act. > > - Database schema > > I use OmniGraffle to build a visual representation of my schema and > relationships. An absolute joy to use. > > - Notes / tasks > > Since I'm working largely solo on the tech side, I keep misc notes in > OmniOutliner and tasks in OmniFocus. > > > On Feb 19, 2009, at 12:23 PM, Alfredo Quiroga-Villamil wrote: > >> Any recommendations for a tool/application that you have used to >> create the entire project from scratch as part of the design process >> (Design Document). Example: gui views details, database schema >> description, NTH, MH, etc ... >> >> What do you typically use when you need to design/architect a new >> site >> from scratch? >> >> Thanks in advance, >> >> Alfredo >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > ------------------------------ > > Message: 4 > Date: Thu, 19 Feb 2009 13:32:25 -0500 > From: Alfredo Quiroga-Villamil > Subject: Re: [raleigh.rb] Project Tool Question > To: "The mailing list of raleigh.rb" > > Message-ID: > <5fe6fa8f0902191032w37b6cb0dyad06943618fe5b46 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Nathan: > > That's pretty much what I am looking for. To be more specific, I > currently use the following. > > a) To get a general idea of what the application will do, I usually > start off with a white board. > b) Some of the stuff in the white board, ends up being mapped with > FreeMind. > c) For my database I use MySql Workbench > d) The design document ends up being old M. Word with some images from > FreeMind, Database Schema and other information regarding the Design > Document. > > What I am looking for: > > An application that will allow me to do all that with a for example > pre-defined set of templates that will contain Design Document items > that are repetitive and applicable to all the projects I'll be working > on. To get an idea, check out: > > http://readyset.tigris.org/nonav/templates/frameset.html > > It's an open source project that allows you to re-use the same set of > templates for all your projects. > > I was wondering if there is a tool out there that sort of combines all > these ideas and merge them all into a single application. Also > providing me with the ability to mock up some of my views and their > respective flows. The view won't look of course like the actual > finished product; but it would allow me to place things such as forms > for login, a grid, accordion layouts, etc ... Essentially allowing me > to sketch out the entire application flow. > > Thanks for the response, appreciate it. > > On Thu, Feb 19, 2009 at 1:07 PM, Nathan L. Walls > wrote: >> I'm not sure I follow, but perhaps in answering, some clarification >> will >> emerge: >> >> - GUI views / HTML >> >> I use BBEdit for generally everything text related. For my moonlit >> business, >> I build HTML for my views, admin and public on a local virtual >> host. That >> leads into hooking up controllers and ERb pretty easily once I >> figure out >> how the app needs to act. >> >> - Database schema >> >> I use OmniGraffle to build a visual representation of my schema and >> relationships. An absolute joy to use. >> >> - Notes / tasks >> >> Since I'm working largely solo on the tech side, I keep misc notes in >> OmniOutliner and tasks in OmniFocus. >> >> >> On Feb 19, 2009, at 12:23 PM, Alfredo Quiroga-Villamil wrote: >> >>> Any recommendations for a tool/application that you have used to >>> create the entire project from scratch as part of the design process >>> (Design Document). Example: gui views details, database schema >>> description, NTH, MH, etc ... >>> >>> What do you typically use when you need to design/architect a new >>> site >>> from scratch? >>> >>> Thanks in advance, >>> >>> Alfredo >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > ------------------------------ > > Message: 5 > Date: Thu, 19 Feb 2009 13:39:31 -0500 > From: Tony Spencer > Subject: Re: [raleigh.rb] Random massive memory usage on a VPS > To: "The mailing list of raleigh.rb" > > Message-ID: <80E95634-4D20-44F4-8F11-BF413D1A52DE at tonyspencer.com> > Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; > delsp=yes > > Phew. Thanks again Mark. Looks like I have their attention now: > > ------------------- > Hi Tony, > > > I wanted to let you know that I am consulting with our developers on > your issue (as those I/O numbers seem outragously high to me) to see > if there is perhaps a bug in our system that may be affecting you. I > will let you know as soon as I know more. > > > Regards, > > > Ben B - Slicehost Support > > ----------------------- > > > > > > > > On Feb 19, 2009, at 12:18 PM, Mark Imbriaco wrote: > >> >> There is absolutely no way that your slice has done 130k writes/ >> second and 66k reads/second over the last 4 hours. If that's in >> bytes or is the number of I/O operations _in total_ over the last 4 >> hours, I can believe it, but not I/O operations per second. The >> disk subsystems in their servers aren't fast enough to support those >> numbers otherwise. >> >> -Mark >> >> On Feb 19, 2009, at 12:06 PM, Tony Spencer wrote: >> >>> This is what stats say currently when I check them. I still don't >>> understand how that can be if I have roughly 600MB of free physical >>> memory: >>> >>> Diagnostics >>> >>> * Your slice is currently running. >>> * The host server is up. >>> * Your swap IO usage over the last 4 hours is high: 869.0001 >>> reads/s, 1276.3531 writes/s. (Read more about swap here) >>> * Your root IO usage over the last 4 hours is high: 130876.76 >>> reads/s, 66013.7694 writes/s. >>> * The host server's load is nominal: 0.18, 0.19, 0.10. >>> >>> >>> One thing that does come to mind: we have contact forms on each >>> property that send email when filled out. I have seen on some of >>> my other sites that there are bots that fill in forms and sometimes >>> rather ruthlessly. Perhaps there are large spikes from this. I >>> think I'll download access logs from apache and run them through an >>> analyzer. >>> >>> >>> On Feb 19, 2009, at 11:24 AM, Sean Cribbs wrote: >>> >>>> My suggestion is to look in your slice management panel and see if >>>> the slice is actually doing as he says (under statistics). Sounds >>>> like a mistake to me! >>>> >>>> Sean >>>> >>>> Tony Spencer wrote: >>>>> >>>>> I'm stumped by this one and hope someone can give me some ideas >>>>> on debugging it. We have one relatively low traffic rails app >>>>> (~1150 pageviews a day) running on a 1GB slice at slicehost.com: http://www.spainrealestate.co.uk >>>>> >>>>> I have received 3 warnings via email from slicehost complaining >>>>> "...your slice, spainrealestate.co.uk, is showing a considerable >>>>> amount of consistent swapping activity..." and they are >>>>> threatening to cancel the slice. Everytime I ssh in the slice is >>>>> happy as a clam: >>>>> >>>>> root at spainrealestate:~# uptime >>>>> 14:53:23 up 69 days, 23:26, 2 users, load average: 0.00, 0.01, >>>>> 0.00 >>>>> >>>>> root at spainrealestate:~# free -m >>>>> total used free shared buffers >>>>> cached >>>>> Mem: 1022 779 242 0 >>>>> 117 227 >>>>> -/+ buffers/cache: 435 587 >>>>> Swap: 2047 5 2042 >>>>> >>>>> The slicehost support told me : >>>>> >>>>> "From what I can see, your Slice's I/O usage is incredibly high: >>>>> >>>>> ? Swap read rate: 868.5205, write rate: 1275.6448 >>>>> ? Root read rate: 130803.8933, write rate: 65973.9669 >>>>> >>>>> Those numbers are "reads/writes per second." Your Slice is >>>>> making almost 131,000 reads and 66,000 writes per second - which >>>>> is a very high number and could cause performance issues." >>>>> >>>>> >>>>> We are running Passenger and Rails 2.1. If I could somehow be >>>>> notified by the server when it began to happen perhaps I could >>>>> find some way to make my Mac blare loud music and wake me up so I >>>>> could see what process was chewing up memory. >>>>> >>>>> Oh and I've verified that we have no entries in any user's >>>>> crontab. >>>>> >>>>> I'd be grateful for any tips. >>>>> >>>>> >>>>> Finally here is what top sorted by memory looks like: >>>>> >>>>> 32167 sre 16 0 202m 122m 1920 S 0 12.0 0:32.64 >>>>> ruby1.8 >>>>> 29092 sre 15 0 135m 60m 1988 S 0 6.0 0:16.68 ruby >>>>> 32309 sre 16 0 139m 58m 1892 S 6 5.7 0:00.94 >>>>> ruby1.8 >>>>> 15936 mysql 15 0 291m 53m 6048 S 2 5.2 22:49.74 >>>>> mysqld >>>>> 32306 sre 16 0 132m 52m 2384 S 0 5.2 0:02.15 >>>>> ruby1.8 >>>>> 32305 root 16 0 98384 34m 2520 S 0 3.4 0:01.92 >>>>> ruby1.8 >>>>> 12291 www-data 20 0 418m 16m 1876 S 0 1.7 0:25.21 >>>>> apache2 >>>>> 12289 www-data 20 0 418m 16m 1928 S 0 1.6 0:22.71 >>>>> apache2 >>>>> 5584 www-data 16 0 418m 15m 1868 S 0 1.5 0:21.60 >>>>> apache2 >>>>> 12285 root 16 0 54388 15m 1528 S 0 1.5 6:22.91 >>>>> ruby1.8 >>>>> 12283 root 15 0 93196 3240 1288 S 0 0.3 0:03.89 >>>>> ApplicationPool >>>>> 12281 root 16 0 125m 3192 1464 S 0 0.3 0:12.71 >>>>> apache2 >>>>> _______________________________________________ >>>>> raleigh-rb-members mailing list >>>>> raleigh-rb-members at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>>> >>>> _______________________________________________ >>>> raleigh-rb-members mailing list >>>> raleigh-rb-members at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > ------------------------------ > > Message: 6 > Date: Thu, 19 Feb 2009 14:21:33 -0500 > From: Alfredo Quiroga-Villamil > Subject: Re: [raleigh.rb] Project Tool Question > To: "The mailing list of raleigh.rb" > > Message-ID: > <5fe6fa8f0902191121l7b2cb2b7qcb54e687c4a74251 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Thanks Tony, that works. > s is in tune with what I had in mind: > Thi > > http://www.conceptdraw.com/en/products/webwave/applications.php > > Thanks all for your help, > > Alfredo > > > On Thu, Feb 19, 2009 at 12:36 PM, Tony Spencer > wrote: >> This might sound arcane but I've had great success over the past 2 >> years by >> drawing interfaces on paper with notes about behavior highlighted. >> I then >> feed them in a multi page scanner and upload to Basecamp. The team >> meets via >> Skype to review the drawings and poke holes in it. >> >> Next step, a developer designs the initial DB just by typing the >> models and >> columns and we meet once more to poke at it. >> >> Next he loads the initial DB with migrations and begins developing >> the app >> around the drawings. >> >> Finally my designer gets tickets assigned to him as views are >> completed and >> he makes them pretty as he has a Rails stack running on his design >> machine >> and understands basics about how to update from SVN. >> >> I review and engage in back and forth with developer and designer >> until an >> interface is right and the ticket gets closed. >> >> This may not be the cool way to do it but it sure has worked great >> for us. >> >> >> On Feb 19, 2009, at 12:23 PM, Alfredo Quiroga-Villamil wrote: >> >>> Any recommendations for a tool/application that you have used to >>> create the entire project from scratch as part of the design process >>> (Design Document). Example: gui views details, database schema >>> description, NTH, MH, etc ... >>> >>> What do you typically use when you need to design/architect a new >>> site >>> from scratch? >>> >>> Thanks in advance, >>> >>> Alfredo >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > ------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > End of raleigh-rb-members Digest, Vol 39, Issue 18 > ************************************************** From thomas at ravinggenius.com Sat Feb 21 16:32:19 2009 From: thomas at ravinggenius.com (Thomas Ingram) Date: Sat, 21 Feb 2009 16:32:19 -0500 Subject: [raleigh.rb] My newbie question is more newbie than yours Message-ID: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> #!/ruby/rails/2.2.2 I am building a website where visitors can add bookings, but not list them. I placed map.resources :bookings, :only => [:new] in routes.rb, but I get a NoMethodError when I try to load the new bookings form. The error happens on this line in the view: form_for booking do |f| If I edit routes.rb to look like map.resources :bookings, :only => [:index, :new] everything is fine until I hit submit. Then I get a weird ActionController::MethodNotAllowed error telling me that only GET requests are allowed. Both the URL in the address bar and the HTML for the form seem to indicate that the form is posting to the index action. Why would it do that? In case you need to know, I have removed the actions that I do not require from the BookingsController. All that is left is new and create and they are pretty much the same as when Rails generated them. Can anybody help me with this or point me in the right direction? I've looked on Google, but I haven't found anything. -- Thomas ><> Raving Genius? - foaming at the brain? m: 919 449.6305 e: thomas at ravinggenius.com w: http://log.ravinggenius.com/ wii: 6751 1365 9898 2150 From mshiltonj at gmail.com Sat Feb 21 17:31:54 2009 From: mshiltonj at gmail.com (Steven Hilton) Date: Sat, 21 Feb 2009 17:31:54 -0500 Subject: [raleigh.rb] My newbie question is more newbie than yours In-Reply-To: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> References: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> Message-ID: <8308260d0902211431h3862e396if23e8f6b13ce7575@mail.gmail.com> You probably need to allow the 'create' action as well. /bookings/new #=> the 'new' form /bookings #=> the form POSTs to this to create. With what you've said so far, you don't need the 'index' action enabled. On Sat, Feb 21, 2009 at 4:32 PM, Thomas Ingram wrote: > #!/ruby/rails/2.2.2 > > I am building a website where visitors can add bookings, but not list > them. I placed map.resources :bookings, :only => [:new] in routes.rb, > but I get a NoMethodError when I try to load the new bookings form. > The error happens on this line in the view: form_for booking do |f| > > If I edit routes.rb to look like map.resources :bookings, :only => > [:index, :new] everything is fine until I hit submit. Then I get a > weird ActionController::MethodNotAllowed error telling me that only > GET requests are allowed. Both the URL in the address bar and the HTML > for the form seem to indicate that the form is posting to the index > action. Why would it do that? > > In case you need to know, I have removed the actions that I do not > require from the BookingsController. All that is left is new and > create and they are pretty much the same as when Rails generated them. > Can anybody help me with this or point me in the right direction? I've > looked on Google, but I haven't found anything. > > -- > Thomas ><> > Raving Genius? - foaming at the brain? > m: 919 449.6305 > e: thomas at ravinggenius.com > w: http://log.ravinggenius.com/ > wii: 6751 1365 9898 2150 > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -- Steven Hilton From dblack at rubypal.com Sat Feb 21 18:51:00 2009 From: dblack at rubypal.com (David A. Black) Date: Sat, 21 Feb 2009 18:51:00 -0500 Subject: [raleigh.rb] [ANN/ADV] Ruby training in Atlanta, April 1-3 Message-ID: <49A09364.70502@rubypal.com> Hi Raleigh friends -- By the power vested in me by his royal Talbottness, I am taking this opportunity to let you know about an upcoming 3-day Ruby training course, April 1-3, in Atlanta. The instructors will be me, Jeremy McAnally, and Rick Olson. Between us we've written something like five Ruby-related books, trained several hundred developers, and written much of Rails (well, that would be Rick). You'll be in good hands. Details and registration are here: http://www.entp.com/training/atlanta09 and I'll be very glad to answer any questions if you want to email me directly. Thanks! David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) Ruby Training Atlanta! April 1-3, http://www.entp.com/training/atlanta09 From jjburka at gmail.com Sat Feb 21 19:02:10 2009 From: jjburka at gmail.com (James Burka) Date: Sat, 21 Feb 2009 19:02:10 -0500 Subject: [raleigh.rb] My newbie question is more newbie than yours In-Reply-To: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> References: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> Message-ID: <3EC41659-7972-4BE5-81E6-9D560298CEF0@gmail.com> If you scaffolded the model , rails puts a cancel link back to the index in the new view. Removing that should make the no method error go away james On Feb 21, 2009, at 4:32 PM, Thomas Ingram wrote: > #!/ruby/rails/2.2.2 > > I am building a website where visitors can add bookings, but not list > them. I placed map.resources :bookings, :only => [:new] in routes.rb, > but I get a NoMethodError when I try to load the new bookings form. > The error happens on this line in the view: form_for booking do |f| > > If I edit routes.rb to look like map.resources :bookings, :only => > [:index, :new] everything is fine until I hit submit. Then I get a > weird ActionController::MethodNotAllowed error telling me that only > GET requests are allowed. Both the URL in the address bar and the HTML > for the form seem to indicate that the form is posting to the index > action. Why would it do that? > > In case you need to know, I have removed the actions that I do not > require from the BookingsController. All that is left is new and > create and they are pretty much the same as when Rails generated them. > Can anybody help me with this or point me in the right direction? I've > looked on Google, but I haven't found anything. > > -- > Thomas ><> > Raving Genius? - foaming at the brain? > m: 919 449.6305 > e: thomas at ravinggenius.com > w: http://log.ravinggenius.com/ > wii: 6751 1365 9898 2150 > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From thomas at ravinggenius.com Sun Feb 22 01:05:57 2009 From: thomas at ravinggenius.com (Thomas Ingram) Date: Sun, 22 Feb 2009 01:05:57 -0500 Subject: [raleigh.rb] My newbie question is more newbie than yours In-Reply-To: <3EC41659-7972-4BE5-81E6-9D560298CEF0@gmail.com> References: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> <3EC41659-7972-4BE5-81E6-9D560298CEF0@gmail.com> Message-ID: <51ce9ce10902212205h6ec0083aoaf09400adede62ef@mail.gmail.com> I did scaffold the files, but I made sure the cancel link was gone. Taking Steven's advise, my route now looks like map.resources :bookings, :only => [:new, :create]. Now the error I get is below: ActiveRecord::AssociationTypeMismatch in BookingsController#create Province(#70175116095560) expected, got String(#70175161187320) I checked BookingsController#create. The only thing I've changed was the flash[:notice] for a successful save. Province, a lookup model, is built as follows: <%= f.select :province, Province.all.map { |p| [p.name, p.id] } %> This was based on an example I found online. Is f.select wrong? It seemed to generate the correct markup for me. Thanks for your help -- Thomas ><> Raving Genius? - foaming at the brain? m: 919 449.6305 e: thomas at ravinggenius.com w: http://log.ravinggenius.com/ wii: 6751 1365 9898 2150 From otto.hammersmith at gmail.com Sun Feb 22 02:13:57 2009 From: otto.hammersmith at gmail.com (Otto Hammersmith) Date: Sun, 22 Feb 2009 02:13:57 -0500 Subject: [raleigh.rb] My newbie question is more newbie than yours In-Reply-To: <51ce9ce10902212205h6ec0083aoaf09400adede62ef@mail.gmail.com> References: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> <3EC41659-7972-4BE5-81E6-9D560298CEF0@gmail.com> <51ce9ce10902212205h6ec0083aoaf09400adede62ef@mail.gmail.com> Message-ID: If your model has_one :province, that's your problem. province= is expecting a Province model not the string that was matching. If you make it set the province_id, then it will work as it's probably getting the id as a string and Rails will coerce that magically for you. Should work: <%= f.select :province_id, Province.all.map { |p| [p.name, p.id] } %> On Sun, Feb 22, 2009 at 1:05 AM, Thomas Ingram wrote: > I did scaffold the files, but I made sure the cancel link was gone. > Taking Steven's advise, my route now looks like map.resources > :bookings, :only => [:new, :create]. Now the error I get is below: > > ActiveRecord::AssociationTypeMismatch in BookingsController#create > Province(#70175116095560) expected, got String(#70175161187320) > > I checked BookingsController#create. The only thing I've changed was > the flash[:notice] for a successful save. Province, a lookup model, is > built as follows: <%= f.select :province, Province.all.map { |p| > [p.name, p.id] } %> This was based on an example I found online. Is > f.select wrong? It seemed to generate the correct markup for me. > > Thanks for your help > > -- > Thomas ><> > Raving Genius? - foaming at the brain? > m: 919 449.6305 > e: thomas at ravinggenius.com > w: http://log.ravinggenius.com/ > wii: 6751 1365 9898 2150 > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.streicher at gmail.com Sun Feb 22 07:57:43 2009 From: martin.streicher at gmail.com (Martin Streicher) Date: Sun, 22 Feb 2009 07:57:43 -0500 Subject: [raleigh.rb] Project tool In-Reply-To: References: Message-ID: <0A4CD609-2F5F-4C9D-8268-CD678FD48DAA@gmail.com> I am addicted to OmniGraffle on Mac OS X. On Feb 19, 2009, at 5:11 PM, raleigh-rb-members-request at rubyforge.org wrote: > Alfredo Quiroga-Villamil wrote, On 2/19/09 12:23 PM: >> Any recommendations for a tool/application that you have used to >> create the entire project from scratch as part of the design process >> (Design Document). Example: gui views details, database schema >> description, NTH, MH, etc ... >> What do you typically use when you need to design/architect a new >> site >> from scratch? > From seancribbs at gmail.com Sun Feb 22 10:54:55 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Sun, 22 Feb 2009 10:54:55 -0500 Subject: [raleigh.rb] My newbie question is more newbie than yours In-Reply-To: References: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> <3EC41659-7972-4BE5-81E6-9D560298CEF0@gmail.com> <51ce9ce10902212205h6ec0083aoaf09400adede62ef@mail.gmail.com> Message-ID: <49A1754F.9030805@gmail.com> In those cases, I like to use collection_select: <%= f.collection_select :province_id, Province.all, :id, :name %> I can never remember the ordering of the label/value in those option arrays, but for some reason, I always remember the ordering of this one. Sean Otto Hammersmith wrote: > If your model has_one :province, that's your problem. province= is > expecting a Province model not the string that was matching. If you > make it set the province_id, then it will work as it's probably > getting the id as a string and Rails will coerce that magically for you. > > Should work: <%= f.select :province_id, Province.all.map { |p| [p.name > , p.id ] } %> > > On Sun, Feb 22, 2009 at 1:05 AM, Thomas Ingram > > wrote: > > I did scaffold the files, but I made sure the cancel link was gone. > Taking Steven's advise, my route now looks like map.resources > :bookings, :only => [:new, :create]. Now the error I get is below: > > ActiveRecord::AssociationTypeMismatch in BookingsController#create > Province(#70175116095560) expected, got String(#70175161187320) > > I checked BookingsController#create. The only thing I've changed was > the flash[:notice] for a successful save. Province, a lookup model, is > built as follows: <%= f.select :province, Province.all.map { |p| > [p.name , p.id ] } %> This was based > on an example I found online. Is > f.select wrong? It seemed to generate the correct markup for me. > > Thanks for your help > > -- > Thomas ><> > Raving Genius? - foaming at the brain? > m: 919 449.6305 > e: thomas at ravinggenius.com > w: http://log.ravinggenius.com/ > wii: 6751 1365 9898 2150 > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > ------------------------------------------------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From otto.hammersmith at gmail.com Sun Feb 22 11:05:00 2009 From: otto.hammersmith at gmail.com (Otto Hammersmith) Date: Sun, 22 Feb 2009 11:05:00 -0500 Subject: [raleigh.rb] Project tool In-Reply-To: <0A4CD609-2F5F-4C9D-8268-CD678FD48DAA@gmail.com> References: <0A4CD609-2F5F-4C9D-8268-CD678FD48DAA@gmail.com> Message-ID: I'm a fan of Curio. Part diagramming, part mind mapping, part note taking. Makes for a good random dump for the stuff related to a new project. I still do end up in OmniGraffle for diagraming somethings... I'm just used to it and am faster with certain kinds of diagrams. On Sun, Feb 22, 2009 at 7:57 AM, Martin Streicher < martin.streicher at gmail.com> wrote: > > I am addicted to OmniGraffle on Mac OS X. > > > On Feb 19, 2009, at 5:11 PM, raleigh-rb-members-request at rubyforge.orgwrote: > > Alfredo Quiroga-Villamil wrote, On 2/19/09 12:23 PM: >> >>> Any recommendations for a tool/application that you have used to >>> create the entire project from scratch as part of the design process >>> (Design Document). Example: gui views details, database schema >>> description, NTH, MH, etc ... >>> What do you typically use when you need to design/architect a new site >>> from scratch? >>> >> >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon.list+rb at gmail.com Sun Feb 22 11:21:42 2009 From: jon.list+rb at gmail.com (Jonathon Brenner) Date: Sun, 22 Feb 2009 11:21:42 -0500 Subject: [raleigh.rb] Project tool In-Reply-To: References: <0A4CD609-2F5F-4C9D-8268-CD678FD48DAA@gmail.com> Message-ID: Omnigraffle here, but mostly because I couldn't find any other suitable Visio replacement when I was involved more with network engineering. On Sun, Feb 22, 2009 at 11:05 AM, Otto Hammersmith < otto.hammersmith at gmail.com> wrote: > I'm a fan of Curio. Part diagramming, part mind mapping, part note taking. > Makes for a good random dump for the stuff related to a new project. > I still do end up in OmniGraffle for diagraming somethings... I'm just used > to it and am faster with certain kinds of diagrams. > > > On Sun, Feb 22, 2009 at 7:57 AM, Martin Streicher < > martin.streicher at gmail.com> wrote: > >> >> I am addicted to OmniGraffle on Mac OS X. >> >> >> On Feb 19, 2009, at 5:11 PM, raleigh-rb-members-request at rubyforge.orgwrote: >> >> Alfredo Quiroga-Villamil wrote, On 2/19/09 12:23 PM: >>> >>>> Any recommendations for a tool/application that you have used to >>>> create the entire project from scratch as part of the design process >>>> (Design Document). Example: gui views details, database schema >>>> description, NTH, MH, etc ... >>>> What do you typically use when you need to design/architect a new site >>>> from scratch? >>>> >>> >>> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas at ravinggenius.com Sun Feb 22 13:35:08 2009 From: thomas at ravinggenius.com (Thomas Ingram) Date: Sun, 22 Feb 2009 13:35:08 -0500 Subject: [raleigh.rb] My newbie question is more newbie than yours In-Reply-To: <49A1754F.9030805@gmail.com> References: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> <3EC41659-7972-4BE5-81E6-9D560298CEF0@gmail.com> <51ce9ce10902212205h6ec0083aoaf09400adede62ef@mail.gmail.com> <49A1754F.9030805@gmail.com> Message-ID: <51ce9ce10902221035x69e9bef5m16cbf558a25e1d58@mail.gmail.com> Thank you all! It now works great! Seems I was sending the string id instead of the Province object I was specifying. What is the difference between f.select and f.collection_select? I was actually using something like @provinces = [['Select', '']] + Province.all.map { |p| [p.name, p.id] } in my controller and then using <%= f.select :province_id, @provinces %> in the view. If f.collection_select is better, how would I add the blank option at the top of the select box? One more question: where is the best place to change where the user it sent when they submit the form? The generated create action has format.html { redirect_to(@booking) }. Should I just modify that or is there a better way to do it? -- Thomas ><> Raving Genius? - foaming at the brain? m: 919 449.6305 e: thomas at ravinggenius.com w: http://log.ravinggenius.com/ wii: 6751 1365 9898 2150 From seancribbs at gmail.com Sun Feb 22 14:46:52 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Sun, 22 Feb 2009 14:46:52 -0500 Subject: [raleigh.rb] My newbie question is more newbie than yours In-Reply-To: <51ce9ce10902221035x69e9bef5m16cbf558a25e1d58@mail.gmail.com> References: <51ce9ce10902211332j4df23126x8e2cfde3361e8084@mail.gmail.com> <3EC41659-7972-4BE5-81E6-9D560298CEF0@gmail.com> <51ce9ce10902212205h6ec0083aoaf09400adede62ef@mail.gmail.com> <49A1754F.9030805@gmail.com> <51ce9ce10902221035x69e9bef5m16cbf558a25e1d58@mail.gmail.com> Message-ID: <49A1ABAC.7010308@gmail.com> Thomas Ingram wrote: > Thank you all! It now works great! Seems I was sending the string id > instead of the Province object I was specifying. What is the > difference between f.select and f.collection_select? I was actually > using something like @provinces = [['Select', '']] + Province.all.map > { |p| [p.name, p.id] } in my controller and then using <%= f.select > :province_id, @provinces %> in the view. If f.collection_select is > better, how would I add the blank option at the top of the select box? > > Have a look at the docs here: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html I believe you can use the :prompt option for a "blank". > One more question: where is the best place to change where the user it > sent when they submit the form? The generated create action has > format.html { redirect_to(@booking) }. Should I just modify that or is > there a better way to do it? > > Yes, modify that. Sean From thomas at ravinggenius.com Mon Feb 23 22:16:06 2009 From: thomas at ravinggenius.com (Thomas Ingram) Date: Mon, 23 Feb 2009 22:16:06 -0500 Subject: [raleigh.rb] How to properly include params[:id] in the view Message-ID: <51ce9ce10902231916u4741d7c5p8578ba179baad42d@mail.gmail.com> I have this snippet in ApplicationController. So I can target specific pages client side, what would be the best way to make this safe? Or is it safe as is? before_filter :set_controller_and_action_names private def set_controller_and_action_names @body_id = controller_name + '_' + action_name @body_id = @body_id + '_' + params[:id] if params[:id] @body_class = 'controller_' + controller_name + ' ' + 'action_' + action_name end -- Thomas ><> Raving Genius? - foaming at the brain? m: 919 449.6305 e: thomas at ravinggenius.com w: http://log.ravinggenius.com/ wii: 6751 1365 9898 2150 From brandan at bclennox.com Tue Feb 24 01:22:01 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Tue, 24 Feb 2009 01:22:01 -0500 Subject: [raleigh.rb] How to properly include params[:id] in the view In-Reply-To: <51ce9ce10902231916u4741d7c5p8578ba179baad42d@mail.gmail.com> References: <51ce9ce10902231916u4741d7c5p8578ba179baad42d@mail.gmail.com> Message-ID: On Feb 23, 2009, at 10:16 PM, Thomas Ingram wrote: > I have this snippet in ApplicationController. So I can target specific > pages client side, what would be the best way to make this safe? Or is > it safe as is? > > before_filter :set_controller_and_action_names > > private > > def set_controller_and_action_names > @body_id = controller_name + '_' + action_name > @body_id = @body_id + '_' + params[:id] if params[:id] > @body_class = 'controller_' + controller_name + ' ' + 'action_' + > action_name > end This is potentially dangerous if an attacker were able to fool your application into accepting HTML as an id parameter. I don't know if it's possible, but it's not worth taking the chance. I personally don't consider this to be controller behavior, either. I typically put this sort of thing in a LayoutHelper. If you're using Haml, there's already a page_class method that (essentially) replaces your @body_class instance variable. From the Haml source: def page_class controller.controller_name + " " + controller.action_name end And if you were to use make_resourceful, the appropriate object is exposed through current_object, so your body id could use the id of the current object ? if one exists ? since that's guaranteed to be an integer in most cases: def page_id id = page_class.tr(' ', '_') id += "_#{current_object.id}" unless current_object.nil? id end That may not be helpful, but this is the pattern I find myself using :-) Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 From belucid at acm.org Tue Feb 24 05:30:40 2009 From: belucid at acm.org (Sean Johnson) Date: Tue, 24 Feb 2009 05:30:40 -0500 Subject: [raleigh.rb] How to properly include params[:id] in the view In-Reply-To: References: <51ce9ce10902231916u4741d7c5p8578ba179baad42d@mail.gmail.com> Message-ID: <225BAD3F-603D-4CCE-9FAB-73F4DEAEE19B@acm.org> Brandon, I agree with Thomas that the best place for this is in a view helper. I don't think it's all that dangerous though (I'm not sure of the bigger picture of why you need it, I assume you have a good reason). To remove any of Thomas' concerns about HTML in the ID parameter, you can escape it and convert it to a number. No nefarious content will survive this: @body_id = "#{@body_id}_#{h(params[:id]).to_i}" if params[:id] Good luck, Sean On Feb 24, 2009, at 1:22 AM, Brandan Lennox wrote: > On Feb 23, 2009, at 10:16 PM, Thomas Ingram wrote: > >> I have this snippet in ApplicationController. So I can target >> specific >> pages client side, what would be the best way to make this safe? Or >> is >> it safe as is? >> >> before_filter :set_controller_and_action_names >> >> private >> >> def set_controller_and_action_names >> @body_id = controller_name + '_' + action_name >> @body_id = @body_id + '_' + params[:id] if params[:id] >> @body_class = 'controller_' + controller_name + ' ' + 'action_' + >> action_name >> end > > This is potentially dangerous if an attacker were able to fool your > application into accepting HTML as an id parameter. I don't know if > it's possible, but it's not worth taking the chance. I personally > don't consider this to be controller behavior, either. I typically > put this sort of thing in a LayoutHelper. > > If you're using Haml, there's already a page_class method that > (essentially) replaces your @body_class instance variable. From the > Haml source: > > def page_class > controller.controller_name + " " + controller.action_name > end > > And if you were to use make_resourceful, the appropriate object is > exposed through current_object, so your body id could use the id of > the current object ? if one exists ? since that's guaranteed to be > an integer in most cases: > > def page_id > id = page_class.tr(' ', '_') > id += "_#{current_object.id}" unless current_object.nil? > id > end > > That may not be helpful, but this is the pattern I find myself > using :-) > > Brandan L. > -- > brandan at bclennox.com > http://www.bclennox.com > +1 (919) 274.7565 > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members __________ Sean Johnson belucid at acm.org Snooty Monkey - Ruby on Rails, Mac and iPhone development http://snootymonkey.com/ BubbleTimer - Achieve your goals through better time management. http://bubbletimer.com/ From steve at iannopollo.com Tue Feb 24 10:20:24 2009 From: steve at iannopollo.com (Steve Iannopollo) Date: Tue, 24 Feb 2009 10:20:24 -0500 Subject: [raleigh.rb] Query help Message-ID: This may be my brain not working at this moment, but I cannot seem to get the proper query I want to find some records. Background info: Merchant has many Specialties through MerchantSpecialties I want to be able to find merchants by all the specialties they have. So right now my query looks something like this select distinct merchants.* from merchants inner join merchant_specialties on merchants.id = merchant_specialties.merchant_id inner join specialties on merchant_specialties.specialty_id = specialties.id where ( specialties.id in (1,2,3, etc...) ) This query works if you only want to find a merchant by one specialty, but potentially doesn't bring back the proper data if you select more than specialty (the "in (1,2,3)" finds merchants that have any of those specialties). I want to be able to find a merchant who has specialty 1, and specialty 2, and specialty 3; not find merchants who only have specialty 1 but not specialty 2 and specialty 3. Hopefully you see what I am trying to get at. It feels like this should be an easy problem to solve, but my SQL skills are not helping me on this one. Thanks for any help! -Steve From rafeco at gmail.com Tue Feb 24 10:37:46 2009 From: rafeco at gmail.com (Rafe Colburn) Date: Tue, 24 Feb 2009 10:37:46 -0500 Subject: [raleigh.rb] Query help In-Reply-To: References: Message-ID: If you want to put it all in one SQL statement, you have to join against merchant_specialities multiple times. Also if you don't need any properties from specialties you can leave it out. So if you need to find a merchant with two specialities, you need a query like: select merchants.* from merchants m join merchant_specialties ms1 on m.id = ms1.merchant_id join merchant_specialties ms2 on m.id = ms2.merchant_id where ms1.specialty_id = 1 and ms2.specialty_id = 2 For 3 specialties, you'd need to add "ms3" to the mix and so on. --Rafe On Tue, Feb 24, 2009 at 10:20 AM, Steve Iannopollo wrote: > This may be my brain not working at this moment, but I cannot seem to get > the proper query I want to find some records. > > Background info: > > Merchant has many Specialties through MerchantSpecialties > > I want to be able to find merchants by all the specialties they have. So > right now my query looks something like this > > select distinct merchants.* from merchants > ?inner join merchant_specialties on merchants.id = > merchant_specialties.merchant_id > ?inner join specialties on merchant_specialties.specialty_id = > specialties.id > ?where ( > ? ?specialties.id in (1,2,3, etc...) > ?) > > This query works if you only want to find a merchant by one specialty, but > potentially doesn't bring back the proper data if you select more than > specialty (the "in (1,2,3)" finds merchants that have any of those > specialties). I want to be able to find a merchant who has specialty 1, and > specialty 2, and specialty 3; not find merchants who only have specialty 1 > but not specialty 2 and specialty 3. Hopefully you see what I am trying to > get at. > > It feels like this should be an easy problem to solve, but my SQL skills are > not helping me on this one. Thanks for any help! From seancribbs at gmail.com Tue Feb 24 11:24:14 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Tue, 24 Feb 2009 11:24:14 -0500 Subject: [raleigh.rb] Query help In-Reply-To: References: Message-ID: <49A41F2E.5070400@gmail.com> A couple things. First I think you probably need to use a directed join so that you return all the possible matches for one side of the join, and then use group by and having clauses to make sure that your merchant has ALL of the specialties. Example: SELECT merchants.*, COUNT(specialty_id) as specialties_count FROM merchants LEFT JOIN merchant_specialties ON merchants.id = merchant_specialties.merchant_id WHERE merchant_specialties.specialty_id IN ([insert your specialty ids here]) GROUP BY merchants.id HAVING COUNT(specialty_id) = [insert the number of specialties here] This should return only merchants who have those specialties (unless I flubbed up royally). Now if you don't mind doing this in memory, you could do something like this: merchants = specialties.map {|s| s.merchants } first = merchants.shift merchants.inject(first) {|acc, m| acc & m } Sean Rafe Colburn wrote: > If you want to put it all in one SQL statement, you have to join > against merchant_specialities multiple times. Also if you don't need > any properties from specialties you can leave it out. > > So if you need to find a merchant with two specialities, you need a query like: > > select merchants.* from merchants m join merchant_specialties ms1 on > m.id = ms1.merchant_id join merchant_specialties ms2 on m.id = > ms2.merchant_id > where ms1.specialty_id = 1 > and ms2.specialty_id = 2 > > For 3 specialties, you'd need to add "ms3" to the mix and so on. > > --Rafe > > On Tue, Feb 24, 2009 at 10:20 AM, Steve Iannopollo wrote: > >> This may be my brain not working at this moment, but I cannot seem to get >> the proper query I want to find some records. >> >> Background info: >> >> Merchant has many Specialties through MerchantSpecialties >> >> I want to be able to find merchants by all the specialties they have. So >> right now my query looks something like this >> >> select distinct merchants.* from merchants >> inner join merchant_specialties on merchants.id = >> merchant_specialties.merchant_id >> inner join specialties on merchant_specialties.specialty_id = >> specialties.id >> where ( >> specialties.id in (1,2,3, etc...) >> ) >> >> This query works if you only want to find a merchant by one specialty, but >> potentially doesn't bring back the proper data if you select more than >> specialty (the "in (1,2,3)" finds merchants that have any of those >> specialties). I want to be able to find a merchant who has specialty 1, and >> specialty 2, and specialty 3; not find merchants who only have specialty 1 >> but not specialty 2 and specialty 3. Hopefully you see what I am trying to >> get at. >> >> It feels like this should be an easy problem to solve, but my SQL skills are >> not helping me on this one. Thanks for any help! >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at iannopollo.com Tue Feb 24 11:30:45 2009 From: steve at iannopollo.com (Steve Iannopollo) Date: Tue, 24 Feb 2009 11:30:45 -0500 Subject: [raleigh.rb] Query help In-Reply-To: References: Message-ID: <83B0BDCE-230D-4F3C-BDAC-DF397C8E3223@iannopollo.com> Looks like I found a solution after a bit of googling: http://answers.google.com/answers/threadview?id=567921 In the last post they show using "group by" with "having". I tried it out, and it apparently works! (I don't really know why it works, but am glad that it does :-) So now my query looks like this: select distinct merchants.* from merchants inner join merchant_specialties on merchants.id = merchant_specialties.merchant_id inner join specialties on merchant_specialties.specialty_id = specialties.id where ( specialties.id in (1,2,3) ) group by merchants.id having count(distinct specialties.id) = 3 So, bonus points if anyone can tell me why this works (because I am still clueless as to why the solution works). Thanks for the replies! -Steve On Feb 24, 2009, at 10:37 AM, Rafe Colburn wrote: > If you want to put it all in one SQL statement, you have to join > against merchant_specialities multiple times. Also if you don't need > any properties from specialties you can leave it out. > > So if you need to find a merchant with two specialities, you need a > query like: > > select merchants.* from merchants m join merchant_specialties ms1 on > m.id = ms1.merchant_id join merchant_specialties ms2 on m.id = > ms2.merchant_id > where ms1.specialty_id = 1 > and ms2.specialty_id = 2 > > For 3 specialties, you'd need to add "ms3" to the mix and so on. > > --Rafe > > On Tue, Feb 24, 2009 at 10:20 AM, Steve Iannopollo > wrote: >> This may be my brain not working at this moment, but I cannot seem >> to get >> the proper query I want to find some records. >> >> Background info: >> >> Merchant has many Specialties through MerchantSpecialties >> >> I want to be able to find merchants by all the specialties they >> have. So >> right now my query looks something like this >> >> select distinct merchants.* from merchants >> inner join merchant_specialties on merchants.id = >> merchant_specialties.merchant_id >> inner join specialties on merchant_specialties.specialty_id = >> specialties.id >> where ( >> specialties.id in (1,2,3, etc...) >> ) >> >> This query works if you only want to find a merchant by one >> specialty, but >> potentially doesn't bring back the proper data if you select more >> than >> specialty (the "in (1,2,3)" finds merchants that have any of those >> specialties). I want to be able to find a merchant who has >> specialty 1, and >> specialty 2, and specialty 3; not find merchants who only have >> specialty 1 >> but not specialty 2 and specialty 3. Hopefully you see what I am >> trying to >> get at. >> >> It feels like this should be an easy problem to solve, but my SQL >> skills are >> not helping me on this one. Thanks for any help! > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From steve at iannopollo.com Tue Feb 24 11:36:20 2009 From: steve at iannopollo.com (Steve Iannopollo) Date: Tue, 24 Feb 2009 11:36:20 -0500 Subject: [raleigh.rb] Query help In-Reply-To: <49A41F2E.5070400@gmail.com> References: <49A41F2E.5070400@gmail.com> Message-ID: <30D75E34-F0FE-4815-965F-445CA78E520A@iannopollo.com> Looks like we're on the same wavelength. Thanks! -Steve On Feb 24, 2009, at 11:24 AM, Sean Cribbs wrote: > A couple things. First I think you probably need to use a directed > join so that you return all the possible matches for one side of the > join, and then use group by and having clauses to make sure that > your merchant has ALL of the specialties. > > Example: > > SELECT merchants.*, COUNT(specialty_id) as specialties_count > FROM merchants LEFT JOIN merchant_specialties ON merchants.id = > merchant_specialties.merchant_id > WHERE merchant_specialties.specialty_id IN ([insert your specialty > ids here]) > GROUP BY merchants.id > HAVING COUNT(specialty_id) = [insert the number of specialties here] > > This should return only merchants who have those specialties (unless > I flubbed up royally). > > Now if you don't mind doing this in memory, you could do something > like this: > > merchants = specialties.map {|s| s.merchants } > first = merchants.shift > merchants.inject(first) {|acc, m| acc & m } > > Sean > > Rafe Colburn wrote: >> >> If you want to put it all in one SQL statement, you have to join >> against merchant_specialities multiple times. Also if you don't need >> any properties from specialties you can leave it out. >> >> So if you need to find a merchant with two specialities, you need >> a query like: >> >> select merchants.* from merchants m join merchant_specialties ms1 on >> m.id = ms1.merchant_id join merchant_specialties ms2 on m.id = >> ms2.merchant_id >> where ms1.specialty_id = 1 >> and ms2.specialty_id = 2 >> >> For 3 specialties, you'd need to add "ms3" to the mix and so on. >> >> --Rafe >> >> On Tue, Feb 24, 2009 at 10:20 AM, Steve Iannopollo > > wrote: >> >>> This may be my brain not working at this moment, but I cannot seem >>> to get >>> the proper query I want to find some records. >>> >>> Background info: >>> >>> Merchant has many Specialties through MerchantSpecialties >>> >>> I want to be able to find merchants by all the specialties they >>> have. So >>> right now my query looks something like this >>> >>> select distinct merchants.* from merchants >>> inner join merchant_specialties on merchants.id = >>> merchant_specialties.merchant_id >>> inner join specialties on merchant_specialties.specialty_id = >>> specialties.id >>> where ( >>> specialties.id in (1,2,3, etc...) >>> ) >>> >>> This query works if you only want to find a merchant by one >>> specialty, but >>> potentially doesn't bring back the proper data if you select more >>> than >>> specialty (the "in (1,2,3)" finds merchants that have any of those >>> specialties). I want to be able to find a merchant who has >>> specialty 1, and >>> specialty 2, and specialty 3; not find merchants who only have >>> specialty 1 >>> but not specialty 2 and specialty 3. Hopefully you see what I am >>> trying to >>> get at. >>> >>> It feels like this should be an easy problem to solve, but my SQL >>> skills are >>> not helping me on this one. Thanks for any help! >>> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From seancribbs at gmail.com Tue Feb 24 12:20:39 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Tue, 24 Feb 2009 12:20:39 -0500 Subject: [raleigh.rb] Query help In-Reply-To: <30D75E34-F0FE-4815-965F-445CA78E520A@iannopollo.com> References: <49A41F2E.5070400@gmail.com> <30D75E34-F0FE-4815-965F-445CA78E520A@iannopollo.com> Message-ID: <49A42C67.7020606@gmail.com> Right, the only difference is that I didn't join to specialties (since you're selecting by IDs, it's not necessary). Sean Steve Iannopollo wrote: > Looks like we're on the same wavelength. Thanks! > > -Steve > > On Feb 24, 2009, at 11:24 AM, Sean Cribbs wrote: > >> A couple things. First I think you probably need to use a directed >> join so that you return all the possible matches for one side of the >> join, and then use group by and having clauses to make sure that your >> merchant has ALL of the specialties. >> >> Example: >> >> SELECT merchants.*, COUNT(specialty_id) as specialties_count >> FROM merchants LEFT JOIN merchant_specialties ON merchants.id = >> merchant_specialties.merchant_id >> WHERE merchant_specialties.specialty_id IN ([insert your specialty >> ids here]) >> GROUP BY merchants.id >> HAVING COUNT(specialty_id) = [insert the number of specialties here] >> >> This should return only merchants who have those specialties (unless >> I flubbed up royally). >> >> Now if you don't mind doing this in memory, you could do something >> like this: >> >> merchants = specialties.map {|s| s.merchants } >> first = merchants.shift >> merchants.inject(first) {|acc, m| acc & m } >> >> Sean >> >> Rafe Colburn wrote: >>> If you want to put it all in one SQL statement, you have to join >>> against merchant_specialities multiple times. Also if you don't need >>> any properties from specialties you can leave it out. >>> >>> So if you need to find a merchant with two specialities, you need a query like: >>> >>> select merchants.* from merchants m join merchant_specialties ms1 on >>> m.id = ms1.merchant_id join merchant_specialties ms2 on m.id = >>> ms2.merchant_id >>> where ms1.specialty_id = 1 >>> and ms2.specialty_id = 2 >>> >>> For 3 specialties, you'd need to add "ms3" to the mix and so on. >>> >>> --Rafe >>> >>> On Tue, Feb 24, 2009 at 10:20 AM, Steve Iannopollo wrote: >>> >>>> This may be my brain not working at this moment, but I cannot seem to get >>>> the proper query I want to find some records. >>>> >>>> Background info: >>>> >>>> Merchant has many Specialties through MerchantSpecialties >>>> >>>> I want to be able to find merchants by all the specialties they have. So >>>> right now my query looks something like this >>>> >>>> select distinct merchants.* from merchants >>>> inner join merchant_specialties on merchants.id = >>>> merchant_specialties.merchant_id >>>> inner join specialties on merchant_specialties.specialty_id = >>>> specialties.id >>>> where ( >>>> specialties.id in (1,2,3, etc...) >>>> ) >>>> >>>> This query works if you only want to find a merchant by one specialty, but >>>> potentially doesn't bring back the proper data if you select more than >>>> specialty (the "in (1,2,3)" finds merchants that have any of those >>>> specialties). I want to be able to find a merchant who has specialty 1, and >>>> specialty 2, and specialty 3; not find merchants who only have specialty 1 >>>> but not specialty 2 and specialty 3. Hopefully you see what I am trying to >>>> get at. >>>> >>>> It feels like this should be an easy problem to solve, but my SQL skills are >>>> not helping me on this one. Thanks for any help! >>>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > ------------------------------------------------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas at ravinggenius.com Tue Feb 24 13:33:25 2009 From: thomas at ravinggenius.com (Thomas Ingram) Date: Tue, 24 Feb 2009 13:33:25 -0500 Subject: [raleigh.rb] How to properly include params[:id] in the view In-Reply-To: <225BAD3F-603D-4CCE-9FAB-73F4DEAEE19B@acm.org> References: <51ce9ce10902231916u4741d7c5p8578ba179baad42d@mail.gmail.com> <225BAD3F-603D-4CCE-9FAB-73F4DEAEE19B@acm.org> Message-ID: <51ce9ce10902241033kee65a88u9c60271ffb0ed7a3@mail.gmail.com> Thank you both, this is just what I was looking for! On Tue, Feb 24, 2009 at 5:30 AM, Sean Johnson wrote: > Brandon, > > I agree with Thomas that the best place for this is in a view helper. I > don't think it's all that dangerous though (I'm not sure of the bigger > picture of why you need it, I assume you have a good reason). To ?remove any > of Thomas' concerns about HTML in the ID parameter, you can escape it and > convert it to a number. No nefarious content will survive this: > > @body_id = "#{@body_id}_#{h(params[:id]).to_i}" if params[:id] > > Good luck, > Sean > > On Feb 24, 2009, at 1:22 AM, Brandan Lennox wrote: >> >> This is potentially dangerous if an attacker were able to fool your >> application into accepting HTML as an id parameter. I don't know if it's >> possible, but it's not worth taking the chance. I personally don't consider >> this to be controller behavior, either. I typically put this sort of thing >> in a LayoutHelper. >> >> If you're using Haml, there's already a page_class method that >> (essentially) replaces your @body_class instance variable. From the Haml >> source: >> >> ?def page_class >> ? controller.controller_name + " " + controller.action_name >> ?end >> >> And if you were to use make_resourceful, the appropriate object is exposed >> through current_object, so your body id could use the id of the current >> object ? if one exists ? since that's guaranteed to be an integer in most >> cases: >> >> ?def page_id >> ? id = page_class.tr(' ', '_') >> ? id += "_#{current_object.id}" unless current_object.nil? >> ? id >> ?end >> >> That may not be helpful, but this is the pattern I find myself using :-) -- Thomas ><> Raving Genius? - foaming at the brain? m: 919 449.6305 e: thomas at ravinggenius.com w: http://log.ravinggenius.com/ wii: 6751 1365 9898 2150 From randomutterings at gmail.com Tue Feb 24 15:29:38 2009 From: randomutterings at gmail.com (Chris Barnes) Date: Tue, 24 Feb 2009 15:29:38 -0500 Subject: [raleigh.rb] jQuery help Message-ID: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> Can anybody tell me why this doesn't work? I'm trying to cycle through some images with jQuery and when I try to pass an argument to the function it breaks. I have all the images on the page with display set to none when the page loads. The following works but it only changes the image once because the variable i is reset to 1 each time cycleFeaturedProperties is called. function cycleFeaturedProperties(){ // Cycles the featured properties on the home page var i = 1; jQuery("#" + i).fadeOut(200, function(){ i++; jQuery("#" + i).fadeIn(200); }); if (i == jQuery(".feature").length) { i = 1; } window.setTimeout(cycleFeaturedProperties, 3000); } function showFirstProperty(){ jQuery("#1").fadeIn(200); } jQuery(document).ready(showFirstProperty); window.setTimeout(cycleFeaturedProperties, 1000); When I try to pass i back to the function the whole thing breaks and does nothing. The actual change that causes the break is window.setTimeout(cycleFeaturedProperties(1), 1000); I've also tried window.setTimeout(cycleFeaturedProperties("1"), 1000); but it makes no difference. function cycleFeaturedProperties(firstId){ // Cycles the featured properties on the home page var i = firstId; jQuery("#" + i).fadeOut(200, function(){ i++; jQuery("#" + i).fadeIn(200); }); if (i == jQuery(".feature").length) { i = 1; } window.setTimeout(cycleFeaturedProperties(i), 3000); } function showFirstProperty(){ jQuery("#1").fadeIn(200); } jQuery(document).ready(showFirstProperty); window.setTimeout(cycleFeaturedProperties(1), 1000); Chris Barnes http://www.randomutterings.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.denatale at gmail.com Tue Feb 24 16:10:52 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 24 Feb 2009 16:10:52 -0500 Subject: [raleigh.rb] Query help In-Reply-To: <49A41F2E.5070400@gmail.com> References: <49A41F2E.5070400@gmail.com> Message-ID: On Tue, Feb 24, 2009 at 11:24 AM, Sean Cribbs wrote: > A couple things. First I think you probably need to use a directed join > so that you return all the possible matches for one side of the join, and > then use group by and having clauses to make sure that your merchant has ALL > of the specialties. > > Example: > > SELECT merchants.*, COUNT(specialty_id) as specialties_count > FROM merchants LEFT JOIN merchant_specialties ON merchants.id = > merchant_specialties.merchant_id > WHERE merchant_specialties.specialty_id IN ([insert your specialty ids > here]) > GROUP BY merchants.id > HAVING COUNT(specialty_id) = [insert the number of specialties here] > > This should return only merchants who have those specialties (unless I > flubbed up royally). > > Or leveraging ActiveRecord a bit more: Merchant.find(:all, :select => "*, COUNT(speciality_id) as specialities_count", :joins => :merchant_specialities, :conditions => "merchant_specialities.speciality_id IN(1,2,3)", :group => "merchants.idHAVING COUNT(speciality_id) = 3") -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.damer at duke.edu Tue Feb 24 16:12:28 2009 From: paul.damer at duke.edu (Paul Damer) Date: Tue, 24 Feb 2009 16:12:28 -0500 Subject: [raleigh.rb] jQuery help In-Reply-To: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> References: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> Message-ID: <0B07F481-D985-4DFF-AD7F-8FA75632940A@duke.edu> Hi, I think the problem is that the callback cycleFeaturedProperties is the name of a function while cycleFeaturedProperties(i) becomes a function call. It is executed immediately with the result is being used as the callback. I believe passing it as a closure should work: window.setTimeout(function() { cycleFeaturedProperties(i) }, 3000); -Paul On Feb 24, 2009, at 3:29 PM, Chris Barnes wrote: > window.setTimeout(cycleFeaturedProperties(i), 3000); > From randomutterings at gmail.com Tue Feb 24 16:28:33 2009 From: randomutterings at gmail.com (Chris Barnes) Date: Tue, 24 Feb 2009 16:28:33 -0500 Subject: [raleigh.rb] jQuery help In-Reply-To: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> References: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> Message-ID: <52c57d810902241328t7323db0eydf5bfba43f8c9fa0@mail.gmail.com> Ok, I think I'm on the right track now. Here is the code I have. Its getting the job done but the pictures are changing really fast regardless of the delay I set on window.setTimeout function cycleFeaturedProperties(hide, show){ // Cycles the featured properties on the home page jQuery("#" + hide).fadeOut(200, function(){ if (hide == jQuery(".feature").length){ hide = 1; }else{ hide++; } jQuery("#" + show).fadeIn(200, function(){ if (show == jQuery(".feature").length) { hide = show; show = 1; }else{ show++; } window.setTimeout(cycleFeaturedProperties(hide, show), 10000); }) }) } function showFirstProperty(){ jQuery("#1").fadeIn(200, function(){ window.setTimeout(cycleFeaturedProperties(1, 2), 10000); }) } jQuery(document).ready(showFirstProperty); Chris Barnes http://www.randomutterings.com On Tue, Feb 24, 2009 at 3:29 PM, Chris Barnes wrote: > Can anybody tell me why this doesn't work? I'm trying to cycle through > some images with jQuery and when I try to pass an argument to the function > it breaks. I have all the images on the page with display set to none when > the page loads. > The following works but it only changes the image once because the variable > i is reset to 1 each time cycleFeaturedProperties is called. > > function cycleFeaturedProperties(){ > // Cycles the featured properties on the home page > var i = 1; > jQuery("#" + i).fadeOut(200, function(){ > i++; > jQuery("#" + i).fadeIn(200); > }); > if (i == jQuery(".feature").length) { > i = 1; > } > window.setTimeout(cycleFeaturedProperties, 3000); > } > > function showFirstProperty(){ > jQuery("#1").fadeIn(200); > } > > jQuery(document).ready(showFirstProperty); > > window.setTimeout(cycleFeaturedProperties, 1000); > > > > When I try to pass i back to the function the whole thing breaks and does > nothing. The actual change that causes the break is > window.setTimeout(cycleFeaturedProperties(1), 1000); I've also > tried window.setTimeout(cycleFeaturedProperties("1"), 1000); but it makes no > difference. > > function cycleFeaturedProperties(firstId){ > // Cycles the featured properties on the home page > var i = firstId; > jQuery("#" + i).fadeOut(200, function(){ > i++; > jQuery("#" + i).fadeIn(200); > }); > if (i == jQuery(".feature").length) { > i = 1; > } > window.setTimeout(cycleFeaturedProperties(i), 3000); > } > > function showFirstProperty(){ > jQuery("#1").fadeIn(200); > } > > jQuery(document).ready(showFirstProperty); > > window.setTimeout(cycleFeaturedProperties(1), 1000); > > Chris Barnes > http://www.randomutterings.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.denatale at gmail.com Tue Feb 24 16:31:09 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 24 Feb 2009 16:31:09 -0500 Subject: [raleigh.rb] Query help In-Reply-To: References: <49A41F2E.5070400@gmail.com> Message-ID: On Tue, Feb 24, 2009 at 4:10 PM, Rick DeNatale wrote: > > > On Tue, Feb 24, 2009 at 11:24 AM, Sean Cribbs wrote: > >> A couple things. First I think you probably need to use a directed join >> so that you return all the possible matches for one side of the join, and >> then use group by and having clauses to make sure that your merchant has ALL >> of the specialties. >> >> Example: >> >> SELECT merchants.*, COUNT(specialty_id) as specialties_count >> FROM merchants LEFT JOIN merchant_specialties ON merchants.id = >> merchant_specialties.merchant_id >> WHERE merchant_specialties.specialty_id IN ([insert your specialty ids >> here]) >> GROUP BY merchants.id >> HAVING COUNT(specialty_id) = [insert the number of specialties here] >> >> This should return only merchants who have those specialties (unless I >> flubbed up royally). >> >> > Or leveraging ActiveRecord a bit more: > Merchant.find(:all, :select => "*, COUNT(speciality_id) as > specialities_count", :joins => :merchant_specialities, :conditions => > "merchant_specialities.speciality_id IN(1,2,3)", :group => "merchants.idHAVING COUNT(speciality_id) = 3") > Actually, I just tried this, and although it generates the same query Sean suggested, it doesn't work this does: Merchant.find(:all, :joins => :merchant_specialities, :conditions => "merchant_specialities.speciality_id IN(1,2,3)", :group => "merchants.idHAVING COUNT(speciality_id) = 3") The original with the select option was returning a Merchant with an artificial id. The COUNT(speciality_id) as specialties_count doesn't seem to be necessary. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From randomutterings at gmail.com Tue Feb 24 16:54:19 2009 From: randomutterings at gmail.com (Chris Barnes) Date: Tue, 24 Feb 2009 16:54:19 -0500 Subject: [raleigh.rb] jQuery help In-Reply-To: <0B07F481-D985-4DFF-AD7F-8FA75632940A@duke.edu> References: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> <0B07F481-D985-4DFF-AD7F-8FA75632940A@duke.edu> Message-ID: <52c57d810902241354h582600c9lfaa2165467909bb9@mail.gmail.com> Thanks, that was it exactly. The final code if anyone is interested. function cycleFeaturedProperties(hide, show){ // Cycles the featured properties on the home page jQuery("#" + hide).fadeOut(200, function(){ if (hide == jQuery(".feature").length){ hide = 1; }else{ hide++; } jQuery("#" + show).fadeIn(200, function(){ if (show == jQuery(".feature").length) { hide = show; show = 1; }else{ show++; } window.setTimeout(function(){ cycleFeaturedProperties(hide, show) }, 3000); }) }) } function showFirstProperty(){ if (jQuery(".feature")){ jQuery("#1").fadeIn(200, function(){ window.setTimeout(function(){ cycleFeaturedProperties(1, 2) }, 3000); }) } } jQuery(document).ready(showFirstProperty); Chris Barnes http://www.randomutterings.com On Tue, Feb 24, 2009 at 4:12 PM, Paul Damer wrote: > Hi, > I think the problem is that the callback cycleFeaturedProperties is the > name of a function while cycleFeaturedProperties(i) becomes a function call. > It is executed immediately with the result is being used as the callback. > I believe passing it as a closure should work: > > window.setTimeout(function() { cycleFeaturedProperties(i) }, 3000); > > -Paul > > > On Feb 24, 2009, at 3:29 PM, Chris Barnes wrote: > > window.setTimeout(cycleFeaturedProperties(i), 3000); >> >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From seancribbs at gmail.com Tue Feb 24 17:10:22 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Tue, 24 Feb 2009 17:10:22 -0500 Subject: [raleigh.rb] jQuery help In-Reply-To: <52c57d810902241354h582600c9lfaa2165467909bb9@mail.gmail.com> References: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> <0B07F481-D985-4DFF-AD7F-8FA75632940A@duke.edu> <52c57d810902241354h582600c9lfaa2165467909bb9@mail.gmail.com> Message-ID: <49A4704E.3090101@gmail.com> I don't use jQuery, but I've enjoyed using LowPro for abstracting these types of behaviors. You might find "LowPro for jQuery" useful. http://github.com/danwrong/ Sean Chris Barnes wrote: > Thanks, that was it exactly. The final code if anyone is interested. > > function cycleFeaturedProperties(hide, show){ > // Cycles the featured properties on the home page > jQuery("#" + hide).fadeOut(200, function(){ > if (hide == jQuery(".feature").length){ > hide = 1; > }else{ > hide++; > } > jQuery("#" + show).fadeIn(200, function(){ > if (show == jQuery(".feature").length) { > hide = show; > show = 1; > }else{ > show++; > } > window.setTimeout(function(){ cycleFeaturedProperties(hide, show) }, > 3000); > }) > }) > } > > function showFirstProperty(){ > if (jQuery(".feature")){ > jQuery("#1").fadeIn(200, function(){ > window.setTimeout(function(){ cycleFeaturedProperties(1, 2) }, 3000); > }) > } > } > > jQuery(document).ready(showFirstProperty); > > Chris Barnes > http://www.randomutterings.com > > > On Tue, Feb 24, 2009 at 4:12 PM, Paul Damer > wrote: > > Hi, > I think the problem is that the callback cycleFeaturedProperties > is the name of a function while cycleFeaturedProperties(i) becomes > a function call. It is executed immediately with the result is > being used as the callback. I believe passing it as a closure > should work: > > window.setTimeout(function() { cycleFeaturedProperties(i) }, 3000); > > -Paul > > > > On Feb 24, 2009, at 3:29 PM, Chris Barnes wrote: > > window.setTimeout(cycleFeaturedProperties(i), 3000); > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > ------------------------------------------------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From rick.denatale at gmail.com Tue Feb 24 17:20:28 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 24 Feb 2009 17:20:28 -0500 Subject: [raleigh.rb] jQuery help In-Reply-To: <49A4704E.3090101@gmail.com> References: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> <0B07F481-D985-4DFF-AD7F-8FA75632940A@duke.edu> <52c57d810902241354h582600c9lfaa2165467909bb9@mail.gmail.com> <49A4704E.3090101@gmail.com> Message-ID: On Tue, Feb 24, 2009 at 5:10 PM, Sean Cribbs wrote: > I don't use jQuery, but I've enjoyed using LowPro for abstracting these > types of behaviors. You might find "LowPro for jQuery" useful. > http://github.com/danwrong/ > > Sean > Sean, thanks for that. I've been looking at a project which would require jquery, and I was wondering if there was anything like lowpro for it. I guess that there is! -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -------------- next part -------------- An HTML attachment was scrubbed... URL: From raleighrb at turrean.com Tue Feb 24 18:05:28 2009 From: raleighrb at turrean.com (Ben Scofield) Date: Tue, 24 Feb 2009 18:05:28 -0500 Subject: [raleigh.rb] Announcing Developer Day! Message-ID: Hello Raleigh.rb-ers, Viget Labs and Relevance are happy to announce Developer Day, a one-day conference on topics ranging over Scala, git, JavaScript, Rails performance, and more! Join us on Saturday, March 21st for a full day of talks, some tasty meals (breakfast and lunch will be provided), and some great ideas???all for only $50. http://www.developer-day.com/ http://twitter.com/dcncdevday Feel free to email me if you have any questions! Ben Scofield ben.scofield at viget.com From matthew.todd at gmail.com Tue Feb 24 23:46:06 2009 From: matthew.todd at gmail.com (Matthew Todd) Date: Wed, 25 Feb 2009 07:46:06 +0300 Subject: [raleigh.rb] jQuery help In-Reply-To: <52c57d810902241354h582600c9lfaa2165467909bb9@mail.gmail.com> References: <52c57d810902241229q3622c5betc124d704576fcbed@mail.gmail.com> <0B07F481-D985-4DFF-AD7F-8FA75632940A@duke.edu> <52c57d810902241354h582600c9lfaa2165467909bb9@mail.gmail.com> Message-ID: <07474DD3-E951-4905-B55C-2BEA0C61EB53@gmail.com> On Feb 25, 2009, at 12:54 AM, Chris Barnes wrote: > Thanks, that was it exactly. The final code if anyone is interested. Nice. For what it's worth, we're using some similarly hard-won jQuery lines to do just about the same thing. With a little trepidation but also knowing that it's good to read other people's code, here it is: http://github.com/amanikids/website/blob/ 9f3b96b56cb5c28c63176187737755c916f1857a/public/javascripts/ application.js#L48-73 (The behavioral difference, purely a matter of taste, is that we fade an image in over the top of its predecessor without first fading out the predecessor. We were also playing with attaching functions straight onto dom elements.) Cheers, -- Matthew From robert.fischer at smokejumperit.com Wed Feb 25 11:08:29 2009 From: robert.fischer at smokejumperit.com (Robert Fischer) Date: Wed, 25 Feb 2009 11:08:29 -0500 Subject: [raleigh.rb] Testing the Flash Message-ID: <49A56CFD.6070808@smokejumperit.com> Using the built-in functional testing for Rails, how do I test that if the flash is set, then a redirect happens to an action, that the action renders the value of that flash to the screen? Trying to set flash[:val] before calling get or post results in a "Cannot convert integer to String" error. ~~ Robert Fischer. Grails Training http://GroovyMag.com/training Smokejumper Consulting http://SmokejumperIT.com Enfranchised Mind Blog http://EnfranchisedMind.com/blog Check out my book, "Grails Persistence with GORM and GSQL"! http://www.smokejumperit.com/redirect.html From blake at 3cubetechnologies.com Wed Feb 25 12:38:34 2009 From: blake at 3cubetechnologies.com (Blake Watters) Date: Wed, 25 Feb 2009 12:38:34 -0500 Subject: [raleigh.rb] Testing the Flash In-Reply-To: <49A56CFD.6070808@smokejumperit.com> References: <49A56CFD.6070808@smokejumperit.com> Message-ID: <811169160902250938m2ee8c6bdy561f335b4786b28@mail.gmail.com> flash is a proxy to the internal flash inside the controller. Accessing it before a get/post won't work. Try something along these lines... def test_flash_redirect get :index assert_equals 'foo', flash[:val] assert_redirected_to :action => 'new' follow_redirect! assert_tag 'p.flash', 'foo' end I've been in RSpec/Cucumber land for awhile, so I can't swear that follow_redirect is available in a functional test. You may need an integration test. I know that it *won't* work if you are crossing controller boundaries. Blake On Wed, Feb 25, 2009 at 11:08 AM, Robert Fischer < robert.fischer at smokejumperit.com> wrote: > Using the built-in functional testing for Rails, how do I test that if the > flash is set, then a redirect happens to an action, that the action renders > the value of that flash to the screen? > > Trying to set flash[:val] before calling get or post results in a "Cannot > convert integer to String" error. > > ~~ Robert Fischer. > Grails Training http://GroovyMag.com/training > Smokejumper Consulting http://SmokejumperIT.com > Enfranchised Mind Blog http://EnfranchisedMind.com/blog > > Check out my book, "Grails Persistence with GORM and GSQL"! > http://www.smokejumperit.com/redirect.html > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.fischer at smokejumperit.com Wed Feb 25 12:47:17 2009 From: robert.fischer at smokejumperit.com (Robert Fischer) Date: Wed, 25 Feb 2009 12:47:17 -0500 Subject: [raleigh.rb] Testing the Flash In-Reply-To: <811169160902250938m2ee8c6bdy561f335b4786b28@mail.gmail.com> References: <49A56CFD.6070808@smokejumperit.com> <811169160902250938m2ee8c6bdy561f335b4786b28@mail.gmail.com> Message-ID: <49A58425.2020300@smokejumperit.com> The Ruby.MN list came up with the solution -- "get" takes the flash in its call. ~~ Robert. Blake Watters wrote: > flash is a proxy to the internal flash inside the controller. Accessing > it before a get/post won't work. > > Try something along these lines... > > def test_flash_redirect > get :index > assert_equals 'foo', flash[:val] > assert_redirected_to :action => 'new' > follow_redirect! > assert_tag 'p.flash', 'foo' > end > > I've been in RSpec/Cucumber land for awhile, so I can't swear that > follow_redirect is available in a functional test. You may need an > integration test. I know that it *won't* work if you are crossing > controller boundaries. > > Blake > > On Wed, Feb 25, 2009 at 11:08 AM, Robert Fischer > > wrote: > > Using the built-in functional testing for Rails, how do I test that > if the flash is set, then a redirect happens to an action, that the > action renders the value of that flash to the screen? > > Trying to set flash[:val] before calling get or post results in a > "Cannot convert integer to String" error. > > ~~ Robert Fischer. > Grails Training http://GroovyMag.com/training > Smokejumper Consulting http://SmokejumperIT.com > Enfranchised Mind Blog http://EnfranchisedMind.com/blog > > Check out my book, "Grails Persistence with GORM and GSQL"! > http://www.smokejumperit.com/redirect.html > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > ------------------------------------------------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -- ~~ Robert Fischer. Grails Training http://GroovyMag.com/training Smokejumper Consulting http://SmokejumperIT.com Enfranchised Mind Blog http://EnfranchisedMind.com/blog Check out my book, "Grails Persistence with GORM and GSQL"! http://www.smokejumperit.com/redirect.html From raleighrb at turrean.com Wed Feb 25 12:56:48 2009 From: raleighrb at turrean.com (Ben Scofield) Date: Wed, 25 Feb 2009 12:56:48 -0500 Subject: [raleigh.rb] Testing the Flash In-Reply-To: <811169160902250938m2ee8c6bdy561f335b4786b28@mail.gmail.com> References: <49A56CFD.6070808@smokejumperit.com> <811169160902250938m2ee8c6bdy561f335b4786b28@mail.gmail.com> Message-ID: The way we'd test this is: def test_flash_is_set get :index assert_equals 'foo', flash[:val] assert_redirected_to :action => 'new' end def test_flash_is_displayed get :new, {}, {}, {:val => 'foo'} assert_tag 'p.flash', 'foo' end The third hash passed to a request method (get, post, etc.) represents the contents of flash. Ben On Wed, Feb 25, 2009 at 12:38 PM, Blake Watters wrote: > flash is a proxy to the internal flash inside the controller. Accessing it > before a get/post won't work. > Try something along these lines... > def test_flash_redirect > ??get :index > ??assert_equals 'foo', flash[:val] > ??assert_redirected_to :action => 'new' > ??follow_redirect! > ??assert_tag 'p.flash', 'foo' > end > > I've been in RSpec/Cucumber land for awhile, so I can't swear that > follow_redirect is available in a functional test. You may need an > integration test. I know that it *won't* work if you are crossing controller > boundaries. > Blake > On Wed, Feb 25, 2009 at 11:08 AM, Robert Fischer > wrote: >> >> Using the built-in functional testing for Rails, how do I test that if the >> flash is set, then a redirect happens to an action, that the action renders >> the value of that flash to the screen? >> >> Trying to set flash[:val] before calling get or post results in a "Cannot >> convert integer to String" error. >> >> ~~ Robert Fischer. >> Grails Training ? ? ? ?http://GroovyMag.com/training >> Smokejumper Consulting http://SmokejumperIT.com >> Enfranchised Mind Blog http://EnfranchisedMind.com/blog >> >> Check out my book, "Grails Persistence with GORM and GSQL"! >> http://www.smokejumperit.com/redirect.html >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From brandan at bclennox.com Thu Feb 26 12:47:02 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Thu, 26 Feb 2009 12:47:02 -0500 Subject: [raleigh.rb] Dynamic chaining of named scopes? Message-ID: <1F99B23E-07FA-48A3-8131-B3EA962F1DA4@bclennox.com> I'm trying to implement search based on a variable number of parameters, like min_price, max_price, etc. I thought it would be neat to set up named scopes for each of those parameters, and then in a class method, dynamically chain them together based on the parameters passed to that method. I tried this: named_scope :min_price, lambda { |price| { :conditions => ['price >= ?', price] } } # and so forth... def self.search(params) scopes.keys.select { |s| params.key?(s) }.inject(all) { |memo, scope| memo.send(scope, params[scope]) } end but when I try: search(:min_price => 50, :max_price => 1000) Rails says "NoMethodError: undefined method `min_price' for #". Apparently named scopes don't work like I think they do. Even if this is a stupid way to implement search, I'm curious if it's possible. Any help? Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 From brandan at bclennox.com Thu Feb 26 13:05:26 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Thu, 26 Feb 2009 13:05:26 -0500 Subject: [raleigh.rb] Dynamic chaining of named scopes? In-Reply-To: <1F99B23E-07FA-48A3-8131-B3EA962F1DA4@bclennox.com> References: <1F99B23E-07FA-48A3-8131-B3EA962F1DA4@bclennox.com> Message-ID: <40241F60-9205-44FC-86A7-18CF1290540A@bclennox.com> Well, I just found Squirrel, which looks like it's better for this than anything I could write or will ever write... Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 On Feb 26, 2009, at 12:47 PM, Brandan Lennox wrote: > I'm trying to implement search based on a variable number of > parameters, like min_price, max_price, etc. I thought it would be > neat to set up named scopes for each of those parameters, and then > in a class method, dynamically chain them together based on the > parameters passed to that method. I tried this: > > named_scope :min_price, lambda { |price| { :conditions => ['price > >= ?', price] } } > # and so forth... > def self.search(params) > scopes.keys.select { |s| params.key?(s) }.inject(all) { |memo, > scope| memo.send(scope, params[scope]) } > end > > but when I try: > search(:min_price => 50, :max_price => 1000) > > Rails says "NoMethodError: undefined method `min_price' for # 0x35a5084>". Apparently named scopes don't work like I think they do. > > Even if this is a stupid way to implement search, I'm curious if > it's possible. Any help? > > Brandan L. > -- > brandan at bclennox.com > http://www.bclennox.com > +1 (919) 274.7565 > > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at lojic.com Thu Feb 26 13:29:57 2009 From: info at lojic.com (Brian Adkins) Date: Thu, 26 Feb 2009 13:29:57 -0500 Subject: [raleigh.rb] Dynamic chaining of named scopes? In-Reply-To: <1F99B23E-07FA-48A3-8131-B3EA962F1DA4@bclennox.com> References: <1F99B23E-07FA-48A3-8131-B3EA962F1DA4@bclennox.com> Message-ID: <49A6DFA5.2070908@lojic.com> Brandan Lennox wrote, On 2/26/09 12:47 PM: > I'm trying to implement search based on a variable number of parameters, > like min_price, max_price, etc. I thought it would be neat to set up > named scopes for each of those parameters, and then in a class method, > dynamically chain them together based on the parameters passed to that > method. I tried this: > > named_scope :min_price, lambda { |price| { :conditions => ['price >= > ?', price] } } > # and so forth... > def self.search(params) > scopes.keys.select { |s| params.key?(s) }.inject(all) { |memo, > scope| memo.send(scope, params[scope]) } > end use inject(self) instead of inject(all) > > but when I try: > search(:min_price => 50, :max_price => 1000) > > Rails says "NoMethodError: undefined method `min_price' for > #". Apparently named scopes don't work like I think > they do. > > Even if this is a stupid way to implement search, I'm curious if it's > possible. Any help? > > Brandan L. -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ 919-946-7547 (mobile) From brandan at bclennox.com Thu Feb 26 15:12:02 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Thu, 26 Feb 2009 15:12:02 -0500 Subject: [raleigh.rb] Dynamic chaining of named scopes? In-Reply-To: <49A6DFA5.2070908@lojic.com> References: <1F99B23E-07FA-48A3-8131-B3EA962F1DA4@bclennox.com> <49A6DFA5.2070908@lojic.com> Message-ID: <976CEDBA-FCB5-46EA-8336-33673F6AD8B9@bclennox.com> Thanks Brian. That makes perfect sense. Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 On Feb 26, 2009, at 1:29 PM, Brian Adkins wrote: > Brandan Lennox wrote, On 2/26/09 12:47 PM: >> I'm trying to implement search based on a variable number of >> parameters, like min_price, max_price, etc. I thought it would be >> neat to set up named scopes for each of those parameters, and then >> in a class method, dynamically chain them together based on the >> parameters passed to that method. I tried this: >> named_scope :min_price, lambda { |price| { :conditions => ['price >> >= ?', price] } } >> # and so forth... >> def self.search(params) >> scopes.keys.select { |s| params.key?(s) }.inject(all) { |memo, >> scope| memo.send(scope, params[scope]) } >> end > > use inject(self) instead of inject(all) > >> but when I try: >> search(:min_price => 50, :max_price => 1000) >> Rails says "NoMethodError: undefined method `min_price' for #> 0x35a5084>". Apparently named scopes don't work like I think they do. >> Even if this is a stupid way to implement search, I'm curious if >> it's possible. Any help? >> Brandan L. > > -- > Brian Adkins > Lojic Technologies, LLC > http://lojic.com/ > 919-946-7547 (mobile) > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From matthew.todd at gmail.com Fri Feb 27 03:40:15 2009 From: matthew.todd at gmail.com (Matthew Todd) Date: Fri, 27 Feb 2009 11:40:15 +0300 Subject: [raleigh.rb] rails routing quiz -- contributions welcome Message-ID: <0CA49B7B-7074-4B3F-94CE-71C89B5AFDEB@gmail.com> Hi, all -- Consider this a Friday "Ruby Quiz", except it's quite Rails-specific. In essence, I'm looking to get this test to pass: http://gist.github.com/71344 I'm on a quest to make my sign up urls look prettier, and I want config/routes.rb to be the *only* place that has to change -- not my named route calls, not my AccountsController. This should be purely a routing concern. I've written the test with minimal dependencies, so you should be able to $ git clone git://gist.github.com/71344.git gist-71344 $ ruby gist-71344/routing_test.rb regardless of your rspec/shoulda/etc. preference. Thanks! Have fun! -- Matthew