similar to: Noob DRY method question

Displaying 20 results from an estimated 200 matches similar to: "Noob DRY method question"

2009 Sep 24
8
Drop down list ?
Hi Gurus, I''m trying to tackle a drop down list. I have category and item dbs, and they''re wired up with category has_many :items and item belongs_to :category, and an item has a category_id. I have this code in my new/edit.html.erb for item: <%= f.collection_select :category_id, Category.find_main, :id, :header, {}, :multiple => false %> And a pretty drop down list
2009 Sep 24
2
Calling ActionView from uninheriting class
Hi Gurus, I have a class, specified in models cart.rb, which doesn''t inherit from anything--it''s just a container class Cart ... I just discovered I can''t call number_to_currency in that class. Any idea how to "include" it in my code? I tried ActionView.number_to_currency without luck. I could kill a few lines of non-DRY regexp code in cart.rb if I could
2009 Sep 25
12
uniqueness validation perplexity
I want to write a validate routine to check to enforce that a position must be unique in a category. (In another category, it doesn''t have to and shouldn''t need to be unique.) I write this code which works happily for new items: def position_in_category_not_unique @items = Item.find( :all, :conditions => [ "category_id = ? AND position = ?", category_id,
2010 Jan 21
2
will_paginate ?
Does anyone have experience with will_paginate? I''m trying to use it with acts_as_ferret. routes.rb ... map.search ''/search'', :controller => ''notes'', :action => ''search'' notes.rb ... acts_as_ferret :fields => [ ''body'' ] notes_controller.rb ... def search if params[ :query ] @query = params[
2010 Jul 01
6
Close Modalpopup with RJS
hi guys: I''m scratching my head on this one: I have a twitter app where I''m trying to open a modalpopup with a twitter sign in, get them to sign in, then close the popup and refresh the main window. My code however refreshes the main window with the popup window result, which I thought was really strange: application.html.erb function OpenModalPopUP() {
2009 May 05
4
modalbox rails var interpolation
Howdy everyone. I am using modalbox which is very nice an easy to use. I have this for an edit for a company listing: <td><%= link_to(''Manage Companies'', {}, :onclick => ''Modalbox.show(\''/ companies/edit/#{company.id}\'', {width: 600}); return false;'') %></td> The link is not putting the company.id in it puts #{
2001 Feb 14
1
smbclient no connect NetShareEnum failed
Running recent cvs from head branch, attempting to list shares on a machine running win2k. Can anyone tell what is wrong here. It does have several shares including a printer. I can connect with: smbclient /chub/SHARE -U Adminstrator (and get prompted for password) What does the line `NetShareEnum failed' below, mean (Sorry about verbose output) #
2008 Feb 13
2
Header packet multiplicity
> There are a usually lot more data packets than header packets, so > having an internal length there hurts your bitrate a lot more. Of > course, it may not be significant for an uncompressed text codec. If muxed with a video, it's insignificant (well, for my test cases). > With codecs using the 'count of decodable samples' rule to calculate > their granulepos, the
2017 Mar 15
2
Problems with replication and dns
Hello, Yes, i have run: /samba_upgradedns --dns-backend=BIND9_DLZ This command runs without errors but I can not delete the zone waspruebas.proteccion.com.co Best regards, Santiago. 2017-03-15 12:44 GMT-05:00, Rowland Penny via samba <samba at lists.samba.org>: > On Wed, 15 Mar 2017 12:40:37 -0500 > Santiago Londoño Mejía <santiago.londono at pragma.com.co> wrote: >
2007 May 25
1
form_remote_tag :condition
I am using the following validation prototype-based js library: http://tetlaw.id.au/view/javascript/really-easy-field-validation What I am trying to do is upon submitting a form via AJAX, I want it to meet the conditions of the validation of the function validateMe() If it passes, go ahead and continue and push the form information via an AJAX call. This is what I have: <% form_remote_tag
2008 Jan 26
1
How do I seek back to the beginning of a speex file?
Okay, I feel really stupid here but I've been unable to figure out how to easily seek within a speex file so that playback starts from the beginning. I've scoured the mailing lists for solutions and the best that I could come up with was to see what libvorbis was doing when it performed a seek inside of an ogg stream but it looked rather complicated for what I want to do. Does
2017 May 16
3
Problems with sysvolcheck
Hello, Thanks for your answer I have tried to alter the default policies but the error persists ./samba-tool ntacl sysvolreset open: error=2 (No such file or directory) ERROR(runtime): uncaught exception - (-1073741823, 'Undetermined error') File "/usr/local/samba/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 175, in _run return self.run(*args, **kwargs)
2005 Dec 14
1
[scriptaculous] scroll down to show full auto completion list (w/ possible patch)
Hi everyone, lately I''ve implemented an auto completion textfield at the bottom of a form. I was a bit bothered by the fact that the user would potentially need to scroll down in order to see all the options offered by the auto completion. I couldn''t find any information on how to auto scroll to the auto completion list with bulit-in functionality so I modified controls.js
2009 Sep 30
2
[LLVMdev] long double type on ARM
Hi Bob! I could not find llvm file for ARM target in llvm-gcc 4.2 front end source code. $llvm-gcc-src/gcc/config.gcc file alpha*-*-*) cpu_type=alpha need_64bit_hwint=yes # LLVM LOCAL begin out_cxx_file=alpha/llvm-alpha.cpp # LLVM LOCAL end ;; ... arm*-*-*) cpu_type=arm extra_headers="mmintrin.h" ;; ... i[34567]86-*-*) cpu_type=i386 # LLVM LOCAL begin
2006 Apr 19
1
HW-Speex: Fileformat and encoding process
Hi I have just written a small c programm which reads in speex files and outputs them as asci text numbers. This is necessary as for writing a hw testbench for decoding tests, since thy only read ascii files :-(.I can't read the bitrate properly from the header file. It's allways -1. Please see example below and attached c programm. I wan't to check for a fixed bitrate (8000).
2017 Mar 27
8
Provision new domain keeping users and passwords
Hello, I try to add a new dc to my domain, but the sysadmin installed the main dc left misconfigured dns zones that I can not remove. ¿Is it possible to provision the domain again using new samba as main dc Keeping users and passwords Of the previous dc? The current main dc runs samba 4.4. Best regards, Santiago. -- Santiago Londoño Mejía Analista de Infraestructura t. (574) 605 25
2008 Mar 25
5
Assign Physical NIC to domU
Hello everyone! Well i want to know, if there is a way to specify a physical nic (like eth0 or eth1) to a domU and how can i do it. The server has two nics, what i want to do is assign physical nic (eth0) to the dom0 and assign physical nic (eht1) to the domU. I appreciate your help. Regards Ivan ____________________________________________________________________________________ Be a
2017 Mar 29
2
Provision new domain keeping users and passwords (Santiago)
Hai Santiago,   Your welkom, i hope i can help you out.   Post my your bind9 configuration, you can anonimize it if needed, but dont remove any lines from it.   And i need a snap of the log when bind is starting up. Like this one : Mar 29 16:42:58 dc1 named[21921]: starting BIND 9.9.5-9+deb8u10-Debian -f -u bind Mar 29 16:42:58 dc1 named[21921]: built with '?pr.... etc. .  Mar
2010 Mar 24
3
More elegant solution for "missing" has-many through ids?
I have LabGroup and LabDesc which have many through LabDescGroup. I''d like to identify LabDescs which don''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
2017 Mar 29
3
Provision new domain keeping users and passwords
I was able to do this by exporting and importing users (including passwords) with the pdbedit samba utility. Look at this: Http://serverfault.com/questions/675938/migrate-samba-users-to-new-server Maybe you need to change the passdb backend 2017-03-28 2:49 GMT-03:00 Mike Lykov via samba <samba at lists.samba.org>: > 27.03.2017 22:48, Santiago Londoño Mejía via samba пишет: >