$ getenforce
Enforcing
$ sestatus
SELinux status: enabled
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
# … | |
tasks: | |
- name: Inspect postman file | |
stat: path=~/bin/Postman/Postman | |
register: postman_file | |
- name: Install postman | |
when: not postman_file.stat.exists | |
unarchive: | |
remote_src: yes |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
func main() { |
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
__author__ = 'sina' | |
def main(): | |
f("12365212354", 26) | |
def f(numbers, target): | |
for i in range(1, len(numbers)): | |
current = int(numbers[0:i]) | |
to_end = numbers[i:-1] | |
evaluate(0, current, to_end, target, current) |
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
package main | |
import ( | |
"fmt" | |
) | |
type Stack struct { | |
top *Element | |
size int | |
} |
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
type ( | |
// BuoyCondition contains information for an individual station. | |
BuoyCondition struct { | |
WindSpeed float64 `bson:"wind_speed_milehour"` | |
WindDirection int `bson:"wind_direction_degnorth"` | |
WindGust float64 `bson:"gust_wind_speed_milehour"` | |
} | |
// BuoyLocation contains the buoy's location. | |
BuoyLocation struct { |
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
/* | |
{ | |
"date_of_creation" => "19 Dec 2016, Mon", | |
"aim_of_program" => "Matrix multiplication in Golang", | |
"coded_by" => "Rishikesh Agrawani", | |
"Go_version" => "1.7", | |
} | |
*/ | |
package main |
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
package main | |
import "fmt" | |
type Node struct { | |
prev *Node | |
next *Node | |
key interface{} | |
} |
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
# The first 12 digits of pi are 314159265358. We can make these digits into an expression evaluating to 27182 (first 5 digits of e) as follows: | |
# 3141 * 5 / 9 * 26 / 5 * 3 - 5 * 8 = 27182 | |
# or | |
# 3 + 1 - 415 * 92 + 65358 = 27182 | |
# Notice that the order of the input digits is not changed. Operators (+,-,/, or *) are simply inserted to create the expression. | |
# Write a function to take a list of numbers and a target, and return all the ways that those numbers can be formed into expressions evaluating to the target. Do not use the eval function in Python, Ruby or JavaScript |
Command-line arguments in Python show up in sys.argv
as a list of strings (so you'll need to import the sys
module).
For example, if you want to print all passed command-line arguments:
import sys
print(sys.argv) # Note the first argument is always the script filename.
Command-line options are sometimes passed by position (e.g. myprogram foo bar
) and sometimes by using a "-name value" pair (e.g. myprogram -a foo -b bar
).
OlderNewer