thin

Oracle ResultSetMetaData getPrecision/getScale

亡梦爱人 提交于 2019-12-09 19:10:24
问题 I'm using Oracle's JDBC thin driver (10.2.0.3) for connecting to an Oracle 10g database. I'd like to get information about the database columns, so I use ResultSetMetaData. The most important information I need is the type of the column and the length, so I use getColumnType, getPrecision, and getScale methods. It works for a simple query ( select * from tablename ) if the column type is "simple" like VARCHAR2(50), NUMBER(5), NUMBER(6,2) . If I have a more complex query ( select count(*) from

POSTing an HTML form to remote.cgi - written in Ruby?

青春壹個敷衍的年華 提交于 2019-12-08 14:15:51
问题 I am working on a website hosted on microsoft's office live service. It has a contact form enabling visitors to get in touch with the owner. I want to write a Ruby script that sits on a seperate sever and which the form will POST to. It will parse the form data and email the details to a preset address. The script should then redirect the browser to a confirmation page. I have an ubuntu hardy machine running nginx and postfix. Ruby is installed and we shall see about using Thin and it's Rack

problems installing thin on Windows

别说谁变了你拦得住时间么 提交于 2019-12-08 06:31:58
问题 I'm trying to install Thin on Windows (ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]) but get an error message: C:>gem install thin Building native extensions. This could take a while... ERROR: Error installing thin: ERROR: Failed to build gem native extension. C:/rails/ruby/bin/ruby.exe extconf.rb checking for main() in c.lib... no creating Makefile nmake Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. cl -nologo -I.

Single thread still handles concurrency request?

独自空忆成欢 提交于 2019-12-07 16:51:55
问题 Ruby process is single thread. When we start a single process using thin server, why are we still able to handle concurrency request? require 'sinatra' require 'thin' set :server, %w[thin] get '/test' do sleep 2 <---- "success" end What is inside thin that can handle concurrency request? If it is due to event-machine framework, the code above is actually a sync code which is not for EM used. 回答1: Quoting the chapter: "Non blocking IOs/Reactor pattern" in http://merbist.com/2011/02/22

Why thin behind nginx?

大城市里の小女人 提交于 2019-12-07 06:09:03
问题 Deploying my first web app. I have been using thin, it's simple and easy. All I need is a config file. But a lot of people use nginx and place a couple thin instance behind that. Why? Why not just use thin alone? And why use nginx rather than placing 3 thin instances behind a single thin instance? Thanks 回答1: Scalability is the main reason. While Thin can do SSL, serve static files, and handle large responses to slow clients, Nginx is better at all of them for any given CPU and memory

Subdomain constraint (Rails 3) makes local server (thin) SO SLOW

假装没事ソ 提交于 2019-12-07 03:58:40
问题 I recently added a subdomain constraint to my Rails routes file constraints(:subdomain => 'new') do devise_for :customers do get "/customers/sign_up" => "registrations#new" post "/customers" => "registrations#create" put "/customers/:id" => "registrations#update" end match '/' => 'roxy#index' namespace :roxy, :path => '/' do resources :customers resources :surveys end end In order to test the subdomain routing constraint locally, I added this line to my hosts file. 127.0.0.1 new.localhost

How to get ActionController::Live streaming working with Thin?

荒凉一梦 提交于 2019-12-07 03:07:49
问题 Question Can you use thin with ActionController::Live to implement Server Side Events (SSE) and long polling? If so, how? Context Although the title is a repeat of How to get Rails 4 ActionController::Live streaming working with Thin and Ruby 2? And how do Thin and Puma scale with live streaming?, the OP muddied the waters by asking two questions, and this question never got answered. A number of other posts suggest you CAN use thin for Server Side Events (sse) if you start it via exec thin

How to view debug code in Thin console window?

倖福魔咒の 提交于 2019-12-06 07:19:57
问题 In Mongrel, we are able to see any ruby debug code. After installing thin and doing thin start . I don't see any debug code on the console window. Is this nromal? Are we supposed to use tail -f log/development.log in a new console window to view the debug code? 回答1: Yes. The solution with tail is normal, and you should use it. 回答2: You could also try to start your server this way : rails server thin It shows your log, in Rails 3 at least. 回答3: You can use a Procfile with foreman: Procfile web

Sinatra - terminate server from request

吃可爱长大的小学妹 提交于 2019-12-06 06:46:54
问题 I want to be able to terminate a Sinatra app from a request, e.g. with the following route: post '/terminate' do Thread.current.kill end Implementing it like this is a bit abrupt. I'd rather the request completed, returned an HTTP OK message, and then Sinatra shut down gracefully. Is there a hook to do this? Edit: My application is a lightweight mock server used for receiving webhook notifications. I will be using multiple servers like this on the same machine (different ports), so need to

How do I log asynchronous thin+sinatra+rack requests?

十年热恋 提交于 2019-12-06 05:47:51
问题 I'm writing my first Sinatra-based web app as a frontend to another TCP-based service, using EventMachine and async_sinatra to process incoming HTTP requests asynchronously. When I'm testing my app, all requests to synchronous routes are logged to stdout in common log format, but asynchronous requests are not. I've read through bits of the source code to async_sinatra, Sinatra, Thin, and Rack, and it looks like logging of synchronous requests is done through CommonLogger#call. However, I can