We are running thinking sphinx on a utility instance in our server cluster. It is rerunning the index every minute. But, if you make a change to a record, it disappears from search results until the index is updated (up to 1 minute).
Is Thinking Sphinx only returning rows that have updated_at times that less than their last index?
If...
Hi, i´m trying to send an email from ruby but I get an error msg.
I have this code:
require 'net/smtp'
message = <<MESSAGE_END
From: Private Person <[email protected]>
To: A Test User <[email protected]>
Subject: SMTP e-mail test
This is a test e-mail message.
MESSAGE_END
Net::SMTP.start('smtp.test.net', 25, 'test.com', 'usr', 'pwd'...
Hi,
I got the following example:
require 'erb'
names = []
names.push( { 'first' => "Jack", 'last' => "Herrington" } )
names.push( { 'first' => "LoriLi", 'last' => "Herrington" } )
names.push( { 'first' => "Megan", 'last' => "Herrington" } )
myname = "John Smith"
File.open( ARGV[0] ) { |fh|
erb = ERB.new( fh.read )
print erb.result...
Hi, I am trying to highlight a custom language in TextMate. However, the following definition does not highlight PHP insertions (I do select it for my *.serpent files):
{ scopeName = 'source.serpent';
fileTypes = ( 'serpent' );
patterns = (
{ begin = '<\?';
end = '\?>';
patterns = ( { include = 'source.php'; } );
},
);
}
...
Hello,
I often need to assign a variable, if the source value is set. So far I have done it like this:
filters[:red] = params[:search][:red] unless params[:search][:red].nil?
This works but looks a bit clumsy. There must be a more DRY way of getting this result.
Any suggestions?
Best regards.
Asbjørn Morell.
...
Using a ruby file (or any rake facility) I need to find out if the user who executes my script is able to execute certain shell commands. In particular g++ etc. Hopefully system independent so if there is some g++.bat, g++.exe or just g++ (etc) it should say yes nevertheless, as long as its on the path and executable on the users system....
rack.request.form_input isn't in my env variable--what's going on?
anyone??
...
I have a situation where I have a single activemq broker with 2 queues, Q1 and Q2. I have two ruby-based consumers using activemessaging. Let's call them C1 and C2. Both consumers subscribe to each queue. I'm setting activemq.prefetchSize=1 when subscribing to each queue. I'm also setting ack=client.
Consider the following sequence...
Hi,
Could some on help me to turn the following search into case - insensitive?
Here is the piece of code for earching "title" field in event module:
# Add each field to the conditions array
searchable_fields.each_pair do |field, value|
conditions << "#{field} LIKE ?"
values << "%#{value}%"
end
Here is the data I have entered:
...
Hi, I have set up my routes so I can search all posts with:
/posts/search/foobar
or search inside a category
/posts/category/1/search/foobar
It works pretty well, when someone is browsing an specific category it does search just posts that belongs to that category.
When inside a category, I want to place a checkbox to "Search all...
ref xml doc
I want to parse on EACH <HOST> and get the number of <OID> , along with Values of each
<TYPE>
<HOST>
<IP>10.1.3.1</IP>
<TRACKING_METHOD>IP</TRACKING_METHOD>
<DNS><![CDATA[.demo.com]]></DNS>
<OPERATING_SYSTEM><![CDATA[abcd Version 7]]></OPERATING_SYSTEM>
<ASSET_GROUPS>
<ASSET_GROUP_TITLE><![CDATA[Demo Lab ]...
Hello,
I have found some really sparse documentation about the options for posting to your feed.
I am trying to post to "/me/feed" and then include a user in that post. I am trying to re-create the way that you can now do @username in the Facebook Status box, but from the API instead.
Using the Ruby OAuth2 lib I to do the following.
...
This is probably super basic but, well, I can't find it...
What's the best way to explore Rails from within the installation itself. Let me explain. I'm looking at some Migration code and curious what a symbol means. How/where do I look that up? In this case, specifically, i'm curious about :force => true and what it's doing but the mor...
Any chance the 2nd and 3rd lines can be combined in an one-liner and hopefully save one valuable?
def self.date_format
record = find_by_key('strftime')
record ? record.value : "%Y-%b-%d'
end
the above function in a Config model try to fetch a database record by a key, return a default if not found in database.
Even better if can...
I have two succeeding function with the same condition and I wonder what is the best way to write this? I know the one way to do this is using if (condition) ... end, but I'm wondering if I can do it in one-line similar to bash, '[$n == $value] echo "$n" && break'.
n = 0
loop do
puts n if n == value # puts and break is having the same...
Hi,
I am new to Ruby on Rails. I am using Netbeans IDE. While importing a new project, I used the inbuilt JRuby 1.4 that comes with Netbeans as the Ruby version. The main reason I want the JRuby is because of its debugging abilities.
Now the doubt/problem I have is integrating libraries/plugins. One of the assignments I have requires ...
I have objects that have comments. As part of a periodic email summary, I want to determine comments for a period, and present the objects in the order of oldest commented object first.
Data:
object_id comment_id
30 40
40 42
32 41
30 43
32 44
Output:
Object #30
comment 40
comment 43
Objec...
I am using Savon to build the client, but want to kno how to create the actual envelope.
I am thinking of using Nokogiri XML Builder and just pass in the values, but not sure if that's the right way.
The SOAP envelope specs can be found here:
http://api.postalmethods.com/PostalWS.asmx?op=UploadFile
...
I'm trying to get Capistrano deploying my web app. I'm deploying a php app using remote_cache from a git repo to a Linux host via a Windows computer. Everything is deploying okay except that it doesn't copy over the .htaccess files. I'm new to Capistrano and Ruby, so any pointers would be helpful!
Capistrano 2.5.18 with Ruby 1.8.6 on...
I am trying to communicate with a RESTful service in Rails. It can return data in different formats, json and xml. Is there a specific way that I can get the data type that I want.
The service mentions that ACCEPT needs to be set in HTTP header. I am not sure how to do that in Ruby.
Currently I'm doing this for get
response = Net::HTT...