search for: eleg

Displaying 20 results from an estimated 2223 matches for "eleg".

Did you mean: elem
2006 Jan 15
6
Saving one-many associations (elegant solution please)
What is the most elegant way to save new one-many associations? order = Order.new(:name => "My Order") order.line_items << LineItem.new(:product_id => 1, :quantity => 2) order.line_items << LineItem.new(:product_id => 2, :quantity => 5) order.save The above - which is by far the m...
2007 May 29
1
Modal Window Stealing Elements from Form. Need Elegant Solution.
...DIV into a separate DIV outside the main content. This creates a problem where my elements are suddenly taken out of the form and when I click submit all the options are completely gone. We would like to use the modal since it makes the entire posting process that much nicer but again we need an elegant solution. The none elegant solution would be to write a script that creates hidden form elements based on the form elements'' values in the modal window but again I''d rather not go with bad code. Is it possible to force the modal window to not go out of it''s initial p...
2011 Jul 06
1
elegant way of removing NA's and selecting specific values from a data.frame
I have a data.frame "e" and would like to extract the 23rd column, remove any NA's and then remove any values >= 30. I can do it in steps such as this but have failed to figure out how to do it in a single line .... any suggestions? first <- e[,23] second <- first[!is.na(first)] third <- second[second<=30] thanks a bunch J -- Dr. Jim Maas University of East
2005 Dec 28
1
making has_and_belongs_to_many save more elegant
...t; "home", :action => "index" else render :action => "new" end end Now I have a couple questions: 1) Is there an easier way to save both the tags and the post at the same time? 2) Do I need to do the push to save the join table or is there a more elegant way or automated way of doing this? 3) Does the fact that I have to check to see if tag already exist change things? Your feedback is greatly appreciated. I find my solution not that elegant and would love to find a new one. This is for my site http:// www.soen.info. Your Friend...
2011 Apr 18
3
guitar pro 5.2 runs of out of gdi handles
On both wine 1.3.15 and 1.3.17, guitar pro 5.2 has a tendency to crash after a while. Wine gives the error message that it ran out of gdi handles and expect crashes. Trigger unknown.
2009 Jan 30
3
How to elegantly set DEVSTATE values after restarting
Hi, Whenever Asterisk restarts, some values such as DEVSTATE ones, should be reset. How would you proceed to have those settings done anytime Asterisk restarts ? I was thinking of using #exec statement in appropriate .conf file. Ant better idea ? Regards -------------- next part -------------- An HTML attachment was scrubbed... URL:
2005 May 17
8
acts_as_tree elegant tree printing
Hi, I''m working with acts_as_tree to print an unordered list of items: Root -- Child ---- Child I''ve got this working, however I''d like to know if there is a more elegant fashion that I''m unaware of: #Takes a parent category and recursivley returns all children def find_all_subcategories(category) if category.children.size > 0 ret = "<ul>" category.children.each { |subcat| if subcat.children.size >...
2010 Mar 24
3
More elegant solution for "missing" has-many through ids?
...#39;'t have a LabGroup. This works: x = [] LabDescGroup.find( :all, :select => ''DISTINCT lab_desc_id'' ).each{ |c| x << c.lab_desc_id } y = [] LabDesc.find( :all, :select => ''id'' ).each{ |c| y << c.id } notfound = x - y But is there a more elegant way? It feels like I should be able to do this entirely through queries, but I''m not seeing the solution. -- 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-/JYP...
2008 Jun 11
3
mdmonitor not triggering program on fail events
...calling mdmonitor with these options mdadm --monitor --scan -f (note that the --program is not there) and this is in my /etc/mdadm.conf MAILADDR root PROGRAM /root/program_2_run.sh short of hacking the mdmonitor script to hardcode the program there, is there an alternate, more elegant way? Thanks.
2006 Jan 03
2
date in logrotate
...tate question for the group. To comply with a PHB mandate, I need to keep our apache logs for a minimum of 2 years, and will be periodically required to hand over chunks of the logs from specific dates/times. While extending the timeframe of logrotate is easy, I've found that there's no elegant solution in the RH/CentOS logrotate for appending dates to the filename. I'm curious to know what others with similar requirements are doing for this. I'd like to stay within the default system framework (no 3rd party apps as they have to be "approved"), so mostly I'm l...
2008 May 07
3
Yum + priorities plugin question
Hello all! I've recently started using the priorities plugin as part of my best practices. It's very effective, and prevents nasty things from happening (like atrpms upgrading python and disabling yum.) I'm wondering if there's a simple and elegant way to allow package-name-based exclusions. For example: For my mysql cluster, I'd prefer to have the latest mysql and mysql-server packages which I can get from utterramblings (Thanks Jason!), however, to do so while using the priorities plugin, I'd need to make that repo an equal pri...
2018 Jul 25
3
How to know the IP of "manager show connected" in dialplan
​I need to launch a remote process at the machine that has the dialer. I could hard-code the IP address in a global variable, but It would be much more elegant if the dialplan would have a "manager" object where I could read "manager-->connected". ​ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180725/0...
2012 Jun 11
3
Re: Wine + PowerBuilder + Sybase ODBC
aotheoverlord wrote: > > > Maybe I missed it, but could you tell us which version of PowerBuilder you are using? PowerBuilder 7... I tried to compile the application in PowerBuilder 6, but it doesn't works.
2013 Sep 18
1
[LLVMdev] In llvm, how can I delete a whole branch elegantly?
Hi, I am trying to prune some uninteresting llvm ir branches, corresponding to the *if-else* condition in the source code. And here is the procedures: 1. Get the BasicBlock containing the BranchInst which has 2 successors(in order to keep consistent with the source code I am using the llvm ir without any optimizations, so SelectInst/SwitchInst/PHINode is absent), one of which
2006 Feb 14
2
Inline list editing with RJS: best practices
...ike this: --- update.rjs --- page.replace_html "item_" + item.id.to_s, :partial => ''item'' The problem of course is that then you have nested <li> elements as the inner text is replaced, not the entire tag. Has anyone else encountered this and come up with an elegant solution. I suppose I could strip the outer <li> elements from the partial only in the RJS call like this: page.replace_html "item_" + item.id.to_s, my_method_that_strips_the_outer_li( render :partial => ''item'') But I have a feeling that there is a much m...
2014 May 29
0
How to make the tests pass in an elegant way? Ruby on Rails
I am writing a rails app with my colleague who wrote a lot of the tests. He had to take a leave of absence due to a death in his family, and I am needing helps with changing the model so that the tests will pass in our spec file. Here is the model: class Worker < ActiveRecord::Base attr_accessible :first_name, :last_name has_many :writings end Here is the spec:
2009 Feb 25
3
Secure but elegant destruction method
Hi,- I am looking for a clean and secure way for an ActiveRecord instance to delete itself. Say I have a User model in my app. Then the destructive action would be /users/user_id/destroy. If this action is not secured by a filter like: (*) before_filter :check_administrator_role, :only => :destroy then any user could potentially log in and start issuing:
2007 Nov 07
1
A more elegant way of obtaining the major OS release number
...^LSB Version:\t(.*)$}, > --- > > { > > "LSBRelease" => %r{^LSB Version:\t(.*)$}, > 623a625 > > "LSBDistRelease_MajorVersion" => > %r{^Release:\t([0-9]+)}, > ======= > > However, this seems like a rather unelegant, non-standard solution, > and it''s Linux-specific! > > Can you think of any way in which one might distinguish between, say, > ''Solaris 7'' and ''Solaris 8'', without caring if it''s 7.1 or 7.2 or 7.3 > within ''7''...
2004 Dec 21
4
Removing trailing spaces
...le method of removing trailing spaces from vector elements. I'd be fairly sure the same would work in R, but I can't find any mention of anything like it in the R archives or with help.search(). There are ways I could do it with substring(), but I seem to remember there was something more elegant. I can find the strip function in the clim.pact package, but that trims everything after the first space which is not useful in this case. Someone please refresh my memory. TIA -- Patrick Connolly HortResearch Mt Albert Auckland New Zealand Ph: +64-9 815 4200 x 7188 ~.~.~.~.~.~.~.~.~.~.~.~...
2005 Dec 08
3
Reshaping data
...mymatrix[age,year] <- mydf$no[mydf$yr==year & mydf$age==age] } else { mymatrix[age,year] <- 0 } } } This is fairly fast in such a simple setting. But with more years and ages (and for roughly 300 datasets) this becomes pretty slow. And in addition, this is not really elegant R-code. Can somebody point me into the direction how I can do that in a more elegant way, possibly avoiding the loops? Thanks, Roland +++++ This mail has been sent through the MPI for Demographic Rese...{{dropped}}