similar to: MySQL IN clause for an array of strings

Displaying 20 results from an estimated 1000 matches similar to: "MySQL IN clause for an array of strings"

2010 Oct 09
1
Loss of precision in read.csv.
Given a csv file from this location Airports<-"http://www.ourairports.com/data/airports.csv" download.file(Airports,basename(Airports)) airports <-read.csv("airports.csv",encoding="UTF-8") > airports[1,] id ident type name latitude_deg longitude_deg elevation_ft continent iso_country iso_region municipality scheduled_service 1 6523
2006 Apr 04
5
How to implement tag clouds using plugin?
The code on http://blog.craz8.com/articles/2005/10/28/acts_as_taggable-is-a-cool-piece-of-code is based on the acts_as_taggable gem,anybody has done that using the acts_as_taggable plugin?thanks! btw:the code above uses the tag_count method,which is defined in the gem: def tags_count(options = {}) options = {:order => ''count DESC''}.merge(options)
2008 Sep 17
13
Capturing the sql from a statement without executing it?
Hi guys, Is there an elegant way to capture the sql that would have been executed by an ActiveRecord statement, without actually executing it? :) I''m imagining something like sql = User.find(1).groups.to_sql or perhaps sql = ActiveRecord::Base.capture_sql { User.find(1).groups } resulting in sql = ''SELECT * FROM groups INNER JOIN memberships.... WHERE users.id =
2006 Dec 04
10
Avoiding SQL Injection in :order?
This thread references: http://www.ruby-forum.com/topic/90258#new http://www.ruby-forum.com/topic/82349#143790 ActiveRecord''s find() method has built in ways to avoid SQL injection by using the format > :conditions => [ "user_name = ?", user_name] Is there any such system for escaping injection in :order? It seems to only take a string and feed it to the SQL
2009 Nov 17
5
has_many :through and foo.bars.include?
hallo everybody, i already googled the following problem, but there are so many questions regarding "has_many :through", that i just couldn''t find what i was looking for. so, i''m really sorry if this has been asked before. if so, just drop me the link. i have a has_many :through relationship similar to the following example: class Group < ActiveRecord::Base
2006 Mar 21
2
SQL bug in acts_as_taggable
Hi, excuse me if this is off-topic and feel free to ingore it in case. I''m using acts_as_taggable (the gem version) and found what to me looks like a bug in this code from the method tags_count: sql = "SELECT #{t}.#{t_pk} AS id, #{t}.name AS name, COUNT (*) AS count FROM #{jt}, #{o}, #{t} WHERE #{jt}.#{t_fk} = #{t}.#{t_pk} AND #{jt}.#{o_fk} =
2006 Jan 29
9
Specify options with habtm
Hi all I have the following models: class member has_and_belongs_to_many :disc_jockeys end class disc_jockey has_and_belongs_to_many :members end The relation table is called disc_jockeys_members and has the following fields: disc_jockeys_members(disc_jockey_id, member_id, status) So far, the field status can have values like valid, invalid, locked etc., but it is not regarded yet by
2003 Jun 25
4
Asterisk and FWD
I can't get my Asterisk to register/place calls with FWD. Here's what I have in my SIP.CONF: register => 11111@fwd.pulver.com/11111 [fwd] type=friend secret=somesecret host=fwd.pulver.com username=11111 fromuser=11111 fromdomain=fwd.pulver.com I'm using CVS version of Asterisk, checked it out last week. I get authenticate error when registering with fwd, and all my calls to
2006 Sep 07
1
ActiveRecord's "conditions" magic
I''ve programmatically built an array suitable for ActiveRecord::Base.find()s :conditions parameter. However, I''m also doing a find_by_sql on the same model and I want to generate the relevant WHERE clause. Does Activerecord have an easy way to do this? I can''t see anything immediately in the docs Thanks, Gareth --~--~---------~--~----~------------~-------~--~----~
2014 Oct 20
1
winbind/i­dmap­ issue on samba4 mem­ber s­erver
Oh! I think I did find the error now :-) If I understand "NOW" correctly, I have also to assign a UID to EACH of my AD users in ADUC tool in the [UNIX Attribute] tab, is that correct? I just tried out. In ADUC tool I did choose "testuser3", and on the [UNIX Attribute] tab I activated the NIS domain so it reflects to "MYDOM". Then by default there was UID=10000, I
2006 Mar 16
1
Rails SQL generation (Firebird adapter) - can someone explain ...
I see some possible issues with the SQL that is being generated by the firebird adapter. Every SQL is being generated on the fly by concatenating strings. Can someone please explain why the SQL is being generated the way it is? I cannot use this in real life for a couple of reasons: 1. This introduces a security hole because a user, accidentally or deliberately, could potentially submit a
2005 Mar 23
1
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
I am getting random can''t connect to MySQL server errors on my Rails application located at http://www.thedatingguy.com/blog Do you have any clue why this is happening? This is the error: Mysql::Error (Can''t connect to local MySQL server through socket ''/tmp/mysql.sock'' (61)):
2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
I submitted this earlier, but the web forums went down and I''ve screwed up the thread, so I''m starting over. I''m trying to built a document upload system. The system has a main Document model with different subclasses for different types of documents. With the code below, if I attempt to create a Document, it works fine, but if I attempt to use one of the subclasses, I
2002 Jan 14
3
smbpasswd file NFS sharable?
If I want to make two servers use the same encrypted passwords can I share the smbpasswd file via NFS? Will updates/locking work correctly? Is there an alternative? Can LDAP/PAM use encrypted passwords? -- Gary Algier, WB2FWZ gaa@@ulticom.com +1 856 787 2758 Ulticom Inc., 1020 Briggs Rd, Mt. Laurel, NJ 08054 Fax:+1 856 866 2033 A self-addressed envelope
2011 Sep 08
3
Conga problems
Hi all, I've spent the past little while attempting to setup Conga on a two node CentOS 6 cluster. While I do have the cluster up and running, I'm running into problems attempting to start services through luci on either node. A little background information: -Both nodes have dual NICs, one interface on each node will be used for the WAN, the other is a private gigabit crossover
2006 Jan 21
4
Single quotes in parameters
I have a "search" action for my "projects" controller, which defines a set of projects as follows @projects = Project.find(:all, :include => [:user,:clients], :conditions => "name like ''%" + params[:query] + "%''",:order => ''number'') This works fine, until I type an entry into my search box that has a single
2006 Jan 13
1
dnid support?
Hi all! I'm in the process of configuring an Asterisk server here that, based on which number was called, should send calls to different extensions: 913 - 11111 -> ext. 1 913 - 22222 -> ext. 2 913-11111 & 913-22222 being 2 (of the) numbers we have coming in to our system via our VoIP hosting provider. The config used here is based on Asterisk at home, so it includes also the
2007 Apr 22
0
rename error using rebuild_index in console after searching
Hi, I use ruby console to experiment acts_as_ferret, but I ran into file rename error when I try to rebuild index after doing a search. is this normal? I am using Ferret 0.10.9 in windows XP. Loading development environment. >> Address.rebuild_index => {} >> Address.find_by_contents(''US'') => #<ActsAsFerret::SearchResults:0x4f2ffcc @total_hits=2,
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2002 Feb 21
3
Any way to prevent mapped drives?
Is there any way to prevent users from mapping drive letters to Samba shares? We are constantly getting user problems like: "I can't find my files on my F: drive. Please restore it". They expect us to know where their F: drive was mapped. We try to show users how to use UNCs and shortcuts, but I would like to prevent mapped drives. There is another reason to prevent them: