similar to: random code questions

Displaying 20 results from an estimated 100 matches similar to: "random code questions"

2006 Oct 28
5
RSpec, REST and different formats
Is anyone using RSpec with RESTful rails apps? In my rails controllers I check request.respond_to? and render different views accordingly. I noticed that the get method in the rails plugin doesn''t accept headers: controller_mixin.rb line 92 def get(action, parameters = nil) @request.env[''REQUEST_METHOD''] = ''GET'' process action,
2007 Sep 22
2
http helpers c extension
hi, I rewrote escape, unescape, and query_parse in a C extension. http://s3.amazonaws.com/four.livejournal/20070922/http_helpers.tar.bz2 Here are some sample benchmarks (the benchmark script is included in the package) user system total real escape: Single long Mongrel: 1.680000 0.020000 1.700000 ( 1.837793) HttpHlp: 0.030000 0.010000 0.040000 ( 0.036590)
2011 May 28
8
Cisco registration problem with 1.8.3.3
I am having a problem registering my cisco phones which is exactly like that described in http://lists.digium.com/pipermail/asterisk-users/2011-May/262306.html except that I am on Asterisk 1.8.3.3 and using sip level POS3-07-4-00 The symptoms are: o 7960 lines show [X] o Outbound calls can be made from the phone, including call pickup of inbound calls, but not to it. o Trace shows REGISTER
2008 Jan 14
3
Reading HTTP Request parameters
Hello I''ve a client which send this request to a mongrel HTTPHandler : res=Net::HTTP.post_form(URI.parse(''http://localhost:3000/test''),{"a"=>1,"b"=>2}) But in the handler I can''t read the parameters one by one, I can read the entire String only : class Serveur class MyHandler < Mongrel::HttpHandler def process(req, resp)
2006 Nov 13
6
mongrel_upload_progress question/possible suggestion
Hey all, First off, thanks to Rick Olson and whoever else was involved with this plugin... It''s been amazingly easy to implement. I''ve got a question about the path_info parameter, though... It seems that unless the request PATH_INFO exactly matches the path_info passed in to the plugin at inclusion, it won''t actually trigger Add and add the upload to the list of
2007 May 04
6
Rspec on Merb Plugin - Initial thoughts?
A couple days ago I submitted a patch, that was committed by Ezra, to the MrBlog project for the Rspec on Merb plugin. So far, it only works with ActiveRecord including fixtures. Has any played with it? If so, did you get it to work? I''m going to be submitting a patch for Controller specs soon. It will be very bare bones, given my current lack of understanding of Merb controller
2007 Aug 13
0
Problems running merb from trunk
I have no problems loading any static requests, but any that are routed to a controller blow up. I''m getting a ''Bad controller'' error. The reason I''m a bit flummoxed is because the stack trace makes no sense. It terminates on this line: resolve_controller 68 /opt/local/lib/ruby/gems/1.8/gems/merb-0.3.7/ lib/merb/merb_dispatcher.rb As you can see,
2006 May 11
5
Mongrel 0.3.13 Pre-Release -- Out of Hibernation
Hello Mongrel Fans, After about a Month of busy work, bad computers, moving half my house across the country, and other dramas, I''m finally pushing out the next release of Mongrel. This pre-release has lots of little goodies and the start of some documentation that should get everyone primed for the big "Mongrel 0.4 Enterprisey Edition 1.2" coming real soon now. INSTALLING
2006 Jan 25
0
asterisk 1.2 with grandstream ht-496 2nd port registration issues
hi@all I have the following problem: With asterisk 1.09 the grandstream's registers fine with both ports, with version 1.2.1 (the newest port on freebsd) I get "Unauthorized" SIP messages from the 2nd port. The ports are configured identically, the only difference is the sip and rtp port. On the first port the sip port is 5060 on the second 5062. The rtp on the first 5004 on the
2006 Feb 01
1
Unable to Register to Asterisk through Proxy
Hi, Has anybody come across a situation where they were unable to register with Asterisk through a SIP stateless proxy server? I'm getting an error: "403 Authentication user name does not match account name" As far as I can tell the requests reaching Asterisk with and without the proxy are identical excepting the IP address the REGISTER request is coming from and the Via header
2007 Apr 12
2
Asterisk 1.2.17 and Cisco 7940/SIP: bug or what?
Hi. I'm stuck into an odd situation. Here's what happens: 4 Thomson ST2030S 2 Cisco 7912 3 Cisco 7940 2 AAstra 480i Asterisk 1.2.17 Diva 4BRI + chan_capi I've just upgraded yesterday from Asterisk 1.2.13 to 1.2.17. Until yesterday, everything was just fine with 1.2.13. Immediately after the upgrade, *all* the 7940 are no more able to make calls, just receive them, while 7912
2006 Sep 22
1
QueryParser bug?
I cooked up a little script to show what I mean. This doesn''t look right to me, but maybe I just completely misunderstand QueryParser. Same output on mswin32, unix, ferret 0.9 and 0.10 Cheers, Sam require ''rubygems'' require ''ferret'' p Ferret::VERSION # 0.10.6 index = Ferret::Index::Index.new() index << {:title => "Programming
2006 Mar 29
1
Using boolean terms in PHP bindings
OK, I'm indexing my data with the scriptindex. I want to be able to restrict the search by the category field. Do I need to do anything to the data itself? Like, literally prefix it with the characters "XC"? Below is my indexor for scriptindex and the my php code... document_id : field=ref unique=Q boolean=Q search_id : field=document_id index=S document_title : field=title
2006 Sep 15
3
Crashes and tests failures again with 0.10.4
In the beginning 0.10.4 looked promising, but now that my index has grown to > 100 MB I''m getting segfaults on some searches again: >> Post.find_by_contents(''rubyforum'') # ok >> Post.find_by_contents(''ruby-forum'') /usr/local/lib/ruby/gems/1.8/gems/ferret-0.10.4/lib/ferret/index.rb:351: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24)
2006 Aug 15
8
Ferret 0.10 series
Hi David, >> Otherwise I''m fully committed to getting 0.10 out. >> When it is out, I''d recommend getting it into your >> development app as soon as you can. Any idea of timeframe to a 0.10 alpha release? Kind Regards Neville
2007 Sep 27
0
query string parsing C extension
Hey all, here is a less hacky version of the query string C extension I posted before. http://s3.amazonaws.com/four.livejournal/20070927/qsp.tar.bz2 It uses an http11-like interface to the state machine. the escape/unescape functions are also slightly more libraryish. again, here is the about benchmark results. it seems to be about 10 times faster than the ruby functions. i''ve seen
2006 Jul 25
1
RDig document processing error
Hi all, Am having problems using RDig: With this rdig config... cfg.crawler.start_urls = [''http://www.defensetech.org''] cfg.crawler.include_hosts = [''www.defensetech.org''] cfg.index.path = ''/my/path/to/index'' cfg.verbose = true ...I get this output: $ rdig -c config/rdig_config.rb /usr/local/lib/site_ruby/1.8/ferret/index/term.rb:45:
2005 Dec 19
2
Parentheses for precedence?
I''m not sure whether this is a bug or whether I''m simply expecting Ferret queries to work in a way other than they''re intended. I notice that if use a query like: (other_text:"Collaborative tools") AND NOT other_text:podcasts I''ll get correct search results. However, if I put parentheses around the second part, like:
2007 Feb 26
4
Ferret 0.11.0 tests segfault
I have an important segfault when I create the index (via Ferret::Index::FieldInfos#create_index). I decided to run the tests, this is what I have : $> ruby test_all.rb Loading once Loaded suite test_all Started ....................EEEEEEEE./unit/../unit/index/../../unit/store/../../unit/analysis/../../unit/utils/../../unit/query_parser/../../unit/search/tc_filter.rb:11: [BUG] Segmentation
2006 Oct 15
12
Very small scores for search results
Hi Everyone, I''m using Ferret 0.10.11 with acts_as_ferret from SVN (same results with 0.10.10 and 0.10.9 though). I''m running into an odd problem where the scores of my top-ranking search results are ridiculously small - even when the query is one that should match at least one document with a decent score. To give an example, I have just the names of 5 businesses indexed