This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body>hi!</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
Testing | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For an arbitrary string, detect the largest palindrome* present within it. | |
* a sequence of characters the same forwards and backwards at least 3 characters long. | |
For instance in "abbabcdedc", the longest palindrome would be "cdedc". | |
Answers? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
240: adr | |
195: lusis | |
193: zunaid | |
189: megbutton | |
175: onebrightlight | |
167: 1ai1a | |
157: cripsahoy | |
154: fivethirtyeight | |
154: tamera | |
137: twilio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Song | |
def initialize(title, length_in_seconds, author) | |
@title, @length_in_seconds, @author = title, length_in_seconds, author | |
end | |
# real ruby | |
def length_in_minutes | |
@length_in_seconds.to_f / 60 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-1.9.2-p180 :001 > body =<<-EMAIL.gsub(/ {6}/, '') | |
ruby-1.9.2-p180 :002"> asdasdasd | |
ruby-1.9.2-p180 :003"> EMAIL | |
=> "asdasdasd\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[joshbuddy@jj ~/Development/todo]$ bundle exec padrino g model List | |
/Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/rake_compat.rb:33: undefined method `task' for class `Object' (NameError) | |
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/gems/padrino-core-0.9.28/lib/padrino-core/cli/base.rb:8 | |
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/gems/padrino-core-0.9.28/bin/padrino:7:in `require' | |
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/gems/padrino-core-0.9.28/bin/padrino:7 | |
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/bin/padrino:19:in `load' | |
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/bin/padrino:19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
timeout: 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whenever you're called on to make up your mind. | |
And you're hampered by not having any. | |
The simplest way to solve the dilemma you'll find, | |
Is simply by flipping a penny. | |
No, not so that chance shall decide the affair; | |
As you're passively standing there moping. | |
But as soon as the penny is up in the air, | |
You'll suddenly know what you're hoping. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.InetSocketAddress | |
import java.util.concurrent.Executors | |
import org.jboss.netty.bootstrap.ServerBootstrap | |
import org.jboss.netty.channel.ChannelPipelineFactory | |
import org.jboss.netty.channel.Channels | |
import org.jboss.netty.channel.SimpleChannelUpstreamHandler | |
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory | |
import org.jboss.netty.channel.MessageEvent | |
class EchoServer |
NewerOlder