Displaying 20 results from an estimated 300 matches similar to: "Subtract a field from the current time in MySQL?"
2005 Dec 08
2
Confusing lock problem in rails
I have a model class in rails that has a class variable that is a
ferret index. For some reason, the methods in my class that refer to
the class variable are getting lock conflicts. Can anybody see any
obvious reason why? I notice that it keeps leaving a lock file in the
index directory. I thought auto_flush was supposed to remove the lock
automatically after every operation. Is there
2006 Mar 28
7
Is Ruby stable for production use?
Hi,
I realise that Windows is a poor platform and that Webrick is a development,
not production, server. However, we have started seeing this crop up when
perfectly simple page to page links are invoked...
[2006-03-28 08:32:21] ERROR Errno::ECONNABORTED: Software caused connection
abort
/usr/lib/ruby/1.8/webrick/httpresponse.rb:324:in `write''
2006 Jun 22
4
Filter on variable
Hi all,
I have a question about filtering on a variable.
If I have the following code in my controller to select a list of
users
> @allusers = User.find(:all,
> :conditions => [''team_id = ?'', @params["id"],
> :order => ''created_at'')
Is there an easy way to find out all users who
2006 May 04
3
Date find help please.
Here''s my problem.
I have an ''Item'' model with a date column called "inserted_on" formatted as
"yyyy-mm-dd hh:mm:ss:t". I want to find all records that were inserted more
than 30 days ago. How would I say that using the Item.find ( :all .....)
method? I don''t fully understand the syntax. I tried
@result = Item.find( :all, :conditions =>
2006 Feb 10
2
Sudden Strange Webrick Error: Errno::ECONNABORTED
Hello,
I''ve been developing an application (on Windows), and everything was
going pretty well, but I suddenly began getting this weird error back
from Webrick after submitting something through ajax, and only through
ajax. I''m submitting a form through ajax, and it is being process
properly - with all the interaction with the database happening
without problem. The response
2006 Feb 15
1
Per Database Migrations
Is there away to have parts of a migration file only work with a specific database. For example I am inserting some data into a table with:
execute "INSERT INTO demo_lists(position, name, updated_at, created_at) VALUES (1, 1, ''scott'', CURDATE(), CURDATE());"
Of course the curdate() function may only be available on mysql. So can we some how determine which
2006 Jan 23
4
Transition between effects
Peepz,
I was looking into how script.aculo.us handles effect to write a
tutorial and for a current project I wanted to make transition between
PAIR effects possible. These PAIR effects are (Appear/Fade,
SlideUp/SlideDown, BlindUp/BlindDown) the effect that toggle can handle.
script.aculo.us calls queue.loop each 40 milliseconds, and that calls
all the effect.loop for all effects in the
2006 Sep 13
1
Net::HTTPResponse
Hello :) I have a problem with the Net::HTTP library...
The Net::HTTP library [1] uses a Net::HTTPResponse object for all it''s
responses from web servers. This class has many subclasses, such as
HTTPSuccess, HTTPRedirecttion, etc.
When obtaining a response, the library suggests to check what it is by testing
the class of the returned object - using case/when or kind_of? (which it does
2011 Aug 16
4
Dashboard table resource_statuses growing uncontrollably
I''ve "inherited" the administration of a puppet-dashboard (version
1.1.0, installed on RHEL 5.6 from puppetlabs RPM), and have hit a
problem I''m hoping for some help with.
In short, one table, "resource_statuses" appears to be growing at a
rate far higher then the other tables:
mysql> select count(*) from nodes;
+----------+
| count(*) |
+----------+
|
2007 Sep 18
10
Routes
hi all,
I want to move some routing tasks out of the router and into the
controller. The goal is to make Merb feel less like mod_rewrite and
give the user more control at the controller. The new Router is
simple: it takes the path_info (not the whole request) then outputs a
controller class and some parameters from the path matching. The rest
of the routing would be done at the controller level.
2006 Apr 19
5
Mongrel 0.3.12.5 -- Pre-Release with File Upload whyness
I''ve got a Mongrel 0.3.12.5 pre-release in the releases directory I''d like
people to try out:
gem install mongrel --source=http://mongrel.rubyforge.org/releases/
This release incorporates why''s changes to allow for uploading files much
more efficiently and for streaming out files via a HttpResponse.send_file
call.
I re-wrote the file upload part what why created to
2007 Mar 26
1
Streaming content
Hello
I''m attempting to write a mongrel plug-in which would stream a response.
At first I was doing this
def process(request, response)
response.start do |head,out|
head[''Content-Type''] = ''text/html''
%w{o m g}.each { |c| out.puts c; sleep 5; }
end
response.done = true
end
But then I looked at HttpResponse and decided
2013 May 07
2
Net::HTTP
I''m looking at the documentation:
http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html
And I notice two uses of Net::HTTP. Both are using GET requests. But
what''s the difference? When to use which?
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri
response = http.request request # Net::HTTPResponse object
end
uri =
2006 Aug 02
1
Modifying Mongrel Examples
Hi,
I am tryinig to work on the Mongrel examples. I am trying to modify
the HttpResponse.
def process(request, response)
response.start do |head,out|
if request.params["REQUEST_METHOD"] == OPTIONS"
else
end
end
One can detect that the request is OPTIONS like this, but how does one
generate the custom response by using HttpResponse.
Please help.
Shubham
2010 Mar 18
13
ERROR NoMethodError: private method `gsub!' called
I have just upgraded to Ruby 1.8.7 and Rails 2.2.2. My previous project
was at Ruby 1.8.6 and Rails 2.0.2. My platform is Windows and Webrick
for development.
When I run Webrick, the server starts without error, the application
runs, database connections work and I can click through the pages and
display data. But it does not serve any stylesheets or javascript
files. What''s
2007 Nov 23
5
Comet style requests with mongrel
Hi,
I''ve been doing some experiments with php and if can use something like
<?php
for ($i = 0; $i < 100; $i++) {
echo "hello world";
flush();
sleep(10);
}
?>
to keep a http link open for an arbitrary amount of time and
routinely display "hello world" in the browser window.
Is is possible to write a mongrel handler to do something similar?
Thanks
2019 Nov 23
2
Re: [PATCH nbdkit v2 10/10] tests: Test the Python plugin thoroughly.
On Sat, Nov 23, 2019 at 3:10 PM Richard W.M. Jones <rjones@redhat.com> wrote:
>
> On Sat, Nov 23, 2019 at 01:42:15AM +0200, Nir Soffer wrote:
> > On Fri, Nov 22, 2019 at 9:55 PM Richard W.M. Jones <rjones@redhat.com> wrote:
> > > +def pread(h, count, offset, flags):
> > > + assert flags == 0
> > > + return
2010 Jun 23
2
Purpose of "Status" header in HTTP responses?
Hi folks
On line #63 of unicorn/http_response.rb a "Status" header is written to the
socket. A comment in the code explains that some broken clients require this
header and unicorn generously accommodates them.
We?re having the opposite problem. One of our clients using Microsoft Windows
and ASP haven?t been able to connect to our HTTP API since we moved it to
unicorn from passenger.
2005 Aug 25
0
multiple refreshs clicks cause errors in WEBrick
Hi all
I am new to rails, so I hope it is not a trivial question...
I am using rails with webrick and MySql4.1 on win XP.
I enter a simple action (with a post method) which fetches some data from a ''users'' table and present it in a rhtml view.
Now when I press the refresh button quickly a few times I get in the command line window errors such as this:
[2005-08-25 17:08:55]
2007 Oct 18
3
Automating blacklists
Hi,
I've been reading all I can on Google (and Asterisk TFOT book) looking for
ideas on how to implement an automated blacklist feature.
I would like to automatically blacklist a incoming number based on timestamp
and count information.
For example, if I get a prank call from the same number 5 times within 15
minutes, I want my dialplan to automatically blacklist this number.
Should I be