similar to: useful bit of code (hopefully)

Displaying 20 results from an estimated 1000 matches similar to: "useful bit of code (hopefully)"

2012 Aug 10
2
Simple question about formulae in R!?
Good morning reader, I have encountered a, probably, simple issue with respect to the *formulae* of a *regression model* I want to use in my research. I’m researching alliances as part of my study Business Economics (focus Strategy) at the Vrije Universiteit in Amsterdam. In the research model I use a moderating variable, I’m looking for confirmation or help on the formulation of the model.
2007 Jun 18
0
no sound with chan_mobile
I am new to Asterisk (1.4.5), and I am trying to get chan_mobile working. My intention is to use it as a cheap GSM gateway. In the dialplan I configured that all mobile numbers should go thru the mobile channel. The current situation is that I can setup the call via the mobile channel (bluetooth), but sound is still thru the bluetooth attached phone's speaker and microphone. I searched
2012 Oct 02
3
case insensitive inclusion validation
I want to add case_sensitive option to inclusion validation. This will allow to do: validates :numbers, :inclusion => { :in => %(One Two), :case_sensitive => false } Does it make a sense? Thanks. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit
2006 May 18
3
Google Map
Used a great howto @ http://iamrice.org/articles/2005/12/09/using-google-maps-in-the-uk-with-rails for using google maps on uk sites. Just having one issue I can''t seem to work out how to draw the postcode from my table I keep getting hit by method errors. The controller is require ''postcode_2_latlong'' postcode = Postcode.new("TN22 2LG") # I want this to
2006 Jan 20
3
text_field_with_auto_complete
Hi, I am trying to use text_field_with_auto_complete, it works fine but when I click on an item (even if I use the up and down key and then type enter) th search panel disappears but the selected results is not shown in the text field. Even more, the text field becomes empty. Any idea? Thanks S?bastien -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Mar 12
2
Find all the methods on a object in an irb session?
How can I find all the methods on an object from withing irb? Thanks, Joe
2006 May 05
4
Is sanitize() strong enough to protect me from XSS?
Haven''t been able to find a good enough answer on whether using sanitize() is enough to really protect me from XSS attacks I basically have a blog page that I want to allow people to display comments on but would like to allow html tags to be posted on the comments, these could html tags like the imageshack img tags, youtube player, photobucket img tags etc any other approaches or
2006 Mar 21
2
How do I get substring of utf-8 string?
I''m trying to get substring from a utf-8 encoded string. (say, first 50 characters of the string) String#[0..49] would give me the first 50 bytes not 50 characters.. I know there is jcode library, but it only let you count number of characters in utf-8 string. unicode gem doesn''t seem to help much. unicode_hacks gem seem to solve the problem, but it also seems to
2006 Jan 09
3
Pagination :conditions not working - MySQL v. PostgreSQL, Rails abstraction v. embedded SQL
Hi everyone, I have this code: @person_pages, @people = paginate :person, :per_page => 20, :conditions => [ "username LIKE ? OR first_name LIKE ? OR last_name LIKE ? OR preferred_name LIKE ?", "%" + params[:q].downcase + "%", "%" + params[:q].downcase + "%",
2009 Mar 26
7
error while compiling xen
Hi, I am facing the below error while compiling dom0. Please guide. root@cbananth:/usr/src/xen-3.3.1# make linux-2.6-xen0-config CONFIGMODE=menuconfig make -f buildconfigs/mk.linux-2.6-xen0 config make[1]: Entering directory `/usr/src/xen-3.3.1'' set -e ; \ if [ ! -e linux-2.6.18-xen.hg/.hg ] ; then \ __repo=$(sh buildconfigs/select-repository linux-2.6.18-xen.hg .:..) ; \
2012 Sep 20
4
access controller's object attributes in view page
Hi, I am new to ROR and learning it. In my controller I have an admins record and I am passing that admin object to the admin''s view page to get the name of the admin. But when I try to access the name it is showing error as "undefined method `name'' for :current_admin:Symbol".. Please help.. Please find my code below Sessions Controller def create
2012 Jun 26
3
plotting two histograms on one plot with hist function
I would like to plot two data sets (frequency (y-axis) of mean values for 0-1(x=axis)) on a single histogram for comparison. The hist() only allow the overlay of two histograms, and although barplot() allows beside=TRUE, it does not show frequency values (like hist) but rather all of the values. Is there any way that I can use the hist() to plot two data sets similar to the barplot(). Any help or
2007 Nov 02
11
xrcise tutorial, undefined method ''upper_bt''
Hi I''m trying to follow the tutorial on xrcise at http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise But I keep getting the following error when I try to run the example; tutorial.rb:21:in `initialize'': undefined method ''upper_bt'' for #<CaseChangeFrame:0x2d610f8> (NoMethodError) from tutorial.rb:28:in `new'' from
2006 Dec 27
10
Mixing html tags and Ruby blocks
I''m trying to get the following idea to work: <%= @column_names.each { |t| <td> t.downcase </td> <td> @listing.send(t.downcase)</td> } %> Essentially I want to display a form that has a left and right TD, with the left TD being a column name and the right TD being the column data. If there''s a better way (the Rails way ?), I''m all ears
2015 Oct 10
2
Forcing a sspecific stream type
Hi Steve, I think you are able to do what you want with liquidsoap. Regards, Dennis Verzonden vanaf mijn Cyanogen-telefoon Op 11 okt. 2015 12:19 AM schreef Jordan Erickson <jerickson at logicalnetworking.net>: > > Hi Steve, Icecast simply passes the stream through unconverted. You'd > want to employ something that will convert the stream for you before it > hits
2006 Sep 05
4
No matches
The following script creates a search index and then searches it. I get no results? Where am I going wrong? Thanks. -----------BEGIN SCRIPT---------------- require ''rubygems'' require ''ferret'' include Ferret path = ''/tmp/myindex'' field_infos = Ferret::Index::FieldInfos.new() field_infos.add_field(:name, :store => :yes, :index => :yes)
2006 Apr 20
7
Rails + postgres case insensitive searches.
Hello all I am wondering how rails handles case sensitivity in databases. If I do a Person.find_all_by_name("tim") in mysql I would expect to get tim, TIm, and Tim. Do I only get tim in postgres? How do other people deal with this? Do you resort to find_by_sql for all your postgres queries to get case insensitive results?
2006 Jul 15
2
FieldQuery not returning anything
Hey .. The QueryParser RDoc page explains to me on how to search for a specific value in a specific field. This is not working the way i thought it should be, what am i doing wrong? Here''s an example .. I''m storing model data in the index like this: doc << Field.new( "object_id", object.id, Field::Store::YES) doc << Field.new( "type",
2006 May 30
3
match operator in find
Greetings! Is there some special syntax required to use the match operator (=~) in a find operation? Or is it not possible? I''ve got some data items from an external source that could be capitalized or not. So right now I''m stuck with doing: Item.find(:first, :conditions => ["name = ? or name =?", Potatoes, potatoes]) I''d prefer to do:
2016 Feb 03
2
linking icecast to ios and android phones
Ok folks, I need to find a method for my listeners to listen to my radio station with their Android Phones - - -I think that I need to bypass the flash player - - -can anyone help me out there. I would imagine that many of you are broadcasting to people with Android phones - - -any help would be appreciated Regards Gary Hudson Home: 817-710-6367 Cell: 0959476691 From: