Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge upstream 'master' into frozen-strings
- Loading branch information
Showing
67 changed files
with
2,858 additions
and
285 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
lib LibC | ||
WNOHANG = 0x00000001 | ||
|
||
@[ReturnsTwice] | ||
fun fork : PidT | ||
fun getpgid(pid : PidT) : PidT | ||
fun kill(pid : PidT, signal : Int) : Int | ||
fun getpid : PidT | ||
fun getppid : PidT | ||
fun exit(status : Int) : NoReturn | ||
|
||
ifdef x86_64 | ||
alias ClockT = UInt64 | ||
else | ||
alias ClockT = UInt32 | ||
end | ||
|
||
SC_CLK_TCK = 3 | ||
|
||
struct Tms | ||
utime : ClockT | ||
stime : ClockT | ||
cutime : ClockT | ||
cstime : ClockT | ||
end | ||
|
||
fun times(buffer : Tms*) : ClockT | ||
fun sysconf(name : Int) : Long | ||
end | ||
|
||
class Process | ||
def self.exit(status = 0) | ||
LibC.exit(status) | ||
end | ||
|
||
def self.pid | ||
LibC.getpid | ||
end | ||
|
||
def self.getpgid(pid : Int32) | ||
ret = LibC.getpgid(pid) | ||
raise Errno.new(ret) if ret < 0 | ||
ret | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
service { | ||
key = "value" | ||
} | ||
|
||
variable "ami" { | ||
description = "the AMI to use" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
<%@ page import="java.time.LocalDateTime" %> | ||
|
||
<%! int day = 3; %> | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Simple JSP Application</title> | ||
</head> | ||
<body> | ||
<%-- This is a JSP comment --%> | ||
<h1>Hello world!</h1> | ||
<h2>Current time is <%= LocalDateTime.now() %></h2> | ||
|
||
<% if (day == 1 || day == 7) { %> | ||
<p> Today is weekend</p> | ||
<% } else { %> | ||
<p> Today is not weekend</p> | ||
<% } %> | ||
|
||
h2>Using JavaBeans in JSP</h2> | ||
<jsp:useBean id="test" class="action.TestBean" /> | ||
<jsp:setProperty name="test" property="message" value="Hello JSP..." /> | ||
|
||
<p>Got message:</p> | ||
<jsp:getProperty name="test" property="message" /> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
initialize: ; go into super user mode | ||
clr.l -(a7) | ||
move.w #32,-(a7) | ||
trap #1 | ||
addq.l #6,a7 | ||
move.l d0,oldstack | ||
rts | ||
|
||
restore: ; go back into user mode | ||
move.l oldstack,-(a7) | ||
move.w #32,-(a7) | ||
trap #1 | ||
addq.l #6,a7 | ||
rts | ||
|
||
oldstack dc.l 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(* Fibonacci numbers with memoization *) | ||
|
||
fib::usage = "f[n] calculates the n'th Fibonacci number."; | ||
fib[0] = fib[1] = 1; | ||
fib[n_Integer?Positive]:= fib[n] = fib[n-1] + fib[n-2]; | ||
|
||
In[4]:= fib[42] | ||
Out[4]= 433494437 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Creates a dot marker at the given position | ||
#include "script_component.hpp" | ||
params ["_pos", "_txt"]; | ||
|
||
if (isNil QGVAR(markerID)) then { | ||
GVAR(markerID) = 0; | ||
}; | ||
|
||
_markerstr = createMarker [QGVAR(marker) + str GVAR(markerID), _pos]; | ||
_markerstr setMarkerShape "ICON"; | ||
_markerstr setMarkerType "hd_dot"; | ||
_markerstr setMarkerText _txt; | ||
|
||
GVAR(markerID) = GVAR(markerID) + 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# From: https://github.com/terraform-providers/terraform-provider-aws/blob/master/examples/count/main.tf | ||
|
||
# Specify the provider and access details | ||
provider "aws" { | ||
region = "${var.aws_region}" | ||
} | ||
|
||
resource "aws_elb" "web" { | ||
name = "terraform-example-elb" | ||
|
||
# The same availability zone as our instances | ||
availability_zones = ["${aws_instance.web.*.availability_zone}"] | ||
|
||
listener { | ||
instance_port = 80 | ||
instance_protocol = "http" | ||
lb_port = 80 | ||
lb_protocol = "http" | ||
} | ||
|
||
# The instances are registered automatically | ||
instances = ["${aws_instance.web.*.id}"] | ||
} | ||
|
||
resource "aws_instance" "web" { | ||
instance_type = "m1.small" | ||
ami = "${lookup(var.aws_amis, var.aws_region)}" | ||
|
||
# This will create 4 instances | ||
count = 4 | ||
} |
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
Oops, something went wrong.