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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
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
# Implement a function that meets the specifications below. | |
def deep_reverse(L): | |
""" | |
assumes L is a list of lists whose elements are ints. | |
returns a new list that reverses L's elements and also | |
reverses the order of the int elements in every element of L. | |
""" | |
# Your code here | |
pass |
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 mystery2(lst, n): | |
if n == 0: | |
return lst | |
elif lst == []: | |
return lst | |
else: | |
a = mystery2(lst[1:], n-1) | |
b = a[0:n-1] | |
c = a[n-1:] | |
return b + [lst[0]] + c |
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
start = 1 | |
end = 10 | |
sum = 0 # sum should be 55 | |
# set sum to the sum of all numbers from 1 to 10 | |
# Your code goes here | |
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 closest_power(base, num): | |
''' | |
base: base of the exponential, integer > 1 | |
num: number you want to be closest to, integer > 0 | |
Find the integer exponent such that base**exponent is closest to num. | |
Note that the base**exponent may be either greater or smaller than num. | |
In case of a tie, return the smaller value. | |
Returns the exponent. | |
''' | |
# your code goes here |
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 mystery(lst, n): | |
if n == 0: | |
return lst | |
elif lst == []: | |
return lst | |
else: | |
return mystery(lst[1:], n-1) + [lst[0]] | |
ans = mystery([1,3,4,7,9], 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
class Literal { | |
constructor(variable, same) { | |
this.variable = variable; | |
this.same = same; | |
} | |
equal(other) { | |
return other instanceof Literal && | |
other.variable === this.variable && | |
other.same === this.same; |
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
//command stack. used to store operands | |
typedef struct cmd_stk | |
{ | |
command_t *stack; | |
unsigned cap; | |
unsigned index; | |
}cmd_stk_t; | |
static cmd_stk_t* | |
make_cmd_stk(unsigned cap) |
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
g++ gtk-floodit-board.cc -fPIC -c -O -o gtk-floodit-board.o `pkg-config gtkmm-3.0 cairomm-1.0 --cflags` `pkg-config gtkmm-3.0 cairomm-1.0 --libs` -Wall -pedantic | |
gtk-floodit-board.cc: In constructor 'GtkFlooditBoard::GtkFlooditBoard()': | |
gtk-floodit-board.cc:15:64: warning: base 'Gtk::DrawingArea' will be initialized after [-Wreorder] | |
gtk-floodit-board.cc:15:64: warning: base 'FlooditBoard' [-Wreorder] | |
gtk-floodit-board.cc:14:1: warning: when initialized here [-Wreorder] | |
gtk-floodit-board.cc: In constructor 'GtkFlooditBoard::GtkFlooditBoard(FlooditBoard*)': | |
gtk-floodit-board.cc:29:27: warning: delegating constructors only available with -std=c++11 or -std=gnu++11 [enabled by default] | |
g++ floodit-board.cc -fPIC -c -O -o floodit-board.o -Wall -pedantic | |
floodit-board.cc: In member function 'color FlooditBoard::set_color(int, int, color)': | |
floodit-board.cc:106:1: warning: no return statement in function returning non-void [-Wreturn-type] |
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
#0 0x00007ffff7bd5e0c in GameOfLife::cells_get(int, int) () from libgame-of-life.so | |
#1 0x00007ffff7bd5e65 in GameOfLife::create_updated_grid() () from libgame-of-life.so | |
#2 0x00007ffff7bd5fb5 in GameOfLife::tick() () from libgame-of-life.so | |
#3 0x00007ffff7bd6af8 in sigc::adaptor_functor<sigc::bound_mem_functor0<bool, GameOfLife> >::operator()() const () from libgame-of-life.so | |
#4 0x00007ffff7bd6b0a in sigc::internal::slot_call0<sigc::bound_mem_functor0<bool, GameOfLife>, bool>::call_it(sigc::internal::slot_rep*) () from libgame-of-life.so | |
#5 0x00007ffff62434f2 in ?? () from /lib/libglibmm-2.4.so.1 | |
#6 0x00007ffff4e9800b in ?? () from /lib/libglib-2.0.so.0 | |
#7 0x00007ffff4e97475 in g_main_context_dispatch () from /lib/libglib-2.0.so.0 | |
#8 0x00007ffff4e977a8 in ?? () from /lib/libglib-2.0.so.0 | |
#9 0x00007ffff4e97ba2 in g_main_loop_run () from /lib/libglib-2.0.so.0 |
NewerOlder