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 | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import random | |
| def scramble(word): | |
| """Returns word with innards scrambled""" | |
| if len(word) < 4: | |
| return word |
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
| findblob: | |
| la $t3, image # address of image | |
| or $t0, $zero, $zero # i = 0 | |
| mult $a1, $a2 | |
| mflo $t1 # max = w * h | |
| loop: beq $t0, $t1, exit | |
| sll $t2, $t0, 2 # mult by 4 | |
| add $t2, $t2, $t3 # t3 = i + address |
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
| # Controller | |
| class GuestsController < ApplicationController | |
| def create | |
| @guest = Guest.new(params[:guest]) | |
| if @guest.save | |
| redirect_to :action => 'index' | |
| else | |
| render :action => 'new' | |
| end |
NewerOlder