[Rails] Re: Need Help!
Few things come to mind here. I've done this exact app before. I keep my devices in a table. The Rails app just displays the information from the table. A background daemon does the actual monitoring. I get alot more details in my version, including mapping what mac/ip address are on which switch port, and using SNMP to the switch to do discovery of devices. The moral of this is break you ping into a separate process/task. Then poll yours AP's and update there status with ActiveRecord. If you need some help, I can certainly give you some pointers. glennswest at yahoo dot com dot sg http://mentalpagingspace.blogspot.com On Apr 7, 10:31 am, Junior Junior wangsa rails-mailing-l...@andreas- s.net wrote: hi.. i'm new at ruby on rails.. first i have a table with a column named status(this column use to store a status of an access point (online or offline) after my application have done pinging the access point) i use a net-ping library.. how can i update the data in column status automatically. --- -- can somebody explain this code? @nodestat = Node.all.map do |node|{ :Status = PingExternal.new(node.ipadd)? Online : Offline} end and why the status always Online Any ideas would be very gratefully received! Thank You. -- Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Creating Complex ActiveResource objects
Yes you would normally update pings as they occur, unless your thinking of submitting a xml and doing a bulk update. So the pinger is doing a butch of pings, then sending the results to the backend? Then you just need to convert a local array to a xml file and submit it to your Restful web app. On Apr 7, 6:45 am, Carl Fyffe carl.fy...@gmail.com wrote: Given the following models: class Uptime ActiveRecord::Base has_many :pings end class Ping ActiveRecord::Base belongs_to :uptime end I can create an ActiveResource that will get the uptimes and ping models: class UptimeResource ActiveResource::Base self.site = http://localhost:3000; self.element_name = uptime end class PingResource UptimeResource self.element_name = ping end If the information exists in the database, I can do UptimeResource.find(1).pings and get a list of pings. But how can I create pings besides creating an UptimeResource and then creating the pings separately. I am trying to save the XML into an XML Database and bypass a relational database (client requirements). I wish I had something like CouchDB_fu but for XML databases... Is this a job for DataMapper? I am open to any strategy. Swift kicks to the head welcome. Carl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Need Ruby on Rails Senior Developer
App is interesting, sound like you need someone with drive and deep experience. Did I say DRIVE :). I'm held the post of CTO, but still very hands on, and very intense. If you need someone to get in, roll up the sleves and get something done, I dont mind. Far as your question, I usually set down in a large screen, and have all the reference I need, and get things done. I've done 500+ table rails app in aviation, so lot of what you saying seems really simple to me. drop me a mail at glennswest at yahoo dot come dot sg On Apr 7, 4:35 am, eborhood.com rajan...@gmail.com wrote: Company: Eborhood Industry: Ecommerce/communication/Real Estate - map-based search, communication, and execution Location: Based in Texas Pay: over $50K-$250K - more if you're worth it We are in need of a programmer that has a great set of ruby/rails skills. We have had a few problems hitting deadlines because some programmers would do things at their convenience. We need a serious programmer that has full knowledge of the ruby on fails framework. If you think you're serious, then send a portfolio or resume to ra...@eborhood.com. Anyway, a little more information about Eborhood.com. This hub focuses on connecting local people, places, and things while helping them interact in a meaningful way - unlike Facebook, MySpace or Twitter. Eborhood allows users to interact and execute on their desires. We're not talking about anything x-rated, we are talking about that Nintendo Wii you couldn't find for your child for Christmas! In sum, we offer many different services such as online leasing to bartering, all local. We also are creating a peer to peer systems for finance and logistics. It's going to be great. We want someone on our team who feels the same way. I could go on about this, but let's just get down to the point. We need to finish out some of our widgets that were made by our last programmers. If you are deeply intrigued and interested, contact us for the beta link which is unavailable to the public at the moment. Many of our features and updates are not pushed out and are on hold until we find the best individual to add the finishing touches. Below are some thing we require our lead ruby developer to know: * Widgets - creating, editing * EC2 setup * Google Maps configuration usage * Sphinx configuration usage * Code compatibility across all computers and operating systems * Complete knowledge of Ajax * Google Maps API * PCI compliancy Our current developer will ask you something like this: * What does acts_as_relationable do for each subclassed models? If you feel like you have the skill set for the above, then we can offer the salary that best matches your skill set. We are open to suggestions from you. We also offer vacation days and shares if you go above and beyond our expectations. We look forward to hearing from you. Sincerely, Rajan Babaria 817-233-3160www.eborhood.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ridiculously Slow View Rendering
Yep I agree there, you should create thumbs that are totally separate. Otherwise your sending megs instead of K. And you can create the thumbs on new user signup. I've done that, and it woks really well. Really need to check your image sizes. On Apr 7, 5:18 am, Harold A. Giménez Ch. harold.gime...@gmail.com wrote: To be honest, I really don't know what's going on, but I would try commenting out the image_tag. First of all, it is probably causing another trip to the DB per user. Second, I don't know how heavy the images are, but using height and width may be hiding the fact that they're big, and you're just using html to scale them down on your view. Do you see similar results when completely removing the images on that _user partial? On Mon, Apr 6, 2009 at 5:10 PM, Avishai avishai.we...@gmail.com wrote: When I leave the params off and just go for a straight index, I'm still seeing this: Processing UsersController#index [GET] Parameters: {action=index, controller=users} User Load (5.6ms) SELECT * FROM `users` ORDER BY users.created_at DESC LIMIT 0, 10 SQL (0.4ms) SELECT count(*) AS count_all FROM `users` Rendering template within layouts/application Rendering users/index Rendered users/_user (432.4ms) Rendered users/_user (133.4ms) Rendered users/_user (96.1ms) Rendered users/_user (202.4ms) Rendered users/_user (26.1ms) Rendered users/_user (55.6ms) Rendered users/_user (51.3ms) Rendered users/_user (21.8ms) Rendered users/_user (38.3ms) Rendered users/_user (47.9ms) User Load (9.3ms) SELECT * FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 Rendered users/_search (67.1ms) SQL (3.8ms) SELECT count(*) AS count_all FROM `messages` WHERE (`messages`.receiver_id = 1 AND (`messages`.`read` = 0)) Rendered users/_user_bar (134.7ms) Completed in 1861ms (View: 1534, DB: 19) I had thought that it had something had to do with the size of the about_me as mentioned before, but I checked again, and some of those long-rendering user partials had no content for the about_me field... Any other ideas as to why this could be taking so long to render? Thanks a lot Avishai On Apr 6, 2:55 pm, Avishai avishai.we...@gmail.com wrote: I tried a bunch of different searches, and it's actually loading reasonably quickly still... 500ms at least. Also, in the process I upgraded from Rails 2.2.1 to 2.3.2, so maybe that helped somewhat too. -Avishai On Apr 6, 2:13 pm, Harold A. Giménez Ch. harold.gime...@gmail.com wrote: This is good to know. Completed in 319ms (View: 288, DB: 27) 319ms is not hardly close to your original 11386ms. I notice that your params below do not have any of the search criteria ([:user][:interests], etc). If you run the view using the criteria, does performance degrade? On Mon, Apr 6, 2009 at 1:50 PM, Avishai avishai.we...@gmail.com wrote: Fred, I took your suggestion to up the log level and this is what it reveals: Processing UsersController#index [GET] Parameters: {action=index, controller=users, page=11} User Load (26.0ms) SELECT * FROM `users` ORDER BY users.created_at DESC LIMIT 100, 10 SQL (0.2ms) SELECT count(*) AS count_all FROM `users` Rendering template within layouts/application Rendering users/index Rendered users/_user (3.7ms) Rendered users/_user (2.9ms) Rendered users/_user (3.1ms) Rendered users/_user (42.6ms) Rendered users/_user (39.6ms) Rendered users/_user (121.2ms) Rendered users/_user (32.9ms) Rendered users/_user (4.9ms) Rendered users/_user (14.7ms) Rendered users/_user (2.7ms) User Load (0.2ms) SELECT * FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 Rendered users/_search (3.0ms) Rendered users/_user_bar (2.1ms) Completed in 319ms (View: 288, DB: 27) However, once I hit refresh a bunch of times, all those partials drop to only a few ms each. Including the ones that show as 40, 120, etc above. Those long ones all had text in the about_me -Avishai On Apr 6, 1:37 pm, Avishai avishai.we...@gmail.com wrote: Interesting. Maybe something is going on in the controller. I've tried running the resulting SQL queries directly, and they still seem to be fetching pretty quickly... The controller contains a lot of conditionals, maybe that's the issue? I've used Newrelic RPM to analyze my SQL, and it looks like for everything there's no USING FILESYSTEM, so indexes are set up properly... The about_me column is a regular freetext column (TEXT i think), so the length varies anywhere from zero to a few paragraphs of text. The photos are handled with paperclip, but are just URLs, not the actual files in the DB. Could it still be a bandwidth still be an issue DB = webserver if they're on the same box? Controller
[Rails] Re: Wizard like data entry
This is a stateful type processing, and you can do redirects after each submit. Also you can keep track of the time of the last state, and then use rufus-scheduler to run a cleanup task from time to time. There is also a call in rails to let you redirect on the server, so on the submit of step 1, you redirect to the beginning of step 2. You must also thing of the condition where the user stops in the middle. Rails after all is stateless, so your state should be in a table somewhere. Also depending on your implementation your step 1 etc may actually run in a different mongrel process if your doing load balancing. If you need help, drop me a line. My blog: http://mentalpagingspace.blogspot.com On Apr 6, 2:30 pm, Indu RS rails-mailing-l...@andreas-s.net wrote: Hello after having searched the forums I couldn't find any solution to this problem: I want to implement a multi step form across models. Step 1: Enter requested username/ password/image etc - User model Step 2: Enter Employer Job Conditions information - EmployerJobCondition model Step 3: Enter Canditate Job Conditions information - CandidateJobCondition model In the third step only I want to store all the informations. The problem is if a user is created in step 1 and then exits his browser during step 2, thus a record in the users table is dangling, no good.Any suggestion for wizard like data entry? Ive looked at the Wizard plugin (http://github.com/crankin/wizard/tree/master), however it doesnt seam like it addresses the issue mentioned above. Pls help by giving suggestions for the above mentioned problem . Thanks in advance. -- Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Where to store scrape results?
Just thinking, your scrape should probably be in a worker, stick the results in a db, Depending on what your using, you configure it to be a temp table even. Then in your search window you can do ajax based updated from the scrape. With the ability to then clear up the cache. You get more concurrency, and with the right javascript you could cancel the scrape in process. Think this would scale and be more responsive On Apr 5, 10:02 pm, Adam Akhtar rails-mailing-l...@andreas-s.net wrote: Excellent thanks once again Andrew! Appreciate your advice. -- Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Where to store scrape results?
Here's your problem in rails: Your web server is single threaded, so while you scrapping, its not doing anything else, so you will need more mongrels to take care of the users. Generally you scale by having more threads, and cpu working on the problem. The database is probably not going to be your bottleneck for a while, its more the style. Why dont I train you a bit. We can do a screen share/skype session. On Apr 6, 9:27 pm, Adam Akhtar rails-mailing-l...@andreas-s.net wrote: Thanks glennswest, im relatively new to rails. Whilst i think i understood what you said can you (or anyone else) elaborate furhter on the points below? I really appreciated your help. Just thinking, your scrape should probably be in a worker, when you say a worker i take it you mean some temporary database? Depending on what your using, you configure it to be a temp table even. Then in your search window you can do ajax based updated from the scrape. From the above do you mean whilst im scraping results from sites, when one sites results get added to the db and i go off scraping another sites results, i can simultaneously show the results that were just added to the screen? With the ability to then clear up the cache. after i get all the results and display them to the screen i can then clear the table? You get more concurrency, Wasnt too sure what you meant by this but thats because im fresh to rails and cant gather from the context. and with the right javascript you could cancel the scrape in process. ahh so if whilst im scraping and simultaneously presenting already scraped data from the db, the user decides to cancel the request, via some javascript call i can terminate the outstanding scrape tasks and move on? Think this would scale and be more responsive In general how fast/slow is it to update a table with around 1000 results? is it fast enough to handle this situation? Id prefer to stick the objects in a temporary db because then id get to use existing activerecord methods and mysql statements. Im just worrying about the performance. -- Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Where to store scrape results?
You can easily create a table, and stick it in as a row. in rails sqlite is easy enough, if you site is bigger you can use db2. If its like most sites, you make a result table that is associated to a user table. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rails Stability
Your code is past being old in ruby and rails terms. Almost everything has been updated/fixed and resolved. I've got production sites that have been running for 6 months, with a reboot at most once a month. (On windows). On linux, no problem at all. Update and run it on passenger. I run code on windows and linux, and find the portability is great. Long with running it over half a dozen different databases. Php is Not portable, nor stable from my past projects. On Nov 18, 1:04 am, Fernando Perez [EMAIL PROTECTED] wrote: Frederick Cheung wrote: On 17 Nov 2008, at 16:09, Bobnation wrote: Don't let that one blog entry turn you away. Like Jeremy said, a lot of stuff can cause instabilities, including configuration. I would search around for some hosts and see which ones are having the greatest luck with mod_rails (or another config) and maybe even think about running your own virtual server somewhere just for the fun. eg see http://www.loudthinking.com/posts/30-myth-1-rails-is-hard-to-deploy All the 37signals stuff will be moving to mod_rails soonish Fred I run Nginx+Thin each in its own virtual machine. My Thin virtual machine only crashed once, but I can't tell you why, anyway it was simply a matter of restarting the VM. Probably a memory leak somewhere in the code. -- Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ROR switcher asks Does ROR offer CRUD form (admin interfaces) auto-generation for databases?
Here my strategy for such a app. 1. Export\copy the existing database schema, and a snapshot of the data into your database of choice. I usually use a ruby application at dbi level, or a rake task. On my blog there are several reviews of doing this. This also gets you a chance to cleanup the data. Fix things like ID being missing, junk data, and build any needed relationships. 2. From the imported data, I use another script to generate all my controllers, models, and even menu's. I use ActiveScaffold to handle the view, models are simple as well. For menus I use tabnav. 3. Edit the menus to organize it to a more useful format 4. At this point you can actually use the app 5. Start adding and customizing the app to fufill the app. AS is highly customizable. 6. Use RoleRequirment to separate your roles. I've done this for 10-500 tables in a single app. Even merging multiple apps into one rails app. For reference look thru mentalpagingspace.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Getting started with ROR when you come from the desktop world with no experience in developing web application
It depends on what you have interest in doing. For my applications, there database focused. So here is the getting something going in the shortest possible time. 1. Get the Ruby Cookbook fro Oreilly. (Keep on your desk) 2. ProActive Record is another one I would keep handy. 3. Choose a project. 4. Use the following plugins: a. ActiveScaffold b. Tabnav/Widgets 5. Use sqlite to start. (I used oracle to start, but I work in a enterprise) 6. Start your app. The lovely part of using activescaffold, is its highly customizable. So you can go far not writing any dhtml/xml/dom/css. Yes your have a enterprisey looking app, but your have it in short order. I've done apps with 20-30 tables, write a conversion script to import the data, write a generator script to generate controllers and models, and had it up and running and usable in 4 days. It all depends on the type of applications you want to do. You might want to look at mentalpagingspace.blogspot.com lots of experience I've gained in using ruby and rails for large scale corp applications. At this point I feel I can do anything from a Stock trading applications to a MRP/ERP system using ruby on rails. (And can do it in windows or linux). On Nov 2, 1:44 am, Tarek Demiati [EMAIL PROTECTED] wrote: I’m very interested in starting with ROR, however I do not know where to start, I’ve a background as a developer of desktop application, the web is new to me, there seems to be a lot of things to master in order to become an efficient ROR developer, So I’m a bit confuse on what should I learn first : HTTP,DHTML,XML,DOM,Javascript, CSS and then Ruby on Rails ? I’m aware that ROR does many of the low level dirty work for you, so it hides the complexity from you So my questions are : 1/ Do you think someone can be a good ROR developer without mastering the following technologies : HTTP,DHTML,XML,DOM,Javascript, CSS 2/ Which books would you advise me to read (ideally in chronological order) 3/ Does the learning curve can be pretty steep for someone who do not come from a web development culture (ie : Java/J2EE) 4/ I would also appreciate book recommendations for : HTTP,DHTML,XML,DOM,Javascript, CSS, Ruby, Rails Best Regards from France, Tarek Demiati --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: the performance debate
Well the had excellent references. And I've look at it. But by software engineering standands php is spagetting code. Ruby is modular, and for once the object oriented nature works quite well. ActiveRecord works well as well. Show me php applications that can handle 400 different tables, that can be developed by one guy in two weeks? I've seen a few php developers that were ok, but its not something I'd recommend a fortune 500 use to do a proper application. On Oct 8, 10:09 am, Maurício Linhares [EMAIL PROTECTED] wrote: On Tue, Oct 7, 2008 at 11:03 PM, glennswest [EMAIL PROTECTED] wrote: Is Ruby Faster to Develop than PHP? Yes (What 5 people did in a year, I did in a week) Crappy developers, what a shame :) Can I make my Rails App Faster than the old PHP APP? Yes Is Ruby the bottleneck? No Can I learn new things in ruby fast? Yes Can I get them into Production fast? Yes Can I scale applications to support billion dollar Multi-national companies? Yes I know a dozen languges(Of the computer type), a kernel hacker, device driver writer, and a embedded systems developer. I can make ruby stand up and shout, and I can do it with a hour a day. After having 5 man years into a PHP project, we scrapped it, and I recoded it in rails in no time at all, by myself. Maybe you should try to learn a litlte bit more of PHP and worry less about kernel hacking or device drivers. -- Maurício Linhareshttp://alinhavado.wordpress.com/(pt-br) |http://blog.codevader.com/(en) João Pessoa, PB, +55 83 8867-7208- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---