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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
I just found another way to add GOPATH sources in the project. | |
1) Open Project Structure. | |
2) Select Project Settings -> Modules -> {your module} | |
3) Under sources label, select Add Content Root to add GOPATH folder. | |
4) Mark src folder in GOPATH folder as Sources. | |
Then the GOPATH is added to the project, and everything works fine. The plugin do not need to know anything about GOPATH. | |
I think it should works for non-IDEA IDEs. |
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 GardenHose: | |
def countDead(self, n, rowDist, colDist, hoseDist): | |
count = 0 | |
for row in range(0, n): | |
for col in range(0, n): | |
if (row + 1) * rowDist <= hoseDist or (n - row) * rowDist <= hoseDist: | |
continue | |
if (col + 1) * colDist <= hoseDist or (n - col) * colDist <= hoseDist: | |
continue | |
count += 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
curl -H "Content-Typ"Authorization: OAuth O7KrMTwmw997iq0KzL7v" -d '{"messages":[{"body":"hello world!"}]}' "http://158.181.176.161:8080/3/projects/53a3b3bd5e8edd1245000005/queues/my_queue/messages" |
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
Argument Array | |
Collapse a list of arguments into an array. | |
Around Alias | |
Call the previous, aliased version of a method from a redefined method. | |
Blank Slate | |
Remove methods from an object to turn them into Ghost Methods. | |
Class Extension |
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
#include <iostream> | |
#include <iterator> | |
#include <functional> | |
#include <algorithm> | |
#include <queue> | |
#include <vector> | |
#include <set> | |
#include <sstream> | |
#include <string> |
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
after "deploy:symlink", "deploy:restart_workers" | |
after "deploy:restart_workers", "deploy:restart_scheduler" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') |
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
Problem Statement | |
Given the width and height of a rectangular grid, return the total number of rectangles (NOT counting squares) that can be found on this grid. | |
For example, width = 3, height = 3 (see diagram below): | |
__ __ __ | |
|__|__|__| | |
|__|__|__| | |
|__|__|__| | |
In this grid, there are 4 2x3 rectangles, 6 1x3 rectangles and 12 1x2 rectangles. Thus there is a total of 4 + 6 + 12 = 22 rectangles. Note we don't count 1x1, 2x2 and 3x3 rectangles because they are squares. |
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
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <queue> | |
#include <stdio.h> | |
#include <fstream> | |
using namespace std; | |
ifstream infile("IntegerArray.txt"); | |
unsigned long long glob=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
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <queue> | |
#include <stdio.h> | |
#include <fstream> | |
using namespace std; | |
#define INF 19999999 | |
long long int glob; |