This file contains hidden or 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
#! /usr/bin/env python | |
# Description: Knuth-Morris-Pratt algorithm | |
__author__ = 'Jay <[email protected]>' | |
def prefix_table(p): | |
m = len(p) | |
pi = [0] * m | |
k = 0 |
This file contains hidden or 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
<%= link_to "delete me", :confirm => "Are you sure?", :method => 'delete', :class => "btn danger" %> | |
<%= link_to "edit me", edit_user_path,:confirm => "Are you sure?", :class => "btn info" %> | |
getting rendered as | |
<a href="/users/1?class=btn+danger&confirm=Are+you+sure%3F&method=delete">delete me</a> | |
<a href="/users/1/edit" class="btn info" data-confirm="Are you sure?">edit me</a> | |
using twitter bootstrap, class "btn danger" is not getting applied. |
This file contains hidden or 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 UsersController < ApplicationController | |
def new | |
@user = User.new | |
@title = "Sign up" | |
end | |
def create | |
@user = User.new(params[:user]) | |
if @user.save | |
redirect_to login_url, :notice => "Signed up!" |
This file contains hidden or 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
#! /usr/bin/python | |
import math | |
def pytha(a,b): | |
return math.sqrt(pow(a,2) + pow(b,2)) | |
def botha(a,b): | |
return (float(a) - float(a/8) + float(b/2)) |
NewerOlder