Exam questions based on the slides and official materials. Covers Minos, Active Oberon, A2, Active Cells, ARM.
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
| require 'rubygems' | |
| require 'bundler' | |
| Bundler.require | |
| include Contracts | |
| Contract Num, Num => Num | |
| def add_c(a, b) | |
| a + b | |
| end |
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
| vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:271:in `call': undefined method `url_options' for #<Module:0x007fd2d8597d58> (NoMethodError) | |
| from vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:222:in `call' | |
| from vendor/bundle/ruby/2.0.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:334:in `block (2 levels) in define_url_helper' | |
| from config/environment.rb:134:in `block (2 levels) in <top (required)>' | |
| [... app specific code, sorry ...] | |
| from vendor/bundle/ruby/2.0.0/gems/sidekiq-3.2.5/lib/sidekiq/processor.rb:52:in `block (2 levels) in process' | |
| from vendor/bundle/ruby/2.0.0/gems/sidekiq-3.2.5/lib/sidekiq/middleware/chain.rb:122:in `call' | |
| from vendor/bundle/ruby/2.0.0/gems/sidekiq-3.2.5/lib/sidekiq/middleware/chain.rb:122:in `block in invoke' | |
| from vendor/bundle/ruby/2.0.0/gems/sidekiq-pro-1.9.0/lib/sidekiq/batch/middleware.rb:26:in `call' | |
| from vendor/bundle/ruby/2.0.0/gems/sidekiq-3.2.5/lib/sidekiq/middlewar |
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
| package com.pavelkalvoda.misc.smoothvox.terrain; | |
| import java.util.Random; | |
| // Based on http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
| // http://www.csee.umbc.edu/~olano/s2002c36/ch02.pdf | |
| // http://mrl.nyu.edu/~perlin/doc/oscar.html | |
| // + simplified | |
| public class SimpleSimplexNoise { |
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
| module M | |
| def x | |
| 'M' | |
| end | |
| end | |
| class A | |
| def x | |
| 42 | |
| end |
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 Window | |
| def initialize | |
| # Implementor selection strategy | |
| extend [WindowsAPI, X11API].sample | |
| end | |
| def drawRectangle | |
| 4.times { drawLine } | |
| end | |
| end |
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
| module Libcbor | |
| extend FFI::Library | |
| ffi_lib ['/usr/local/lib/libcbor.so'] | |
| attach_function :cbor_new_int8, [], :pointer | |
| attach_function :cbor_set_uint16, [:pointer, :ushort], :void | |
| attach_function :cbor_set_uint8, [:pointer, :uchar], :void | |
| attach_function :cbor_serialize, [:pointer, :pointer, :size_t], :size_t | |
| puts 'yo' | |
| end |
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
| $(NAME).bbl: $(BIB) $(NAME).tex | |
| pdflatex -shell-escape $(PDFL_FLAGS) $(NAME) | |
| biber $(NAME) |
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
| #include "cbor.h" | |
| int main(int argc, char * argv[]) | |
| { | |
| /* Preallocate the map structure */ | |
| cbor_item_t * root = cbor_new_definite_map(2); | |
| /* Add the content */ | |
| cbor_map_add(root, (struct cbor_pair) { | |
| .key = cbor_move(cbor_build_string("Is CBOR awesome?")), | |
| .value = cbor_move(cbor_build_bool(true)) |
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
| #include <cbor.h> | |
| #include <stdio.h> | |
| int main(int argc, char * argv[]) | |
| { | |
| /* Preallocate the map structure */ | |
| cbor_item_t * root = cbor_new_definite_map(2); | |
| /* Add the content */ | |
| cbor_map_add(root, (struct cbor_pair) { | |
| .key = cbor_move(cbor_build_string("Is CBOR awesome?")), |