Run ruby hello_world.rb
or python hello_world.py
to print Hello World
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
Exercise 1-1: Comment on the choice of names and values in the following code: | |
#define TRUE 0 | |
#define FALSE 1 | |
if ((ch = getchar()) == EOF) | |
not_eof = FALSE; | |
- Answer: | |
- You'd expect TRUE to be 1 and FALSE to be 0. |
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
import pytest | |
from vm_with_os import VirtualMachine | |
def test_load_two_programs_to_memory(): | |
vm = VirtualMachine() | |
segment_file_path_1 = 'add_255_3_test.vef' | |
vm.load_program(segment_file_path_1) |
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 HelloWorld: | |
def __init__(self, name): | |
self.name = name.capitalize() | |
def sayHi(self): | |
print "Hello " + self.name + "!" | |
hello = HelloWorld("world") | |
hello.sayHi() |
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
1. Count the number of facilities | |
SELECT COUNT(*) | |
FROM cd.facilities | |
2. Count the number of expensive facilities | |
SELECT COUNT(*) | |
FROM cd.facilities | |
WHERE guestcost > 10 |
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="nav" id="primary_navigation" style="background-color: #ff7600; font-size: 15px;"> | |
<div class="container phone-message"> | |
<p style="text-align: center;">Please use live chat to contact us</p> | |
</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
if [ -f "/usr/local/share/chruby/chruby.sh" ]; then | |
source /usr/local/share/chruby/chruby.sh | |
chruby $(cat ./.ruby-version) | |
fi |
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
cnuapp-cnu_content-lib-ruby-cnu/content-action_controller | |
def locale | |
request_uri unless @locale | |
@locale | |
end | |
def locale_cd | |
locale.locale_cd | |
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
1. What is a useful level of documentation? | |
Documentation should cover the following items: | |
- How to install the software and any dependencies, such as Ruby version. | |
- How to use the API and public methods. | |
- The current way of doing things and the proper idioms to use. | |
- Including meaningful examples of how to use the software. | |
- How to upgrade if moving up versions. |
NewerOlder