I have a simple question really: SWT documentation says that if you're using styledText, you either implements its API or you implement LineStyleListener.
So, If I do use LineStyleListener, how can I still control the representation of specific characters in the editor widget? It seems that implementing LineStyleListener only provides c...
Hey guys, so I'm making a script to featch words/results off of this site (http://grecni.com/texttwist.php), So I already have the http request post ready, ect.
Only thing I need now is to fetch out the words, So I'm working with an html source that looks like so:
<html>
<head>
<title>Text Twist Unscrambler</title>
<META NAME="keyword...
Hi,
I have a test suite with me. I want to add another test class with a set of tests in the test suite. Since this is a class with test cases, I do not know how to add it to the test suite.
testsuite - existing test suite.
FactorTest.rb - test class with test methods (class name is FactorTest)
I tried
testsuite<<FactorTest
and then
T...
For some reason, one of my models in rails is returning nil when I call .new. This is only a problem in the controller. When I try on the console, it returns an object with nil attributes as I would expect. I suspect the problem is in my controller, but I have no idea.
This also happens when I call .all. Again, I can execute these comm...
I have heard that one in PostgreSQL can write stored procedures in Ruby.
But I haven't been able to find more information about it teaching one how to actually do it.
Could someone recommend good sources for that.
Thanks
...
Newbie here, so probably something stupid :)
I'm trying to play with the erb templating in Ruby. It works fine at home - Apache on windows. But when I upload it to the server it breaks every time... Simple example:
require "erb"
class Stuff
def initialize( name )
@name = name
end
def get_binding
binding
...
Hi
How can I configure a Netbeans Ruby project so that it does not run a Ruby interpreter (a Ruby "platform"), but starts up rackup?
Thanks
...
I read a few tutorials on getting memcached set up with Rails (2.3.5), and I'm a bit lost.
Here's what I need to cache:
I have user-specific settings that are stored in the db. The settings are queried in the ApplicationController meaning that a query is running per-request.
I understand that Rails has built-in support for SQL cachei...
I'm just starting out in Ruby (Rails actually) and the book I'm reading covers Ruby 1.8.6, RubyGems 1.0.1, Rails 2.0.2 and SQLite 3.5.4, but the current stable releases of these are 1.9.1, 2.3.8, 1.3.7 and 3.7.0 respectively, should I still proceed with the book or find another?
Also, I couldn't find a recent guide/tutorial to walk me t...
When I do a find query from the mongodb JavaScript console, I get a beautiful JSON response. However, when I do a find with the ruby driver, it stores the JSON as some Ruby object. How do I convert this back to JSON? Or, better yet, how do I just get the JSON without doing the extra conversions?
...
I'm looking for good ruby/rails oriented twitter accounts to follow. Interesting in news/events in life of ruby/rails community.
...
MBPro:shovell myname$ ruby script/server
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-08-01 15:28:35] INFO WEBrick 1.3.1
[2010-08-01 15:28:35] INFO ruby 1.9.1 (2010-07-02) [i386-darwin10.4.0]
[2010-08-01 15:28:35] INFO WEBrick::HTTPServer#sta...
Given an n x m array of boolean:
[[true, true, false],
[false, true, true],
[false, true, true]]
what is the shortest code that can return "how many true are there in that column?"
the result should be
[1, 3, 2]
...
I've recently bought a copy of EZDrummer, a VST plugin that acts as a virtual drumkit. I'd really like to hook into it from Ruby code so that I can create loops and drum patterns programmatically. To be honest I am not sure even where to start. Presumably I have to create a VST host which can load the plugin and then hook into it somehow...
I am getting this error
rake db:migrate (in
/Users/john/Sites/my_app) rake aborted!
Don't know how to build task
'db:migrate'
When I trace the error I get
rake aborted! Don't know how to build task 'db:migrate'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in `[]'
/usr/local/lib/ruby/gems/1.8/gems/rake-0....
I am looking for a good ruby editor that supports VI commands. I have been using gvim but it would be nice to have an IDE that helps me navigate between files. Any suggestions?
I realize there is a similar question http://stackoverflow.com/questions/172168/ruby-on-rails-editor-for-windows however it doesn't address VI specific editors.
...
You can create a subclass of an exception to make it more descriptive, but how should you set the default 'message'?
class MyError < StandardError
# default message = "You've triggered a MyError"
end
begin
raise MyError, "A custom message"
rescue Exception => e
p e.message
end
begin
raise MyError
raise Exception => e
p e.mes...
Is there a way to mock out Curb's Easy.perform method for unit testing? I use this to hit Facebook's graph API, and none of the http mock libs seem to support Curb.
What's the best approach here?
...
Many sites have communication via the site (instead of via email). Examples:
LinkedIn: Click "Inbox" at the top of the screen.
Facebook: Click "Messages" in the left sidebar.
Is there a gem that provides this sort of functionality? Googling hasn't turned up much, because the search terms are so generic - "Rails gem messaging" "Ruby...
I have a Thread model which has a show page, and in that action's view code I have:
<%= render 'comments/form' %>
What is the proper way to initialize the new Comment? I've tried:
@comment = @thread.comments.build(params[:comment]) in the Comment create action and the comment form's view code.
Thread helper methods and Model metho...