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
# Enter your code for runSimulation in this box. | |
def runSimulation(num_robots, speed, width, height, min_coverage, num_trials, | |
robot_type): | |
""" | |
Runs NUM_TRIALS trials of the simulation and returns the mean number of | |
time-steps needed to clean the fraction MIN_COVERAGE of the room. | |
The simulation is run with NUM_ROBOTS robots of type ROBOT_TYPE, each with | |
speed SPEED, in a room of dimensions WIDTH x HEIGHT. |
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
def insert(atMe, newFrob): | |
""" | |
atMe: a Frob that is part of a doubly linked list | |
newFrob: a Frob with no link | |
This procedure appropriately inserts newFrob into the linked list that atMe is a part of. | |
""" | |
# Your Code Here | |
if newFrob.myName() < atMe.myName(): | |
if atMe.getBefore() == None: | |
atMe.setBefore(newFrob) |
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
# comments.js.coffee | |
jQuery -> | |
# Create a comment | |
$(".comment-form") | |
.on "ajax:beforeSend", (evt, xhr, settings) -> | |
$(this).find('textarea') | |
.addClass('uneditable-input') | |
.attr('disabled', 'disabled'); | |
.on "ajax:success", (evt, data, status, xhr) -> | |
$(this).find('textarea') |
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
<div class="comment" id=<%=comment.id %>> | |
<div class="well"><%= comment.body %><br> | |
<%= comment.user.username %> | |
<small><%= comment.updated_at.strftime('%b %d, %Y at %I:%M %p') %></small> | |
<%= link_to "×", comment_path(comment), :method => :delete, :remote => true, :confirm => "Are you sure you want to remove this comment?", :disable_with => "×", :class => 'close' %></div> | |
</div> |
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
def good_fact(x) | |
def fact_tail(x,sum) | |
if x == 0 | |
return sum | |
else | |
fact_tail(x-1,x*sum) | |
end | |
end | |
fact_tail(x,1) | |
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
def update | |
@model = Model.find(params[:id]) # ActiveRecord's find method being used here | |
@model.update_attributes(params) # ActiveRecord's update_attributes method being used here | |
if @model.save # ActiveRecord's save method being used here | |
respond_with(@model) | |
else | |
respond_with(@model.errors) | |
end | |
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
~/Documents/Code/haskell cabal install ghc-mod-5.2.1.1 -v3 | |
Using a sandbox located at /Users/Alex/Documents/Code/haskell/.cabal-sandbox | |
Searching for ghc in path. | |
Found ghc at /usr/local/bin/ghc | |
("/usr/local/bin/ghc",["--numeric-version"]) | |
/usr/local/bin/ghc is version 7.8.2 | |
looking for tool ghc-pkg near compiler in /usr/local/bin | |
found ghc-pkg in /usr/local/bin/ghc-pkg | |
("/usr/local/bin/ghc-pkg",["--version"]) | |
/usr/local/bin/ghc-pkg is version 7.8.2 |
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
adt IntList | |
representation | |
list = NIL | CELL of integer * list | |
operations | |
nil = NIL | |
adjoin(x : integer, l : list) = | |
CELL(x, l) | |
null?(l : list) = case l of | |
NIL ⇒ true | |
CELL(x, l) ⇒ false |
This file has been truncated, but you can view the full file.
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
2015-04-30 17:38:31 | |
Full thread dump Java HotSpot(TM) Client VM (20.65-b04-466.1 mixed mode): | |
"http-/127.0.0.1:8080-89" daemon prio=5 tid=0000000043816c00 nid=0xc1b35000 waiting on condition [00000000c1b2e000] | |
java.lang.Thread.State: WAITING (parking) | |
at sun.misc.Unsafe.park(Native Method) | |
- parking to wait for <000000000fd5f520> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) | |
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156) | |
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811) | |
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireInterruptibly(AbstractQueuedSynchronizer.java:867) |
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
Java::JavaLang::OutOfMemoryError (Java heap space): | |
java.lang.reflect.Array.newArray(Native Method) | |
java.lang.reflect.Array.newInstance(java/lang/reflect/Array.java:52) | |
oracle.jdbc.driver.BufferCache.get(oracle/jdbc/driver/BufferCache.java:226) | |
oracle.jdbc.driver.PhysicalConnection.getCharBuffer(oracle/jdbc/driver/PhysicalConnection.java:7672) | |
oracle.jdbc.driver.OracleStatement.prepareAccessors(oracle/jdbc/driver/OracleStatement.java:1005) | |
oracle.jdbc.driver.T4CTTIdcb.receiveCommon(oracle/jdbc/driver/T4CTTIdcb.java:277) | |
oracle.jdbc.driver.T4CTTIdcb.receive(oracle/jdbc/driver/T4CTTIdcb.java:146) | |
oracle.jdbc.driver.T4C8Oall.readDCB(oracle/jdbc/driver/T4C8Oall.java:844) | |
oracle.jdbc.driver.T4CTTIfun.receive(oracle/jdbc/driver/T4CTTIfun.java:358) |