commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 1
4.87k
| subject
stringlengths 15
778
| message
stringlengths 15
8.75k
| lang
stringclasses 266
values | license
stringclasses 13
values | repos
stringlengths 5
127k
|
---|---|---|---|---|---|---|---|---|---|
33e4a1aeebf626e36b3d589ed7c594235a436a17
|
doc/tutorial/examples/second-tape.yang
|
doc/tutorial/examples/second-tape.yang
|
module second-tape {
namespace "http://example.com/turing-machine/tape2";
prefix "t2";
import turing-machine {
prefix "tm";
}
augment "/tm:turing-machine" {
description
"State data for the second tape.";
leaf head-position-2 {
config "false";
type tm:cell-index;
description
"Head position of the second tape.";
}
container tape-2 {
description
"Contents of the second tape.";
config "false";
uses tm:tape-cells;
}
}
augment
"/tm:turing-machine/tm:transition-function/tm:delta/tm:input" {
description
"A new input parameter.";
leaf symbol-2 {
type tm:tape-symbol;
description
"Symbol read from the second tape.";
}
}
augment
"/tm:turing-machine/tm:transition-function/tm:delta/tm:output" {
description
"New output parameters.";
leaf symbol-2 {
type tm:tape-symbol;
description
"Symbol to be written to the second tape.";
}
leaf head-move-2 {
type tm:head-dir;
description
"Move the head on the second tape one cell to the left or
right.";
}
}
augment "/tm:initialize/tm:input" {
description
"A new RPC input parameter.";
leaf tape-content-2 {
type string;
description
"Initial content of the second tape.";
}
}
}
|
module second-tape {
namespace "http://example.net/turing-machine/tape-2";
prefix "t2";
import turing-machine {
prefix "tm";
}
augment "/tm:turing-machine" {
description
"State data for the second tape.";
leaf head-position-2 {
config "false";
type tm:cell-index;
description
"Head position of the second tape.";
}
container tape-2 {
description
"Contents of the second tape.";
config "false";
uses tm:tape-cells;
}
}
augment
"/tm:turing-machine/tm:transition-function/tm:delta/tm:input" {
description
"A new input parameter.";
leaf symbol-2 {
type tm:tape-symbol;
description
"Symbol read from the second tape.";
}
}
augment
"/tm:turing-machine/tm:transition-function/tm:delta/tm:output" {
description
"New output parameters.";
leaf symbol-2 {
type tm:tape-symbol;
description
"Symbol to be written to the second tape.";
}
leaf head-move-2 {
type tm:head-dir;
description
"Move the head on the second tape one cell to the left or
right.";
}
}
augment "/tm:initialize/tm:input" {
description
"A new RPC input parameter.";
leaf tape-content-2 {
type string;
description
"Initial content of the second tape.";
}
}
}
|
Modify namespace URI in the tutorial example.
|
Modify namespace URI in the tutorial example.
|
YANG
|
isc
|
davidegurgone/pyang,davidegurgone/pyang
|
405a8ae6373dc2ab7c03f291ffc448b2b628d5be
|
yang/actor-system-provider-service.yang
|
yang/actor-system-provider-service.yang
|
module actor-system-provider-service {
yang-version 1;
namespace "urn:opendaylight:params:xml:ns:yang:controller:config:actor-system-provider:service";
prefix "actor-system";
import config { prefix config; revision-date 2013-04-05; }
description "Akka actor system provider service definition";
revision "2015-10-05" {
description "Initial revision";
}
identity actor-system-provider-service {
base "config:service-type";
config:java-class "org.opendaylight.controller.cluster.ActorSystemProvider";
}
}
|
module actor-system-provider-service {
yang-version 1;
namespace "urn:opendaylight:params:xml:ns:yang:controller:config:actor-system-provider:service";
prefix "actor-system";
import config { prefix config; revision-date 2013-04-05; }
description "Akka actor system provider service definition";
revision "2015-10-05" {
description "Initial revision";
}
identity actor-system-provider-service {
base "config:service-type";
config:java-class "org.opendaylight.controller.cluster.ActorSystemProvider";
config:disable-osgi-service-registration;
}
}
|
Modify config Module impls to co-exist with blueprint
|
Modify config Module impls to co-exist with blueprint
Modified various config system Module implementation classes which
have corresponding instances created and advertised via blueprint to
obtain the instance in createInstance from the OSGi registry. The
instance may not be available yet so it will wait. I added a
WaitingServiceTracker class to encapsulate this logic using a ServiceTracker.
For those modules that don't advertise services, createInstance simply
returns a noop AutoCloseable since the components are created via
blueprint.
I also added the new disable-osgi-service-registration flag to the
corresponding service yang identities to prevent the CSS from
duplicating the service registrations.
This patch also adds the blueprint bundle to the mdsal features and
"turns on" blueprint.
Change-Id: I60099c82a2a248fc233ad930c4808d6ab19ea881
Signed-off-by: Tom Pantelis <[email protected]>
|
YANG
|
epl-1.0
|
opendaylight/yangtools,opendaylight/yangtools
|
d41b2a5776e75b851d617a03c0e813a0945cc4ca
|
test/builtin/charmethods.zep
|
test/builtin/charmethods.zep
|
namespace Test\BuiltIn;
class CharMethods
{
public function getHex()
{
return 'a'->toHex();
}
public function getHexForString(string str)
{
var o = "", n;
char ch;
for ch in str {
let o .= ch->toHex();
}
return o;
}
}
|
namespace Test\BuiltIn;
class CharMethods
{
public function getHex()
{
return 'a'->toHex();
}
public function getHexForString(string str)
{
var o = "";
char ch;
for ch in str {
let o .= ch->toHex();
}
return o;
}
}
|
Remove unused variable n in Test\BuiltIn\CharMethods::getHexForString
|
Remove unused variable n in Test\BuiltIn\CharMethods::getHexForString
|
Zephir
|
mit
|
KorsaR-ZN/zephir,joeyhub/zephir,patrick-zippenfenig/zephir,ovr/zephir,gsouf/zephir,aaam/zephir,gsouf/zephir,carlmcdade/zephir,patrick-zippenfenig/zephir,janusnic/zephir,cesarmarinhorj/zephir,zephir-lang/zephir,cesarmarinhorj/zephir,sergeyklay/zephir,fezfez/zephir,patrick-zippenfenig/zephir,sjinks/zephir,dreamsxin/zephir,steffengy/zephir,cesarmarinhorj/zephir,fezfez/zephir,carlmcdade/zephir,fezfez/zephir,joeyhub/zephir,zephir-lang/zephir,aaam/zephir,gsouf/zephir,phalcon/zephir,sjinks/zephir,KorsaR-ZN/zephir,patrick-zippenfenig/zephir,gsouf/zephir,ovr/zephir,aaam/zephir,cesarmarinhorj/zephir,ovr/zephir,steffengy/zephir,phalcon/zephir,sergeyklay/zephir,zephir-lang/zephir,cesarmarinhorj/zephir,karakurihiden/zephir,sergeyklay/zephir,sjinks/zephir,karakurihiden/zephir,sjinks/zephir,dreamsxin/zephir,KorsaR-ZN/zephir,joeyhub/zephir,janusnic/zephir,karakurihiden/zephir,zephir-lang/zephir,vpg/zephir,vpg/zephir,patrick-zippenfenig/zephir,gsouf/zephir,steffengy/zephir,phalcon/zephir,KorsaR-ZN/zephir,phalcon/zephir,vpg/zephir,vpg/zephir,KorsaR-ZN/zephir,zephir-lang/zephir,steffengy/zephir,karakurihiden/zephir,sjinks/zephir,steffengy/zephir,sergeyklay/zephir,karakurihiden/zephir,sergeyklay/zephir,sergeyklay/zephir,dreamsxin/zephir,joeyhub/zephir,cesarmarinhorj/zephir,carlmcdade/zephir,steffengy/zephir,carlmcdade/zephir,fezfez/zephir,dreamsxin/zephir,vpg/zephir,dreamsxin/zephir,sjinks/zephir,aaam/zephir,gsouf/zephir,fezfez/zephir,dreamsxin/zephir,vpg/zephir,carlmcdade/zephir,janusnic/zephir,janusnic/zephir,patrick-zippenfenig/zephir,joeyhub/zephir,ovr/zephir,aaam/zephir,janusnic/zephir,phalcon/zephir,aaam/zephir,fezfez/zephir,janusnic/zephir,carlmcdade/zephir,phalcon/zephir,KorsaR-ZN/zephir,joeyhub/zephir,karakurihiden/zephir
|
478a985a1efecb96c4c737507e2d965f20bd9f36
|
stub/functions.zep
|
stub/functions.zep
|
namespace Stub;
class Functions
{
/**
* @issue https://github.com/phalcon/zephir/issues/658
*/
public function filterVar1() -> bool
{
var ret;
let ret = "0";
return false === filter_var($ret, FILTER_VALIDATE_FLOAT, 20480);
}
/**
* @issue https://github.com/phalcon/zephir/issues/658
*/
public function filterVar2() -> bool
{
var ret;
let ret = "0";
return false == filter_var($ret, FILTER_VALIDATE_FLOAT, 20480);
}
}
|
namespace Stub;
class Functions
{
/**
* @issue https://github.com/phalcon/zephir/issues/658
*/
public function filterVar1() -> bool
{
var ret;
let ret = "0";
return false === filter_var(ret, FILTER_VALIDATE_FLOAT, 20480);
}
/**
* @issue https://github.com/phalcon/zephir/issues/658
*/
public function filterVar2() -> bool
{
var ret;
let ret = "0";
return false == filter_var(ret, FILTER_VALIDATE_FLOAT, 20480);
}
}
|
Remove dollar sign in Zephir code
|
Remove dollar sign in Zephir code
|
Zephir
|
mit
|
phalcon/zephir,zephir-lang/zephir,zephir-lang/zephir,phalcon/zephir,phalcon/zephir,zephir-lang/zephir,vpg/zephir,phalcon/zephir,vpg/zephir,zephir-lang/zephir,vpg/zephir,zephir-lang/zephir,vpg/zephir,phalcon/zephir,phalcon/zephir,vpg/zephir,vpg/zephir
|
688f976c1e65c53cc23f1e2fbfe12935a9aa9cd0
|
test/test/test.zep
|
test/test/test.zep
|
namespace Test;
class Test
{
public static function check()
{
var arr;
var ret;
let arr = [0, 1, 2, 3, 4, 5];
let ret = arr->rev();
var_dump(ret);
}
public static function replace()
{
var patterns = [
":any": "[^/]+",
":num": "[0-9]+",
":all": ".*"
];
var replaces, str;
var searches = [];
let str = "mystringwith:anyinside";
let searches = array_keys(patterns),
replaces = array_values(patterns);
echo str_replace(searches, replaces, str);
}
public static function param(str)
{
echo trim(str);
}
public static function div(float a)
{
return 1/a;
}
public static function testBool()
{
var ret;
let ret = strpos("something","asome");
var_dump(ret);
if (ret === 0) {
echo "invalid comparison";
} else {
echo "succesfull comparison";
}
}
}
|
namespace Test;
class Test
{
public static function check()
{
var arr;
var ret;
let arr = [0, 1, 2, 3, 4, 5];
let ret = arr->rev();
var_dump(ret);
}
public static function replace()
{
var patterns = [
":any": "[^/]+",
":num": "[0-9]+",
":all": ".*"
];
var replaces, str;
var searches = [];
let str = "mystringwith:anyinside";
let searches = array_keys(patterns),
replaces = array_values(patterns);
echo str_replace(searches, replaces, str);
}
public static function param(str)
{
echo trim(str);
}
public static function div(float a)
{
return 1/a;
}
public static function testBool()
{
var ret;
let ret = strpos("something","asome");
var_dump(ret);
if (ret === 0) {
echo "invalid comparison";
} else {
echo "succesfull comparison";
}
}
public static function testArray()
{
var elements;
let elements = ["abc": 1, ABDAY_1: DAY_1, ABDAY_2: DAY_2];
var_dump(elements);
}
}
|
Test use constant key about array
|
Test use constant key about array
|
Zephir
|
mit
|
dreamsxin/zephir-demo
|
c2a4e012f13e435225c59271499cbf89c8a56909
|
arango/handler/vertexhandler.zep
|
arango/handler/vertexhandler.zep
|
namespace Arango\Handler;
use Arango\Document\Vertex;
use Arango\Document\Document;
use Arango\Handler\DocumentHandler;
/**
* A handler that manages vertex documents
*
* @package Arango/Handler
* @class VertexHandler
* @author Lucas S. Vieira
*/
class VertexHandler extends DocumentHandler {
/**
* Intermediate function to call the createFromArray function from the right context
*
* @throws Arango\Exception\ClientException
*
* @param array $data
* @param array $options
*
* @return Arango\Document\Document
*/
public function createFromArrayWithContext(array data, array options) -> <Document> {
return Vertex::createFromArray(data, options);
}
}
|
namespace Arango\Handler;
use Arango\Document\Vertex;
use Arango\Handler\DocumentHandler;
/**
* A handler that manages vertex documents
*
* @package Arango/Handler
* @class VertexHandler
* @author Lucas S. Vieira
*/
class VertexHandler extends DocumentHandler {
/**
* Intermediate function to call the createFromArray function from the right context
*
* @throws Arango\Exception\ClientException
*
* @param array $data
* @param array $options
*
* @return Arango\Document\Vertex
*/
public function createFromArrayWithContext(array data, array options) -> <Vertex> {
return Vertex::createFromArray(data, options);
}
}
|
Change return type in VertexHandler
|
Change return type in VertexHandler
|
Zephir
|
mit
|
lucassouzavieira/arangodb-php-driver,lucassouzavieira/arangodb-php-driver
|
04267fb1baf0b7b47330223fad0acbd088452ee7
|
lib/std/os/windows/ole32.zig
|
lib/std/os/windows/ole32.zig
|
// SPDX-License-Identifier: MIT
// Copyright (c) 2015-2020 Zig Contributors
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
// The MIT license requires this copyright notice to be included in all copies
// and substantial portions of the software.
usingnamespace @import("bits.zig");
pub extern "ole32" fn CoTaskMemFree(pv: LPVOID) callconv(.Stdcall) void;
pub extern "ole32" fn CoUninitialize() callconv(.Stdcall) void;
pub extern "ole32" fn CoGetCurrentProcess() callconv(.Stdcall) DWORD;
pub extern "ole32" fn CoInitializeEx(pvReserved: LPVOID, dwCoInit: DWORD) callconv(.Stdcall) HRESULT;
|
// SPDX-License-Identifier: MIT
// Copyright (c) 2015-2020 Zig Contributors
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
// The MIT license requires this copyright notice to be included in all copies
// and substantial portions of the software.
usingnamespace @import("bits.zig");
pub extern "ole32" fn CoTaskMemFree(pv: LPVOID) callconv(.Stdcall) void;
pub extern "ole32" fn CoUninitialize() callconv(.Stdcall) void;
pub extern "ole32" fn CoGetCurrentProcess() callconv(.Stdcall) DWORD;
pub extern "ole32" fn CoInitializeEx(pvReserved: ?LPVOID, dwCoInit: DWORD) callconv(.Stdcall) HRESULT;
|
Fix CoInitializeEx so it can take a null pointer
|
Fix CoInitializeEx so it can take a null pointer
|
Zig
|
mit
|
zig-lang/zig,raulgrell/zig,raulgrell/zig,raulgrell/zig,andrewrk/zig,raulgrell/zig,zig-lang/zig,andrewrk/zig,raulgrell/zig,zig-lang/zig
|
7287c7482a2c694c7c7f56b9f7c1744a7ae7905f
|
lib/std/io/buffered_writer.zig
|
lib/std/io/buffered_writer.zig
|
const std = @import("../std.zig");
const io = std.io;
pub fn BufferedWriter(comptime buffer_size: usize, comptime WriterType: type) type {
return struct {
unbuffered_writer: WriterType,
fifo: FifoType = FifoType.init(),
pub const Error = WriterType.Error;
pub const Writer = io.Writer(*Self, Error, write);
const Self = @This();
const FifoType = std.fifo.LinearFifo(u8, std.fifo.LinearFifoBufferType{ .Static = buffer_size });
pub fn flush(self: *Self) !void {
while (true) {
const slice = self.fifo.readableSlice(0);
if (slice.len == 0) break;
try self.unbuffered_writer.writeAll(slice);
self.fifo.discard(slice.len);
}
}
pub fn writer(self: *Self) Writer {
return .{ .context = self };
}
pub fn write(self: *Self, bytes: []const u8) Error!usize {
if (bytes.len >= self.fifo.writableLength()) {
try self.flush();
return self.unbuffered_writer.write(bytes);
}
self.fifo.writeAssumeCapacity(bytes);
return bytes.len;
}
};
}
pub fn bufferedWriter(underlying_stream: anytype) BufferedWriter(4096, @TypeOf(underlying_stream)) {
return .{ .unbuffered_writer = underlying_stream };
}
|
const std = @import("../std.zig");
const io = std.io;
const mem = std.mem;
pub fn BufferedWriter(comptime buffer_size: usize, comptime WriterType: type) type {
return struct {
unbuffered_writer: WriterType,
buf: [buffer_size]u8 = undefined,
end: usize = 0,
pub const Error = WriterType.Error;
pub const Writer = io.Writer(*Self, Error, write);
const Self = @This();
pub fn flush(self: *Self) !void {
try self.unbuffered_writer.writeAll(self.buf[0..self.end]);
self.end = 0;
}
pub fn writer(self: *Self) Writer {
return .{ .context = self };
}
pub fn write(self: *Self, bytes: []const u8) Error!usize {
if (self.end + bytes.len > self.buf.len) {
try self.flush();
if (bytes.len > self.buf.len)
return self.unbuffered_writer.write(bytes);
}
mem.copy(u8, self.buf[self.end..], bytes);
self.end += bytes.len;
return bytes.len;
}
};
}
pub fn bufferedWriter(underlying_stream: anytype) BufferedWriter(4096, @TypeOf(underlying_stream)) {
return .{ .unbuffered_writer = underlying_stream };
}
|
Stop using LinearFifo in BufferedWriter
|
Stop using LinearFifo in BufferedWriter
Looking at the BufferedWriter assembly generated, one can see that is
has to do a lot of work, just to copy over some bytes and increase an
offset. This is because the LinearFifo is a much more general construct
than what BufferedWriter needs and the optimizer cannot prove that we
don't need to do this extra work.
|
Zig
|
mit
|
andrewrk/zig,andrewrk/zig
|
a7e10565fce359d00bee409cbb5226526c1bbb5e
|
std/special/build_file_template.zig
|
std/special/build_file_template.zig
|
const Builder = @import("std").build.Builder;
pub fn build(b: &Builder) {
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("YOUR_NAME_HERE", "src/main.zig");
exe.setBuildMode(mode);
b.default_step.dependOn(&exe.step);
b.installArtifact(exe);
}
|
const Builder = @import("std").build.Builder;
pub fn build(b: &Builder) -> %void {
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("YOUR_NAME_HERE", "src/main.zig");
exe.setBuildMode(mode);
b.default_step.dependOn(&exe.step);
b.installArtifact(exe);
}
|
Fix build template to match build runner changes
|
Fix build template to match build runner changes
Api changed in 7b57454cc11371b71097967656e19f0a1736d733.
|
Zig
|
mit
|
Dimenus/zig,raulgrell/zig,zig-lang/zig,Dimenus/zig,raulgrell/zig,raulgrell/zig,raulgrell/zig,zig-lang/zig,raulgrell/zig,andrewrk/zig,zig-lang/zig,Dimenus/zig,andrewrk/zig
|
742abc71c75a3448526c14980d0daae1c6ff8f96
|
std/c/freebsd.zig
|
std/c/freebsd.zig
|
const std = @import("../std.zig");
usingnamespace std.c;
extern "c" fn __error() *c_int;
pub const _errno = __error;
pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
|
const std = @import("../std.zig");
usingnamespace std.c;
extern "c" fn __error() *c_int;
pub const _errno = __error;
pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
pub const dl_iterate_phdr_callback = extern fn (info: *dl_phdr_info, size: usize, data: ?*c_void) c_int;
pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int;
|
Add missing C dl_iterate_phdr function for FreeBSD
|
Add missing C dl_iterate_phdr function for FreeBSD
|
Zig
|
mit
|
andrewrk/zig,raulgrell/zig,zig-lang/zig,raulgrell/zig,raulgrell/zig,zig-lang/zig,raulgrell/zig,raulgrell/zig,andrewrk/zig,zig-lang/zig
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.