Here I'm trying to understand what happens when I run
./hello
#include | [Presets] | |
| Preset0=Classical | |
| Preset1=Club | |
| Preset2=Dance | |
| Preset3=Flat | |
| Preset4=Live | |
| Preset5=Laptop Speakers/Headphone | |
| Preset6=Rock | |
| Preset7=Pop |
| { | |
| "always_show_minimap_viewport": true, | |
| "bold_folder_labels": false, | |
| "caret_style": "phase", | |
| "color_scheme": "Packages/User/Alpenglow (SublimePythonIDE).tmTheme", | |
| "ensure_newline_at_eof_on_save": true, | |
| "font_face": "Fira Code", | |
| "font_size": 9, | |
| "heighlight_line": true, | |
| "heighlight_modified_tabs": true, |
Here I'm trying to understand what happens when I run
./hello
#include | sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \ | |
| libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial checkinstall | |
| hg clone https://code.google.com/p/vim/ | |
| cd vim | |
| ./configure --with-features=huge \ | |
| --enable-rubyinterp \ | |
| --enable-pythoninterp \ | |
| --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ \ |
| import itertools | |
| def do_calc(expr): | |
| stack = [] | |
| for t in expr: | |
| if t == '+': stack[-2:] = [stack[-1] + stack[-2]] | |
| elif t == '*': stack[-2:] = [stack[-1] * stack[-2]] | |
| elif t == '/': stack[-2:] = [stack[-1] / stack[-2]] | |
| else: stack.append(t) | |
| return stack[0] |
| if __name__ == "__main__": | |
| import sys | |
| file = open(sys.argv[1], 'r') | |
| for i in file.read().split('\n'): | |
| if i: | |
| print bin(int(i))[2:] |
| #Multi-word Queries | |
| #Triple Gold Star | |
| #For this question, your goal is to modify the search engine to be able to | |
| #handle multi-word queries. To do this, we need to make two main changes: | |
| # 1. Modify the index to keep track of not only the URL, but the position | |
| # within that page where a word appears. |
| #Spelling Correction | |
| #Double Gold Star | |
| #For this question, your goal is to build a step towards a spelling corrector, | |
| #similarly to the way Google used to respond, | |
| # "Did you mean: audacity" | |
| #Reachability | |
| #Single Gold Star | |
| #Define a procedure, reachable(graph, node), that takes as input a graph and a | |
| #starting node, and returns a list of all the nodes in the graph that can be | |
| #reached by following zero or more edges starting from node. The input graph is | |
| #represented as a Dictionary where each node in the graph is a key in the | |
| #Dictionary, and the value associated with a key is a list of the nodes that the | |
| #key node is connected to. The nodes in the returned list may appear in any |
| #Same Structure | |
| #Define a procedure, same_structure, that takes two inputs. It should output | |
| #True if the lists contain the same elements in the same structure, and False | |
| #otherwise. Two values, p and q have the same structure if: | |
| # Neither p or q is a list. | |
| # Both p and q are lists, they have the same number of elements, and each | |
| # element of p has the same structure as the corresponding element of q. |