commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2295a5b14eeaa6abfceb15b61d0a5271dfd8af | lib/comma.rb | lib/comma.rb | if defined? Rails and Rails.version < '2.3.5'
require 'activesupport'
else
require 'active_support/core_ext/class/inheritable_attributes'
end
# load the right csv library
if RUBY_VERSION >= '1.9'
require 'csv'
FasterCSV = CSV
else
begin
# try faster csv
require 'fastercsv'
rescue Error => e
if defined? Rails
Rails.logger.info "FasterCSV not installed, falling back on CSV"
else
puts "FasterCSV not installed, falling back on CSV"
end
require 'csv'
FasterCSV = CSV
end
end
require 'comma/extractors'
require 'comma/generator'
require 'comma/array'
require 'comma/object'
require 'comma/render_as_csv'
if defined?(ActiveRecord)
require 'comma/named_scope'
require 'comma/association_proxy'
end
if defined?(ActionController)
ActionController::Base.send :include, RenderAsCSV
end
| if defined? Rails and (Rails.version.split('.').map(&:to_i) <=> [2,3,5]) < 0
require 'activesupport'
else
require 'active_support/core_ext/class/inheritable_attributes'
end
# load the right csv library
if RUBY_VERSION >= '1.9'
require 'csv'
FasterCSV = CSV
else
begin
# try faster csv
require 'fastercsv'
rescue Error => e
if defined? Rails
Rails.logger.info "FasterCSV not installed, falling back on CSV"
else
puts "FasterCSV not installed, falling back on CSV"
end
require 'csv'
FasterCSV = CSV
end
end
require 'comma/extractors'
require 'comma/generator'
require 'comma/array'
require 'comma/object'
require 'comma/render_as_csv'
if defined?(ActiveRecord)
require 'comma/named_scope'
require 'comma/association_proxy'
end
if defined?(ActionController)
ActionController::Base.send :include, RenderAsCSV
end
| Fix deprecation warning when upgrading to Rails 2.3.10 | Fix deprecation warning when upgrading to Rails 2.3.10
| Ruby | mit | chargify/comma,plancien/comma,comma-csv/comma | ruby | ## Code Before:
if defined? Rails and Rails.version < '2.3.5'
require 'activesupport'
else
require 'active_support/core_ext/class/inheritable_attributes'
end
# load the right csv library
if RUBY_VERSION >= '1.9'
require 'csv'
FasterCSV = CSV
else
begin
# try faster csv
require 'fastercsv'
rescue Error => e
if defined? Rails
Rails.logger.info "FasterCSV not installed, falling back on CSV"
else
puts "FasterCSV not installed, falling back on CSV"
end
require 'csv'
FasterCSV = CSV
end
end
require 'comma/extractors'
require 'comma/generator'
require 'comma/array'
require 'comma/object'
require 'comma/render_as_csv'
if defined?(ActiveRecord)
require 'comma/named_scope'
require 'comma/association_proxy'
end
if defined?(ActionController)
ActionController::Base.send :include, RenderAsCSV
end
## Instruction:
Fix deprecation warning when upgrading to Rails 2.3.10
## Code After:
if defined? Rails and (Rails.version.split('.').map(&:to_i) <=> [2,3,5]) < 0
require 'activesupport'
else
require 'active_support/core_ext/class/inheritable_attributes'
end
# load the right csv library
if RUBY_VERSION >= '1.9'
require 'csv'
FasterCSV = CSV
else
begin
# try faster csv
require 'fastercsv'
rescue Error => e
if defined? Rails
Rails.logger.info "FasterCSV not installed, falling back on CSV"
else
puts "FasterCSV not installed, falling back on CSV"
end
require 'csv'
FasterCSV = CSV
end
end
require 'comma/extractors'
require 'comma/generator'
require 'comma/array'
require 'comma/object'
require 'comma/render_as_csv'
if defined?(ActiveRecord)
require 'comma/named_scope'
require 'comma/association_proxy'
end
if defined?(ActionController)
ActionController::Base.send :include, RenderAsCSV
end
| - if defined? Rails and Rails.version < '2.3.5'
+ if defined? Rails and (Rails.version.split('.').map(&:to_i) <=> [2,3,5]) < 0
require 'activesupport'
else
require 'active_support/core_ext/class/inheritable_attributes'
end
# load the right csv library
if RUBY_VERSION >= '1.9'
require 'csv'
FasterCSV = CSV
else
begin
# try faster csv
require 'fastercsv'
rescue Error => e
if defined? Rails
Rails.logger.info "FasterCSV not installed, falling back on CSV"
else
puts "FasterCSV not installed, falling back on CSV"
end
require 'csv'
FasterCSV = CSV
end
end
require 'comma/extractors'
require 'comma/generator'
require 'comma/array'
require 'comma/object'
require 'comma/render_as_csv'
if defined?(ActiveRecord)
require 'comma/named_scope'
require 'comma/association_proxy'
end
if defined?(ActionController)
ActionController::Base.send :include, RenderAsCSV
end | 2 | 0.051282 | 1 | 1 |
2261c0618492499077c0c8840901362710d5fd10 | resource/resourceadapters/deploy.go | resource/resourceadapters/deploy.go | // Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package resourceadapters
import (
"github.com/juju/errors"
charmresource "gopkg.in/juju/charm.v6-unstable/resource"
"github.com/juju/juju/api"
"github.com/juju/juju/resource/cmd"
)
// DeployResources uploads the bytes for the given files to the server and
// creates pending resource metadata for the all resource mentioned in the
// metadata. It returns a map of resource name to pending resource IDs.
func DeployResources(serviceID string, files map[string]string, resources map[string]charmresource.Meta, conn api.Connection) (ids map[string]string, err error) {
client, err := newAPIClient(conn)
if err != nil {
return nil, errors.Trace(err)
}
ids, err = cmd.DeployResources(serviceID, files, resources, client)
if err != nil {
return nil, errors.Trace(err)
}
return ids, nil
}
| // Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package resourceadapters
import (
"github.com/juju/errors"
"gopkg.in/juju/charm.v6-unstable"
charmresource "gopkg.in/juju/charm.v6-unstable/resource"
"github.com/juju/juju/api"
"github.com/juju/juju/resource/cmd"
)
// DeployResources uploads the bytes for the given files to the server and
// creates pending resource metadata for the all resource mentioned in the
// metadata. It returns a map of resource name to pending resource IDs.
func DeployResources(serviceID string, files map[string]string, resources map[string]charmresource.Meta, conn api.Connection) (ids map[string]string, err error) {
client, err := newAPIClient(conn)
if err != nil {
return nil, errors.Trace(err)
}
var cURL *charm.URL
ids, err = cmd.DeployResources(cmd.DeployResourcesArgs{
ServiceID: serviceID,
CharmURL: cURL,
Specified: files,
ResourcesMeta: resources,
Client: client,
})
if err != nil {
return nil, errors.Trace(err)
}
return ids, nil
}
| Fix the DeployResources() call args. | Fix the DeployResources() call args.
| Go | agpl-3.0 | perrito666/juju,makyo/juju,gabriel-samfira/juju,ericsnowcurrently/juju,dimitern/juju,bac/juju,macgreagoir/juju,waigani/juju,bz2/juju,anastasiamac/juju,kat-co/juju,howbazaar/juju,reedobrien/juju,macgreagoir/juju,macgreagoir/juju,ericsnowcurrently/juju,howbazaar/juju,dooferlad/juju,dimitern/juju,anastasiamac/juju,makyo/juju,bac/juju,AdamIsrael/juju,bz2/juju,macgreagoir/juju,mjs/juju,perrito666/juju,waigani/juju,bogdanteleaga/juju,reedobrien/juju,axw/juju,dooferlad/juju,anastasiamac/juju,ericsnowcurrently/juju,marcmolla/juju,bz2/juju,axw/juju,mjs/juju,bac/juju,gabriel-samfira/juju,marcmolla/juju,bac/juju,ericsnowcurrently/juju,reedobrien/juju,anastasiamac/juju,frankban/juju,mjs/juju,bz2/juju,gabriel-samfira/juju,AdamIsrael/juju,reedobrien/juju,axw/juju,kat-co/juju,howbazaar/juju,ericsnowcurrently/juju,perrito666/juju,waigani/juju,alesstimec/juju,kat-co/juju,mjs/juju,gabriel-samfira/juju,marcmolla/juju,AdamIsrael/juju,alesstimec/juju,alesstimec/juju,anastasiamac/juju,axw/juju,frankban/juju,gabriel-samfira/juju,mikemccracken/juju,macgreagoir/juju,mjs/juju,mikemccracken/juju,perrito666/juju,marcmolla/juju,howbazaar/juju,dooferlad/juju,bogdanteleaga/juju,alesstimec/juju,dimitern/juju,bogdanteleaga/juju,axw/juju,makyo/juju,marcmolla/juju,mjs/juju,frankban/juju,makyo/juju,alesstimec/juju,howbazaar/juju,mjs/juju,dimitern/juju,AdamIsrael/juju,dooferlad/juju,kat-co/juju,kat-co/juju,reedobrien/juju,frankban/juju,bogdanteleaga/juju,mikemccracken/juju,mikemccracken/juju,frankban/juju,dooferlad/juju,perrito666/juju,waigani/juju,bz2/juju,mikemccracken/juju,dimitern/juju,bac/juju | go | ## Code Before:
// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package resourceadapters
import (
"github.com/juju/errors"
charmresource "gopkg.in/juju/charm.v6-unstable/resource"
"github.com/juju/juju/api"
"github.com/juju/juju/resource/cmd"
)
// DeployResources uploads the bytes for the given files to the server and
// creates pending resource metadata for the all resource mentioned in the
// metadata. It returns a map of resource name to pending resource IDs.
func DeployResources(serviceID string, files map[string]string, resources map[string]charmresource.Meta, conn api.Connection) (ids map[string]string, err error) {
client, err := newAPIClient(conn)
if err != nil {
return nil, errors.Trace(err)
}
ids, err = cmd.DeployResources(serviceID, files, resources, client)
if err != nil {
return nil, errors.Trace(err)
}
return ids, nil
}
## Instruction:
Fix the DeployResources() call args.
## Code After:
// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package resourceadapters
import (
"github.com/juju/errors"
"gopkg.in/juju/charm.v6-unstable"
charmresource "gopkg.in/juju/charm.v6-unstable/resource"
"github.com/juju/juju/api"
"github.com/juju/juju/resource/cmd"
)
// DeployResources uploads the bytes for the given files to the server and
// creates pending resource metadata for the all resource mentioned in the
// metadata. It returns a map of resource name to pending resource IDs.
func DeployResources(serviceID string, files map[string]string, resources map[string]charmresource.Meta, conn api.Connection) (ids map[string]string, err error) {
client, err := newAPIClient(conn)
if err != nil {
return nil, errors.Trace(err)
}
var cURL *charm.URL
ids, err = cmd.DeployResources(cmd.DeployResourcesArgs{
ServiceID: serviceID,
CharmURL: cURL,
Specified: files,
ResourcesMeta: resources,
Client: client,
})
if err != nil {
return nil, errors.Trace(err)
}
return ids, nil
}
| // Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package resourceadapters
import (
"github.com/juju/errors"
+ "gopkg.in/juju/charm.v6-unstable"
charmresource "gopkg.in/juju/charm.v6-unstable/resource"
"github.com/juju/juju/api"
"github.com/juju/juju/resource/cmd"
)
// DeployResources uploads the bytes for the given files to the server and
// creates pending resource metadata for the all resource mentioned in the
// metadata. It returns a map of resource name to pending resource IDs.
func DeployResources(serviceID string, files map[string]string, resources map[string]charmresource.Meta, conn api.Connection) (ids map[string]string, err error) {
client, err := newAPIClient(conn)
if err != nil {
return nil, errors.Trace(err)
}
- ids, err = cmd.DeployResources(serviceID, files, resources, client)
+ var cURL *charm.URL
+ ids, err = cmd.DeployResources(cmd.DeployResourcesArgs{
+ ServiceID: serviceID,
+ CharmURL: cURL,
+ Specified: files,
+ ResourcesMeta: resources,
+ Client: client,
+ })
if err != nil {
return nil, errors.Trace(err)
}
return ids, nil
} | 10 | 0.357143 | 9 | 1 |
b73b7e29bd9c5c50f555537dede6f568e6f2fc0a | pkgs/tools/misc/gummiboot/default.nix | pkgs/tools/misc/gummiboot/default.nix | { stdenv, fetchurl, gnu_efi }:
stdenv.mkDerivation rec {
name = "gummiboot-16";
patches = [ ./no-usr.patch ];
buildFlags = [
"GNU_EFI=${gnu_efi}"
];
installPhase = "mkdir -p $out/bin; mv gummiboot.efi $out/bin";
src = fetchurl {
url = "http://cgit.freedesktop.org/gummiboot/snapshot/${name}.tar.gz";
sha256 = "1znvbxrhc7pkbhbw9bvg4zhfkp81q7fy4mq2jsw6vimccr7h29a0";
};
meta = {
description = "A simple UEFI boot manager which executes configured EFI images";
homepage = http://freedesktop.org/wiki/Software/gummiboot;
license = stdenv.lib.licenses.lgpl21Plus;
platforms = [ "x86_64-linux" ];
maintainers = [ stdenv.lib.maintainers.shlevy ];
};
}
| { stdenv, fetchurl, gnu_efi }:
stdenv.mkDerivation rec {
name = "gummiboot-16";
patches = [ ./no-usr.patch ];
buildFlags = [
"GNU_EFI=${gnu_efi}"
] ++ stdenv.lib.optional (stdenv.system == "i686-linux") "ARCH=ia32";
installPhase = "mkdir -p $out/bin; mv gummiboot.efi $out/bin";
src = fetchurl {
url = "http://cgit.freedesktop.org/gummiboot/snapshot/${name}.tar.gz";
sha256 = "1znvbxrhc7pkbhbw9bvg4zhfkp81q7fy4mq2jsw6vimccr7h29a0";
};
meta = {
description = "A simple UEFI boot manager which executes configured EFI images";
homepage = http://freedesktop.org/wiki/Software/gummiboot;
license = stdenv.lib.licenses.lgpl21Plus;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = [ stdenv.lib.maintainers.shlevy ];
};
}
| Fix build on 32-bit Linux | Gummiboot: Fix build on 32-bit Linux
| Nix | mit | SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,triton/triton,triton/triton | nix | ## Code Before:
{ stdenv, fetchurl, gnu_efi }:
stdenv.mkDerivation rec {
name = "gummiboot-16";
patches = [ ./no-usr.patch ];
buildFlags = [
"GNU_EFI=${gnu_efi}"
];
installPhase = "mkdir -p $out/bin; mv gummiboot.efi $out/bin";
src = fetchurl {
url = "http://cgit.freedesktop.org/gummiboot/snapshot/${name}.tar.gz";
sha256 = "1znvbxrhc7pkbhbw9bvg4zhfkp81q7fy4mq2jsw6vimccr7h29a0";
};
meta = {
description = "A simple UEFI boot manager which executes configured EFI images";
homepage = http://freedesktop.org/wiki/Software/gummiboot;
license = stdenv.lib.licenses.lgpl21Plus;
platforms = [ "x86_64-linux" ];
maintainers = [ stdenv.lib.maintainers.shlevy ];
};
}
## Instruction:
Gummiboot: Fix build on 32-bit Linux
## Code After:
{ stdenv, fetchurl, gnu_efi }:
stdenv.mkDerivation rec {
name = "gummiboot-16";
patches = [ ./no-usr.patch ];
buildFlags = [
"GNU_EFI=${gnu_efi}"
] ++ stdenv.lib.optional (stdenv.system == "i686-linux") "ARCH=ia32";
installPhase = "mkdir -p $out/bin; mv gummiboot.efi $out/bin";
src = fetchurl {
url = "http://cgit.freedesktop.org/gummiboot/snapshot/${name}.tar.gz";
sha256 = "1znvbxrhc7pkbhbw9bvg4zhfkp81q7fy4mq2jsw6vimccr7h29a0";
};
meta = {
description = "A simple UEFI boot manager which executes configured EFI images";
homepage = http://freedesktop.org/wiki/Software/gummiboot;
license = stdenv.lib.licenses.lgpl21Plus;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = [ stdenv.lib.maintainers.shlevy ];
};
}
| { stdenv, fetchurl, gnu_efi }:
stdenv.mkDerivation rec {
name = "gummiboot-16";
patches = [ ./no-usr.patch ];
buildFlags = [
"GNU_EFI=${gnu_efi}"
- ];
+ ] ++ stdenv.lib.optional (stdenv.system == "i686-linux") "ARCH=ia32";
installPhase = "mkdir -p $out/bin; mv gummiboot.efi $out/bin";
src = fetchurl {
url = "http://cgit.freedesktop.org/gummiboot/snapshot/${name}.tar.gz";
sha256 = "1znvbxrhc7pkbhbw9bvg4zhfkp81q7fy4mq2jsw6vimccr7h29a0";
};
meta = {
description = "A simple UEFI boot manager which executes configured EFI images";
homepage = http://freedesktop.org/wiki/Software/gummiboot;
license = stdenv.lib.licenses.lgpl21Plus;
- platforms = [ "x86_64-linux" ];
+ platforms = [ "x86_64-linux" "i686-linux" ];
? +++++++++++++
maintainers = [ stdenv.lib.maintainers.shlevy ];
};
} | 4 | 0.133333 | 2 | 2 |
2799baad642130720250d1d3a369a59a74678b7d | CHANGELOG.md | CHANGELOG.md |
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- `npm` support
- Reporting arbitrary failures with `fail()` (moved from `bats-assert`)
### Changed
- Renamed to `bats-support`
## 0.1.0 - 2016-02-16
### Added
- Two-column key-value formatting with `batslib_print_kv_single()`
- Multi-line key-value formatting with `batslib_print_kv_multi()`
- Mixed formatting with `batslib_print_kv_single_or_multi()`
- Header and footer decoration with `batslib_decorate()`
- Prefixing lines with `batslib_prefix()`
- Marking lines with `batslib_mark()`
- Common output function `batslib_err()`
- Line counting with `batslib_count_lines()`
- Checking whether a text is one line long with
`batslib_is_single_line()`
- Determining key width for two-column and mixed formatting with
`batslib_get_max_single_line_key_width()`
[Unreleased]: https://github.com/ztombol/varrick/compare/v0.1.0...HEAD
|
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- `npm` support
- Reporting arbitrary failures with `fail()` (moved from `bats-assert`)
### Changed
- Renamed to `bats-support`
## 0.1.0 - 2016-02-16
### Added
- Two-column key-value formatting with `batslib_print_kv_single()`
- Multi-line key-value formatting with `batslib_print_kv_multi()`
- Mixed formatting with `batslib_print_kv_single_or_multi()`
- Header and footer decoration with `batslib_decorate()`
- Prefixing lines with `batslib_prefix()`
- Marking lines with `batslib_mark()`
- Common output function `batslib_err()`
- Line counting with `batslib_count_lines()`
- Checking whether a text is one line long with
`batslib_is_single_line()`
- Determining key width for two-column and mixed formatting with
`batslib_get_max_single_line_key_width()`
[Unreleased]: https://github.com/ztombol/bats-support/compare/v0.1.0...HEAD
| Fix version compare URLs in change log | Fix version compare URLs in change log
| Markdown | cc0-1.0 | ztombol/bats-core | markdown | ## Code Before:
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- `npm` support
- Reporting arbitrary failures with `fail()` (moved from `bats-assert`)
### Changed
- Renamed to `bats-support`
## 0.1.0 - 2016-02-16
### Added
- Two-column key-value formatting with `batslib_print_kv_single()`
- Multi-line key-value formatting with `batslib_print_kv_multi()`
- Mixed formatting with `batslib_print_kv_single_or_multi()`
- Header and footer decoration with `batslib_decorate()`
- Prefixing lines with `batslib_prefix()`
- Marking lines with `batslib_mark()`
- Common output function `batslib_err()`
- Line counting with `batslib_count_lines()`
- Checking whether a text is one line long with
`batslib_is_single_line()`
- Determining key width for two-column and mixed formatting with
`batslib_get_max_single_line_key_width()`
[Unreleased]: https://github.com/ztombol/varrick/compare/v0.1.0...HEAD
## Instruction:
Fix version compare URLs in change log
## Code After:
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- `npm` support
- Reporting arbitrary failures with `fail()` (moved from `bats-assert`)
### Changed
- Renamed to `bats-support`
## 0.1.0 - 2016-02-16
### Added
- Two-column key-value formatting with `batslib_print_kv_single()`
- Multi-line key-value formatting with `batslib_print_kv_multi()`
- Mixed formatting with `batslib_print_kv_single_or_multi()`
- Header and footer decoration with `batslib_decorate()`
- Prefixing lines with `batslib_prefix()`
- Marking lines with `batslib_mark()`
- Common output function `batslib_err()`
- Line counting with `batslib_count_lines()`
- Checking whether a text is one line long with
`batslib_is_single_line()`
- Determining key width for two-column and mixed formatting with
`batslib_get_max_single_line_key_width()`
[Unreleased]: https://github.com/ztombol/bats-support/compare/v0.1.0...HEAD
|
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- `npm` support
- Reporting arbitrary failures with `fail()` (moved from `bats-assert`)
### Changed
- Renamed to `bats-support`
## 0.1.0 - 2016-02-16
### Added
- Two-column key-value formatting with `batslib_print_kv_single()`
- Multi-line key-value formatting with `batslib_print_kv_multi()`
- Mixed formatting with `batslib_print_kv_single_or_multi()`
- Header and footer decoration with `batslib_decorate()`
- Prefixing lines with `batslib_prefix()`
- Marking lines with `batslib_mark()`
- Common output function `batslib_err()`
- Line counting with `batslib_count_lines()`
- Checking whether a text is one line long with
`batslib_is_single_line()`
- Determining key width for two-column and mixed formatting with
`batslib_get_max_single_line_key_width()`
- [Unreleased]: https://github.com/ztombol/varrick/compare/v0.1.0...HEAD
? ^ ^^^^
+ [Unreleased]: https://github.com/ztombol/bats-support/compare/v0.1.0...HEAD
? ^ ++++++++ ^
| 2 | 0.055556 | 1 | 1 |
a8053f72e54e41011cad782cb37801dc26af6251 | src/xenia/base/platform_linux.h | src/xenia/base/platform_linux.h | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_BASE_PLATFORM_X11_H_
#define XENIA_BASE_PLATFORM_X11_H_
// NOTE: if you're including this file it means you are explicitly depending
// on Linux headers. Including this file outside of linux platform specific
// source code will break portability
#include "xenia/base/platform.h"
// Xlib is used only for GLX interaction, the window management and input
// events are done with gtk/gdk
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
//Used for window management. Gtk is for GUI and wigets, gdk is for lower
//level events like key presses, mouse events, etc
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#endif // XENIA_BASE_PLATFORM_X11_H_
| /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_BASE_PLATFORM_X11_H_
#define XENIA_BASE_PLATFORM_X11_H_
// NOTE: if you're including this file it means you are explicitly depending
// on Linux headers. Including this file outside of linux platform specific
// source code will break portability
#include "xenia/base/platform.h"
// Xlib/Xcb is used only for GLX/Vulkan interaction, the window management
// and input events are done with gtk/gdk
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <xcb/xcb.h>
//Used for window management. Gtk is for GUI and wigets, gdk is for lower
//level events like key presses, mouse events, etc
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#endif // XENIA_BASE_PLATFORM_X11_H_
| Add xcb headers to linux platform, needed for vulkan | Add xcb headers to linux platform, needed for vulkan
| C | bsd-3-clause | sephiroth99/xenia,sephiroth99/xenia,sephiroth99/xenia | c | ## Code Before:
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_BASE_PLATFORM_X11_H_
#define XENIA_BASE_PLATFORM_X11_H_
// NOTE: if you're including this file it means you are explicitly depending
// on Linux headers. Including this file outside of linux platform specific
// source code will break portability
#include "xenia/base/platform.h"
// Xlib is used only for GLX interaction, the window management and input
// events are done with gtk/gdk
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
//Used for window management. Gtk is for GUI and wigets, gdk is for lower
//level events like key presses, mouse events, etc
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#endif // XENIA_BASE_PLATFORM_X11_H_
## Instruction:
Add xcb headers to linux platform, needed for vulkan
## Code After:
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_BASE_PLATFORM_X11_H_
#define XENIA_BASE_PLATFORM_X11_H_
// NOTE: if you're including this file it means you are explicitly depending
// on Linux headers. Including this file outside of linux platform specific
// source code will break portability
#include "xenia/base/platform.h"
// Xlib/Xcb is used only for GLX/Vulkan interaction, the window management
// and input events are done with gtk/gdk
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <xcb/xcb.h>
//Used for window management. Gtk is for GUI and wigets, gdk is for lower
//level events like key presses, mouse events, etc
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#endif // XENIA_BASE_PLATFORM_X11_H_
| /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_BASE_PLATFORM_X11_H_
#define XENIA_BASE_PLATFORM_X11_H_
// NOTE: if you're including this file it means you are explicitly depending
// on Linux headers. Including this file outside of linux platform specific
// source code will break portability
#include "xenia/base/platform.h"
- // Xlib is used only for GLX interaction, the window management and input
? ----------
+ // Xlib/Xcb is used only for GLX/Vulkan interaction, the window management
? ++++ +++++++
- // events are done with gtk/gdk
+ // and input events are done with gtk/gdk
? ++++++++++
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
+ #include <xcb/xcb.h>
//Used for window management. Gtk is for GUI and wigets, gdk is for lower
//level events like key presses, mouse events, etc
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#endif // XENIA_BASE_PLATFORM_X11_H_ | 5 | 0.166667 | 3 | 2 |
9516caa0c62289c89b605b9b8a34622a0bb54e2b | tests/70_program_libpfasst_swe_sphere_timestepper_convergence_l1/postprocessing_pickle.py | tests/70_program_libpfasst_swe_sphere_timestepper_convergence_l1/postprocessing_pickle.py |
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
pickle_SphereDataPhysicalDiff()
|
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataSpectralDiff import *
from mule.exec_program import *
pickle_SphereDataSpectralDiff()
| Use SphereDataSpectral instead of SphereDataPhysical | Use SphereDataSpectral instead of SphereDataPhysical
The script for physical data requires CSV files as default output files,
whereas the spectral script uses .sweet binary files as default.
Since libpfasst_swe_sphere's CSV output is not in the same format as
swe_sphere's CSV output, the CSV parsing does not work --> this is
the easiest way to use the (working) binary output files.
| Python | mit | schreiberx/sweet,schreiberx/sweet,schreiberx/sweet,schreiberx/sweet | python | ## Code Before:
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataPhysicalDiff import *
from mule.exec_program import *
pickle_SphereDataPhysicalDiff()
## Instruction:
Use SphereDataSpectral instead of SphereDataPhysical
The script for physical data requires CSV files as default output files,
whereas the spectral script uses .sweet binary files as default.
Since libpfasst_swe_sphere's CSV output is not in the same format as
swe_sphere's CSV output, the CSV parsing does not work --> this is
the easiest way to use the (working) binary output files.
## Code After:
import sys
import math
import glob
from mule_local.postprocessing.pickle_SphereDataSpectralDiff import *
from mule.exec_program import *
pickle_SphereDataSpectralDiff()
|
import sys
import math
import glob
- from mule_local.postprocessing.pickle_SphereDataPhysicalDiff import *
? ^^^^^
+ from mule_local.postprocessing.pickle_SphereDataSpectralDiff import *
? ^^^ ++
from mule.exec_program import *
- pickle_SphereDataPhysicalDiff()
? ^^^^^
+ pickle_SphereDataSpectralDiff()
? ^^^ ++
| 4 | 0.444444 | 2 | 2 |
4c1a64b20caa1bbf1ab6215b1ee20ed3f2877bb3 | src/main/java/io/github/robwin/markup/builder/MarkupDocBuilders.java | src/main/java/io/github/robwin/markup/builder/MarkupDocBuilders.java | /*
*
* Copyright 2015 Robert Winkler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package io.github.robwin.markup.builder;
import io.github.robwin.markup.builder.asciidoc.AsciiDocBuilder;
import io.github.robwin.markup.builder.markdown.MarkdownBuilder;
/**
* @author Robert Winkler
*/
public final class MarkupDocBuilders {
private MarkupDocBuilders(){}
public static MarkupDocBuilder documentBuilder(MarkupLanguage markupLanguage){
switch(markupLanguage){
case MARKDOWN: return new MarkdownBuilder();
case ASCIIDOC: return new AsciiDocBuilder();
default: return new AsciiDocBuilder();
}
}
}
| /*
*
* Copyright 2015 Robert Winkler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package io.github.robwin.markup.builder;
import io.github.robwin.markup.builder.asciidoc.AsciiDocBuilder;
import io.github.robwin.markup.builder.markdown.MarkdownBuilder;
/**
* @author Robert Winkler
*/
public final class MarkupDocBuilders {
private MarkupDocBuilders(){}
public static MarkupDocBuilder documentBuilder(MarkupLanguage markupLanguage){
switch(markupLanguage){
case MARKDOWN: return new MarkdownBuilder();
case ASCIIDOC: return new AsciiDocBuilder();
default: return new AsciiDocBuilder();
}
}
/**
* Instantiate a new builder copying {@code docBuilder} characteristics.
* You can use it to build intermediate MarkupDocBuilder for composition purpose.
*/
public static MarkupDocBuilder documentBuilder(MarkupDocBuilder docBuilder){
if (docBuilder instanceof MarkdownBuilder)
return new MarkdownBuilder();
else if (docBuilder instanceof AsciiDocBuilder)
return new AsciiDocBuilder();
else
return new AsciiDocBuilder();
}
}
| Create a builder instance from another builder instance, for easier composition | Create a builder instance from another builder instance, for easier composition
| Java | apache-2.0 | Swagger2Markup/markup-document-builder | java | ## Code Before:
/*
*
* Copyright 2015 Robert Winkler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package io.github.robwin.markup.builder;
import io.github.robwin.markup.builder.asciidoc.AsciiDocBuilder;
import io.github.robwin.markup.builder.markdown.MarkdownBuilder;
/**
* @author Robert Winkler
*/
public final class MarkupDocBuilders {
private MarkupDocBuilders(){}
public static MarkupDocBuilder documentBuilder(MarkupLanguage markupLanguage){
switch(markupLanguage){
case MARKDOWN: return new MarkdownBuilder();
case ASCIIDOC: return new AsciiDocBuilder();
default: return new AsciiDocBuilder();
}
}
}
## Instruction:
Create a builder instance from another builder instance, for easier composition
## Code After:
/*
*
* Copyright 2015 Robert Winkler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package io.github.robwin.markup.builder;
import io.github.robwin.markup.builder.asciidoc.AsciiDocBuilder;
import io.github.robwin.markup.builder.markdown.MarkdownBuilder;
/**
* @author Robert Winkler
*/
public final class MarkupDocBuilders {
private MarkupDocBuilders(){}
public static MarkupDocBuilder documentBuilder(MarkupLanguage markupLanguage){
switch(markupLanguage){
case MARKDOWN: return new MarkdownBuilder();
case ASCIIDOC: return new AsciiDocBuilder();
default: return new AsciiDocBuilder();
}
}
/**
* Instantiate a new builder copying {@code docBuilder} characteristics.
* You can use it to build intermediate MarkupDocBuilder for composition purpose.
*/
public static MarkupDocBuilder documentBuilder(MarkupDocBuilder docBuilder){
if (docBuilder instanceof MarkdownBuilder)
return new MarkdownBuilder();
else if (docBuilder instanceof AsciiDocBuilder)
return new AsciiDocBuilder();
else
return new AsciiDocBuilder();
}
}
| /*
*
* Copyright 2015 Robert Winkler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package io.github.robwin.markup.builder;
import io.github.robwin.markup.builder.asciidoc.AsciiDocBuilder;
import io.github.robwin.markup.builder.markdown.MarkdownBuilder;
/**
* @author Robert Winkler
*/
public final class MarkupDocBuilders {
private MarkupDocBuilders(){}
public static MarkupDocBuilder documentBuilder(MarkupLanguage markupLanguage){
switch(markupLanguage){
case MARKDOWN: return new MarkdownBuilder();
case ASCIIDOC: return new AsciiDocBuilder();
default: return new AsciiDocBuilder();
}
}
+ /**
+ * Instantiate a new builder copying {@code docBuilder} characteristics.
+ * You can use it to build intermediate MarkupDocBuilder for composition purpose.
+ */
+ public static MarkupDocBuilder documentBuilder(MarkupDocBuilder docBuilder){
+ if (docBuilder instanceof MarkdownBuilder)
+ return new MarkdownBuilder();
+ else if (docBuilder instanceof AsciiDocBuilder)
+ return new AsciiDocBuilder();
+ else
+ return new AsciiDocBuilder();
+ }
+
+
} | 14 | 0.35 | 14 | 0 |
ab35da87e4304da77e298d67f5aad337826226ca | src/opbeat.js | src/opbeat.js | ;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(function () {
return (root.Opbeat = factory())
})
} else {
root.Opbeat = factory()
}
}(this, function () {
var defaultOptions = {
apiHost: 'https://opbeat.com',
logger: 'javascript',
collectHttp: true,
ignoreErrors: [],
ignoreUrls: [],
whitelistUrls: [],
includePaths: [],
collectWindowErrors: true,
extra: {
frame_info: {}
}
}
function Opbeat () {
this.options = defaultOptions
}
return {}
}))
| ;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(function () {
return (root.Opbeat = factory())
})
} else {
root.Opbeat = factory()
}
}(this, function () {
var defaultOptions = {
apiHost: 'https://opbeat.com',
logger: 'javascript',
collectHttp: true,
ignoreErrors: [],
ignoreUrls: [],
whitelistUrls: [],
includePaths: [],
collectWindowErrors: true,
extra: {
frame_info: {}
}
}
function Opbeat () {
this.options = defaultOptions
}
/*
* Configure Opbeat with Opbeat.com credentials and other options
*
* @param {object} options Optional set of of global options
* @return {Opbeat}
*/
Opbeat.prototype.config = function (options) {
return this
}
/*
* Installs a global window.onerror error handler
* to capture and report uncaught exceptions.
* At this point, install() is required to be called due
* to the way TraceKit is set up.
*
* @return {Opbeat}
*/
Opbeat.prototype.install = function () {
return this
}
/*
* Uninstalls the global error handler.
*
* @return {Opbeat}
*/
Opbeat.prototype.uninstall = function () {
return this
}
/*
* Manually capture an exception and send it over to Opbeat.com
*
* @param {error} ex An exception to be logged
* @param {object} options A specific set of options for this error [optional]
* @return {Opbeat}
*/
Opbeat.prototype.captureException = function (ex, options) {
return this
}
/*
* Set/clear a user to be sent along with the payload.
*
* @param {object} user An object representing user data [optional]
* @return {Opbeat}
*/
Opbeat.prototype.setUserContext = function (user) {
return this
}
/*
* Set extra attributes to be sent along with the payload.
*
* @param {object} extra An object representing extra data [optional]
* @return {Opbeat}
*/
Opbeat.prototype.setExtraContext = function (extra) {
return this
}
return new Opbeat()
}))
| Add public interface from previous client. | Add public interface from previous client. | JavaScript | mit | opbeat/opbeat-js-core,opbeat/opbeat-angular,jahtalab/opbeat-js,jahtalab/opbeat-js,opbeat/opbeat-angular,opbeat/opbeat-react,opbeat/opbeat-angular,opbeat/opbeat-react,opbeat/opbeat-js-core,jahtalab/opbeat-js,opbeat/opbeat-react | javascript | ## Code Before:
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(function () {
return (root.Opbeat = factory())
})
} else {
root.Opbeat = factory()
}
}(this, function () {
var defaultOptions = {
apiHost: 'https://opbeat.com',
logger: 'javascript',
collectHttp: true,
ignoreErrors: [],
ignoreUrls: [],
whitelistUrls: [],
includePaths: [],
collectWindowErrors: true,
extra: {
frame_info: {}
}
}
function Opbeat () {
this.options = defaultOptions
}
return {}
}))
## Instruction:
Add public interface from previous client.
## Code After:
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(function () {
return (root.Opbeat = factory())
})
} else {
root.Opbeat = factory()
}
}(this, function () {
var defaultOptions = {
apiHost: 'https://opbeat.com',
logger: 'javascript',
collectHttp: true,
ignoreErrors: [],
ignoreUrls: [],
whitelistUrls: [],
includePaths: [],
collectWindowErrors: true,
extra: {
frame_info: {}
}
}
function Opbeat () {
this.options = defaultOptions
}
/*
* Configure Opbeat with Opbeat.com credentials and other options
*
* @param {object} options Optional set of of global options
* @return {Opbeat}
*/
Opbeat.prototype.config = function (options) {
return this
}
/*
* Installs a global window.onerror error handler
* to capture and report uncaught exceptions.
* At this point, install() is required to be called due
* to the way TraceKit is set up.
*
* @return {Opbeat}
*/
Opbeat.prototype.install = function () {
return this
}
/*
* Uninstalls the global error handler.
*
* @return {Opbeat}
*/
Opbeat.prototype.uninstall = function () {
return this
}
/*
* Manually capture an exception and send it over to Opbeat.com
*
* @param {error} ex An exception to be logged
* @param {object} options A specific set of options for this error [optional]
* @return {Opbeat}
*/
Opbeat.prototype.captureException = function (ex, options) {
return this
}
/*
* Set/clear a user to be sent along with the payload.
*
* @param {object} user An object representing user data [optional]
* @return {Opbeat}
*/
Opbeat.prototype.setUserContext = function (user) {
return this
}
/*
* Set extra attributes to be sent along with the payload.
*
* @param {object} extra An object representing extra data [optional]
* @return {Opbeat}
*/
Opbeat.prototype.setExtraContext = function (extra) {
return this
}
return new Opbeat()
}))
| ;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(function () {
return (root.Opbeat = factory())
})
} else {
root.Opbeat = factory()
}
}(this, function () {
var defaultOptions = {
apiHost: 'https://opbeat.com',
logger: 'javascript',
collectHttp: true,
ignoreErrors: [],
ignoreUrls: [],
whitelistUrls: [],
includePaths: [],
collectWindowErrors: true,
extra: {
frame_info: {}
}
}
function Opbeat () {
this.options = defaultOptions
}
- return {}
+ /*
+ * Configure Opbeat with Opbeat.com credentials and other options
+ *
+ * @param {object} options Optional set of of global options
+ * @return {Opbeat}
+ */
+
+ Opbeat.prototype.config = function (options) {
+ return this
+ }
+
+ /*
+ * Installs a global window.onerror error handler
+ * to capture and report uncaught exceptions.
+ * At this point, install() is required to be called due
+ * to the way TraceKit is set up.
+ *
+ * @return {Opbeat}
+ */
+
+ Opbeat.prototype.install = function () {
+ return this
+
+ }
+
+ /*
+ * Uninstalls the global error handler.
+ *
+ * @return {Opbeat}
+ */
+ Opbeat.prototype.uninstall = function () {
+ return this
+ }
+
+ /*
+ * Manually capture an exception and send it over to Opbeat.com
+ *
+ * @param {error} ex An exception to be logged
+ * @param {object} options A specific set of options for this error [optional]
+ * @return {Opbeat}
+ */
+ Opbeat.prototype.captureException = function (ex, options) {
+ return this
+ }
+
+ /*
+ * Set/clear a user to be sent along with the payload.
+ *
+ * @param {object} user An object representing user data [optional]
+ * @return {Opbeat}
+ */
+ Opbeat.prototype.setUserContext = function (user) {
+ return this
+ }
+
+ /*
+ * Set extra attributes to be sent along with the payload.
+ *
+ * @param {object} extra An object representing extra data [optional]
+ * @return {Opbeat}
+ */
+ Opbeat.prototype.setExtraContext = function (extra) {
+ return this
+ }
+
+ return new Opbeat()
})) | 67 | 2.233333 | 66 | 1 |
9f9ef0f13b4747e8acdf251cb1c2f3b9587589ca | src/Auth/QuickbooksAuth.php | src/Auth/QuickbooksAuth.php | <?php
namespace PhpQuickbooks\Auth;
use Wheniwork\OAuth1\Client\Server\Intuit;
class QuickbooksAuth
{
/**
* @var \Wheniwork\OAuth1\Client\Server\Intuit
*/
protected $oauth;
/**
* @var string
*/
protected $consumer_key;
/**
* @var string
*/
protected $consumer_secret;
public function __construct(string $consumer_key, string $consumer_secret)
{
$this->consumer_key = $consumer_key;
$this->consumer_secret = $consumer_secret;
$this->initServer();
}
protected function initServer()
{
$this->oauth = new Intuit([
'identifier' => $this->consumer_key,
'secret' => $this->consumer_secret,
'callback_uri' => 'http://localhost:8080/auth/authorize_callback.php',
]);
}
public function getRequestToken()
{
$temporaryCredentials = $this->oauth->getTemporaryCredentials();
$_SESSION['temporary_credentials'] = serialize($temporaryCredentials);
session_write_close();
$this->oauth->authorize($temporaryCredentials);
}
public function getTokenCredentials(string $oauth_token, string $oauth_verifier)
{
$temporaryCredentials = unserialize($_SESSION['temporary_credentials']);
return $this->oauth->getTokenCredentials($temporaryCredentials, $_GET['oauth_token'], $_GET['oauth_verifier']);
}
}
| <?php
namespace PhpQuickbooks\Auth;
use Wheniwork\OAuth1\Client\Server\Intuit;
class QuickbooksAuth
{
/**
* @var \Wheniwork\OAuth1\Client\Server\Intuit
*/
protected $oauth;
/**
* @var string
*/
protected $consumer_key;
/**
* @var string
*/
protected $consumer_secret;
/**
* @var string
*/
protected $callback;
public function __construct(
string $consumer_key,
string $consumer_secret,
$callback = 'http://localhost:8080/auth/authorize_callback.php'
) {
$this->consumer_key = $consumer_key;
$this->consumer_secret = $consumer_secret;
$this->callback = $callback;
$this->initServer();
}
protected function initServer()
{
$this->oauth = new Intuit([
'identifier' => $this->consumer_key,
'secret' => $this->consumer_secret,
'callback_uri' => $this->callback
]);
}
public function getRequestToken()
{
$temporaryCredentials = $this->oauth->getTemporaryCredentials();
$_SESSION['temporary_credentials'] = serialize($temporaryCredentials);
session_write_close();
$this->oauth->authorize($temporaryCredentials);
}
public function getTokenCredentials(string $oauth_token, string $oauth_verifier)
{
$temporaryCredentials = unserialize($_SESSION['temporary_credentials']);
return $this->oauth->getTokenCredentials($temporaryCredentials, $_GET['oauth_token'], $_GET['oauth_verifier']);
}
}
| Store callback as a property | Store callback as a property
- so that it can be overriden | PHP | mit | teampickr/php-quickbooks | php | ## Code Before:
<?php
namespace PhpQuickbooks\Auth;
use Wheniwork\OAuth1\Client\Server\Intuit;
class QuickbooksAuth
{
/**
* @var \Wheniwork\OAuth1\Client\Server\Intuit
*/
protected $oauth;
/**
* @var string
*/
protected $consumer_key;
/**
* @var string
*/
protected $consumer_secret;
public function __construct(string $consumer_key, string $consumer_secret)
{
$this->consumer_key = $consumer_key;
$this->consumer_secret = $consumer_secret;
$this->initServer();
}
protected function initServer()
{
$this->oauth = new Intuit([
'identifier' => $this->consumer_key,
'secret' => $this->consumer_secret,
'callback_uri' => 'http://localhost:8080/auth/authorize_callback.php',
]);
}
public function getRequestToken()
{
$temporaryCredentials = $this->oauth->getTemporaryCredentials();
$_SESSION['temporary_credentials'] = serialize($temporaryCredentials);
session_write_close();
$this->oauth->authorize($temporaryCredentials);
}
public function getTokenCredentials(string $oauth_token, string $oauth_verifier)
{
$temporaryCredentials = unserialize($_SESSION['temporary_credentials']);
return $this->oauth->getTokenCredentials($temporaryCredentials, $_GET['oauth_token'], $_GET['oauth_verifier']);
}
}
## Instruction:
Store callback as a property
- so that it can be overriden
## Code After:
<?php
namespace PhpQuickbooks\Auth;
use Wheniwork\OAuth1\Client\Server\Intuit;
class QuickbooksAuth
{
/**
* @var \Wheniwork\OAuth1\Client\Server\Intuit
*/
protected $oauth;
/**
* @var string
*/
protected $consumer_key;
/**
* @var string
*/
protected $consumer_secret;
/**
* @var string
*/
protected $callback;
public function __construct(
string $consumer_key,
string $consumer_secret,
$callback = 'http://localhost:8080/auth/authorize_callback.php'
) {
$this->consumer_key = $consumer_key;
$this->consumer_secret = $consumer_secret;
$this->callback = $callback;
$this->initServer();
}
protected function initServer()
{
$this->oauth = new Intuit([
'identifier' => $this->consumer_key,
'secret' => $this->consumer_secret,
'callback_uri' => $this->callback
]);
}
public function getRequestToken()
{
$temporaryCredentials = $this->oauth->getTemporaryCredentials();
$_SESSION['temporary_credentials'] = serialize($temporaryCredentials);
session_write_close();
$this->oauth->authorize($temporaryCredentials);
}
public function getTokenCredentials(string $oauth_token, string $oauth_verifier)
{
$temporaryCredentials = unserialize($_SESSION['temporary_credentials']);
return $this->oauth->getTokenCredentials($temporaryCredentials, $_GET['oauth_token'], $_GET['oauth_verifier']);
}
}
| <?php
namespace PhpQuickbooks\Auth;
use Wheniwork\OAuth1\Client\Server\Intuit;
class QuickbooksAuth
{
/**
* @var \Wheniwork\OAuth1\Client\Server\Intuit
*/
protected $oauth;
/**
* @var string
*/
protected $consumer_key;
/**
* @var string
*/
protected $consumer_secret;
- public function __construct(string $consumer_key, string $consumer_secret)
+ /**
+ * @var string
+ */
+ protected $callback;
+
+ public function __construct(
+ string $consumer_key,
+ string $consumer_secret,
+ $callback = 'http://localhost:8080/auth/authorize_callback.php'
- {
+ ) {
? ++
$this->consumer_key = $consumer_key;
$this->consumer_secret = $consumer_secret;
+ $this->callback = $callback;
$this->initServer();
}
protected function initServer()
{
$this->oauth = new Intuit([
'identifier' => $this->consumer_key,
'secret' => $this->consumer_secret,
- 'callback_uri' => 'http://localhost:8080/auth/authorize_callback.php',
+ 'callback_uri' => $this->callback
]);
}
public function getRequestToken()
{
$temporaryCredentials = $this->oauth->getTemporaryCredentials();
$_SESSION['temporary_credentials'] = serialize($temporaryCredentials);
session_write_close();
$this->oauth->authorize($temporaryCredentials);
}
public function getTokenCredentials(string $oauth_token, string $oauth_verifier)
{
$temporaryCredentials = unserialize($_SESSION['temporary_credentials']);
return $this->oauth->getTokenCredentials($temporaryCredentials, $_GET['oauth_token'], $_GET['oauth_verifier']);
}
} | 15 | 0.263158 | 12 | 3 |
a6c71c0e217d17cf517aea7908eeaaf985ca48e9 | .github/workflows/ci.yml | .github/workflows/ci.yml | name: CI
on:
push:
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- { icon: 🐧, name: ubuntu }
- { icon: 🍎, name: macos }
- { icon: 🧊, name: windows }
pyver:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
runs-on: ${{ matrix.os.name }}-latest
name: ${{ matrix.os.icon }} ${{ matrix.os.name }} | ${{ matrix.pyver }}
steps:
- name: 🧰 Repository Checkout
uses: actions/checkout@v2
- name: 🐍 Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.pyver }}
- name: 🛠️ Install dependencies
run: |
python -c "import sys; print(sys.version)"
pip install tox
- name: 🚧 Build package and run tests with tox
run: tox -e py
| name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 5'
# See:
# * https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#scheduled-events
# * https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
workflow_dispatch:
# See:
# * https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# * https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- { icon: 🐧, name: ubuntu }
- { icon: 🍎, name: macos }
- { icon: 🧊, name: windows }
pyver:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
runs-on: ${{ matrix.os.name }}-latest
name: ${{ matrix.os.icon }} ${{ matrix.os.name }} | ${{ matrix.pyver }}
steps:
- name: 🧰 Repository Checkout
uses: actions/checkout@v2
- name: 🐍 Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.pyver }}
- name: 🛠️ Install dependencies
run: |
python -c "import sys; print(sys.version)"
pip install tox
- name: 🚧 Build package and run tests with tox
run: tox -e py
| Add CRON and workflow_dispatch events | [CI] Add CRON and workflow_dispatch events
| YAML | bsd-2-clause | lowRISC/edalize,lowRISC/edalize,SymbiFlow/edalize,SymbiFlow/edalize | yaml | ## Code Before:
name: CI
on:
push:
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- { icon: 🐧, name: ubuntu }
- { icon: 🍎, name: macos }
- { icon: 🧊, name: windows }
pyver:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
runs-on: ${{ matrix.os.name }}-latest
name: ${{ matrix.os.icon }} ${{ matrix.os.name }} | ${{ matrix.pyver }}
steps:
- name: 🧰 Repository Checkout
uses: actions/checkout@v2
- name: 🐍 Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.pyver }}
- name: 🛠️ Install dependencies
run: |
python -c "import sys; print(sys.version)"
pip install tox
- name: 🚧 Build package and run tests with tox
run: tox -e py
## Instruction:
[CI] Add CRON and workflow_dispatch events
## Code After:
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 5'
# See:
# * https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#scheduled-events
# * https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
workflow_dispatch:
# See:
# * https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# * https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- { icon: 🐧, name: ubuntu }
- { icon: 🍎, name: macos }
- { icon: 🧊, name: windows }
pyver:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
runs-on: ${{ matrix.os.name }}-latest
name: ${{ matrix.os.icon }} ${{ matrix.os.name }} | ${{ matrix.pyver }}
steps:
- name: 🧰 Repository Checkout
uses: actions/checkout@v2
- name: 🐍 Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.pyver }}
- name: 🛠️ Install dependencies
run: |
python -c "import sys; print(sys.version)"
pip install tox
- name: 🚧 Build package and run tests with tox
run: tox -e py
| name: CI
on:
push:
pull_request:
+ schedule:
+ - cron: '0 0 * * 5'
+ # See:
+ # * https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#scheduled-events
+ # * https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
+ workflow_dispatch:
+ # See:
+ # * https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
+ # * https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- { icon: 🐧, name: ubuntu }
- { icon: 🍎, name: macos }
- { icon: 🧊, name: windows }
pyver:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
runs-on: ${{ matrix.os.name }}-latest
name: ${{ matrix.os.icon }} ${{ matrix.os.name }} | ${{ matrix.pyver }}
steps:
- name: 🧰 Repository Checkout
uses: actions/checkout@v2
- name: 🐍 Set up Python ${{ matrix.pyver }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.pyver }}
- name: 🛠️ Install dependencies
run: |
python -c "import sys; print(sys.version)"
pip install tox
- name: 🚧 Build package and run tests with tox
run: tox -e py | 9 | 0.219512 | 9 | 0 |
31f81fd98a678949b1bb7d14863d497ab40d5afc | locksmith/common.py | locksmith/common.py | import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_signature(params, signkey):
# sorted k,v pairs of everything but signature
data = sorted([(k,v.encode('utf-8')) for k,v in params.iteritems() if k != 'signature'])
qs = urllib.urlencode(data)
return hmac.new(str(signkey), qs, hashlib.sha1).hexdigest()
def apicall(url, signkey, **params):
params['signature'] = get_signature(params, signkey)
data = sorted([(k,v) for k,v in params.iteritems()])
body = urllib.urlencode(data)
urllib2.urlopen(url, body)
| import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_signature(params, signkey):
# sorted k,v pairs of everything but signature
data = sorted([(k,unicode(v).encode('utf-8'))
for k,v in params.iteritems()
if k != 'signature'])
qs = urllib.urlencode(data)
return hmac.new(str(signkey), qs, hashlib.sha1).hexdigest()
def apicall(url, signkey, **params):
params['signature'] = get_signature(params, signkey)
data = sorted([(k,v) for k,v in params.iteritems()])
body = urllib.urlencode(data)
urllib2.urlopen(url, body)
| Convert url param values to unicode before encoding. | Convert url param values to unicode before encoding.
| Python | bsd-3-clause | sunlightlabs/django-locksmith,sunlightlabs/django-locksmith,sunlightlabs/django-locksmith | python | ## Code Before:
import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_signature(params, signkey):
# sorted k,v pairs of everything but signature
data = sorted([(k,v.encode('utf-8')) for k,v in params.iteritems() if k != 'signature'])
qs = urllib.urlencode(data)
return hmac.new(str(signkey), qs, hashlib.sha1).hexdigest()
def apicall(url, signkey, **params):
params['signature'] = get_signature(params, signkey)
data = sorted([(k,v) for k,v in params.iteritems()])
body = urllib.urlencode(data)
urllib2.urlopen(url, body)
## Instruction:
Convert url param values to unicode before encoding.
## Code After:
import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_signature(params, signkey):
# sorted k,v pairs of everything but signature
data = sorted([(k,unicode(v).encode('utf-8'))
for k,v in params.iteritems()
if k != 'signature'])
qs = urllib.urlencode(data)
return hmac.new(str(signkey), qs, hashlib.sha1).hexdigest()
def apicall(url, signkey, **params):
params['signature'] = get_signature(params, signkey)
data = sorted([(k,v) for k,v in params.iteritems()])
body = urllib.urlencode(data)
urllib2.urlopen(url, body)
| import hashlib
import hmac
import urllib, urllib2
API_OPERATING_STATUSES = (
(1, 'Normal'),
(2, 'Degraded Service'),
(3, 'Service Disruption'),
(4, 'Undergoing Maintenance')
)
API_STATUSES = (
(1, 'Active'),
(2, 'Deprecated'),
(3, 'Disabled')
)
KEY_STATUSES = (
('U', 'Unactivated'),
('A', 'Active'),
('S', 'Suspended')
)
UNPUBLISHED, PUBLISHED, NEEDS_UPDATE = range(3)
PUB_STATUSES = (
(UNPUBLISHED, 'Unpublished'),
(PUBLISHED, 'Published'),
(NEEDS_UPDATE, 'Needs Update'),
)
def get_signature(params, signkey):
# sorted k,v pairs of everything but signature
- data = sorted([(k,v.encode('utf-8')) for k,v in params.iteritems() if k != 'signature'])
+ data = sorted([(k,unicode(v).encode('utf-8'))
+ for k,v in params.iteritems()
+ if k != 'signature'])
qs = urllib.urlencode(data)
return hmac.new(str(signkey), qs, hashlib.sha1).hexdigest()
def apicall(url, signkey, **params):
params['signature'] = get_signature(params, signkey)
data = sorted([(k,v) for k,v in params.iteritems()])
body = urllib.urlencode(data)
urllib2.urlopen(url, body)
| 4 | 0.095238 | 3 | 1 |
b6aa0864959157974fb55a56b70c5a0abcb85364 | airstory.php | airstory.php | <?php
/**
* Plugin Name: Airstory
* Plugin URI: http://www.airstory.co/integrations/
* Description: Publish content from Airstory to WordPress.
* Version: 0.1.0
* Author: Liquid Web
* Author URI: https://www.liquidweb.com
* Text Domain: airstory
*
* @package Airstory
*/
namespace Airstory;
define( 'AIRSTORY_DIR', __DIR__ );
require_once AIRSTORY_DIR . '/includes/async-tasks.php';
require_once AIRSTORY_DIR . '/includes/class-api.php';
require_once AIRSTORY_DIR . '/includes/core.php';
require_once AIRSTORY_DIR . '/includes/credentials.php';
require_once AIRSTORY_DIR . '/includes/formatting.php';
require_once AIRSTORY_DIR . '/includes/webhook.php';
| <?php
/**
* Plugin Name: Airstory
* Plugin URI: http://www.airstory.co/integrations/
* Description: Publish content from Airstory to WordPress.
* Version: 0.1.0
* Author: Liquid Web
* Author URI: https://www.liquidweb.com
* Text Domain: airstory
* Domain Path: /languages
*
* @package Airstory
*/
namespace Airstory;
if ( ! defined( 'AIRSTORY_DIR' ) ) {
define( 'AIRSTORY_DIR', __DIR__ );
}
require_once AIRSTORY_DIR . '/includes/async-tasks.php';
require_once AIRSTORY_DIR . '/includes/class-api.php';
require_once AIRSTORY_DIR . '/includes/core.php';
require_once AIRSTORY_DIR . '/includes/credentials.php';
require_once AIRSTORY_DIR . '/includes/formatting.php';
require_once AIRSTORY_DIR . '/includes/webhook.php';
| Add a 'Domain Path' plugin header, and a check around the AIRSTORY_DIR constant definition | Add a 'Domain Path' plugin header, and a check around the AIRSTORY_DIR constant definition
| PHP | mit | liquidweb/airstory-wp,liquidweb/airstory-wp | php | ## Code Before:
<?php
/**
* Plugin Name: Airstory
* Plugin URI: http://www.airstory.co/integrations/
* Description: Publish content from Airstory to WordPress.
* Version: 0.1.0
* Author: Liquid Web
* Author URI: https://www.liquidweb.com
* Text Domain: airstory
*
* @package Airstory
*/
namespace Airstory;
define( 'AIRSTORY_DIR', __DIR__ );
require_once AIRSTORY_DIR . '/includes/async-tasks.php';
require_once AIRSTORY_DIR . '/includes/class-api.php';
require_once AIRSTORY_DIR . '/includes/core.php';
require_once AIRSTORY_DIR . '/includes/credentials.php';
require_once AIRSTORY_DIR . '/includes/formatting.php';
require_once AIRSTORY_DIR . '/includes/webhook.php';
## Instruction:
Add a 'Domain Path' plugin header, and a check around the AIRSTORY_DIR constant definition
## Code After:
<?php
/**
* Plugin Name: Airstory
* Plugin URI: http://www.airstory.co/integrations/
* Description: Publish content from Airstory to WordPress.
* Version: 0.1.0
* Author: Liquid Web
* Author URI: https://www.liquidweb.com
* Text Domain: airstory
* Domain Path: /languages
*
* @package Airstory
*/
namespace Airstory;
if ( ! defined( 'AIRSTORY_DIR' ) ) {
define( 'AIRSTORY_DIR', __DIR__ );
}
require_once AIRSTORY_DIR . '/includes/async-tasks.php';
require_once AIRSTORY_DIR . '/includes/class-api.php';
require_once AIRSTORY_DIR . '/includes/core.php';
require_once AIRSTORY_DIR . '/includes/credentials.php';
require_once AIRSTORY_DIR . '/includes/formatting.php';
require_once AIRSTORY_DIR . '/includes/webhook.php';
| <?php
/**
* Plugin Name: Airstory
* Plugin URI: http://www.airstory.co/integrations/
* Description: Publish content from Airstory to WordPress.
* Version: 0.1.0
* Author: Liquid Web
* Author URI: https://www.liquidweb.com
* Text Domain: airstory
+ * Domain Path: /languages
*
* @package Airstory
*/
namespace Airstory;
+ if ( ! defined( 'AIRSTORY_DIR' ) ) {
- define( 'AIRSTORY_DIR', __DIR__ );
+ define( 'AIRSTORY_DIR', __DIR__ );
? +
+ }
require_once AIRSTORY_DIR . '/includes/async-tasks.php';
require_once AIRSTORY_DIR . '/includes/class-api.php';
require_once AIRSTORY_DIR . '/includes/core.php';
require_once AIRSTORY_DIR . '/includes/credentials.php';
require_once AIRSTORY_DIR . '/includes/formatting.php';
require_once AIRSTORY_DIR . '/includes/webhook.php'; | 5 | 0.217391 | 4 | 1 |
176720d7e4df46cfd777c77db09e7923284f3e15 | .travis.yml | .travis.yml | language: python
python:
- "2.7"
- "3.4"
- "3.5"
install: "pip install -r requirements.txt"
script:
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles || true
- ./verify.py missing examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14
- ./optimize.py check -z 8 examples/optimized_water_125_188_z8.mbtiles
- ./optimize.py remove -z 8 examples/water_125_188_z8-z14.mbtiles > /dev/null
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles
| language: python
python:
- "2.7"
- "3.4"
- "3.5"
install: "pip install -r requirements.txt"
script:
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles || true
- ./verify.py missing examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14
- ./verify.py redundant examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14
- ./optimize.py check -z 8 examples/optimized_water_125_188_z8.mbtiles
- ./optimize.py remove -z 8 examples/water_125_188_z8-z14.mbtiles > /dev/null
- ./verify.py missing examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14 || true
- ./verify.py size -s 500000 examples/water_125_188_z8-z14.mbtiles
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles
| Test redundant and size as well | Test redundant and size as well
| YAML | mit | lukasmartinelli/mbtoolbox | yaml | ## Code Before:
language: python
python:
- "2.7"
- "3.4"
- "3.5"
install: "pip install -r requirements.txt"
script:
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles || true
- ./verify.py missing examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14
- ./optimize.py check -z 8 examples/optimized_water_125_188_z8.mbtiles
- ./optimize.py remove -z 8 examples/water_125_188_z8-z14.mbtiles > /dev/null
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles
## Instruction:
Test redundant and size as well
## Code After:
language: python
python:
- "2.7"
- "3.4"
- "3.5"
install: "pip install -r requirements.txt"
script:
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles || true
- ./verify.py missing examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14
- ./verify.py redundant examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14
- ./optimize.py check -z 8 examples/optimized_water_125_188_z8.mbtiles
- ./optimize.py remove -z 8 examples/water_125_188_z8-z14.mbtiles > /dev/null
- ./verify.py missing examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14 || true
- ./verify.py size -s 500000 examples/water_125_188_z8-z14.mbtiles
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles
| language: python
python:
- "2.7"
- "3.4"
- "3.5"
install: "pip install -r requirements.txt"
script:
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles || true
- ./verify.py missing examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14
+ - ./verify.py redundant examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14
- ./optimize.py check -z 8 examples/optimized_water_125_188_z8.mbtiles
- ./optimize.py remove -z 8 examples/water_125_188_z8-z14.mbtiles > /dev/null
+ - ./verify.py missing examples/water_125_188_z8-z14.mbtiles 125 188 -z 8 -Z 14 || true
+ - ./verify.py size -s 500000 examples/water_125_188_z8-z14.mbtiles
- ./optimize.py check -z 8 examples/water_125_188_z8-z14.mbtiles | 3 | 0.25 | 3 | 0 |
e7a01fa473b9e5d481ba1b0069ff32a208d5d936 | src/selectors/notifications.js | src/selectors/notifications.js | import Immutable from 'immutable'
import { createSelector } from 'reselect'
export const selectAnnouncementCollection = state => state.json.get('announcements', Immutable.Map())
export const selectAnnouncement = createSelector(
[selectAnnouncementCollection], collection =>
collection.first() || Immutable.Map(),
)
export const selectIsAnnouncementUnread = createSelector(
[selectAnnouncementCollection], collection => Boolean(collection && Object.keys(collection)[0]),
)
| import Immutable from 'immutable'
import { createSelector } from 'reselect'
export const selectAnnouncementCollection = state => state.json.get('announcements', Immutable.Map())
export const selectAnnouncement = createSelector(
[selectAnnouncementCollection], collection =>
collection.first() || Immutable.Map(),
)
export const selectIsAnnouncementUnread = createSelector(
[selectAnnouncementCollection], collection => Boolean(collection && collection.size),
)
| Use unread announcement lookup as Immutable object | Use unread announcement lookup as Immutable object
| JavaScript | mit | ello/webapp,ello/webapp,ello/webapp | javascript | ## Code Before:
import Immutable from 'immutable'
import { createSelector } from 'reselect'
export const selectAnnouncementCollection = state => state.json.get('announcements', Immutable.Map())
export const selectAnnouncement = createSelector(
[selectAnnouncementCollection], collection =>
collection.first() || Immutable.Map(),
)
export const selectIsAnnouncementUnread = createSelector(
[selectAnnouncementCollection], collection => Boolean(collection && Object.keys(collection)[0]),
)
## Instruction:
Use unread announcement lookup as Immutable object
## Code After:
import Immutable from 'immutable'
import { createSelector } from 'reselect'
export const selectAnnouncementCollection = state => state.json.get('announcements', Immutable.Map())
export const selectAnnouncement = createSelector(
[selectAnnouncementCollection], collection =>
collection.first() || Immutable.Map(),
)
export const selectIsAnnouncementUnread = createSelector(
[selectAnnouncementCollection], collection => Boolean(collection && collection.size),
)
| import Immutable from 'immutable'
import { createSelector } from 'reselect'
export const selectAnnouncementCollection = state => state.json.get('announcements', Immutable.Map())
export const selectAnnouncement = createSelector(
[selectAnnouncementCollection], collection =>
collection.first() || Immutable.Map(),
)
export const selectIsAnnouncementUnread = createSelector(
- [selectAnnouncementCollection], collection => Boolean(collection && Object.keys(collection)[0]),
? ------------ ^^^^
+ [selectAnnouncementCollection], collection => Boolean(collection && collection.size),
? ^^^^^
)
| 2 | 0.142857 | 1 | 1 |
741020d8e2b34e68c6ecabb607e3985eca30349b | src/main/java/org/mastercoin/rpc/MPBalanceEntry.java | src/main/java/org/mastercoin/rpc/MPBalanceEntry.java | package org.mastercoin.rpc;
import com.google.bitcoin.core.Address;
import java.math.BigDecimal;
/**
* Balance data for a specific Mastercoin CurrencyID in a single Bitcoin address
*
* A Java representation of the JSON entry returned by getallbalancesforid_MP
*/
public class MPBalanceEntry {
private Address address;
private BigDecimal balance;
private BigDecimal reserved;
public MPBalanceEntry(Address address, BigDecimal balance, BigDecimal reserved) {
this.address = address;
this.balance = balance;
this.reserved = reserved;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof MPBalanceEntry)) {
return false;
}
MPBalanceEntry e = (MPBalanceEntry) o;
if ( (this.address == e.address) &&
(this.balance == e.balance) &&
(this.reserved == e.reserved) ) {
return true;
} else {
return false;
}
}
public Address getAddress() {
return address;
}
public BigDecimal getBalance() {
return balance;
}
public BigDecimal getReserved() {
return reserved;
}
}
| package org.mastercoin.rpc;
import com.google.bitcoin.core.Address;
import java.math.BigDecimal;
/**
* Balance data for a specific Mastercoin CurrencyID in a single Bitcoin address
*
* A Java representation of the JSON entry returned by getallbalancesforid_MP
*/
public class MPBalanceEntry {
private Address address;
private BigDecimal balance;
private BigDecimal reserved;
public MPBalanceEntry(Address address, BigDecimal balance, BigDecimal reserved) {
this.address = address;
this.balance = balance;
this.reserved = reserved;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MPBalanceEntry that = (MPBalanceEntry) o;
if (!address.equals(that.address)) return false;
if (!balance.equals(that.balance)) return false;
if (!reserved.equals(that.reserved)) return false;
return true;
}
@Override
public int hashCode() {
int result = address.hashCode();
result = 31 * result + balance.hashCode();
result = 31 * result + reserved.hashCode();
return result;
}
public Address getAddress() {
return address;
}
public BigDecimal getBalance() {
return balance;
}
public BigDecimal getReserved() {
return reserved;
}
}
| Correct equals() implementation, add hashCode() | Correct equals() implementation, add hashCode()
(Use IntelliJ to Generate)
| Java | apache-2.0 | dexX7/OmniJ,OmniLayer/OmniJ,OmniLayer/OmniJ,dexX7/bitcoin-spock,OmniLayer/OmniJ,dexX7/bitcoin-spock,dexX7/OmniJ | java | ## Code Before:
package org.mastercoin.rpc;
import com.google.bitcoin.core.Address;
import java.math.BigDecimal;
/**
* Balance data for a specific Mastercoin CurrencyID in a single Bitcoin address
*
* A Java representation of the JSON entry returned by getallbalancesforid_MP
*/
public class MPBalanceEntry {
private Address address;
private BigDecimal balance;
private BigDecimal reserved;
public MPBalanceEntry(Address address, BigDecimal balance, BigDecimal reserved) {
this.address = address;
this.balance = balance;
this.reserved = reserved;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof MPBalanceEntry)) {
return false;
}
MPBalanceEntry e = (MPBalanceEntry) o;
if ( (this.address == e.address) &&
(this.balance == e.balance) &&
(this.reserved == e.reserved) ) {
return true;
} else {
return false;
}
}
public Address getAddress() {
return address;
}
public BigDecimal getBalance() {
return balance;
}
public BigDecimal getReserved() {
return reserved;
}
}
## Instruction:
Correct equals() implementation, add hashCode()
(Use IntelliJ to Generate)
## Code After:
package org.mastercoin.rpc;
import com.google.bitcoin.core.Address;
import java.math.BigDecimal;
/**
* Balance data for a specific Mastercoin CurrencyID in a single Bitcoin address
*
* A Java representation of the JSON entry returned by getallbalancesforid_MP
*/
public class MPBalanceEntry {
private Address address;
private BigDecimal balance;
private BigDecimal reserved;
public MPBalanceEntry(Address address, BigDecimal balance, BigDecimal reserved) {
this.address = address;
this.balance = balance;
this.reserved = reserved;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MPBalanceEntry that = (MPBalanceEntry) o;
if (!address.equals(that.address)) return false;
if (!balance.equals(that.balance)) return false;
if (!reserved.equals(that.reserved)) return false;
return true;
}
@Override
public int hashCode() {
int result = address.hashCode();
result = 31 * result + balance.hashCode();
result = 31 * result + reserved.hashCode();
return result;
}
public Address getAddress() {
return address;
}
public BigDecimal getBalance() {
return balance;
}
public BigDecimal getReserved() {
return reserved;
}
}
| package org.mastercoin.rpc;
import com.google.bitcoin.core.Address;
import java.math.BigDecimal;
/**
* Balance data for a specific Mastercoin CurrencyID in a single Bitcoin address
*
* A Java representation of the JSON entry returned by getallbalancesforid_MP
*/
public class MPBalanceEntry {
private Address address;
private BigDecimal balance;
private BigDecimal reserved;
public MPBalanceEntry(Address address, BigDecimal balance, BigDecimal reserved) {
this.address = address;
this.balance = balance;
this.reserved = reserved;
}
@Override
public boolean equals(Object o) {
- if (!(o instanceof MPBalanceEntry)) {
- return false;
- }
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
- MPBalanceEntry e = (MPBalanceEntry) o;
? ^
+ MPBalanceEntry that = (MPBalanceEntry) o;
? ^^^^
- if ( (this.address == e.address) &&
- (this.balance == e.balance) &&
- (this.reserved == e.reserved) ) {
+
+ if (!address.equals(that.address)) return false;
+ if (!balance.equals(that.balance)) return false;
+ if (!reserved.equals(that.reserved)) return false;
+
- return true;
? ----
+ return true;
- } else {
- return false;
- }
+ }
+
+ @Override
+ public int hashCode() {
+ int result = address.hashCode();
+ result = 31 * result + balance.hashCode();
+ result = 31 * result + reserved.hashCode();
+ return result;
}
public Address getAddress() {
return address;
}
public BigDecimal getBalance() {
return balance;
}
public BigDecimal getReserved() {
return reserved;
}
} | 29 | 0.591837 | 18 | 11 |
dc253f78a357f36d361f529392969f665a19f1ec | app/helpers/emails_helper.rb | app/helpers/emails_helper.rb | module EmailsHelper
# Mapping from status strings to bootstrap classes
# The naming of the classes is not entirely consistent. There are two variants
def bootstrap_status_mapping(variant = false)
if variant
{
"delivered" => "success",
"soft_bounce" => "warning",
"hard_bounce" => "important",
"unknown" => nil
}
else
{
"delivered" => "success",
"soft_bounce" => "warning",
"hard_bounce" => "error",
"unknown" => nil
}
end
end
# Give a warning level (used for colouring things in Bootstrap) based on whether the email has
# been delivered succesfully
def row_status_class(status)
raise "Unknown status" unless bootstrap_status_mapping.has_key?(status)
bootstrap_status_mapping[status]
end
def status_class_category(status)
raise "Unknown status" unless bootstrap_status_mapping(true).has_key?(status)
bootstrap_status_mapping(true)[status]
end
def label_class(status)
["label", ("label-#{status_class_category(status)}" if status_class_category(status))]
end
def status_name(status)
case status
when "delivered"
"Delivered"
when "soft_bounce"
"Soft bounce"
when "hard_bounce"
"Hard bounce"
when "unknown"
"Unknown"
else
raise "Unknown status"
end
end
def delivered_label(status)
content_tag(:span, status_name(status), :class => label_class(status))
end
end
| module EmailsHelper
# Mapping from status strings to bootstrap classes
# The naming of the classes is not entirely consistent. There are two variants
def bootstrap_status_mapping(variant = false)
map = {
"delivered" => "success",
"soft_bounce" => "warning",
"unknown" => nil
}
map["hard_bounce"] = variant ? "important" : "error"
map
end
# Give a warning level (used for colouring things in Bootstrap) based on whether the email has
# been delivered succesfully
def row_status_class(status)
raise "Unknown status" unless bootstrap_status_mapping.has_key?(status)
bootstrap_status_mapping[status]
end
def status_class_category(status)
raise "Unknown status" unless bootstrap_status_mapping(true).has_key?(status)
bootstrap_status_mapping(true)[status]
end
def label_class(status)
["label", ("label-#{status_class_category(status)}" if status_class_category(status))]
end
def status_name(status)
case status
when "delivered"
"Delivered"
when "soft_bounce"
"Soft bounce"
when "hard_bounce"
"Hard bounce"
when "unknown"
"Unknown"
else
raise "Unknown status"
end
end
def delivered_label(status)
content_tag(:span, status_name(status), :class => label_class(status))
end
end
| Remove duplication between two variants of map | Remove duplication between two variants of map
| Ruby | agpl-3.0 | idlweb/cuttlefish,pratyushmittal/cuttlefish,pratyushmittal/cuttlefish,idlweb/cuttlefish,idlweb/cuttlefish,pratyushmittal/cuttlefish,pratyushmittal/cuttlefish,idlweb/cuttlefish | ruby | ## Code Before:
module EmailsHelper
# Mapping from status strings to bootstrap classes
# The naming of the classes is not entirely consistent. There are two variants
def bootstrap_status_mapping(variant = false)
if variant
{
"delivered" => "success",
"soft_bounce" => "warning",
"hard_bounce" => "important",
"unknown" => nil
}
else
{
"delivered" => "success",
"soft_bounce" => "warning",
"hard_bounce" => "error",
"unknown" => nil
}
end
end
# Give a warning level (used for colouring things in Bootstrap) based on whether the email has
# been delivered succesfully
def row_status_class(status)
raise "Unknown status" unless bootstrap_status_mapping.has_key?(status)
bootstrap_status_mapping[status]
end
def status_class_category(status)
raise "Unknown status" unless bootstrap_status_mapping(true).has_key?(status)
bootstrap_status_mapping(true)[status]
end
def label_class(status)
["label", ("label-#{status_class_category(status)}" if status_class_category(status))]
end
def status_name(status)
case status
when "delivered"
"Delivered"
when "soft_bounce"
"Soft bounce"
when "hard_bounce"
"Hard bounce"
when "unknown"
"Unknown"
else
raise "Unknown status"
end
end
def delivered_label(status)
content_tag(:span, status_name(status), :class => label_class(status))
end
end
## Instruction:
Remove duplication between two variants of map
## Code After:
module EmailsHelper
# Mapping from status strings to bootstrap classes
# The naming of the classes is not entirely consistent. There are two variants
def bootstrap_status_mapping(variant = false)
map = {
"delivered" => "success",
"soft_bounce" => "warning",
"unknown" => nil
}
map["hard_bounce"] = variant ? "important" : "error"
map
end
# Give a warning level (used for colouring things in Bootstrap) based on whether the email has
# been delivered succesfully
def row_status_class(status)
raise "Unknown status" unless bootstrap_status_mapping.has_key?(status)
bootstrap_status_mapping[status]
end
def status_class_category(status)
raise "Unknown status" unless bootstrap_status_mapping(true).has_key?(status)
bootstrap_status_mapping(true)[status]
end
def label_class(status)
["label", ("label-#{status_class_category(status)}" if status_class_category(status))]
end
def status_name(status)
case status
when "delivered"
"Delivered"
when "soft_bounce"
"Soft bounce"
when "hard_bounce"
"Hard bounce"
when "unknown"
"Unknown"
else
raise "Unknown status"
end
end
def delivered_label(status)
content_tag(:span, status_name(status), :class => label_class(status))
end
end
| module EmailsHelper
# Mapping from status strings to bootstrap classes
# The naming of the classes is not entirely consistent. There are two variants
def bootstrap_status_mapping(variant = false)
- if variant
- {
+ map = {
? +++ +
- "delivered" => "success",
? --
+ "delivered" => "success",
- "soft_bounce" => "warning",
? --
+ "soft_bounce" => "warning",
- "hard_bounce" => "important",
- "unknown" => nil
? --
+ "unknown" => nil
- }
? --
+ }
+ map["hard_bounce"] = variant ? "important" : "error"
+ map
- else
- {
- "delivered" => "success",
- "soft_bounce" => "warning",
- "hard_bounce" => "error",
- "unknown" => nil
- }
- end
end
# Give a warning level (used for colouring things in Bootstrap) based on whether the email has
# been delivered succesfully
def row_status_class(status)
raise "Unknown status" unless bootstrap_status_mapping.has_key?(status)
bootstrap_status_mapping[status]
end
def status_class_category(status)
raise "Unknown status" unless bootstrap_status_mapping(true).has_key?(status)
bootstrap_status_mapping(true)[status]
end
def label_class(status)
["label", ("label-#{status_class_category(status)}" if status_class_category(status))]
end
def status_name(status)
case status
when "delivered"
"Delivered"
when "soft_bounce"
"Soft bounce"
when "hard_bounce"
"Hard bounce"
when "unknown"
"Unknown"
else
raise "Unknown status"
end
end
def delivered_label(status)
content_tag(:span, status_name(status), :class => label_class(status))
end
end | 22 | 0.392857 | 7 | 15 |
5c89aa079d94fe70bb5627eb67404bc65b80212a | sympy/solvers/decompogen.py | sympy/solvers/decompogen.py | from sympy.core import Function, Pow, sympify
from sympy.polys import Poly
def decompogen(f, symbol):
"""
Computes General functional decomposition of ``f``.
Given an expression ``f``, returns a list ``[f_1, f_2, ..., f_n]``,
where::
f = f_1 o f_2 o ... f_n = f_1(f_2(... f_n))
Note: This is a General decomposition function. For Polynomial
decomposition see ``decompose`` in polys.
Examples
========
>>> from sympy.solvers.decompogen import decompogen
>>> from sympy.abc import x
>>> from sympy import sqrt, sin, cos
>>> decompogen(sin(cos(x)), x)
[sin(x), cos(x)]
>>> decompogen(sin(x)**2 + sin(x) + 1, x)
[x**2 + x + 1, sin(x)]
>>> decompogen(sqrt(6*x**2 - 5), x)
[sqrt(x), 6*x**2 - 5]
"""
f = sympify(f)
# ===== Simple Functions ===== #
if isinstance(f, (Function, Pow)):
return [f.subs(f.args[0], symbol), f.args[0]]
# ===== Convert to Polynomial ===== #
fp = Poly(f)
gens = fp.gens
if len(gens) == 1:
f1 = f.subs(gens[0], symbol)
f2 = gens[0]
return [f1, f2]
| from sympy.core import Function, Pow, sympify
from sympy.polys import Poly
def decompogen(f, symbol):
"""
Computes General functional decomposition of ``f``.
Given an expression ``f``, returns a list ``[f_1, f_2, ..., f_n]``,
where::
f = f_1 o f_2 o ... f_n = f_1(f_2(... f_n))
Note: This is a General decomposition function. For Polynomial
decomposition see ``decompose`` in polys.
Examples
========
>>> from sympy.solvers.decompogen import decompogen
>>> from sympy.abc import x
>>> from sympy import sqrt, sin, cos
>>> decompogen(sin(cos(x)), x)
[sin(x), cos(x)]
>>> decompogen(sin(x)**2 + sin(x) + 1, x)
[x**2 + x + 1, sin(x)]
>>> decompogen(sqrt(6*x**2 - 5), x)
[sqrt(x), 6*x**2 - 5]
"""
f = sympify(f)
# ===== Simple Functions ===== #
if isinstance(f, (Function, Pow)):
return [f.subs(f.args[0], symbol), f.args[0]]
# ===== Convert to Polynomial ===== #
fp = Poly(f)
gens = fp.gens
if len(gens) == 1:
f1 = f.subs(gens[0], symbol)
f2 = gens[0]
return [f1, f2]
return [f]
| Return `f` if no decomposition | Return `f` if no decomposition
Signed-off-by: AMiT Kumar <a9f82ad3e8c446d8f49d5b7e05ec2c64a9e15ea9@gmail.com>
| Python | bsd-3-clause | drufat/sympy,ChristinaZografou/sympy,chaffra/sympy,Vishluck/sympy,skidzo/sympy,ga7g08/sympy,wanglongqi/sympy,mafiya69/sympy,ga7g08/sympy,Davidjohnwilson/sympy,yashsharan/sympy,mcdaniel67/sympy,hargup/sympy,postvakje/sympy,Davidjohnwilson/sympy,VaibhavAgarwalVA/sympy,kaushik94/sympy,ChristinaZografou/sympy,MechCoder/sympy,MechCoder/sympy,Shaswat27/sympy,emon10005/sympy,kaichogami/sympy,jaimahajan1997/sympy,Shaswat27/sympy,kaushik94/sympy,Arafatk/sympy,Titan-C/sympy,kevalds51/sympy,jaimahajan1997/sympy,oliverlee/sympy,mafiya69/sympy,maniteja123/sympy,postvakje/sympy,drufat/sympy,AkademieOlympia/sympy,wanglongqi/sympy,madan96/sympy,abhiii5459/sympy,jerli/sympy,iamutkarshtiwari/sympy,Davidjohnwilson/sympy,lindsayad/sympy,madan96/sympy,ChristinaZografou/sympy,jerli/sympy,souravsingh/sympy,postvakje/sympy,rahuldan/sympy,saurabhjn76/sympy,ahhda/sympy,aktech/sympy,Titan-C/sympy,kaushik94/sympy,chaffra/sympy,madan96/sympy,lindsayad/sympy,wanglongqi/sympy,kevalds51/sympy,iamutkarshtiwari/sympy,jbbskinny/sympy,oliverlee/sympy,aktech/sympy,souravsingh/sympy,maniteja123/sympy,ahhda/sympy,iamutkarshtiwari/sympy,Curious72/sympy,emon10005/sympy,Titan-C/sympy,skidzo/sympy,Vishluck/sympy,ahhda/sympy,saurabhjn76/sympy,aktech/sympy,sampadsaha5/sympy,ga7g08/sympy,MechCoder/sympy,sampadsaha5/sympy,mcdaniel67/sympy,emon10005/sympy,jbbskinny/sympy,farhaanbukhsh/sympy,Curious72/sympy,VaibhavAgarwalVA/sympy,kevalds51/sympy,sahmed95/sympy,saurabhjn76/sympy,sahmed95/sympy,Arafatk/sympy,rahuldan/sympy,mcdaniel67/sympy,rahuldan/sympy,Shaswat27/sympy,yashsharan/sympy,abhiii5459/sympy,mafiya69/sympy,Vishluck/sympy,Arafatk/sympy,AkademieOlympia/sympy,skidzo/sympy,Curious72/sympy,souravsingh/sympy,AkademieOlympia/sympy,VaibhavAgarwalVA/sympy,sahmed95/sympy,jbbskinny/sympy,hargup/sympy,hargup/sympy,abhiii5459/sympy,farhaanbukhsh/sympy,kaichogami/sympy,chaffra/sympy,kaichogami/sympy,sampadsaha5/sympy,farhaanbukhsh/sympy,yashsharan/sympy,jerli/sympy,maniteja123/sympy,jaimahajan1997/sympy,oliverlee/sympy,lindsayad/sympy,drufat/sympy | python | ## Code Before:
from sympy.core import Function, Pow, sympify
from sympy.polys import Poly
def decompogen(f, symbol):
"""
Computes General functional decomposition of ``f``.
Given an expression ``f``, returns a list ``[f_1, f_2, ..., f_n]``,
where::
f = f_1 o f_2 o ... f_n = f_1(f_2(... f_n))
Note: This is a General decomposition function. For Polynomial
decomposition see ``decompose`` in polys.
Examples
========
>>> from sympy.solvers.decompogen import decompogen
>>> from sympy.abc import x
>>> from sympy import sqrt, sin, cos
>>> decompogen(sin(cos(x)), x)
[sin(x), cos(x)]
>>> decompogen(sin(x)**2 + sin(x) + 1, x)
[x**2 + x + 1, sin(x)]
>>> decompogen(sqrt(6*x**2 - 5), x)
[sqrt(x), 6*x**2 - 5]
"""
f = sympify(f)
# ===== Simple Functions ===== #
if isinstance(f, (Function, Pow)):
return [f.subs(f.args[0], symbol), f.args[0]]
# ===== Convert to Polynomial ===== #
fp = Poly(f)
gens = fp.gens
if len(gens) == 1:
f1 = f.subs(gens[0], symbol)
f2 = gens[0]
return [f1, f2]
## Instruction:
Return `f` if no decomposition
Signed-off-by: AMiT Kumar <a9f82ad3e8c446d8f49d5b7e05ec2c64a9e15ea9@gmail.com>
## Code After:
from sympy.core import Function, Pow, sympify
from sympy.polys import Poly
def decompogen(f, symbol):
"""
Computes General functional decomposition of ``f``.
Given an expression ``f``, returns a list ``[f_1, f_2, ..., f_n]``,
where::
f = f_1 o f_2 o ... f_n = f_1(f_2(... f_n))
Note: This is a General decomposition function. For Polynomial
decomposition see ``decompose`` in polys.
Examples
========
>>> from sympy.solvers.decompogen import decompogen
>>> from sympy.abc import x
>>> from sympy import sqrt, sin, cos
>>> decompogen(sin(cos(x)), x)
[sin(x), cos(x)]
>>> decompogen(sin(x)**2 + sin(x) + 1, x)
[x**2 + x + 1, sin(x)]
>>> decompogen(sqrt(6*x**2 - 5), x)
[sqrt(x), 6*x**2 - 5]
"""
f = sympify(f)
# ===== Simple Functions ===== #
if isinstance(f, (Function, Pow)):
return [f.subs(f.args[0], symbol), f.args[0]]
# ===== Convert to Polynomial ===== #
fp = Poly(f)
gens = fp.gens
if len(gens) == 1:
f1 = f.subs(gens[0], symbol)
f2 = gens[0]
return [f1, f2]
return [f]
| from sympy.core import Function, Pow, sympify
from sympy.polys import Poly
def decompogen(f, symbol):
"""
Computes General functional decomposition of ``f``.
Given an expression ``f``, returns a list ``[f_1, f_2, ..., f_n]``,
where::
f = f_1 o f_2 o ... f_n = f_1(f_2(... f_n))
Note: This is a General decomposition function. For Polynomial
decomposition see ``decompose`` in polys.
Examples
========
>>> from sympy.solvers.decompogen import decompogen
>>> from sympy.abc import x
>>> from sympy import sqrt, sin, cos
>>> decompogen(sin(cos(x)), x)
[sin(x), cos(x)]
>>> decompogen(sin(x)**2 + sin(x) + 1, x)
[x**2 + x + 1, sin(x)]
>>> decompogen(sqrt(6*x**2 - 5), x)
[sqrt(x), 6*x**2 - 5]
"""
f = sympify(f)
# ===== Simple Functions ===== #
if isinstance(f, (Function, Pow)):
return [f.subs(f.args[0], symbol), f.args[0]]
# ===== Convert to Polynomial ===== #
fp = Poly(f)
gens = fp.gens
if len(gens) == 1:
f1 = f.subs(gens[0], symbol)
f2 = gens[0]
return [f1, f2]
+
+ return [f] | 2 | 0.047619 | 2 | 0 |
f23509bf6026b969c7317fb51adc1910083bce36 | src/styles/partials/AdminMenu.scss | src/styles/partials/AdminMenu.scss | @import '../Constants';
.AdminMenu__mainItem {
font-weight: bold !important;
}
.AdminMenu__item {
padding-left: 16px !important;
}
@media only screen and (min-width: $screen-min-sm) {
.AdminMenu__show-xs {
display: none !important;
}
}
@media only screen and (max-width: $screen-max-xs) {
.AdminMenu__hide-xs {
display: none !important;
}
}
| @import '../Constants';
.AdminMenu__mainItem {
}
.AdminMenu__item {
padding-left: 16px !important;
}
@media only screen and (min-width: $screen-min-sm) {
.AdminMenu__show-xs {
display: none !important;
}
}
@media only screen and (max-width: $screen-max-xs) {
.AdminMenu__hide-xs {
display: none !important;
}
}
| Remove bold on main items in menu | Remove bold on main items in menu
| SCSS | mit | ungdev/flux2-client,ungdev/flux2-client,ungdev/flux2-client | scss | ## Code Before:
@import '../Constants';
.AdminMenu__mainItem {
font-weight: bold !important;
}
.AdminMenu__item {
padding-left: 16px !important;
}
@media only screen and (min-width: $screen-min-sm) {
.AdminMenu__show-xs {
display: none !important;
}
}
@media only screen and (max-width: $screen-max-xs) {
.AdminMenu__hide-xs {
display: none !important;
}
}
## Instruction:
Remove bold on main items in menu
## Code After:
@import '../Constants';
.AdminMenu__mainItem {
}
.AdminMenu__item {
padding-left: 16px !important;
}
@media only screen and (min-width: $screen-min-sm) {
.AdminMenu__show-xs {
display: none !important;
}
}
@media only screen and (max-width: $screen-max-xs) {
.AdminMenu__hide-xs {
display: none !important;
}
}
| @import '../Constants';
.AdminMenu__mainItem {
- font-weight: bold !important;
}
.AdminMenu__item {
padding-left: 16px !important;
}
@media only screen and (min-width: $screen-min-sm) {
.AdminMenu__show-xs {
display: none !important;
}
}
@media only screen and (max-width: $screen-max-xs) {
.AdminMenu__hide-xs {
display: none !important;
}
} | 1 | 0.045455 | 0 | 1 |
af57a9fcebc08867bc29e1c241a0e9768a3da318 | .travis.yml | .travis.yml | language: ruby
notifications:
email: false
webhooks: https://getchef.slack.com/services/hooks/travis?token=ECftsW2P2itUaz1MhfiU6cS4
rvm:
- 2.0.0
before_script:
- psql -c 'create database supermarket_test;' -U postgres
- cp .env.example .env
- bundle exec rake db:schema:load
bundler_args: --without development
script: bundle exec rspec && bundle exec rake spec:javascripts
env:
global:
secure: 3FQQOyNDbi98izCrHovUld+Laj+y7ENcMraVlpgge4q12PysndHWz5zU/VrSo/3ZInE3u36Mn2dH95nnM+kXa8rfpXtDh23YjinW4vkA1FTnnt/yppdksvY1K+K7QePIvGfmVU/Y7kq6C3k4R3kB99cN+luf5oVdby9kePFkQHc=
| language: ruby
notifications:
email: false
webhooks: https://getchef.slack.com/services/hooks/travis?token=ECftsW2P2itUaz1MhfiU6cS4
rvm:
- 2.0.0
before_script:
- psql -c 'create database supermarket_test;' -U postgres
- cp .env.example .env
- bundle exec rake db:schema:load
bundler_args: --without development
script: bundle exec rspec && bundle exec rake spec:javascripts
services:
- redis-server
env:
global:
secure: "rzoy57s+oxvw27HStU1VNHN7fS525ocQo11bmASbwG5Ax6I4X/dwWofQCoZPoGrXisMw5RQaa7e3bHJpATZsMJC67Sf6gbfSOIYY7tISXuCFh9q/19YPGltdwZkP3OgawEpufA8zcMHzD5nvWNXq4c4TKRdtX6mHQVIAOJ9u6qY="
| Add redis and GitHub access token to Travis config | Add redis and GitHub access token to Travis config
Note: the GitHub access token is encrypted. B)
| YAML | apache-2.0 | nellshamrell/supermarket,jzohrab/supermarket,leftathome/supermarket,juliandunn/supermarket,nellshamrell/supermarket,robbkidd/supermarket,rafaelmagu/supermarket,jzohrab/supermarket,rafaelmagu/supermarket,tas50/supermarket,dpnl87/supermarket,chef/supermarket,chef/supermarket,nellshamrell/supermarket,leftathome/supermarket,chef/supermarket,robbkidd/supermarket,chef/supermarket,robbkidd/supermarket,tas50/supermarket,jzohrab/supermarket,robbkidd/supermarket,juliandunn/supermarket,chef/supermarket,jzohrab/supermarket,rafaelmagu/supermarket,nellshamrell/supermarket,juliandunn/supermarket,tas50/supermarket,dpnl87/supermarket,leftathome/supermarket,leftathome/supermarket,juliandunn/supermarket,dpnl87/supermarket,rafaelmagu/supermarket,dpnl87/supermarket,tas50/supermarket | yaml | ## Code Before:
language: ruby
notifications:
email: false
webhooks: https://getchef.slack.com/services/hooks/travis?token=ECftsW2P2itUaz1MhfiU6cS4
rvm:
- 2.0.0
before_script:
- psql -c 'create database supermarket_test;' -U postgres
- cp .env.example .env
- bundle exec rake db:schema:load
bundler_args: --without development
script: bundle exec rspec && bundle exec rake spec:javascripts
env:
global:
secure: 3FQQOyNDbi98izCrHovUld+Laj+y7ENcMraVlpgge4q12PysndHWz5zU/VrSo/3ZInE3u36Mn2dH95nnM+kXa8rfpXtDh23YjinW4vkA1FTnnt/yppdksvY1K+K7QePIvGfmVU/Y7kq6C3k4R3kB99cN+luf5oVdby9kePFkQHc=
## Instruction:
Add redis and GitHub access token to Travis config
Note: the GitHub access token is encrypted. B)
## Code After:
language: ruby
notifications:
email: false
webhooks: https://getchef.slack.com/services/hooks/travis?token=ECftsW2P2itUaz1MhfiU6cS4
rvm:
- 2.0.0
before_script:
- psql -c 'create database supermarket_test;' -U postgres
- cp .env.example .env
- bundle exec rake db:schema:load
bundler_args: --without development
script: bundle exec rspec && bundle exec rake spec:javascripts
services:
- redis-server
env:
global:
secure: "rzoy57s+oxvw27HStU1VNHN7fS525ocQo11bmASbwG5Ax6I4X/dwWofQCoZPoGrXisMw5RQaa7e3bHJpATZsMJC67Sf6gbfSOIYY7tISXuCFh9q/19YPGltdwZkP3OgawEpufA8zcMHzD5nvWNXq4c4TKRdtX6mHQVIAOJ9u6qY="
| language: ruby
notifications:
email: false
webhooks: https://getchef.slack.com/services/hooks/travis?token=ECftsW2P2itUaz1MhfiU6cS4
rvm:
- 2.0.0
before_script:
- psql -c 'create database supermarket_test;' -U postgres
- cp .env.example .env
- bundle exec rake db:schema:load
bundler_args: --without development
script: bundle exec rspec && bundle exec rake spec:javascripts
+ services:
+ - redis-server
env:
global:
- secure: 3FQQOyNDbi98izCrHovUld+Laj+y7ENcMraVlpgge4q12PysndHWz5zU/VrSo/3ZInE3u36Mn2dH95nnM+kXa8rfpXtDh23YjinW4vkA1FTnnt/yppdksvY1K+K7QePIvGfmVU/Y7kq6C3k4R3kB99cN+luf5oVdby9kePFkQHc=
+ secure: "rzoy57s+oxvw27HStU1VNHN7fS525ocQo11bmASbwG5Ax6I4X/dwWofQCoZPoGrXisMw5RQaa7e3bHJpATZsMJC67Sf6gbfSOIYY7tISXuCFh9q/19YPGltdwZkP3OgawEpufA8zcMHzD5nvWNXq4c4TKRdtX6mHQVIAOJ9u6qY=" | 4 | 0.266667 | 3 | 1 |
8003030e38d8a716ad3f8b3fe3363c06f963ccf2 | buffalo/index.markdown | buffalo/index.markdown | ---
layout: default
title: OpenHack - Buffalo
---
## Buffalo

### Info
OpenHack Buffalo meets at [CoworkBuffalo](http://coworkbuffalo.com) every other Tuesday at 7pm.
Please RSVP on [Meetup](http://www.meetup.com/Western-New-York-Ruby/) so we know how much food to get!
### Next meetups
* [December 4, 2012](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyqqbgb/)
* [December 18, 2012](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyqqbxb/)
* [January 1, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbcb/)
* [January 15, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbtb/)
### Past meetups
* October 9, 2012 (15 attendees)
* October 23, 2012 (19 attendees)
* November 6, 2012 (12 attendees)
* November 20, 2012 (13 attendees) | ---
layout: default
title: OpenHack - Buffalo
---
## Buffalo

### Info
OpenHack Buffalo meets at [CoworkBuffalo](http://coworkbuffalo.com) every other Tuesday at 7pm.
Please RSVP on [Meetup](http://www.meetup.com/Western-New-York-Ruby/) so we know how much food to get!
### Next meetups
* [December 18, 2012](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyqqbxb/)
* [January 1, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbcb/)
* [January 15, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbtb/)
* [January 29, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbmc/)
### Past meetups
* October 9, 2012 (15 attendees)
* October 23, 2012 (19 attendees)
* November 6, 2012 (12 attendees)
* November 20, 2012 (13 attendees)
* December 4, 2012 (18 attendeess) | Update markdown to show new meetup | Update markdown to show new meetup | Markdown | mit | OpenHack/openhack.github.com,imrehg/openhacktest,ilikepi/openhack.github.com,NeftaliYagua/openhackve.github.io-bk,dideler/openhack.github.com,ridingwolf/openhack.github.com,NeftaliYagua/openhackve.github.io-bk,ilikepi/openhack.github.com,ilikepi/openhack.github.com,twinn/openhack.github.com,ridingwolf/openhack.github.com,clone1018/openhack.github.com,imrehg/openhacktest,geopet/openhack.github.com,robdudley/openhack.github.com,OpenHack/openhack.github.com,clone1018/openhack.github.com,clone1018/openhack.github.com,dideler/openhack.github.com,OpenHack/openhack.github.com,twinn/openhack.github.com,robdudley/openhack.github.com,geopet/openhack.github.com,geopet/openhack.github.com,twinn/openhack.github.com,ridingwolf/openhack.github.com,robdudley/openhack.github.com,NeftaliYagua/openhackve.github.io-bk,dideler/openhack.github.com | markdown | ## Code Before:
---
layout: default
title: OpenHack - Buffalo
---
## Buffalo

### Info
OpenHack Buffalo meets at [CoworkBuffalo](http://coworkbuffalo.com) every other Tuesday at 7pm.
Please RSVP on [Meetup](http://www.meetup.com/Western-New-York-Ruby/) so we know how much food to get!
### Next meetups
* [December 4, 2012](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyqqbgb/)
* [December 18, 2012](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyqqbxb/)
* [January 1, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbcb/)
* [January 15, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbtb/)
### Past meetups
* October 9, 2012 (15 attendees)
* October 23, 2012 (19 attendees)
* November 6, 2012 (12 attendees)
* November 20, 2012 (13 attendees)
## Instruction:
Update markdown to show new meetup
## Code After:
---
layout: default
title: OpenHack - Buffalo
---
## Buffalo

### Info
OpenHack Buffalo meets at [CoworkBuffalo](http://coworkbuffalo.com) every other Tuesday at 7pm.
Please RSVP on [Meetup](http://www.meetup.com/Western-New-York-Ruby/) so we know how much food to get!
### Next meetups
* [December 18, 2012](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyqqbxb/)
* [January 1, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbcb/)
* [January 15, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbtb/)
* [January 29, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbmc/)
### Past meetups
* October 9, 2012 (15 attendees)
* October 23, 2012 (19 attendees)
* November 6, 2012 (12 attendees)
* November 20, 2012 (13 attendees)
* December 4, 2012 (18 attendeess) | ---
layout: default
title: OpenHack - Buffalo
---
## Buffalo

### Info
OpenHack Buffalo meets at [CoworkBuffalo](http://coworkbuffalo.com) every other Tuesday at 7pm.
Please RSVP on [Meetup](http://www.meetup.com/Western-New-York-Ruby/) so we know how much food to get!
### Next meetups
- * [December 4, 2012](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyqqbgb/)
* [December 18, 2012](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyqqbxb/)
* [January 1, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbcb/)
* [January 15, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbtb/)
+ * [January 29, 2013](http://www.meetup.com/Western-New-York-Ruby/events/dfqlpdyrcbmc/)
### Past meetups
* October 9, 2012 (15 attendees)
* October 23, 2012 (19 attendees)
* November 6, 2012 (12 attendees)
* November 20, 2012 (13 attendees)
+ * December 4, 2012 (18 attendeess) | 3 | 0.107143 | 2 | 1 |
4c32cddef89eeaa9aa1a5f07b65508a246c7ef61 | tests/ffi/regress_37100_test.dart | tests/ffi/regress_37100_test.dart | // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:ffi';
import "package:expect/expect.dart";
import 'dylib_utils.dart';
class EVP_MD extends Pointer<Void> {}
DynamicLibrary ffiTestFunctions = dlopenPlatformSpecific("ffi_test_functions");
final EVP_sha1 = ffiTestFunctions
.lookupFunction<EVP_MD Function(), EVP_MD Function()>('LargePointer');
main() {
int result = EVP_sha1().address;
// On 32 bit only the lowest 32 bits are returned, so only test those.
result &= 0x00000000FFFFFFFF;
Expect.equals(0x0000000082000000, result);
}
| // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// SharedObjects=ffi_test_functions
import 'dart:ffi';
import "package:expect/expect.dart";
import 'dylib_utils.dart';
class EVP_MD extends Pointer<Void> {}
DynamicLibrary ffiTestFunctions = dlopenPlatformSpecific("ffi_test_functions");
final EVP_sha1 = ffiTestFunctions
.lookupFunction<EVP_MD Function(), EVP_MD Function()>('LargePointer');
main() {
int result = EVP_sha1().address;
// On 32 bit only the lowest 32 bits are returned, so only test those.
result &= 0x00000000FFFFFFFF;
Expect.equals(0x0000000082000000, result);
}
| Fix ffi trampoline class finalization - fix test on android | [vm/ffi] Fix ffi trampoline class finalization - fix test on android
Change-Id: I4389667701de45827e093305bdda8443520abe54
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103844
Commit-Queue: Daco Harkes <930cbae0ca77f1954c53e32620d89cfcca318f00@google.com>
Reviewed-by: Daco Harkes <930cbae0ca77f1954c53e32620d89cfcca318f00@google.com>
| Dart | bsd-3-clause | dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk | dart | ## Code Before:
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:ffi';
import "package:expect/expect.dart";
import 'dylib_utils.dart';
class EVP_MD extends Pointer<Void> {}
DynamicLibrary ffiTestFunctions = dlopenPlatformSpecific("ffi_test_functions");
final EVP_sha1 = ffiTestFunctions
.lookupFunction<EVP_MD Function(), EVP_MD Function()>('LargePointer');
main() {
int result = EVP_sha1().address;
// On 32 bit only the lowest 32 bits are returned, so only test those.
result &= 0x00000000FFFFFFFF;
Expect.equals(0x0000000082000000, result);
}
## Instruction:
[vm/ffi] Fix ffi trampoline class finalization - fix test on android
Change-Id: I4389667701de45827e093305bdda8443520abe54
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103844
Commit-Queue: Daco Harkes <930cbae0ca77f1954c53e32620d89cfcca318f00@google.com>
Reviewed-by: Daco Harkes <930cbae0ca77f1954c53e32620d89cfcca318f00@google.com>
## Code After:
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// SharedObjects=ffi_test_functions
import 'dart:ffi';
import "package:expect/expect.dart";
import 'dylib_utils.dart';
class EVP_MD extends Pointer<Void> {}
DynamicLibrary ffiTestFunctions = dlopenPlatformSpecific("ffi_test_functions");
final EVP_sha1 = ffiTestFunctions
.lookupFunction<EVP_MD Function(), EVP_MD Function()>('LargePointer');
main() {
int result = EVP_sha1().address;
// On 32 bit only the lowest 32 bits are returned, so only test those.
result &= 0x00000000FFFFFFFF;
Expect.equals(0x0000000082000000, result);
}
| // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+ //
+ // SharedObjects=ffi_test_functions
import 'dart:ffi';
import "package:expect/expect.dart";
import 'dylib_utils.dart';
class EVP_MD extends Pointer<Void> {}
DynamicLibrary ffiTestFunctions = dlopenPlatformSpecific("ffi_test_functions");
final EVP_sha1 = ffiTestFunctions
.lookupFunction<EVP_MD Function(), EVP_MD Function()>('LargePointer');
main() {
int result = EVP_sha1().address;
// On 32 bit only the lowest 32 bits are returned, so only test those.
result &= 0x00000000FFFFFFFF;
Expect.equals(0x0000000082000000, result);
} | 2 | 0.086957 | 2 | 0 |
245bc2bf935cb8aecba4c4e3707f1c5ebe1ec5e0 | server/server.js | server/server.js | var express = require('express');
var passport = require('passport');
var util = require('./lib/utility.js');
// Load environment variables
if (process.env.NODE_ENV !== 'integration') {
require('dotenv').config({ path: './env/.env' });
}
var app = express();
// Initial Configuration, Static Assets, & View Engine Configuration
require('./config/initialize.js')(app, express);
// Authentication Middleware: Express Sessions, Passport Strategy
require('./config/auth.js')(app, express, passport);
// Pre-Authentication Routes & OAuth Requests
require('./routes/auth-routes.js')(app, passport);
//Authentication check currently commented out, uncomment line to re-activate
app.use(util.ensureAuthenticated);
// View Routes
require('./routes/view-routes.js')(app);
// API Routes
// require('./routes/api-routes.js')(app);
// Wildcard route
app.get('/*', function(req, res) {
res.redirect('/');
})
app.listen(Number(process.env.PORT), process.env.HOST, function() {
console.log(process.env.APP_NAME + ' is listening at ' + process.env.HOST + ' on port ' + process.env.PORT + '.')
}); | // Load environment variables
if (process.env.NODE_ENV !== 'integration') {
require('dotenv').config({ path: './env/.env' });
}
var express = require('express');
var passport = require('passport');
var util = require('./lib/utility.js');
var app = express();
// Initial Configuration, Static Assets, & View Engine Configuration
require('./config/initialize.js')(app, express);
// Authentication Middleware: Express Sessions, Passport Strategy
require('./config/auth.js')(app, express, passport);
// Pre-Authentication Routes & OAuth Requests
require('./routes/auth-routes.js')(app, passport);
//Authentication check currently commented out, uncomment line to re-activate
app.use(util.ensureAuthenticated);
// View Routes
require('./routes/view-routes.js')(app);
// API Routes
// require('./routes/api-routes.js')(app);
// Wildcard route
app.get('/*', function(req, res) {
res.redirect('/');
})
app.listen(Number(process.env.PORT), process.env.HOST, function() {
console.log(process.env.APP_NAME + ' is listening at ' + process.env.HOST + ' on port ' + process.env.PORT + '.')
}); | Load environment variable first in express app | Load environment variable first in express app
| JavaScript | mit | formidable-coffee/masterfully,chkakaja/sentimize,formidable-coffee/masterfully,chkakaja/sentimize | javascript | ## Code Before:
var express = require('express');
var passport = require('passport');
var util = require('./lib/utility.js');
// Load environment variables
if (process.env.NODE_ENV !== 'integration') {
require('dotenv').config({ path: './env/.env' });
}
var app = express();
// Initial Configuration, Static Assets, & View Engine Configuration
require('./config/initialize.js')(app, express);
// Authentication Middleware: Express Sessions, Passport Strategy
require('./config/auth.js')(app, express, passport);
// Pre-Authentication Routes & OAuth Requests
require('./routes/auth-routes.js')(app, passport);
//Authentication check currently commented out, uncomment line to re-activate
app.use(util.ensureAuthenticated);
// View Routes
require('./routes/view-routes.js')(app);
// API Routes
// require('./routes/api-routes.js')(app);
// Wildcard route
app.get('/*', function(req, res) {
res.redirect('/');
})
app.listen(Number(process.env.PORT), process.env.HOST, function() {
console.log(process.env.APP_NAME + ' is listening at ' + process.env.HOST + ' on port ' + process.env.PORT + '.')
});
## Instruction:
Load environment variable first in express app
## Code After:
// Load environment variables
if (process.env.NODE_ENV !== 'integration') {
require('dotenv').config({ path: './env/.env' });
}
var express = require('express');
var passport = require('passport');
var util = require('./lib/utility.js');
var app = express();
// Initial Configuration, Static Assets, & View Engine Configuration
require('./config/initialize.js')(app, express);
// Authentication Middleware: Express Sessions, Passport Strategy
require('./config/auth.js')(app, express, passport);
// Pre-Authentication Routes & OAuth Requests
require('./routes/auth-routes.js')(app, passport);
//Authentication check currently commented out, uncomment line to re-activate
app.use(util.ensureAuthenticated);
// View Routes
require('./routes/view-routes.js')(app);
// API Routes
// require('./routes/api-routes.js')(app);
// Wildcard route
app.get('/*', function(req, res) {
res.redirect('/');
})
app.listen(Number(process.env.PORT), process.env.HOST, function() {
console.log(process.env.APP_NAME + ' is listening at ' + process.env.HOST + ' on port ' + process.env.PORT + '.')
}); | - var express = require('express');
- var passport = require('passport');
- var util = require('./lib/utility.js');
-
// Load environment variables
if (process.env.NODE_ENV !== 'integration') {
require('dotenv').config({ path: './env/.env' });
}
+
+ var express = require('express');
+ var passport = require('passport');
+ var util = require('./lib/utility.js');
var app = express();
// Initial Configuration, Static Assets, & View Engine Configuration
require('./config/initialize.js')(app, express);
// Authentication Middleware: Express Sessions, Passport Strategy
require('./config/auth.js')(app, express, passport);
// Pre-Authentication Routes & OAuth Requests
require('./routes/auth-routes.js')(app, passport);
//Authentication check currently commented out, uncomment line to re-activate
app.use(util.ensureAuthenticated);
// View Routes
require('./routes/view-routes.js')(app);
// API Routes
// require('./routes/api-routes.js')(app);
// Wildcard route
app.get('/*', function(req, res) {
res.redirect('/');
})
app.listen(Number(process.env.PORT), process.env.HOST, function() {
console.log(process.env.APP_NAME + ' is listening at ' + process.env.HOST + ' on port ' + process.env.PORT + '.')
}); | 8 | 0.228571 | 4 | 4 |
af42b83bd7fe16124d22acec025b5816638b9f3b | src/Pux/RouteRequestMatcher.php | src/Pux/RouteRequestMatcher.php | <?php
namespace Pux;
interface RouteRequestMatcher
{
public function matchConstraints(array $constraints);
public function matchPath($pattern, & $matches = array());
public function matchHost($host, & $matches = array());
public function matchRequestMethod($method);
public function matchPathSuffix($suffix);
public function containsPath($path);
}
| <?php
namespace Pux;
interface RouteRequestMatcher
{
public function matchConstraints(array $constraints);
public function matchPath($pattern, & $matches = array());
public function matchHost($host, & $matches = array());
public function matchRequestMethod($method);
public function matchPathSuffix($suffix);
public function containsPath($path);
public function equalsHost($host);
public function equalsPath($path);
public function matchQueryString($pattern, & $matches = array());
}
| Update route request matcher interface | Update route request matcher interface
| PHP | mit | c9s/Pux,c9s/Pux,c9s/Pux,c9s/Pux | php | ## Code Before:
<?php
namespace Pux;
interface RouteRequestMatcher
{
public function matchConstraints(array $constraints);
public function matchPath($pattern, & $matches = array());
public function matchHost($host, & $matches = array());
public function matchRequestMethod($method);
public function matchPathSuffix($suffix);
public function containsPath($path);
}
## Instruction:
Update route request matcher interface
## Code After:
<?php
namespace Pux;
interface RouteRequestMatcher
{
public function matchConstraints(array $constraints);
public function matchPath($pattern, & $matches = array());
public function matchHost($host, & $matches = array());
public function matchRequestMethod($method);
public function matchPathSuffix($suffix);
public function containsPath($path);
public function equalsHost($host);
public function equalsPath($path);
public function matchQueryString($pattern, & $matches = array());
}
| <?php
namespace Pux;
interface RouteRequestMatcher
{
public function matchConstraints(array $constraints);
public function matchPath($pattern, & $matches = array());
public function matchHost($host, & $matches = array());
public function matchRequestMethod($method);
public function matchPathSuffix($suffix);
public function containsPath($path);
+ public function equalsHost($host);
+
+ public function equalsPath($path);
+
+ public function matchQueryString($pattern, & $matches = array());
+
}
| 6 | 0.3 | 6 | 0 |
ed7a71b09dfba5bde377ba9dfb9249b620df3a68 | EN-trans-dictlist.txt | EN-trans-dictlist.txt | ar Arabic tr Turkish
es Spanish ca Catalan
es Spanish pt Portuguese
| ar Arabic tr Turkish
de German th Thai
es Spanish ca Catalan
es Spanish pt Portuguese
| Add German-Thai dictionary to generation list. | Add German-Thai dictionary to generation list.
| Text | apache-2.0 | rdoeffinger/DictionaryPC,rdoeffinger/DictionaryPC,rdoeffinger/DictionaryPC | text | ## Code Before:
ar Arabic tr Turkish
es Spanish ca Catalan
es Spanish pt Portuguese
## Instruction:
Add German-Thai dictionary to generation list.
## Code After:
ar Arabic tr Turkish
de German th Thai
es Spanish ca Catalan
es Spanish pt Portuguese
| ar Arabic tr Turkish
+ de German th Thai
es Spanish ca Catalan
es Spanish pt Portuguese | 1 | 0.333333 | 1 | 0 |
c70d588b1f4f12b385412af80520a1745cd944ca | src/Alchemy/Zippy/FileStrategy/ZipFileStrategy.php | src/Alchemy/Zippy/FileStrategy/ZipFileStrategy.php | <?php
/*
* This file is part of Zippy.
*
* (c) Alchemy <info@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Zippy\FileStrategy;
use Alchemy\Zippy\Adapter\AdapterContainer;
class ZipFileStrategy implements FileStrategyInterface
{
private $container;
public function __construct(AdapterContainer $container)
{
$this->container = $container;
}
/**
* {@inheritdoc}
*/
public function getAdapters()
{
return array(
$this->container['Alchemy\\Zippy\\Adapter\\ZipExtensionAdapter'],
$this->container['Alchemy\\Zippy\\Adapter\\ZipAdapter'],
);
}
/**
* {@inheritdoc}
*/
public function getFileExtension()
{
return 'zip';
}
}
| <?php
/*
* This file is part of Zippy.
*
* (c) Alchemy <info@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Zippy\FileStrategy;
use Alchemy\Zippy\Adapter\AdapterContainer;
class ZipFileStrategy implements FileStrategyInterface
{
private $container;
public function __construct(AdapterContainer $container)
{
$this->container = $container;
}
/**
* {@inheritdoc}
*/
public function getAdapters()
{
return array(
$this->container['Alchemy\\Zippy\\Adapter\\ZipAdapter'],
$this->container['Alchemy\\Zippy\\Adapter\\ZipExtensionAdapter'],
);
}
/**
* {@inheritdoc}
*/
public function getFileExtension()
{
return 'zip';
}
}
| Use binary zip adapter prior to ZIpExtension | Use binary zip adapter prior to ZIpExtension | PHP | mit | bburnichon/Zippy,bburnichon/Zippy,bburnichon/Zippy | php | ## Code Before:
<?php
/*
* This file is part of Zippy.
*
* (c) Alchemy <info@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Zippy\FileStrategy;
use Alchemy\Zippy\Adapter\AdapterContainer;
class ZipFileStrategy implements FileStrategyInterface
{
private $container;
public function __construct(AdapterContainer $container)
{
$this->container = $container;
}
/**
* {@inheritdoc}
*/
public function getAdapters()
{
return array(
$this->container['Alchemy\\Zippy\\Adapter\\ZipExtensionAdapter'],
$this->container['Alchemy\\Zippy\\Adapter\\ZipAdapter'],
);
}
/**
* {@inheritdoc}
*/
public function getFileExtension()
{
return 'zip';
}
}
## Instruction:
Use binary zip adapter prior to ZIpExtension
## Code After:
<?php
/*
* This file is part of Zippy.
*
* (c) Alchemy <info@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Zippy\FileStrategy;
use Alchemy\Zippy\Adapter\AdapterContainer;
class ZipFileStrategy implements FileStrategyInterface
{
private $container;
public function __construct(AdapterContainer $container)
{
$this->container = $container;
}
/**
* {@inheritdoc}
*/
public function getAdapters()
{
return array(
$this->container['Alchemy\\Zippy\\Adapter\\ZipAdapter'],
$this->container['Alchemy\\Zippy\\Adapter\\ZipExtensionAdapter'],
);
}
/**
* {@inheritdoc}
*/
public function getFileExtension()
{
return 'zip';
}
}
| <?php
/*
* This file is part of Zippy.
*
* (c) Alchemy <info@alchemy.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Zippy\FileStrategy;
use Alchemy\Zippy\Adapter\AdapterContainer;
class ZipFileStrategy implements FileStrategyInterface
{
private $container;
public function __construct(AdapterContainer $container)
{
$this->container = $container;
}
/**
* {@inheritdoc}
*/
public function getAdapters()
{
return array(
+ $this->container['Alchemy\\Zippy\\Adapter\\ZipAdapter'],
$this->container['Alchemy\\Zippy\\Adapter\\ZipExtensionAdapter'],
- $this->container['Alchemy\\Zippy\\Adapter\\ZipAdapter'],
);
}
/**
* {@inheritdoc}
*/
public function getFileExtension()
{
return 'zip';
}
} | 2 | 0.046512 | 1 | 1 |
8260ffeca9481a499127871a3957a7f16ba74816 | SurgSim/Input/UnitTests/CMakeLists.txt | SurgSim/Input/UnitTests/CMakeLists.txt |
include_directories(
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}
)
set(UNIT_TEST_SOURCES
DataGroupTests.cpp
IndexDirectoryTests.cpp
NamedDataTests.cpp
)
set(UNIT_TEST_HEADERS
)
include_directories(
)
#set(LIBS SurgSimFramework SurgSimInput gtest)
set(LIBS SurgSimFramework gtest)
surgsim_add_unit_tests(SurgSimInputTest)
|
include_directories(
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}
)
set(UNIT_TEST_SOURCES
DataGroupTests.cpp
IndexDirectoryTests.cpp
NamedDataTests.cpp
)
set(UNIT_TEST_HEADERS
)
include_directories(
)
#set(LIBS SurgSimFramework SurgSimInput gtest ${Boost_LIBRARIES})
set(LIBS SurgSimFramework gtest ${Boost_LIBRARIES})
surgsim_add_unit_tests(SurgSimInputTest)
| Fix missing library on Linux. | Fix missing library on Linux.
| Text | apache-2.0 | simquest/opensurgsim,simquest/opensurgsim,simquest/opensurgsim,simquest/opensurgsim | text | ## Code Before:
include_directories(
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}
)
set(UNIT_TEST_SOURCES
DataGroupTests.cpp
IndexDirectoryTests.cpp
NamedDataTests.cpp
)
set(UNIT_TEST_HEADERS
)
include_directories(
)
#set(LIBS SurgSimFramework SurgSimInput gtest)
set(LIBS SurgSimFramework gtest)
surgsim_add_unit_tests(SurgSimInputTest)
## Instruction:
Fix missing library on Linux.
## Code After:
include_directories(
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}
)
set(UNIT_TEST_SOURCES
DataGroupTests.cpp
IndexDirectoryTests.cpp
NamedDataTests.cpp
)
set(UNIT_TEST_HEADERS
)
include_directories(
)
#set(LIBS SurgSimFramework SurgSimInput gtest ${Boost_LIBRARIES})
set(LIBS SurgSimFramework gtest ${Boost_LIBRARIES})
surgsim_add_unit_tests(SurgSimInputTest)
|
include_directories(
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}
)
set(UNIT_TEST_SOURCES
DataGroupTests.cpp
IndexDirectoryTests.cpp
NamedDataTests.cpp
)
set(UNIT_TEST_HEADERS
)
include_directories(
)
- #set(LIBS SurgSimFramework SurgSimInput gtest)
+ #set(LIBS SurgSimFramework SurgSimInput gtest ${Boost_LIBRARIES})
? +++++++++++++++++++
- set(LIBS SurgSimFramework gtest)
+ set(LIBS SurgSimFramework gtest ${Boost_LIBRARIES})
? +++++++++++++++++++
surgsim_add_unit_tests(SurgSimInputTest) | 4 | 0.173913 | 2 | 2 |
cb781d86a40f0f3f9ada71cbe482b52ad9abd454 | tests/unit/utils/gravatar-test.js | tests/unit/utils/gravatar-test.js | import gravatar from '../../../utils/gravatar';
import { module, test } from 'qunit';
module('gravatar');
// Replace this with your real tests.
test('it works', function(assert) {
var result = gravatar();
assert.ok(result);
});
| import gravatar from '../../../utils/gravatar';
import { module, test } from 'qunit';
module('gravatar');
test('it returns a valid gravatar', function(assert) {
var email = 'brian.runnells@gmail.com';
var expected = 'http://www.gravatar.com/avatar/9b210755bd9296a95e75b08bc14fe4aa';
var result = gravatar(email);
assert.equal(result, expected);
});
| Add unit test for gravatar util | Add unit test for gravatar util
| JavaScript | mit | Dhaulagiri/ember-purple-form,Dhaulagiri/ember-purple-form | javascript | ## Code Before:
import gravatar from '../../../utils/gravatar';
import { module, test } from 'qunit';
module('gravatar');
// Replace this with your real tests.
test('it works', function(assert) {
var result = gravatar();
assert.ok(result);
});
## Instruction:
Add unit test for gravatar util
## Code After:
import gravatar from '../../../utils/gravatar';
import { module, test } from 'qunit';
module('gravatar');
test('it returns a valid gravatar', function(assert) {
var email = 'brian.runnells@gmail.com';
var expected = 'http://www.gravatar.com/avatar/9b210755bd9296a95e75b08bc14fe4aa';
var result = gravatar(email);
assert.equal(result, expected);
});
| import gravatar from '../../../utils/gravatar';
import { module, test } from 'qunit';
module('gravatar');
- // Replace this with your real tests.
- test('it works', function(assert) {
+ test('it returns a valid gravatar', function(assert) {
+ var email = 'brian.runnells@gmail.com';
+ var expected = 'http://www.gravatar.com/avatar/9b210755bd9296a95e75b08bc14fe4aa';
+
- var result = gravatar();
+ var result = gravatar(email);
? +++++
- assert.ok(result);
+ assert.equal(result, expected);
}); | 10 | 1 | 6 | 4 |
3507d1a595016a0a9260b9dadeda30546782d628 | package.json | package.json | {
"name": "element-wrapper",
"version": "0.0.1",
"main": "src/index.js",
"repository": "git@github.com:mickaelvieira/element-wrapper.git",
"author": "Mickael Vieira <contact@mickael-vieira.com>",
"license": "MIT",
"scripts": {
"test": "NODE_ENV=test jest --config=jest.json",
"watch": "rollup -c rollup.config.js --watch",
"build": "rollup -c rollup.config.js"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.1.1",
"eslint-plugin-prettier": "^2.1.2",
"jest": "^20.0.4",
"prettier": "^1.5.2",
"rollup": "^0.43.0",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.0.0"
}
}
| {
"name": "element-wrapper",
"version": "0.0.1",
"main": "src/index.js",
"repository": "git@github.com:mickaelvieira/element-wrapper.git",
"author": "Mickael Vieira <contact@mickael-vieira.com>",
"license": "MIT",
"scripts": {
"test": "NODE_ENV=test jest --config=jest.json",
"test:watch": "yarn run test -- --watch",
"watch": "rollup -c rollup.config.js --watch",
"build": "rollup -c rollup.config.js"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.1.1",
"eslint-plugin-prettier": "^2.1.2",
"jest": "^20.0.4",
"prettier": "^1.5.2",
"rollup": "^0.43.0",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.0.0"
}
}
| Add watch mode to test command | Add watch mode to test command
| JSON | mit | mickaelvieira/dom-element-wrapper,mickaelvieira/dom-element-wrapper | json | ## Code Before:
{
"name": "element-wrapper",
"version": "0.0.1",
"main": "src/index.js",
"repository": "git@github.com:mickaelvieira/element-wrapper.git",
"author": "Mickael Vieira <contact@mickael-vieira.com>",
"license": "MIT",
"scripts": {
"test": "NODE_ENV=test jest --config=jest.json",
"watch": "rollup -c rollup.config.js --watch",
"build": "rollup -c rollup.config.js"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.1.1",
"eslint-plugin-prettier": "^2.1.2",
"jest": "^20.0.4",
"prettier": "^1.5.2",
"rollup": "^0.43.0",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.0.0"
}
}
## Instruction:
Add watch mode to test command
## Code After:
{
"name": "element-wrapper",
"version": "0.0.1",
"main": "src/index.js",
"repository": "git@github.com:mickaelvieira/element-wrapper.git",
"author": "Mickael Vieira <contact@mickael-vieira.com>",
"license": "MIT",
"scripts": {
"test": "NODE_ENV=test jest --config=jest.json",
"test:watch": "yarn run test -- --watch",
"watch": "rollup -c rollup.config.js --watch",
"build": "rollup -c rollup.config.js"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.1.1",
"eslint-plugin-prettier": "^2.1.2",
"jest": "^20.0.4",
"prettier": "^1.5.2",
"rollup": "^0.43.0",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.0.0"
}
}
| {
"name": "element-wrapper",
"version": "0.0.1",
"main": "src/index.js",
"repository": "git@github.com:mickaelvieira/element-wrapper.git",
"author": "Mickael Vieira <contact@mickael-vieira.com>",
"license": "MIT",
"scripts": {
"test": "NODE_ENV=test jest --config=jest.json",
+ "test:watch": "yarn run test -- --watch",
"watch": "rollup -c rollup.config.js --watch",
"build": "rollup -c rollup.config.js"
},
"devDependencies": {
"babel-core": "^6.25.0",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.1.1",
"eslint-plugin-prettier": "^2.1.2",
"jest": "^20.0.4",
"prettier": "^1.5.2",
"rollup": "^0.43.0",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.0.0"
}
} | 1 | 0.037037 | 1 | 0 |
8761ceb320b96cbcfc91bf8268311bf35b50e82f | README.md | README.md |

Oculus is a web-based logging SQL client. It keeps a history of your queries
and the results they returned, so your research is always at hand, easy to share
and easy to repeat or reproduce in the future.
**Oculus is alpha software. Interface and implementation may change suddenly!**
## Installation
$ gem install oculus
## Usage
Oculus is a Sinatra app. Run it from the command line, or mount `Oculus::Server`
as middleware in your Rack application.
For details on command line options, run:
oculus --help
## Contributing
1. Fork it
2. Make your changes
3. Send me a pull request
If you're making a big change, please open an Issue first, so we can discuss.
|

[](http://travis-ci.org/paulrosania/oculus)
Oculus is a web-based logging SQL client. It keeps a history of your queries
and the results they returned, so your research is always at hand, easy to share
and easy to repeat or reproduce in the future.
**Oculus will not prevent you from doing stupid things! I recommend using a
readonly MySQL account.**
## Installation
$ gem install oculus
## Usage
Oculus is a Sinatra app. Run it from the command line, or mount `Oculus::Server`
as middleware in your Rack application.
For details on command line options, run:
oculus --help
## Contributing
1. Fork it
2. Make your changes
3. Send me a pull request
If you're making a big change, please open an Issue first, so we can discuss.
| Update disclaimer; alpha warning probably unwarranted now | Update disclaimer; alpha warning probably unwarranted now
| Markdown | mit | paulrosania/oculus,paulrosania/oculus | markdown | ## Code Before:

Oculus is a web-based logging SQL client. It keeps a history of your queries
and the results they returned, so your research is always at hand, easy to share
and easy to repeat or reproduce in the future.
**Oculus is alpha software. Interface and implementation may change suddenly!**
## Installation
$ gem install oculus
## Usage
Oculus is a Sinatra app. Run it from the command line, or mount `Oculus::Server`
as middleware in your Rack application.
For details on command line options, run:
oculus --help
## Contributing
1. Fork it
2. Make your changes
3. Send me a pull request
If you're making a big change, please open an Issue first, so we can discuss.
## Instruction:
Update disclaimer; alpha warning probably unwarranted now
## Code After:

[](http://travis-ci.org/paulrosania/oculus)
Oculus is a web-based logging SQL client. It keeps a history of your queries
and the results they returned, so your research is always at hand, easy to share
and easy to repeat or reproduce in the future.
**Oculus will not prevent you from doing stupid things! I recommend using a
readonly MySQL account.**
## Installation
$ gem install oculus
## Usage
Oculus is a Sinatra app. Run it from the command line, or mount `Oculus::Server`
as middleware in your Rack application.
For details on command line options, run:
oculus --help
## Contributing
1. Fork it
2. Make your changes
3. Send me a pull request
If you're making a big change, please open an Issue first, so we can discuss.
|

+
+ [](http://travis-ci.org/paulrosania/oculus)
Oculus is a web-based logging SQL client. It keeps a history of your queries
and the results they returned, so your research is always at hand, easy to share
and easy to repeat or reproduce in the future.
- **Oculus is alpha software. Interface and implementation may change suddenly!**
+ **Oculus will not prevent you from doing stupid things! I recommend using a
+ readonly MySQL account.**
## Installation
$ gem install oculus
## Usage
Oculus is a Sinatra app. Run it from the command line, or mount `Oculus::Server`
as middleware in your Rack application.
For details on command line options, run:
oculus --help
## Contributing
1. Fork it
2. Make your changes
3. Send me a pull request
If you're making a big change, please open an Issue first, so we can discuss. | 5 | 0.172414 | 4 | 1 |
4a167edba49ce6d6e903e959f9d65eb7d35a1fbd | .github/workflows/publish.yml | .github/workflows/publish.yml | name: Publish
on:
push:
branches: [ master ]
paths:
- '**.md'
- '**.yml'
- '**.swift'
jobs:
publish:
if: "!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), '[skip ci]')"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v
- name: Generate
run: swift run -v Publisher
- name: Move Files
run: |
rm -Rf docs
cp -R Output/* .
rm -Rf Output
- name: Commit files
run: |
git config --local user.email "publish.bot@ryanjdavies.com"
git config --local user.name "Publish Bot"
git add -A
git commit -m "Publish deploy"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
| name: Publish
on:
push:
branches: [ master ]
paths:
- '**.md'
- '**.yml'
- '**.swift'
- 'Content/**'
jobs:
publish:
if: "!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), '[skip ci]')"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v
- name: Generate
run: swift run -v Publisher
- name: Move Files
run: |
rm -Rf docs
cp -R Output/* .
rm -Rf Output
- name: Commit files
run: |
git config --local user.email "publish.bot@ryanjdavies.com"
git config --local user.name "Publish Bot"
git add -A
git commit -m "Publish deploy"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
| Deploy on all content changes | Deploy on all content changes | YAML | mit | iotize/iotize.github.io | yaml | ## Code Before:
name: Publish
on:
push:
branches: [ master ]
paths:
- '**.md'
- '**.yml'
- '**.swift'
jobs:
publish:
if: "!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), '[skip ci]')"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v
- name: Generate
run: swift run -v Publisher
- name: Move Files
run: |
rm -Rf docs
cp -R Output/* .
rm -Rf Output
- name: Commit files
run: |
git config --local user.email "publish.bot@ryanjdavies.com"
git config --local user.name "Publish Bot"
git add -A
git commit -m "Publish deploy"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
## Instruction:
Deploy on all content changes
## Code After:
name: Publish
on:
push:
branches: [ master ]
paths:
- '**.md'
- '**.yml'
- '**.swift'
- 'Content/**'
jobs:
publish:
if: "!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), '[skip ci]')"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v
- name: Generate
run: swift run -v Publisher
- name: Move Files
run: |
rm -Rf docs
cp -R Output/* .
rm -Rf Output
- name: Commit files
run: |
git config --local user.email "publish.bot@ryanjdavies.com"
git config --local user.name "Publish Bot"
git add -A
git commit -m "Publish deploy"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
| name: Publish
on:
push:
branches: [ master ]
paths:
- '**.md'
- '**.yml'
- '**.swift'
+ - 'Content/**'
jobs:
publish:
if: "!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), '[skip ci]')"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v
- name: Generate
run: swift run -v Publisher
- name: Move Files
run: |
rm -Rf docs
cp -R Output/* .
rm -Rf Output
- name: Commit files
run: |
git config --local user.email "publish.bot@ryanjdavies.com"
git config --local user.name "Publish Bot"
git add -A
git commit -m "Publish deploy"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }} | 1 | 0.028571 | 1 | 0 |
537e9b1e749f9d198a85b1b4b0303975542753f1 | static/templates/confirm_dialog/confirm_deactivate_bot.hbs | static/templates/confirm_dialog/confirm_deactivate_bot.hbs | <p>
{{#tr}}
When you deactivate <z-user></z-user>.
{{#*inline "z-user"}}<strong>{{username}}</strong>{{#if email}} <{{email}}>{{/if}}{{/inline}}
{{/tr}}
</p>
<p>{{t "They will not send messages or take any other actions." }}</p>
| <p>
{{#tr}}
When you deactivate <z-user></z-user>.
{{#*inline "z-user"}}<strong>{{username}}</strong>{{#if email}} <{{email}}>{{/if}}{{/inline}}
{{/tr}}
</p>
<p>{{t "A deactivated bot cannot send messages, access data, or take any other action." }}</p>
| Improve wording for deactivate bot modal. | settings: Improve wording for deactivate bot modal.
| Handlebars | apache-2.0 | zulip/zulip,rht/zulip,rht/zulip,zulip/zulip,andersk/zulip,andersk/zulip,zulip/zulip,andersk/zulip,rht/zulip,zulip/zulip,zulip/zulip,zulip/zulip,rht/zulip,andersk/zulip,andersk/zulip,andersk/zulip,rht/zulip,andersk/zulip,zulip/zulip,rht/zulip,rht/zulip | handlebars | ## Code Before:
<p>
{{#tr}}
When you deactivate <z-user></z-user>.
{{#*inline "z-user"}}<strong>{{username}}</strong>{{#if email}} <{{email}}>{{/if}}{{/inline}}
{{/tr}}
</p>
<p>{{t "They will not send messages or take any other actions." }}</p>
## Instruction:
settings: Improve wording for deactivate bot modal.
## Code After:
<p>
{{#tr}}
When you deactivate <z-user></z-user>.
{{#*inline "z-user"}}<strong>{{username}}</strong>{{#if email}} <{{email}}>{{/if}}{{/inline}}
{{/tr}}
</p>
<p>{{t "A deactivated bot cannot send messages, access data, or take any other action." }}</p>
| <p>
{{#tr}}
When you deactivate <z-user></z-user>.
{{#*inline "z-user"}}<strong>{{username}}</strong>{{#if email}} <{{email}}>{{/if}}{{/inline}}
{{/tr}}
</p>
- <p>{{t "They will not send messages or take any other actions." }}</p>
? ^^ ^ ^^^^ -
+ <p>{{t "A deactivated bot cannot send messages, access data, or take any other action." }}</p>
? ^^^ ^^^^^^^^^ ^^^ +++ ++++++++++++++
| 2 | 0.285714 | 1 | 1 |
dd4e7bca972810510cc20ce91463b7ac84a2f449 | less/breadcrumbs.less | less/breadcrumbs.less | //
// Breadcrumbs
// --------------------------------------------------
.breadcrumb {
padding: 8px 15px;
margin: 0 0 @line-height-base;
list-style: none;
background-color: #f5f5f5;
border-radius: @border-radius-base;
> li {
display: inline-block;
text-shadow: 0 1px 0 #fff;
&:after {
display: inline-block;
content: "\00a0 /"; // Unicode space added since inline-block means non-collapsing white-space
padding: 0 5px;
color: #ccc;
}
}
> .active {
color: @grayLight;
}
}
| //
// Breadcrumbs
// --------------------------------------------------
.breadcrumb {
padding: 8px 15px;
margin: 0 0 @line-height-base;
list-style: none;
background-color: #f5f5f5;
border-radius: @border-radius-base;
> li {
display: inline-block;
text-shadow: 0 1px 0 #fff;
&:after {
display: inline-block;
content: "\00a0 /"; // Unicode space added since inline-block means non-collapsing white-space
padding: 0 5px;
color: #ccc;
}
&:last-child:after {
content: ""; // No divider after last element
}
}
> .active {
color: @grayLight;
}
}
| Remove breadcrumb divider after last element | Remove breadcrumb divider after last element
| Less | mit | ammula88/bootstrap,ammula88/bootstrap,ammula88/bootstrap,ammula88/bootstrap | less | ## Code Before:
//
// Breadcrumbs
// --------------------------------------------------
.breadcrumb {
padding: 8px 15px;
margin: 0 0 @line-height-base;
list-style: none;
background-color: #f5f5f5;
border-radius: @border-radius-base;
> li {
display: inline-block;
text-shadow: 0 1px 0 #fff;
&:after {
display: inline-block;
content: "\00a0 /"; // Unicode space added since inline-block means non-collapsing white-space
padding: 0 5px;
color: #ccc;
}
}
> .active {
color: @grayLight;
}
}
## Instruction:
Remove breadcrumb divider after last element
## Code After:
//
// Breadcrumbs
// --------------------------------------------------
.breadcrumb {
padding: 8px 15px;
margin: 0 0 @line-height-base;
list-style: none;
background-color: #f5f5f5;
border-radius: @border-radius-base;
> li {
display: inline-block;
text-shadow: 0 1px 0 #fff;
&:after {
display: inline-block;
content: "\00a0 /"; // Unicode space added since inline-block means non-collapsing white-space
padding: 0 5px;
color: #ccc;
}
&:last-child:after {
content: ""; // No divider after last element
}
}
> .active {
color: @grayLight;
}
}
| //
// Breadcrumbs
// --------------------------------------------------
.breadcrumb {
padding: 8px 15px;
margin: 0 0 @line-height-base;
list-style: none;
background-color: #f5f5f5;
border-radius: @border-radius-base;
> li {
display: inline-block;
text-shadow: 0 1px 0 #fff;
&:after {
display: inline-block;
content: "\00a0 /"; // Unicode space added since inline-block means non-collapsing white-space
padding: 0 5px;
color: #ccc;
}
+ &:last-child:after {
+ content: ""; // No divider after last element
+ }
}
> .active {
color: @grayLight;
}
} | 3 | 0.12 | 3 | 0 |
339970410154b08a001c99ec740f9fe55cf81207 | .travis.yml | .travis.yml | language: cpp
compiler:
- gcc
before_install:
# We need this line to have g++4.9 available in apt
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
install:
- sudo apt-get install -qq gcc-4.9 g++-4.9
# We want to compile with g++ 4.9 when rather than the default g++
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90
git:
submodules: false
script: make release
| language: cpp
compiler:
- gcc
before_install:
# Install SFML 2.2
- wget http://www.sfml-dev.org/files/SFML-2.2-linux-gcc-32-bit.tar.gz
- tar xf SFML-2.2-linux-gcc-32-bit.tar.gz
- sudo cp -r SFML-2.2/lib/* /usr/local/lib/.
# We need this line to have g++4.9 available in apt
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- apt-cache search sfml
install:
- sudo apt-get install -qq gcc-4.9 g++-4.9
# We want to compile with g++ 4.9 when rather than the default g++
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90
git:
submodules: false
script: make release
| Fix SFML URL. Remove installation of CSFML | Fix SFML URL. Remove installation of CSFML
Based on https://github.com/jeremyletang/rust-sfml/blob/master/.travis.yml
| YAML | mit | nabijaczleweli/Cwepper | yaml | ## Code Before:
language: cpp
compiler:
- gcc
before_install:
# We need this line to have g++4.9 available in apt
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
install:
- sudo apt-get install -qq gcc-4.9 g++-4.9
# We want to compile with g++ 4.9 when rather than the default g++
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90
git:
submodules: false
script: make release
## Instruction:
Fix SFML URL. Remove installation of CSFML
Based on https://github.com/jeremyletang/rust-sfml/blob/master/.travis.yml
## Code After:
language: cpp
compiler:
- gcc
before_install:
# Install SFML 2.2
- wget http://www.sfml-dev.org/files/SFML-2.2-linux-gcc-32-bit.tar.gz
- tar xf SFML-2.2-linux-gcc-32-bit.tar.gz
- sudo cp -r SFML-2.2/lib/* /usr/local/lib/.
# We need this line to have g++4.9 available in apt
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- apt-cache search sfml
install:
- sudo apt-get install -qq gcc-4.9 g++-4.9
# We want to compile with g++ 4.9 when rather than the default g++
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90
git:
submodules: false
script: make release
| language: cpp
compiler:
- gcc
before_install:
+ # Install SFML 2.2
+ - wget http://www.sfml-dev.org/files/SFML-2.2-linux-gcc-32-bit.tar.gz
+ - tar xf SFML-2.2-linux-gcc-32-bit.tar.gz
+ - sudo cp -r SFML-2.2/lib/* /usr/local/lib/.
# We need this line to have g++4.9 available in apt
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
+ - apt-cache search sfml
install:
- sudo apt-get install -qq gcc-4.9 g++-4.9
# We want to compile with g++ 4.9 when rather than the default g++
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90
git:
submodules: false
script: make release | 5 | 0.263158 | 5 | 0 |
27d2d0cb83b22fbbd77c4c62336c0b53462b12d5 | app/views/show.haml | app/views/show.haml | %html
%head
%title
= page_title
%link{:rel => 'stylesheet', :type => 'text/css', :href => '/styles/main.css'}
%script{:type => 'text/javascript', :src => '/javascripts/mootools.js'}
%script{:type => 'text/javascript', :src => '/javascripts/application.js'}
%body
.title
= page_title
.subtitle Tracking Open Source Contributions
#calendar
= seinfeld
#main
#stats
.current_streak
%span.type
current streak
%span.num
= @user.current_streak
%span.desc days
.longest_streak
%span.type
longest streak
%span.num
= @user.longest_streak
%span.desc days
#content.footnote
%a{:href => "http://calendaraboutnothing.com"} Calendar About Nothing
by <a href="http://weblog.techno-weenie.net">rick</a> and <a href="http://warpspire.com/">kyle</a>
%br
%a{:href => "http://github.com/entp/seinfeld/tree/master"} accepting patches
| %html
%head
%title
= page_title
%link{:rel => 'icon', :type => 'image/png', :href => '/images/x_1.png', :sizes => '48x48'}
%link{:rel => 'stylesheet', :type => 'text/css', :href => '/styles/main.css'}
%script{:type => 'text/javascript', :src => '/javascripts/mootools.js'}
%script{:type => 'text/javascript', :src => '/javascripts/application.js'}
%body
.title
= page_title
.subtitle Tracking Open Source Contributions
#calendar
= seinfeld
#main
#stats
.current_streak
%span.type
current streak
%span.num
= @user.current_streak
%span.desc days
.longest_streak
%span.type
longest streak
%span.num
= @user.longest_streak
%span.desc days
#content.footnote
%a{:href => "http://calendaraboutnothing.com"} Calendar About Nothing
by <a href="http://weblog.techno-weenie.net">rick</a> and <a href="http://warpspire.com/">kyle</a>
%br
%a{:href => "http://github.com/entp/seinfeld/tree/master"} accepting patches
| Add icon, every web page needs an icon! | Add icon, every web page needs an icon!
| Haml | mit | entp/seinfeld,nex3/seinfeld,technoweenie/seinfeld,dustin/seinfeld,entp/seinfeld,nex3/seinfeld,dustin/seinfeld,technoweenie/seinfeld | haml | ## Code Before:
%html
%head
%title
= page_title
%link{:rel => 'stylesheet', :type => 'text/css', :href => '/styles/main.css'}
%script{:type => 'text/javascript', :src => '/javascripts/mootools.js'}
%script{:type => 'text/javascript', :src => '/javascripts/application.js'}
%body
.title
= page_title
.subtitle Tracking Open Source Contributions
#calendar
= seinfeld
#main
#stats
.current_streak
%span.type
current streak
%span.num
= @user.current_streak
%span.desc days
.longest_streak
%span.type
longest streak
%span.num
= @user.longest_streak
%span.desc days
#content.footnote
%a{:href => "http://calendaraboutnothing.com"} Calendar About Nothing
by <a href="http://weblog.techno-weenie.net">rick</a> and <a href="http://warpspire.com/">kyle</a>
%br
%a{:href => "http://github.com/entp/seinfeld/tree/master"} accepting patches
## Instruction:
Add icon, every web page needs an icon!
## Code After:
%html
%head
%title
= page_title
%link{:rel => 'icon', :type => 'image/png', :href => '/images/x_1.png', :sizes => '48x48'}
%link{:rel => 'stylesheet', :type => 'text/css', :href => '/styles/main.css'}
%script{:type => 'text/javascript', :src => '/javascripts/mootools.js'}
%script{:type => 'text/javascript', :src => '/javascripts/application.js'}
%body
.title
= page_title
.subtitle Tracking Open Source Contributions
#calendar
= seinfeld
#main
#stats
.current_streak
%span.type
current streak
%span.num
= @user.current_streak
%span.desc days
.longest_streak
%span.type
longest streak
%span.num
= @user.longest_streak
%span.desc days
#content.footnote
%a{:href => "http://calendaraboutnothing.com"} Calendar About Nothing
by <a href="http://weblog.techno-weenie.net">rick</a> and <a href="http://warpspire.com/">kyle</a>
%br
%a{:href => "http://github.com/entp/seinfeld/tree/master"} accepting patches
| %html
%head
%title
= page_title
+ %link{:rel => 'icon', :type => 'image/png', :href => '/images/x_1.png', :sizes => '48x48'}
%link{:rel => 'stylesheet', :type => 'text/css', :href => '/styles/main.css'}
%script{:type => 'text/javascript', :src => '/javascripts/mootools.js'}
%script{:type => 'text/javascript', :src => '/javascripts/application.js'}
%body
.title
= page_title
.subtitle Tracking Open Source Contributions
#calendar
= seinfeld
#main
#stats
.current_streak
%span.type
current streak
%span.num
= @user.current_streak
%span.desc days
.longest_streak
%span.type
longest streak
%span.num
= @user.longest_streak
%span.desc days
#content.footnote
%a{:href => "http://calendaraboutnothing.com"} Calendar About Nothing
by <a href="http://weblog.techno-weenie.net">rick</a> and <a href="http://warpspire.com/">kyle</a>
%br
%a{:href => "http://github.com/entp/seinfeld/tree/master"} accepting patches
| 1 | 0.030303 | 1 | 0 |
518ddb0c37030d759c12e1862e4bdbc420d7bc15 | data/transition-sites/nactso_syf.yml | data/transition-sites/nactso_syf.yml | ---
site: nactso_syf
whitehall_slug: national-counter-terrorism-security-office
host: www.secureyourfertiliser.gov.uk
tna_timestamp: 20090805162030
homepage: https://www.gov.uk/government/organisations/national-counter-terrorism-security-office
| ---
site: nactso_syf
whitehall_slug: national-counter-terrorism-security-office
host: www.secureyourfertiliser.gov.uk
tna_timestamp: 20090805162030
homepage: https://www.gov.uk/government/organisations/national-counter-terrorism-security-office
global: =301 https://www.gov.uk/government/publications/secure-your-fertiliser/secure-your-fertiliser
| Make NACTSO SecureYourFertiliser a global redirect | Make NACTSO SecureYourFertiliser a global redirect
| YAML | mit | alphagov/transition-config,alphagov/transition-config | yaml | ## Code Before:
---
site: nactso_syf
whitehall_slug: national-counter-terrorism-security-office
host: www.secureyourfertiliser.gov.uk
tna_timestamp: 20090805162030
homepage: https://www.gov.uk/government/organisations/national-counter-terrorism-security-office
## Instruction:
Make NACTSO SecureYourFertiliser a global redirect
## Code After:
---
site: nactso_syf
whitehall_slug: national-counter-terrorism-security-office
host: www.secureyourfertiliser.gov.uk
tna_timestamp: 20090805162030
homepage: https://www.gov.uk/government/organisations/national-counter-terrorism-security-office
global: =301 https://www.gov.uk/government/publications/secure-your-fertiliser/secure-your-fertiliser
| ---
site: nactso_syf
whitehall_slug: national-counter-terrorism-security-office
host: www.secureyourfertiliser.gov.uk
tna_timestamp: 20090805162030
homepage: https://www.gov.uk/government/organisations/national-counter-terrorism-security-office
+ global: =301 https://www.gov.uk/government/publications/secure-your-fertiliser/secure-your-fertiliser | 1 | 0.166667 | 1 | 0 |
c76c1c180a8960e7bbef120a0ca2d1945fc2d050 | response.php | response.php | <?php
// File: response.php
// Get GET moviename value
$gender = $_POST["moviename"];
// Connect to the database
// replace the parameters with your proper credentials
$connection = mysqli_connect("localhost", "username", "password", "database_name");
// Query to run
$query = mysqli_query($connection,
"SELECT * FROM movies_in_db");
// Create empty array to hold query results
$someArray = [];
// Loop through query and push results into $someArray;
while ($row = mysqli_fetch_assoc($query)) {
array_push($someArray, [
'name' => $row['movie_name'],
'image' => $row['movie_image']
]);
}
// Convert the Array to a JSON String and echo it
$someJSON = json_encode($someArray);
echo $someJSON;
?>
| <?php
// File: response.php
// Get response type
$resp = $_POST["resptype"];
if($resp == "all") {
// Connect to the database
// replace the parameters with your proper credentials
$connection = mysqli_connect("localhost", "username", "password", "database_name");
// Query to run
$query = mysqli_query($connection,
"SELECT * FROM movies_in_db");
// Create empty array to hold query results
$someArray = [];
// Loop through query and push results into $someArray;
while ($row = mysqli_fetch_assoc($query)) {
array_push($someArray, [
'name' => $row['movie_name'],
'image' => $row['movie_image']
]);
}
// Convert the Array to a JSON String and echo it
$someJSON = json_encode($someArray);
echo $someJSON;
mysqli_close($connection);
}
?>
| Make changes for closing connection after use | Make changes for closing connection after use | PHP | unlicense | codergab/json-php-javascript-request,codergab/json-php-javascript-request | php | ## Code Before:
<?php
// File: response.php
// Get GET moviename value
$gender = $_POST["moviename"];
// Connect to the database
// replace the parameters with your proper credentials
$connection = mysqli_connect("localhost", "username", "password", "database_name");
// Query to run
$query = mysqli_query($connection,
"SELECT * FROM movies_in_db");
// Create empty array to hold query results
$someArray = [];
// Loop through query and push results into $someArray;
while ($row = mysqli_fetch_assoc($query)) {
array_push($someArray, [
'name' => $row['movie_name'],
'image' => $row['movie_image']
]);
}
// Convert the Array to a JSON String and echo it
$someJSON = json_encode($someArray);
echo $someJSON;
?>
## Instruction:
Make changes for closing connection after use
## Code After:
<?php
// File: response.php
// Get response type
$resp = $_POST["resptype"];
if($resp == "all") {
// Connect to the database
// replace the parameters with your proper credentials
$connection = mysqli_connect("localhost", "username", "password", "database_name");
// Query to run
$query = mysqli_query($connection,
"SELECT * FROM movies_in_db");
// Create empty array to hold query results
$someArray = [];
// Loop through query and push results into $someArray;
while ($row = mysqli_fetch_assoc($query)) {
array_push($someArray, [
'name' => $row['movie_name'],
'image' => $row['movie_image']
]);
}
// Convert the Array to a JSON String and echo it
$someJSON = json_encode($someArray);
echo $someJSON;
mysqli_close($connection);
}
?>
| <?php
// File: response.php
- // Get GET moviename value
- $gender = $_POST["moviename"];
+ // Get response type
+ $resp = $_POST["resptype"];
+ if($resp == "all") {
- // Connect to the database
- // replace the parameters with your proper credentials
- $connection = mysqli_connect("localhost", "username", "password", "database_name");
- // Query to run
- $query = mysqli_query($connection,
- "SELECT * FROM movies_in_db");
+ // Connect to the database
+ // replace the parameters with your proper credentials
+ $connection = mysqli_connect("localhost", "username", "password", "database_name");
- // Create empty array to hold query results
- $someArray = [];
+ // Query to run
+ $query = mysqli_query($connection,
+ "SELECT * FROM movies_in_db");
+ // Create empty array to hold query results
+ $someArray = [];
+
- // Loop through query and push results into $someArray;
+ // Loop through query and push results into $someArray;
? ++
- while ($row = mysqli_fetch_assoc($query)) {
+ while ($row = mysqli_fetch_assoc($query)) {
? ++
- array_push($someArray, [
+ array_push($someArray, [
? ++
- 'name' => $row['movie_name'],
+ 'name' => $row['movie_name'],
? ++
- 'image' => $row['movie_image']
+ 'image' => $row['movie_image']
? ++
- ]);
+ ]);
? ++
+ }
+
+ // Convert the Array to a JSON String and echo it
+ $someJSON = json_encode($someArray);
+ echo $someJSON;
+
+ mysqli_close($connection);
}
-
- // Convert the Array to a JSON String and echo it
- $someJSON = json_encode($someArray);
- echo $someJSON;
?> | 45 | 1.551724 | 25 | 20 |
33f922d9315db43bb2e0eea257c25b723aeac89f | spec/models.rb | spec/models.rb | class TaggableModel < ActiveRecord::Base
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class CachedModel < ActiveRecord::Base
acts_as_taggable
end
class OtherCachedModel < ActiveRecord::Base
acts_as_taggable_on :languages, :statuses, :glasses
end
class OtherTaggableModel < ActiveRecord::Base
acts_as_taggable_on :tags, :languages
acts_as_taggable_on :needs, :offerings
end
class InheritingTaggableModel < TaggableModel
end
class AlteredInheritingTaggableModel < TaggableModel
acts_as_taggable_on :parts
end
class TaggableUser < ActiveRecord::Base
acts_as_tagger
end
class UntaggableModel < ActiveRecord::Base
belongs_to :taggable_model
end
class NonStandardIdTaggableModel < ActiveRecord::Base
primary_key = "an_id"
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class OrderedTaggableModel < ActiveRecord::Base
acts_as_ordered_taggable
acts_as_ordered_taggable_on :colours
end
| class TaggableModel < ActiveRecord::Base
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class CachedModel < ActiveRecord::Base
acts_as_taggable
end
class OtherCachedModel < ActiveRecord::Base
acts_as_taggable_on :languages, :statuses, :glasses
end
class OtherTaggableModel < ActiveRecord::Base
acts_as_taggable_on :tags, :languages
acts_as_taggable_on :needs, :offerings
end
class InheritingTaggableModel < TaggableModel
end
class AlteredInheritingTaggableModel < TaggableModel
acts_as_taggable_on :parts
end
class TaggableUser < ActiveRecord::Base
acts_as_tagger
end
class InheritingTaggableUser < TaggableUser
end
class UntaggableModel < ActiveRecord::Base
belongs_to :taggable_model
end
class NonStandardIdTaggableModel < ActiveRecord::Base
primary_key = "an_id"
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class OrderedTaggableModel < ActiveRecord::Base
acts_as_ordered_taggable
acts_as_ordered_taggable_on :colours
end
| Add inheriting user model to specs | Add inheriting user model to specs
| Ruby | mit | danielma/acts-as-taggable-on,EndingChaung/acts-as-taggable-on,FlowerWrong/acts-as-taggable-on,ches/acts-as-taggable-on,3playmedia/acts-as-taggable-on,ryanfox1985/acts-as-taggable-on,JakeTheSnake3p0/acts-as-taggable-on,Antiarchitect/acts-as-taggable-on,Vorob-Astronaut/acts-as-taggable-on,onursarikaya/acts-as-taggable-on,sideci-sample/sideci-sample-acts-as-taggable-on,AlexVPopov/acts-as-taggable-on,carpeliam/acts-as-taggable-on,envato/acts-as-taggable-on | ruby | ## Code Before:
class TaggableModel < ActiveRecord::Base
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class CachedModel < ActiveRecord::Base
acts_as_taggable
end
class OtherCachedModel < ActiveRecord::Base
acts_as_taggable_on :languages, :statuses, :glasses
end
class OtherTaggableModel < ActiveRecord::Base
acts_as_taggable_on :tags, :languages
acts_as_taggable_on :needs, :offerings
end
class InheritingTaggableModel < TaggableModel
end
class AlteredInheritingTaggableModel < TaggableModel
acts_as_taggable_on :parts
end
class TaggableUser < ActiveRecord::Base
acts_as_tagger
end
class UntaggableModel < ActiveRecord::Base
belongs_to :taggable_model
end
class NonStandardIdTaggableModel < ActiveRecord::Base
primary_key = "an_id"
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class OrderedTaggableModel < ActiveRecord::Base
acts_as_ordered_taggable
acts_as_ordered_taggable_on :colours
end
## Instruction:
Add inheriting user model to specs
## Code After:
class TaggableModel < ActiveRecord::Base
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class CachedModel < ActiveRecord::Base
acts_as_taggable
end
class OtherCachedModel < ActiveRecord::Base
acts_as_taggable_on :languages, :statuses, :glasses
end
class OtherTaggableModel < ActiveRecord::Base
acts_as_taggable_on :tags, :languages
acts_as_taggable_on :needs, :offerings
end
class InheritingTaggableModel < TaggableModel
end
class AlteredInheritingTaggableModel < TaggableModel
acts_as_taggable_on :parts
end
class TaggableUser < ActiveRecord::Base
acts_as_tagger
end
class InheritingTaggableUser < TaggableUser
end
class UntaggableModel < ActiveRecord::Base
belongs_to :taggable_model
end
class NonStandardIdTaggableModel < ActiveRecord::Base
primary_key = "an_id"
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class OrderedTaggableModel < ActiveRecord::Base
acts_as_ordered_taggable
acts_as_ordered_taggable_on :colours
end
| class TaggableModel < ActiveRecord::Base
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class CachedModel < ActiveRecord::Base
acts_as_taggable
end
class OtherCachedModel < ActiveRecord::Base
acts_as_taggable_on :languages, :statuses, :glasses
end
class OtherTaggableModel < ActiveRecord::Base
acts_as_taggable_on :tags, :languages
acts_as_taggable_on :needs, :offerings
end
class InheritingTaggableModel < TaggableModel
end
class AlteredInheritingTaggableModel < TaggableModel
acts_as_taggable_on :parts
end
class TaggableUser < ActiveRecord::Base
acts_as_tagger
end
+ class InheritingTaggableUser < TaggableUser
+ end
+
class UntaggableModel < ActiveRecord::Base
belongs_to :taggable_model
end
class NonStandardIdTaggableModel < ActiveRecord::Base
primary_key = "an_id"
acts_as_taggable
acts_as_taggable_on :languages
acts_as_taggable_on :skills
acts_as_taggable_on :needs, :offerings
has_many :untaggable_models
end
class OrderedTaggableModel < ActiveRecord::Base
acts_as_ordered_taggable
acts_as_ordered_taggable_on :colours
end | 3 | 0.061224 | 3 | 0 |
9d0e9af5844772c18ca24d4012642d4518b66dfc | tests/test_judicious.py | tests/test_judicious.py |
"""Tests for `judicious` package."""
import pytest
import judicious
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
def test_content(response):
"""Sample pytest test function with the pytest fixture as an argument."""
# from bs4 import BeautifulSoup
# assert 'GitHub' in BeautifulSoup(response.content).title.string
|
"""Tests for `judicious` package."""
import random
import pytest
import judicious
def test_seeding():
r1 = random.random()
r2 = random.random()
judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff")
r3 = random.random()
r4 = random.random()
judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff")
r5 = random.random()
r6 = random.random()
judicious.seed()
r7 = random.random()
r8 = random.random()
assert(r1 != r3)
assert(r2 != r4)
assert(r3 == r5)
assert(r4 == r6)
assert(r5 != r7)
assert(r6 != r8)
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
def test_content(response):
"""Sample pytest test function with the pytest fixture as an argument."""
# from bs4 import BeautifulSoup
# assert 'GitHub' in BeautifulSoup(response.content).title.string
| Add test of seeding PRNG | Add test of seeding PRNG
| Python | mit | suchow/judicious,suchow/judicious,suchow/judicious | python | ## Code Before:
"""Tests for `judicious` package."""
import pytest
import judicious
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
def test_content(response):
"""Sample pytest test function with the pytest fixture as an argument."""
# from bs4 import BeautifulSoup
# assert 'GitHub' in BeautifulSoup(response.content).title.string
## Instruction:
Add test of seeding PRNG
## Code After:
"""Tests for `judicious` package."""
import random
import pytest
import judicious
def test_seeding():
r1 = random.random()
r2 = random.random()
judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff")
r3 = random.random()
r4 = random.random()
judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff")
r5 = random.random()
r6 = random.random()
judicious.seed()
r7 = random.random()
r8 = random.random()
assert(r1 != r3)
assert(r2 != r4)
assert(r3 == r5)
assert(r4 == r6)
assert(r5 != r7)
assert(r6 != r8)
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
def test_content(response):
"""Sample pytest test function with the pytest fixture as an argument."""
# from bs4 import BeautifulSoup
# assert 'GitHub' in BeautifulSoup(response.content).title.string
|
"""Tests for `judicious` package."""
+ import random
+
import pytest
+ import judicious
- import judicious
+
+ def test_seeding():
+ r1 = random.random()
+ r2 = random.random()
+ judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff")
+ r3 = random.random()
+ r4 = random.random()
+ judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff")
+ r5 = random.random()
+ r6 = random.random()
+ judicious.seed()
+ r7 = random.random()
+ r8 = random.random()
+
+ assert(r1 != r3)
+ assert(r2 != r4)
+ assert(r3 == r5)
+ assert(r4 == r6)
+ assert(r5 != r7)
+ assert(r6 != r8)
@pytest.fixture
def response():
"""Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
def test_content(response):
"""Sample pytest test function with the pytest fixture as an argument."""
# from bs4 import BeautifulSoup
# assert 'GitHub' in BeautifulSoup(response.content).title.string | 24 | 1.043478 | 23 | 1 |
e3118ed62848f490a795a10db52eae4b75b41460 | src/FlysystemServiceProviderTrait.php | src/FlysystemServiceProviderTrait.php | <?php
namespace WyriHaximus\Pimple;
use League\Flysystem\Filesystem;
trait FlysystemServiceProviderTrait
{
/**
* Register this service provider with the Application.
*
* @param \Pimple $app Application.
*
* @return void
*/
protected function registerFlysystems(\Pimple $app)
{
$app['flysystem.filesystems'] = [];
$app['flysystems'] = $app->share(function (\Pimple $app) {
$flysystems = new \Pimple();
foreach ($app['flysystem.filesystems'] as $alias => $parameters) {
$flysystems[$alias] = $this->buildFilesystem($parameters);
}
return $flysystems;
});
}
/**
* Instantiate an adapter and wrap it in a filesystem.
*
* @param array $parameters Array containing the adapter classname and arguments that need to be passed into it.
*
* @return Filesystem
*/
protected function buildFilesystem(array $parameters)
{
$adapter = new \ReflectionClass($parameters['adapter']);
return new Filesystem($adapter->newInstanceArgs($parameters['args']));
}
}
| <?php
namespace WyriHaximus\Pimple;
use League\Flysystem\Filesystem;
use League\Flysystem\Plugin\EmptyDir;
use League\Flysystem\Plugin\GetWithMetadata;
use League\Flysystem\Plugin\ListFiles;
use League\Flysystem\Plugin\ListPaths;
use League\Flysystem\Plugin\ListWith;
trait FlysystemServiceProviderTrait
{
/**
* Register this service provider with the Application.
*
* @param \Pimple $app Application.
*
* @return void
*/
protected function registerFlysystems(\Pimple $app)
{
$app['flysystem.filesystems'] = [];
$app['flysystem.plugins'] = [
new EmptyDir(),
new GetWithMetadata(),
new ListFiles(),
new ListPaths(),
new ListWith(),
];
$app['flysystems'] = $app->share(function (\Pimple $app) {
$flysystems = new \Pimple();
foreach ($app['flysystem.filesystems'] as $alias => $parameters) {
$flysystems[$alias] = $this->buildFilesystem($app, $parameters);
}
return $flysystems;
});
}
/**
* Instantiate an adapter and wrap it in a filesystem.
*
* @param array $parameters Array containing the adapter classname and arguments that need to be passed into it.
*
* @return Filesystem
*/
protected function buildFilesystem(\Pimple $app, array $parameters)
{
$adapter = new \ReflectionClass($parameters['adapter']);
$filesystem = new Filesystem($adapter->newInstanceArgs($parameters['args']));
foreach ($app['flysystem.plugins'] as $plugin) {
$plugin->setFilesystem($filesystem);
$filesystem->addPlugin($plugin);
}
return $filesystem;
}
}
| Add all available plugins by default | Add all available plugins by default
| PHP | mit | WyriHaximus/pimple-flysystem-service | php | ## Code Before:
<?php
namespace WyriHaximus\Pimple;
use League\Flysystem\Filesystem;
trait FlysystemServiceProviderTrait
{
/**
* Register this service provider with the Application.
*
* @param \Pimple $app Application.
*
* @return void
*/
protected function registerFlysystems(\Pimple $app)
{
$app['flysystem.filesystems'] = [];
$app['flysystems'] = $app->share(function (\Pimple $app) {
$flysystems = new \Pimple();
foreach ($app['flysystem.filesystems'] as $alias => $parameters) {
$flysystems[$alias] = $this->buildFilesystem($parameters);
}
return $flysystems;
});
}
/**
* Instantiate an adapter and wrap it in a filesystem.
*
* @param array $parameters Array containing the adapter classname and arguments that need to be passed into it.
*
* @return Filesystem
*/
protected function buildFilesystem(array $parameters)
{
$adapter = new \ReflectionClass($parameters['adapter']);
return new Filesystem($adapter->newInstanceArgs($parameters['args']));
}
}
## Instruction:
Add all available plugins by default
## Code After:
<?php
namespace WyriHaximus\Pimple;
use League\Flysystem\Filesystem;
use League\Flysystem\Plugin\EmptyDir;
use League\Flysystem\Plugin\GetWithMetadata;
use League\Flysystem\Plugin\ListFiles;
use League\Flysystem\Plugin\ListPaths;
use League\Flysystem\Plugin\ListWith;
trait FlysystemServiceProviderTrait
{
/**
* Register this service provider with the Application.
*
* @param \Pimple $app Application.
*
* @return void
*/
protected function registerFlysystems(\Pimple $app)
{
$app['flysystem.filesystems'] = [];
$app['flysystem.plugins'] = [
new EmptyDir(),
new GetWithMetadata(),
new ListFiles(),
new ListPaths(),
new ListWith(),
];
$app['flysystems'] = $app->share(function (\Pimple $app) {
$flysystems = new \Pimple();
foreach ($app['flysystem.filesystems'] as $alias => $parameters) {
$flysystems[$alias] = $this->buildFilesystem($app, $parameters);
}
return $flysystems;
});
}
/**
* Instantiate an adapter and wrap it in a filesystem.
*
* @param array $parameters Array containing the adapter classname and arguments that need to be passed into it.
*
* @return Filesystem
*/
protected function buildFilesystem(\Pimple $app, array $parameters)
{
$adapter = new \ReflectionClass($parameters['adapter']);
$filesystem = new Filesystem($adapter->newInstanceArgs($parameters['args']));
foreach ($app['flysystem.plugins'] as $plugin) {
$plugin->setFilesystem($filesystem);
$filesystem->addPlugin($plugin);
}
return $filesystem;
}
}
| <?php
namespace WyriHaximus\Pimple;
use League\Flysystem\Filesystem;
+ use League\Flysystem\Plugin\EmptyDir;
+ use League\Flysystem\Plugin\GetWithMetadata;
+ use League\Flysystem\Plugin\ListFiles;
+ use League\Flysystem\Plugin\ListPaths;
+ use League\Flysystem\Plugin\ListWith;
trait FlysystemServiceProviderTrait
{
/**
* Register this service provider with the Application.
*
* @param \Pimple $app Application.
*
* @return void
*/
protected function registerFlysystems(\Pimple $app)
{
$app['flysystem.filesystems'] = [];
+ $app['flysystem.plugins'] = [
+ new EmptyDir(),
+ new GetWithMetadata(),
+ new ListFiles(),
+ new ListPaths(),
+ new ListWith(),
+ ];
$app['flysystems'] = $app->share(function (\Pimple $app) {
$flysystems = new \Pimple();
foreach ($app['flysystem.filesystems'] as $alias => $parameters) {
- $flysystems[$alias] = $this->buildFilesystem($parameters);
+ $flysystems[$alias] = $this->buildFilesystem($app, $parameters);
? ++++++
}
return $flysystems;
});
}
/**
* Instantiate an adapter and wrap it in a filesystem.
*
* @param array $parameters Array containing the adapter classname and arguments that need to be passed into it.
*
* @return Filesystem
*/
- protected function buildFilesystem(array $parameters)
+ protected function buildFilesystem(\Pimple $app, array $parameters)
? ++++++++++++++
{
$adapter = new \ReflectionClass($parameters['adapter']);
- return new Filesystem($adapter->newInstanceArgs($parameters['args']));
? ^ ^^^
+ $filesystem = new Filesystem($adapter->newInstanceArgs($parameters['args']));
? ^^^^ +++ ^^^^
+
+ foreach ($app['flysystem.plugins'] as $plugin) {
+ $plugin->setFilesystem($filesystem);
+ $filesystem->addPlugin($plugin);
+ }
+
+ return $filesystem;
}
} | 25 | 0.625 | 22 | 3 |
87d3c1ce24e56ae9568c012bf16b14d833df4b23 | system/Config/BaseConfig.php | system/Config/BaseConfig.php | <?php namespace CodeIgniter\Config;
/**
* Class BaseConfig
*
* Not intended to be used on its own, this class will attempt to
* automatically populate the child class' properties with values
* from the environment.
*
* These can be set within the .env file.
*
* @package App\Config
*/
class BaseConfig
{
/**
* Will attempt to get environment variables with names
* that match the properties of the child class.
*/
public function __construct()
{
$properties = array_keys(get_object_vars($this));
foreach ($properties as $property)
{
if ($value = getenv($property))
{
$this->{$property} = $value;
}
}
}
//--------------------------------------------------------------------
}
| <?php namespace CodeIgniter\Config;
/**
* Class BaseConfig
*
* Not intended to be used on its own, this class will attempt to
* automatically populate the child class' properties with values
* from the environment.
*
* These can be set within the .env file.
*
* @package App\Config
*/
class BaseConfig
{
/**
* Will attempt to get environment variables with names
* that match the properties of the child class.
*/
public function __construct()
{
$properties = array_keys(get_object_vars($this));
$prefix = get_class($this);
foreach ($properties as $property)
{
if ($value = getenv("{$prefix}.{$property}"))
{
$this->{$property} = $value;
}
elseif ($value = getenv($property))
{
$this->{$property} = $value;
}
}
}
//--------------------------------------------------------------------
}
| Use prefixed properties in .env files | Use prefixed properties in .env files
As mentioned in discussion regarding database config files, BaseConfig
should prefer env vars prefixed with the classname (and a dot (.)
separator) over env vars using the property name alone.
| PHP | mit | butane/CodeIgniter4,butane/CodeIgniter4,butane/CodeIgniter4,KundiZ/CodeIgniter4,KundiZ/CodeIgniter4,lonnieezell/CodeIgniter4,KundiZ/CodeIgniter4,gustavojm/CodeIgniter4,titounnes/CodeIgniter4,gustavojm/CodeIgniter4,ytetsuro/CodeIgniter4,EpicKris/CodeIgniter4,natanfelles/CodeIgniter4,redweb-tn/CodeIgniter4,ytetsuro/CodeIgniter4,lonnieezell/CodeIgniter4,natanfelles/CodeIgniter4,KundiZ/CodeIgniter4,redweb-tn/CodeIgniter4,bcit-ci/CodeIgniter4,JuveLee/CodeIgniter4,samsonasik/CodeIgniter4,JuveLee/CodeIgniter4,hex-ci/CodeIgniter4,samsonasik/CodeIgniter4,hex-ci/CodeIgniter4,lonnieezell/CodeIgniter4,samsonasik/CodeIgniter4,noldor/CodeIgniter4,ytetsuro/CodeIgniter4,jim-parry/CodeIgniter4,samsonasik/CodeIgniter4,butane/CodeIgniter4,natanfelles/CodeIgniter4,EpicKris/CodeIgniter4,bcit-ci/CodeIgniter4,kenjis/CodeIgniter4,wuzheng40/CodeIgniter4,natanfelles/CodeIgniter4,samsonasik/CodeIgniter4,EpicKris/CodeIgniter4,jim-parry/CodeIgniter4,lonnieezell/CodeIgniter4,titounnes/CodeIgniter4,wuzheng40/CodeIgniter4,jim-parry/CodeIgniter4,titounnes/CodeIgniter4,kenjis/CodeIgniter4,EpicKris/CodeIgniter4,redweb-tn/CodeIgniter4,hex-ci/CodeIgniter4,butane/CodeIgniter4,kenjis/CodeIgniter4,titounnes/CodeIgniter4,hex-ci/CodeIgniter4,natanfelles/CodeIgniter4,noldor/CodeIgniter4,samsonasik/CodeIgniter4,kenjis/CodeIgniter4,natanfelles/CodeIgniter4,lonnieezell/CodeIgniter4,wuzheng40/CodeIgniter4,JuveLee/CodeIgniter4,gustavojm/CodeIgniter4,lonnieezell/CodeIgniter4,jim-parry/CodeIgniter4,noldor/CodeIgniter4,bcit-ci/CodeIgniter4,jim-parry/CodeIgniter4,noldor/CodeIgniter4,ytetsuro/CodeIgniter4,kenjis/CodeIgniter4,wuzheng40/CodeIgniter4,gustavojm/CodeIgniter4,butane/CodeIgniter4,redweb-tn/CodeIgniter4,bcit-ci/CodeIgniter4,ytetsuro/CodeIgniter4,ytetsuro/CodeIgniter4,bcit-ci/CodeIgniter4,JuveLee/CodeIgniter4,jim-parry/CodeIgniter4 | php | ## Code Before:
<?php namespace CodeIgniter\Config;
/**
* Class BaseConfig
*
* Not intended to be used on its own, this class will attempt to
* automatically populate the child class' properties with values
* from the environment.
*
* These can be set within the .env file.
*
* @package App\Config
*/
class BaseConfig
{
/**
* Will attempt to get environment variables with names
* that match the properties of the child class.
*/
public function __construct()
{
$properties = array_keys(get_object_vars($this));
foreach ($properties as $property)
{
if ($value = getenv($property))
{
$this->{$property} = $value;
}
}
}
//--------------------------------------------------------------------
}
## Instruction:
Use prefixed properties in .env files
As mentioned in discussion regarding database config files, BaseConfig
should prefer env vars prefixed with the classname (and a dot (.)
separator) over env vars using the property name alone.
## Code After:
<?php namespace CodeIgniter\Config;
/**
* Class BaseConfig
*
* Not intended to be used on its own, this class will attempt to
* automatically populate the child class' properties with values
* from the environment.
*
* These can be set within the .env file.
*
* @package App\Config
*/
class BaseConfig
{
/**
* Will attempt to get environment variables with names
* that match the properties of the child class.
*/
public function __construct()
{
$properties = array_keys(get_object_vars($this));
$prefix = get_class($this);
foreach ($properties as $property)
{
if ($value = getenv("{$prefix}.{$property}"))
{
$this->{$property} = $value;
}
elseif ($value = getenv($property))
{
$this->{$property} = $value;
}
}
}
//--------------------------------------------------------------------
}
| <?php namespace CodeIgniter\Config;
/**
* Class BaseConfig
*
* Not intended to be used on its own, this class will attempt to
* automatically populate the child class' properties with values
* from the environment.
*
* These can be set within the .env file.
*
* @package App\Config
*/
class BaseConfig
{
/**
* Will attempt to get environment variables with names
* that match the properties of the child class.
*/
public function __construct()
{
$properties = array_keys(get_object_vars($this));
+ $prefix = get_class($this);
foreach ($properties as $property)
{
+ if ($value = getenv("{$prefix}.{$property}"))
+ {
+ $this->{$property} = $value;
+ }
- if ($value = getenv($property))
+ elseif ($value = getenv($property))
? ++++
{
$this->{$property} = $value;
}
}
}
//--------------------------------------------------------------------
} | 7 | 0.2 | 6 | 1 |
6187667b8225ba629bc898c77322634cde9e6d44 | lib/node_modules/@stdlib/time/now/lib/index.js | lib/node_modules/@stdlib/time/now/lib/index.js | 'use strict';
/**
* Time in seconds since the epoch.
*
* @module @stdlib/time/now
*
* @example
* var now = require( '@stdlib/time/now' );
*
* var ts = now();
* // returns <number>
*/
// MODULES //
var bool = require( './detect.js' );
// MAIN //
var now;
if ( bool ) {
now = require( './now.js' );
} else {
now = require( './polyfill.js' );
}
// EXPORTS //
module.exports = now;
| 'use strict';
/**
* Time in seconds since the epoch.
*
* @module @stdlib/time/now
*
* @example
* var now = require( '@stdlib/time/now' );
*
* var ts = now();
* // returns <number>
*/
// MODULES //
var bool = require( './detect.js' );
var main = require( './now.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var now;
if ( bool ) {
now = main;
} else {
now = polyfill;
}
// EXPORTS //
module.exports = now;
| Refactor to avoid dynamic module resolution | Refactor to avoid dynamic module resolution
| JavaScript | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | javascript | ## Code Before:
'use strict';
/**
* Time in seconds since the epoch.
*
* @module @stdlib/time/now
*
* @example
* var now = require( '@stdlib/time/now' );
*
* var ts = now();
* // returns <number>
*/
// MODULES //
var bool = require( './detect.js' );
// MAIN //
var now;
if ( bool ) {
now = require( './now.js' );
} else {
now = require( './polyfill.js' );
}
// EXPORTS //
module.exports = now;
## Instruction:
Refactor to avoid dynamic module resolution
## Code After:
'use strict';
/**
* Time in seconds since the epoch.
*
* @module @stdlib/time/now
*
* @example
* var now = require( '@stdlib/time/now' );
*
* var ts = now();
* // returns <number>
*/
// MODULES //
var bool = require( './detect.js' );
var main = require( './now.js' );
var polyfill = require( './polyfill.js' );
// MAIN //
var now;
if ( bool ) {
now = main;
} else {
now = polyfill;
}
// EXPORTS //
module.exports = now;
| 'use strict';
/**
* Time in seconds since the epoch.
*
* @module @stdlib/time/now
*
* @example
* var now = require( '@stdlib/time/now' );
*
* var ts = now();
* // returns <number>
*/
// MODULES //
var bool = require( './detect.js' );
+ var main = require( './now.js' );
+ var polyfill = require( './polyfill.js' );
// MAIN //
var now;
if ( bool ) {
- now = require( './now.js' );
+ now = main;
} else {
- now = require( './polyfill.js' );
+ now = polyfill;
}
// EXPORTS //
module.exports = now; | 6 | 0.1875 | 4 | 2 |
9e10e1c0b275a76db9dd54ba9d3378d3f748c344 | fish/functions/getmd.fish | fish/functions/getmd.fish | function getmd -d "Retrieve single URL, convert to markdown"
if test -z $MERCURY_API_KEY
echo "error: MERCURY_API_KEY not set"
return 1
end
if test -z $argv[1]
echo "usage: $_ url"
return 1
end
curl -s -H "x-api-key: $MERCURY_API_KEY" 'https://mercury.postlight.com/parser?url='$argv[1] | jq -r .content | pandoc -f html -t markdown-raw_html-native_divs-native_spans
end
| function getmd -d "Retrieve single URL, convert to markdown"
if test -z $MERCURY_API_KEY
echo "error: MERCURY_API_KEY not set"
return 1
end
if test -z $argv[1]
echo "usage: $_ url"
return 1
end
curl -s -G --data-urlencode (printf "url=%s" $argv[1]) -H "x-api-key: $MERCURY_API_KEY" https://mercury.postlight.com/parser | jq -r .content | pandoc -f html -t markdown
end
| Handle URLs with ? and & | Handle URLs with ? and &
| fish | apache-2.0 | ithinkihaveacat/dotfiles,ithinkihaveacat/dotfiles,ithinkihaveacat/dotfiles | fish | ## Code Before:
function getmd -d "Retrieve single URL, convert to markdown"
if test -z $MERCURY_API_KEY
echo "error: MERCURY_API_KEY not set"
return 1
end
if test -z $argv[1]
echo "usage: $_ url"
return 1
end
curl -s -H "x-api-key: $MERCURY_API_KEY" 'https://mercury.postlight.com/parser?url='$argv[1] | jq -r .content | pandoc -f html -t markdown-raw_html-native_divs-native_spans
end
## Instruction:
Handle URLs with ? and &
## Code After:
function getmd -d "Retrieve single URL, convert to markdown"
if test -z $MERCURY_API_KEY
echo "error: MERCURY_API_KEY not set"
return 1
end
if test -z $argv[1]
echo "usage: $_ url"
return 1
end
curl -s -G --data-urlencode (printf "url=%s" $argv[1]) -H "x-api-key: $MERCURY_API_KEY" https://mercury.postlight.com/parser | jq -r .content | pandoc -f html -t markdown
end
| function getmd -d "Retrieve single URL, convert to markdown"
if test -z $MERCURY_API_KEY
echo "error: MERCURY_API_KEY not set"
return 1
end
if test -z $argv[1]
echo "usage: $_ url"
return 1
end
- curl -s -H "x-api-key: $MERCURY_API_KEY" 'https://mercury.postlight.com/parser?url='$argv[1] | jq -r .content | pandoc -f html -t markdown-raw_html-native_divs-native_spans
+ curl -s -G --data-urlencode (printf "url=%s" $argv[1]) -H "x-api-key: $MERCURY_API_KEY" https://mercury.postlight.com/parser | jq -r .content | pandoc -f html -t markdown
end | 2 | 0.181818 | 1 | 1 |
66820620b419ffcd5c826b886437097b22d196a5 | examples/requirements.txt | examples/requirements.txt | moderngl_window
objloader
numpy
pillow
pyrr
pymunk
matplotlib
imageio
glfw<2.0
pyglet>1.4,<2.0
PySDL2
PyQt5<6
PySide2<6
| moderngl_window
objloader
pymunk
matplotlib
imageio
glfw<2.0
pyglet>1.4,<2.0
PySDL2
PyQt5<6
PySide2<6
| Remove dependecies already required by moderngl_window | Remove dependecies already required by moderngl_window
| Text | mit | cprogrammer1994/ModernGL,cprogrammer1994/ModernGL,cprogrammer1994/ModernGL | text | ## Code Before:
moderngl_window
objloader
numpy
pillow
pyrr
pymunk
matplotlib
imageio
glfw<2.0
pyglet>1.4,<2.0
PySDL2
PyQt5<6
PySide2<6
## Instruction:
Remove dependecies already required by moderngl_window
## Code After:
moderngl_window
objloader
pymunk
matplotlib
imageio
glfw<2.0
pyglet>1.4,<2.0
PySDL2
PyQt5<6
PySide2<6
| moderngl_window
objloader
- numpy
- pillow
- pyrr
pymunk
matplotlib
imageio
glfw<2.0
pyglet>1.4,<2.0
PySDL2
PyQt5<6
PySide2<6 | 3 | 0.2 | 0 | 3 |
901462b1fad8f8776c1619ee2466dbbc2c48ea04 | stubs-for-cf-release/enable_diego_ssh_in_cf.yml | stubs-for-cf-release/enable_diego_ssh_in_cf.yml | properties:
<<: (( merge ))
app_ssh:
host_key_fingerprint: a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a
oauth_client_id: ssh-proxy
cc:
<<: (( merge ))
allow_app_ssh_access: true
uaa:
<<: (( merge ))
clients:
<<: (( merge ))
ssh-proxy:
authorized-grant-types: authorization_code
autoapprove: true
override: true
redirect-uri: /login
scope: openid,cloud_controller.read,cloud_controller.write
secret: ssh-proxy-secret
| properties:
<<: (( merge ))
app_ssh:
host_key_fingerprint: a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a
oauth_client_id: ssh-proxy
cc:
allow_app_ssh_access: true
uaa:
clients:
<<: (( merge ))
ssh-proxy:
authorized-grant-types: authorization_code
autoapprove: true
override: true
redirect-uri: /login
scope: openid,cloud_controller.read,cloud_controller.write
secret: ssh-proxy-secret
| Remove ignored hash merges from cf-release stub | Remove ignored hash merges from cf-release stub
* cf-release manifest templates do not have upstream merges, so they are
* effectively meaningless
[#105611266]
Signed-off-by: Jen Spinney <475b118f8db4f150e7ed3b69b35fd7c857f9c9f8@hpe.com>
| YAML | apache-2.0 | cloudfoundry-incubator/diego-release,cloudfoundry-incubator/diego-release,cloudfoundry-incubator/diego-release,cloudfoundry-incubator/diego-release | yaml | ## Code Before:
properties:
<<: (( merge ))
app_ssh:
host_key_fingerprint: a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a
oauth_client_id: ssh-proxy
cc:
<<: (( merge ))
allow_app_ssh_access: true
uaa:
<<: (( merge ))
clients:
<<: (( merge ))
ssh-proxy:
authorized-grant-types: authorization_code
autoapprove: true
override: true
redirect-uri: /login
scope: openid,cloud_controller.read,cloud_controller.write
secret: ssh-proxy-secret
## Instruction:
Remove ignored hash merges from cf-release stub
* cf-release manifest templates do not have upstream merges, so they are
* effectively meaningless
[#105611266]
Signed-off-by: Jen Spinney <475b118f8db4f150e7ed3b69b35fd7c857f9c9f8@hpe.com>
## Code After:
properties:
<<: (( merge ))
app_ssh:
host_key_fingerprint: a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a
oauth_client_id: ssh-proxy
cc:
allow_app_ssh_access: true
uaa:
clients:
<<: (( merge ))
ssh-proxy:
authorized-grant-types: authorization_code
autoapprove: true
override: true
redirect-uri: /login
scope: openid,cloud_controller.read,cloud_controller.write
secret: ssh-proxy-secret
| properties:
<<: (( merge ))
app_ssh:
host_key_fingerprint: a6:d1:08:0b:b0:cb:9b:5f:c4:ba:44:2a:97:26:19:8a
oauth_client_id: ssh-proxy
cc:
- <<: (( merge ))
allow_app_ssh_access: true
uaa:
- <<: (( merge ))
clients:
<<: (( merge ))
ssh-proxy:
authorized-grant-types: authorization_code
autoapprove: true
override: true
redirect-uri: /login
scope: openid,cloud_controller.read,cloud_controller.write
secret: ssh-proxy-secret | 2 | 0.105263 | 0 | 2 |
2654a91a63129caefa74f385e13531e7e2fa5360 | Hints.hs | Hints.hs |
module Hints where
import Data.List
-- concatMap f x
concat_map f x = concat (map f x)
-- map (f . g) x
map_map f g x = map f (map g x)
-- x : y
box_append x y = [x] ++ y
-- head x
head_index x = x !! 0
-- tail x
tail_drop x = drop 1 x
-- replicate n x
use_replicate n x = take n (repeat x)
-- unwords (x:xs)
use_unwords1 x xs = x ++ concatMap (' ':) xs
-- unwords xs
use_unwords2 xs = concat (intersperse " " xs)
-- a
no_if a = if a then True else False
-- not a
use_not a = if a then False else True
-- a /= b
use_neq a b = not (a == b)
-- a == b
use_eq a b = not (a /= b)
-- if a || b then t else f
use_or a b t f = if a then t else (if b then t else f)
-- if a && b then t else f
use_and a b t f = if a then (if b then t else f) else f
-- liftM f m
use_liftM m f = m >>= return . f
-- [x | b]
use_list_comp b x = if b then [x] else []
|
module Hints where
import Data.List
-- concatMap f x
concat_map f x = concat (map f x)
-- map (f . g) x
map_map f g x = map f (map g x)
-- x : y
box_append x y = [x] ++ y
-- head x
head_index x = x !! 0
-- replicate n x
use_replicate n x = take n (repeat x)
-- unwords (x:xs)
use_unwords1 x xs = x ++ concatMap (' ':) xs
-- unwords xs
use_unwords2 xs = concat (intersperse " " xs)
-- a
no_if a = if a then True else False
-- not a
use_not a = if a then False else True
-- a /= b
use_neq a b = not (a == b)
-- a == b
use_eq a b = not (a /= b)
-- if a || b then t else f
use_or a b t f = if a then t else (if b then t else f)
-- if a && b then t else f
use_and a b t f = if a then (if b then t else f) else f
-- liftM f m
use_liftM m f = m >>= return . f
-- [x | b]
use_list_comp b x = if b then [x] else []
| Remove tail_drop, the behaviour for tail [] vs drop 1 [] is different | Remove tail_drop, the behaviour for tail [] vs drop 1 [] is different | Haskell | bsd-3-clause | eigengrau/hlint,bitemyapp/hlint,mpickering/hlint,ndmitchell/hlint,gibiansky/hlint,ndmitchell/hlint | haskell | ## Code Before:
module Hints where
import Data.List
-- concatMap f x
concat_map f x = concat (map f x)
-- map (f . g) x
map_map f g x = map f (map g x)
-- x : y
box_append x y = [x] ++ y
-- head x
head_index x = x !! 0
-- tail x
tail_drop x = drop 1 x
-- replicate n x
use_replicate n x = take n (repeat x)
-- unwords (x:xs)
use_unwords1 x xs = x ++ concatMap (' ':) xs
-- unwords xs
use_unwords2 xs = concat (intersperse " " xs)
-- a
no_if a = if a then True else False
-- not a
use_not a = if a then False else True
-- a /= b
use_neq a b = not (a == b)
-- a == b
use_eq a b = not (a /= b)
-- if a || b then t else f
use_or a b t f = if a then t else (if b then t else f)
-- if a && b then t else f
use_and a b t f = if a then (if b then t else f) else f
-- liftM f m
use_liftM m f = m >>= return . f
-- [x | b]
use_list_comp b x = if b then [x] else []
## Instruction:
Remove tail_drop, the behaviour for tail [] vs drop 1 [] is different
## Code After:
module Hints where
import Data.List
-- concatMap f x
concat_map f x = concat (map f x)
-- map (f . g) x
map_map f g x = map f (map g x)
-- x : y
box_append x y = [x] ++ y
-- head x
head_index x = x !! 0
-- replicate n x
use_replicate n x = take n (repeat x)
-- unwords (x:xs)
use_unwords1 x xs = x ++ concatMap (' ':) xs
-- unwords xs
use_unwords2 xs = concat (intersperse " " xs)
-- a
no_if a = if a then True else False
-- not a
use_not a = if a then False else True
-- a /= b
use_neq a b = not (a == b)
-- a == b
use_eq a b = not (a /= b)
-- if a || b then t else f
use_or a b t f = if a then t else (if b then t else f)
-- if a && b then t else f
use_and a b t f = if a then (if b then t else f) else f
-- liftM f m
use_liftM m f = m >>= return . f
-- [x | b]
use_list_comp b x = if b then [x] else []
|
module Hints where
import Data.List
-- concatMap f x
concat_map f x = concat (map f x)
-- map (f . g) x
map_map f g x = map f (map g x)
-- x : y
box_append x y = [x] ++ y
-- head x
head_index x = x !! 0
-
- -- tail x
- tail_drop x = drop 1 x
-- replicate n x
use_replicate n x = take n (repeat x)
-- unwords (x:xs)
use_unwords1 x xs = x ++ concatMap (' ':) xs
-- unwords xs
use_unwords2 xs = concat (intersperse " " xs)
-- a
no_if a = if a then True else False
-- not a
use_not a = if a then False else True
-- a /= b
use_neq a b = not (a == b)
-- a == b
use_eq a b = not (a /= b)
-- if a || b then t else f
use_or a b t f = if a then t else (if b then t else f)
-- if a && b then t else f
use_and a b t f = if a then (if b then t else f) else f
-- liftM f m
use_liftM m f = m >>= return . f
-- [x | b]
use_list_comp b x = if b then [x] else [] | 3 | 0.056604 | 0 | 3 |
c366ad751cc613a04a22983d5547a9067f83ea12 | app/assets/stylesheets/sephora_style_guide/app/base.scss | app/assets/stylesheets/sephora_style_guide/app/base.scss | article {
margin-top: 50px;
> h2 {
border-bottom: 2px solid $black;
padding-bottom: 10px;
margin-bottom: 20px;
text-align: center;
}
}
section {
margin-top: 10px;
> h3 {
color: $brand-primary;
margin-bottom: 10px;
}
}
| article {
margin-top: 50px;
> h2 {
border-bottom: 2px solid $black;
padding-bottom: 10px;
margin-bottom: 20px;
text-align: center;
}
}
section {
margin-top: 10px;
> h3 {
color: $grey-mid;
margin-bottom: 10px;
}
> h4 {
color: $grey-mid;
}
}
| Change subheading colours to match new design | Change subheading colours to match new design
| SCSS | mit | luxola/sephora-style-guide,luxola/sephora-style-guide,luxola/sephora-style-guide | scss | ## Code Before:
article {
margin-top: 50px;
> h2 {
border-bottom: 2px solid $black;
padding-bottom: 10px;
margin-bottom: 20px;
text-align: center;
}
}
section {
margin-top: 10px;
> h3 {
color: $brand-primary;
margin-bottom: 10px;
}
}
## Instruction:
Change subheading colours to match new design
## Code After:
article {
margin-top: 50px;
> h2 {
border-bottom: 2px solid $black;
padding-bottom: 10px;
margin-bottom: 20px;
text-align: center;
}
}
section {
margin-top: 10px;
> h3 {
color: $grey-mid;
margin-bottom: 10px;
}
> h4 {
color: $grey-mid;
}
}
| article {
margin-top: 50px;
> h2 {
border-bottom: 2px solid $black;
padding-bottom: 10px;
margin-bottom: 20px;
text-align: center;
}
}
section {
margin-top: 10px;
> h3 {
- color: $brand-primary;
+ color: $grey-mid;
margin-bottom: 10px;
}
+
+ > h4 {
+ color: $grey-mid;
+ }
} | 6 | 0.315789 | 5 | 1 |
5126730849f350bbe14e358aa854d8e1968b2efc | client/catalog/index.js | client/catalog/index.js | module.exports = [].concat(
require('./accounting'),
require('./advertising'),
require('./biomedical-engineering'),
require('./chemical-engineering'),
require('./chemistry'),
require('./civil-and-coastal-engineering'),
require('./computer-science'),
require('./mathematics'),
require('./physics'),
require('./statistics')
); | module.exports = [].concat(
require('./accounting'),
require('./advertising'),
require('./african-studies'),
require('./biomedical-engineering'),
require('./chemical-engineering'),
require('./chemistry'),
require('./civil-and-coastal-engineering'),
require('./computer-science'),
require('./mathematics'),
require('./physics'),
require('./statistics')
); | Add African Studies to search | Add African Studies to search
| JavaScript | mit | KenanY/course-search,KenanY/course-search | javascript | ## Code Before:
module.exports = [].concat(
require('./accounting'),
require('./advertising'),
require('./biomedical-engineering'),
require('./chemical-engineering'),
require('./chemistry'),
require('./civil-and-coastal-engineering'),
require('./computer-science'),
require('./mathematics'),
require('./physics'),
require('./statistics')
);
## Instruction:
Add African Studies to search
## Code After:
module.exports = [].concat(
require('./accounting'),
require('./advertising'),
require('./african-studies'),
require('./biomedical-engineering'),
require('./chemical-engineering'),
require('./chemistry'),
require('./civil-and-coastal-engineering'),
require('./computer-science'),
require('./mathematics'),
require('./physics'),
require('./statistics')
); | module.exports = [].concat(
require('./accounting'),
require('./advertising'),
+ require('./african-studies'),
require('./biomedical-engineering'),
require('./chemical-engineering'),
require('./chemistry'),
require('./civil-and-coastal-engineering'),
require('./computer-science'),
require('./mathematics'),
require('./physics'),
require('./statistics')
); | 1 | 0.083333 | 1 | 0 |
02436bea03b1f9a61fb0bc39b2a9f821ac4f6118 | src/node.h | src/node.h |
/**
* \brief Base class for nodes which are managed by the
* Nodes class
*
* The only virtual method which must be implemented is
* Node::render.
*/
class Node
{
public:
virtual ~Node()
{
}
virtual void render(Graphics::Gl *gl, RenderData renderData) = 0;
virtual std::shared_ptr<Math::Obb> getObb()
{
return std::shared_ptr<Math::Obb>();
}
bool isPersistable()
{
return persistable;
}
protected:
Node()
{
}
bool persistable = true;
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, unsigned int version) const
{
}
};
#endif // SRC_NODE_H_
|
/**
* \brief Base class for nodes which are managed by the
* Nodes class
*
* The only virtual method which must be implemented is
* Node::render.
*/
class Node
{
public:
virtual ~Node()
{
}
virtual void render(Graphics::Gl *gl, RenderData renderData) = 0;
void render(Graphics::Gl *gl, std::shared_ptr<Graphics::HABuffer> haBuffer,
RenderData renderData)
{
this->haBuffer = haBuffer;
render(gl, renderData);
}
virtual std::shared_ptr<Math::Obb> getObb()
{
return std::shared_ptr<Math::Obb>();
}
bool isPersistable()
{
return persistable;
}
protected:
Node()
{
}
bool persistable = true;
std::shared_ptr<Graphics::HABuffer> haBuffer;
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, unsigned int version) const
{
}
};
#endif // SRC_NODE_H_
| Store haBuffer shared_ptr in Node. | Store haBuffer shared_ptr in Node.
| C | mit | Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller | c | ## Code Before:
/**
* \brief Base class for nodes which are managed by the
* Nodes class
*
* The only virtual method which must be implemented is
* Node::render.
*/
class Node
{
public:
virtual ~Node()
{
}
virtual void render(Graphics::Gl *gl, RenderData renderData) = 0;
virtual std::shared_ptr<Math::Obb> getObb()
{
return std::shared_ptr<Math::Obb>();
}
bool isPersistable()
{
return persistable;
}
protected:
Node()
{
}
bool persistable = true;
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, unsigned int version) const
{
}
};
#endif // SRC_NODE_H_
## Instruction:
Store haBuffer shared_ptr in Node.
## Code After:
/**
* \brief Base class for nodes which are managed by the
* Nodes class
*
* The only virtual method which must be implemented is
* Node::render.
*/
class Node
{
public:
virtual ~Node()
{
}
virtual void render(Graphics::Gl *gl, RenderData renderData) = 0;
void render(Graphics::Gl *gl, std::shared_ptr<Graphics::HABuffer> haBuffer,
RenderData renderData)
{
this->haBuffer = haBuffer;
render(gl, renderData);
}
virtual std::shared_ptr<Math::Obb> getObb()
{
return std::shared_ptr<Math::Obb>();
}
bool isPersistable()
{
return persistable;
}
protected:
Node()
{
}
bool persistable = true;
std::shared_ptr<Graphics::HABuffer> haBuffer;
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, unsigned int version) const
{
}
};
#endif // SRC_NODE_H_
| -
/**
* \brief Base class for nodes which are managed by the
* Nodes class
*
* The only virtual method which must be implemented is
* Node::render.
*/
class Node
{
public:
virtual ~Node()
{
}
virtual void render(Graphics::Gl *gl, RenderData renderData) = 0;
+ void render(Graphics::Gl *gl, std::shared_ptr<Graphics::HABuffer> haBuffer,
+ RenderData renderData)
+ {
+ this->haBuffer = haBuffer;
+ render(gl, renderData);
+ }
+
virtual std::shared_ptr<Math::Obb> getObb()
{
return std::shared_ptr<Math::Obb>();
}
bool isPersistable()
{
return persistable;
}
protected:
Node()
{
}
bool persistable = true;
+ std::shared_ptr<Graphics::HABuffer> haBuffer;
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, unsigned int version) const
{
}
};
#endif // SRC_NODE_H_ | 9 | 0.204545 | 8 | 1 |
eea647cf05d7143d800f834dd77aeafc32522100 | groundstation/settings.py | groundstation/settings.py | PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
| PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
DEFAULT_CACHE_LIFETIME=900
| Add config key for default cache lifetime | Add config key for default cache lifetime
| Python | mit | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | python | ## Code Before:
PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
## Instruction:
Add config key for default cache lifetime
## Code After:
PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
DEFAULT_CACHE_LIFETIME=900
| PORT=1248
BEACON_TIMEOUT=5
DEFAULT_BUFSIZE=8192
+ DEFAULT_CACHE_LIFETIME=900 | 1 | 0.333333 | 1 | 0 |
6ea68a9cdb345bf8dc2dab5f56d90ac8bc1a29a6 | tests/library/CM/SmartyPlugins/function.viewTemplateTest.php | tests/library/CM/SmartyPlugins/function.viewTemplateTest.php | <?php
class smarty_function_viewTemplateTest extends CMTest_TestCase {
public function testRender() {
/** @var CM_Component_Abstract $component */
$component = $this->mockObject('CM_Component_Abstract');
$viewResponse = new CM_Frontend_ViewResponse($component);
$render = $this->mockObject('CM_Frontend_Render');
$method = $render->mockMethod('fetchViewTemplate')->set(function ($view, $templateName, $data) use ($component) {
$this->assertSame($component, $view);
$this->assertSame('jar', $templateName);
$this->assertArrayContains(['bar' => 'bar', 'foo' => 'foo'], $data);
});
/** @var CM_Frontend_Render $render */
$render->getGlobalResponse()->treeExpand($viewResponse);
$render->parseTemplateContent('{viewTemplate file="jar" bar="bar"}', ['foo' => 'foo']);
$this->assertSame(1, $method->getCallCount());
}
}
| <?php
class smarty_function_viewTemplateTest extends CMTest_TestCase {
public function testRender() {
/** @var CM_Component_Abstract $component */
$component = $this->mockObject('CM_Component_Abstract');
$componentViewResponse = new CM_Frontend_ViewResponse($component);
/** @var CM_Form_Abstract $form */
$form = $this->mockObject('CM_Form_Abstract');
$formViewResponse = new CM_Frontend_ViewResponse($form);
$render = $this->mockObject('CM_Frontend_Render');
$method = $render->mockMethod('fetchViewTemplate')
->at(0, function ($view, $templateName, $data) use ($form) {
$this->assertSame($form, $view);
$this->assertSame('jar', $templateName);
$this->assertArrayContains(['bar' => 'bar', 'foo' => 'foo'], $data);
})
->at(1, function ($view, $templateName, $data) use ($component) {
$this->assertSame($component, $view);
$this->assertSame('foo', $templateName);
});
/** @var CM_Frontend_Render $render */
$render->getGlobalResponse()->treeExpand($componentViewResponse);
$render->getGlobalResponse()->treeExpand($formViewResponse);
$render->parseTemplateContent('{viewTemplate file="jar" bar="bar"}', ['foo' => 'foo']);
$render->parseTemplateContent('{viewTemplate view="CM_Component_Abstract" file="foo"}');
$this->assertSame(2, $method->getCallCount());
}
}
| Include testing view param for viewTemplate | Include testing view param for viewTemplate
| PHP | mit | mariansollmann/CM,fvovan/CM,fvovan/CM,njam/CM,cargomedia/CM,njam/CM,fauvel/CM,tomaszdurka/CM,fvovan/CM,mariansollmann/CM,njam/CM,zazabe/cm,alexispeter/CM,alexispeter/CM,vogdb/cm,tomaszdurka/CM,fauvel/CM,fauvel/CM,tomaszdurka/CM,vogdb/cm,cargomedia/CM,vogdb/cm,cargomedia/CM,alexispeter/CM,cargomedia/CM,njam/CM,mariansollmann/CM,tomaszdurka/CM,zazabe/cm,vogdb/cm,zazabe/cm,mariansollmann/CM,njam/CM,tomaszdurka/CM,alexispeter/CM,fauvel/CM,fauvel/CM,zazabe/cm,fvovan/CM,vogdb/cm | php | ## Code Before:
<?php
class smarty_function_viewTemplateTest extends CMTest_TestCase {
public function testRender() {
/** @var CM_Component_Abstract $component */
$component = $this->mockObject('CM_Component_Abstract');
$viewResponse = new CM_Frontend_ViewResponse($component);
$render = $this->mockObject('CM_Frontend_Render');
$method = $render->mockMethod('fetchViewTemplate')->set(function ($view, $templateName, $data) use ($component) {
$this->assertSame($component, $view);
$this->assertSame('jar', $templateName);
$this->assertArrayContains(['bar' => 'bar', 'foo' => 'foo'], $data);
});
/** @var CM_Frontend_Render $render */
$render->getGlobalResponse()->treeExpand($viewResponse);
$render->parseTemplateContent('{viewTemplate file="jar" bar="bar"}', ['foo' => 'foo']);
$this->assertSame(1, $method->getCallCount());
}
}
## Instruction:
Include testing view param for viewTemplate
## Code After:
<?php
class smarty_function_viewTemplateTest extends CMTest_TestCase {
public function testRender() {
/** @var CM_Component_Abstract $component */
$component = $this->mockObject('CM_Component_Abstract');
$componentViewResponse = new CM_Frontend_ViewResponse($component);
/** @var CM_Form_Abstract $form */
$form = $this->mockObject('CM_Form_Abstract');
$formViewResponse = new CM_Frontend_ViewResponse($form);
$render = $this->mockObject('CM_Frontend_Render');
$method = $render->mockMethod('fetchViewTemplate')
->at(0, function ($view, $templateName, $data) use ($form) {
$this->assertSame($form, $view);
$this->assertSame('jar', $templateName);
$this->assertArrayContains(['bar' => 'bar', 'foo' => 'foo'], $data);
})
->at(1, function ($view, $templateName, $data) use ($component) {
$this->assertSame($component, $view);
$this->assertSame('foo', $templateName);
});
/** @var CM_Frontend_Render $render */
$render->getGlobalResponse()->treeExpand($componentViewResponse);
$render->getGlobalResponse()->treeExpand($formViewResponse);
$render->parseTemplateContent('{viewTemplate file="jar" bar="bar"}', ['foo' => 'foo']);
$render->parseTemplateContent('{viewTemplate view="CM_Component_Abstract" file="foo"}');
$this->assertSame(2, $method->getCallCount());
}
}
| <?php
class smarty_function_viewTemplateTest extends CMTest_TestCase {
public function testRender() {
/** @var CM_Component_Abstract $component */
$component = $this->mockObject('CM_Component_Abstract');
- $viewResponse = new CM_Frontend_ViewResponse($component);
? ^
+ $componentViewResponse = new CM_Frontend_ViewResponse($component);
? ^^^^^^^^^^
+
+ /** @var CM_Form_Abstract $form */
+ $form = $this->mockObject('CM_Form_Abstract');
+ $formViewResponse = new CM_Frontend_ViewResponse($form);
$render = $this->mockObject('CM_Frontend_Render');
- $method = $render->mockMethod('fetchViewTemplate')->set(function ($view, $templateName, $data) use ($component) {
+ $method = $render->mockMethod('fetchViewTemplate')
+ ->at(0, function ($view, $templateName, $data) use ($form) {
- $this->assertSame($component, $view);
? ^ ------
+ $this->assertSame($form, $view);
? ++++ ^ +
- $this->assertSame('jar', $templateName);
+ $this->assertSame('jar', $templateName);
? ++++
- $this->assertArrayContains(['bar' => 'bar', 'foo' => 'foo'], $data);
+ $this->assertArrayContains(['bar' => 'bar', 'foo' => 'foo'], $data);
? ++++
+ })
+ ->at(1, function ($view, $templateName, $data) use ($component) {
+ $this->assertSame($component, $view);
+ $this->assertSame('foo', $templateName);
- });
+ });
? ++++
/** @var CM_Frontend_Render $render */
+ $render->getGlobalResponse()->treeExpand($componentViewResponse);
- $render->getGlobalResponse()->treeExpand($viewResponse);
? ^
+ $render->getGlobalResponse()->treeExpand($formViewResponse);
? ^^^^^
+
$render->parseTemplateContent('{viewTemplate file="jar" bar="bar"}', ['foo' => 'foo']);
+ $render->parseTemplateContent('{viewTemplate view="CM_Component_Abstract" file="foo"}');
+
- $this->assertSame(1, $method->getCallCount());
? ^
+ $this->assertSame(2, $method->getCallCount());
? ^
}
} | 29 | 1.380952 | 21 | 8 |
694421302ec427142189fa4b1de6b7894dc93839 | README.md | README.md | fdocopt
=======
> File decorator for [docopt] option parser.
[docopt]: https://github.com/docopt/docopt.coffee
Overview
--------
It's not easy to work with docopt in pure JavaScript since, unlike
Python and CoffeeScript, there's no simple way to define a multiline
string to contain the usage string.
This package provides a decorator for docopt to solve this problem.
```js
#!/usr/bin/env node
'use strict';
/*
Usage: hello [options] <world>
Arguments:
<world> Hello world!
Options:
-h, --help Show this help.
--version Show version.
--happy Be happy.
*/
var docopt = require('fdocopt')();
```
By default it will decorate the global docopt instance, so the above is
the same as:
```js
var docopt = require('fdocopt')(require('docopt').docopt);
```
Then, pass the documented filename instead of the usage string:
```js
var args = docopt(__filename);
```
You can also use the internal functions to extract the comment block
from a file or a code buffer:
```js
var doc = require('fdocopt').extract(__filename);
var doc = require('fdocopt').extractBuffer('/** Usage: hello */');
```
| fdocopt
=======
> File decorator for [docopt] option parser.
[docopt]: https://github.com/docopt/docopt.coffee
Overview
--------
It's not easy to work with docopt in pure JavaScript since, unlike
Python and CoffeeScript, there's no simple way to define a multiline
string to contain the usage string.
This package provides a decorator for docopt to solve this problem.
```js
/*
Usage: hello [options] <world>
Arguments:
<world> Hello world!
Options:
-h, --help Show this help.
--version Show version.
--happy Be happy.
*/
var docopt = require('fdocopt')();
```
By default it will decorate the global docopt instance, so the above is
the same as:
```js
var docopt = require('fdocopt')(require('docopt').docopt);
```
Then, pass the documented filename instead of the usage string:
```js
var args = docopt(__filename);
```
You can also use the internal functions to extract the comment block
from a file or a code buffer:
```js
var doc = require('fdocopt').extract(__filename);
var doc = require('fdocopt').extractBuffer('/** Usage: hello */');
```
| Remove unneeded lines in example | Remove unneeded lines in example
| Markdown | unlicense | valeriangalliat/fdocopt | markdown | ## Code Before:
fdocopt
=======
> File decorator for [docopt] option parser.
[docopt]: https://github.com/docopt/docopt.coffee
Overview
--------
It's not easy to work with docopt in pure JavaScript since, unlike
Python and CoffeeScript, there's no simple way to define a multiline
string to contain the usage string.
This package provides a decorator for docopt to solve this problem.
```js
#!/usr/bin/env node
'use strict';
/*
Usage: hello [options] <world>
Arguments:
<world> Hello world!
Options:
-h, --help Show this help.
--version Show version.
--happy Be happy.
*/
var docopt = require('fdocopt')();
```
By default it will decorate the global docopt instance, so the above is
the same as:
```js
var docopt = require('fdocopt')(require('docopt').docopt);
```
Then, pass the documented filename instead of the usage string:
```js
var args = docopt(__filename);
```
You can also use the internal functions to extract the comment block
from a file or a code buffer:
```js
var doc = require('fdocopt').extract(__filename);
var doc = require('fdocopt').extractBuffer('/** Usage: hello */');
```
## Instruction:
Remove unneeded lines in example
## Code After:
fdocopt
=======
> File decorator for [docopt] option parser.
[docopt]: https://github.com/docopt/docopt.coffee
Overview
--------
It's not easy to work with docopt in pure JavaScript since, unlike
Python and CoffeeScript, there's no simple way to define a multiline
string to contain the usage string.
This package provides a decorator for docopt to solve this problem.
```js
/*
Usage: hello [options] <world>
Arguments:
<world> Hello world!
Options:
-h, --help Show this help.
--version Show version.
--happy Be happy.
*/
var docopt = require('fdocopt')();
```
By default it will decorate the global docopt instance, so the above is
the same as:
```js
var docopt = require('fdocopt')(require('docopt').docopt);
```
Then, pass the documented filename instead of the usage string:
```js
var args = docopt(__filename);
```
You can also use the internal functions to extract the comment block
from a file or a code buffer:
```js
var doc = require('fdocopt').extract(__filename);
var doc = require('fdocopt').extractBuffer('/** Usage: hello */');
```
| fdocopt
=======
> File decorator for [docopt] option parser.
[docopt]: https://github.com/docopt/docopt.coffee
Overview
--------
It's not easy to work with docopt in pure JavaScript since, unlike
Python and CoffeeScript, there's no simple way to define a multiline
string to contain the usage string.
This package provides a decorator for docopt to solve this problem.
```js
- #!/usr/bin/env node
-
- 'use strict';
-
/*
Usage: hello [options] <world>
Arguments:
<world> Hello world!
Options:
-h, --help Show this help.
--version Show version.
--happy Be happy.
*/
var docopt = require('fdocopt')();
```
By default it will decorate the global docopt instance, so the above is
the same as:
```js
var docopt = require('fdocopt')(require('docopt').docopt);
```
Then, pass the documented filename instead of the usage string:
```js
var args = docopt(__filename);
```
You can also use the internal functions to extract the comment block
from a file or a code buffer:
```js
var doc = require('fdocopt').extract(__filename);
var doc = require('fdocopt').extractBuffer('/** Usage: hello */');
``` | 4 | 0.071429 | 0 | 4 |
f5b24aeb347754c472e76bee9f390d6dd46f2fb6 | resources/sparql/integrity_constraints/03_continuous_path.rq | resources/sparql/integrity_constraints/03_continuous_path.rq | PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rpath: <https://w3id.org/lodsight/rdf-path#>
PREFIX spin: <http://spinrdf.org/spin#>
CONSTRUCT {
[] a spin:ConstraintViolation ;
spin:violationRoot ?path ;
spin:violationPath rpath:start ;
rdfs:label "Path is not continuous."@en .
}
WHERE {
{
SELECT ?path
WHERE {
?path a rpath:Path ;
rpath:edges/rdf:rest*/rdf:first ?edge .
?edge rpath:start ?start .
FILTER NOT EXISTS {
[] rpath:end ?start .
}
}
GROUP BY ?path
HAVING (COUNT(DISTINCT ?start) > 1)
}
}
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rpath: <https://w3id.org/lodsight/rdf-path#>
PREFIX spin: <http://spinrdf.org/spin#>
CONSTRUCT {
[] a spin:ConstraintViolation ;
spin:violationRoot ?next ;
spin:violationPath rpath:start ;
spin:violationValue ?o ;
rdfs:label "Path is not continuous."@en .
}
WHERE {
[] rdf:first/rpath:end/rdf:type ?o ;
rdf:rest/rdf:first ?next .
FILTER NOT EXISTS {
?next rpath:start/rdf:type ?o .
}
}
| Fix continuous path integrity constraint | Fix continuous path integrity constraint
| SPARQL | epl-1.0 | jindrichmynarz/rdf-path-examples,jindrichmynarz/rdf-path-examples | sparql | ## Code Before:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rpath: <https://w3id.org/lodsight/rdf-path#>
PREFIX spin: <http://spinrdf.org/spin#>
CONSTRUCT {
[] a spin:ConstraintViolation ;
spin:violationRoot ?path ;
spin:violationPath rpath:start ;
rdfs:label "Path is not continuous."@en .
}
WHERE {
{
SELECT ?path
WHERE {
?path a rpath:Path ;
rpath:edges/rdf:rest*/rdf:first ?edge .
?edge rpath:start ?start .
FILTER NOT EXISTS {
[] rpath:end ?start .
}
}
GROUP BY ?path
HAVING (COUNT(DISTINCT ?start) > 1)
}
}
## Instruction:
Fix continuous path integrity constraint
## Code After:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rpath: <https://w3id.org/lodsight/rdf-path#>
PREFIX spin: <http://spinrdf.org/spin#>
CONSTRUCT {
[] a spin:ConstraintViolation ;
spin:violationRoot ?next ;
spin:violationPath rpath:start ;
spin:violationValue ?o ;
rdfs:label "Path is not continuous."@en .
}
WHERE {
[] rdf:first/rpath:end/rdf:type ?o ;
rdf:rest/rdf:first ?next .
FILTER NOT EXISTS {
?next rpath:start/rdf:type ?o .
}
}
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rpath: <https://w3id.org/lodsight/rdf-path#>
PREFIX spin: <http://spinrdf.org/spin#>
CONSTRUCT {
[] a spin:ConstraintViolation ;
- spin:violationRoot ?path ;
? ^^ -
+ spin:violationRoot ?next ;
? ^^^
spin:violationPath rpath:start ;
+ spin:violationValue ?o ;
rdfs:label "Path is not continuous."@en .
}
WHERE {
+ [] rdf:first/rpath:end/rdf:type ?o ;
+ rdf:rest/rdf:first ?next .
- {
- SELECT ?path
- WHERE {
- ?path a rpath:Path ;
- rpath:edges/rdf:rest*/rdf:first ?edge .
- ?edge rpath:start ?start .
- FILTER NOT EXISTS {
? ----
+ FILTER NOT EXISTS {
+ ?next rpath:start/rdf:type ?o .
- [] rpath:end ?start .
- }
- }
- GROUP BY ?path
- HAVING (COUNT(DISTINCT ?start) > 1)
}
} | 19 | 0.730769 | 6 | 13 |
e5066e859f68a8b16b4313976ee821872fad6a3c | .cirrus.yml | .cirrus.yml | test_task:
matrix:
- container:
image: rust:latest
- allow_failures: true
container:
image: rustlang/rust:nightly
cargo_cache:
folder: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
build_script: cargo build
test_script: cargo test
before_cache_script: rm -rf $CARGO_HOME/registry/index
| fmt_task:
container:
image: rustlang/rust:nightly
install_script: rustup component add rustfmt-preview
check_script: cargo fmt -- --check
test_task:
matrix:
- container:
image: rust:latest
- allow_failures: true
container:
image: rustlang/rust:nightly
cargo_cache:
folder: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
build_script: cargo build
test_script: cargo test
before_cache_script: rm -rf $CARGO_HOME/registry/index
| Add formatting check to CI | Add formatting check to CI
| YAML | mit | jasonwhite/button-rs | yaml | ## Code Before:
test_task:
matrix:
- container:
image: rust:latest
- allow_failures: true
container:
image: rustlang/rust:nightly
cargo_cache:
folder: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
build_script: cargo build
test_script: cargo test
before_cache_script: rm -rf $CARGO_HOME/registry/index
## Instruction:
Add formatting check to CI
## Code After:
fmt_task:
container:
image: rustlang/rust:nightly
install_script: rustup component add rustfmt-preview
check_script: cargo fmt -- --check
test_task:
matrix:
- container:
image: rust:latest
- allow_failures: true
container:
image: rustlang/rust:nightly
cargo_cache:
folder: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
build_script: cargo build
test_script: cargo test
before_cache_script: rm -rf $CARGO_HOME/registry/index
| + fmt_task:
+ container:
+ image: rustlang/rust:nightly
+ install_script: rustup component add rustfmt-preview
+ check_script: cargo fmt -- --check
+
test_task:
matrix:
- container:
image: rust:latest
- allow_failures: true
container:
image: rustlang/rust:nightly
cargo_cache:
folder: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
build_script: cargo build
test_script: cargo test
before_cache_script: rm -rf $CARGO_HOME/registry/index | 6 | 0.461538 | 6 | 0 |
6b2d276f737c18f8e9ea3f6de7f5b6a197eaff8a | README.md | README.md | jenkins_notifier
================
A bookmarklet that notifies you of Jenkins errors/successes, as well as restyling its fugly interface.
| jenkins_notifier
================
A bookmarklet that notifies you of Jenkins errors/successes, as well as restyling its fugly interface.
See the [GitHub Page](http://elstgav.github.io/jenkins_notifier/) for the bookmarklet (GitHub Markdown doesn't allow javascript: urls)
| Add link to project page | Add link to project page | Markdown | mit | elstgav/jenkins_notifier | markdown | ## Code Before:
jenkins_notifier
================
A bookmarklet that notifies you of Jenkins errors/successes, as well as restyling its fugly interface.
## Instruction:
Add link to project page
## Code After:
jenkins_notifier
================
A bookmarklet that notifies you of Jenkins errors/successes, as well as restyling its fugly interface.
See the [GitHub Page](http://elstgav.github.io/jenkins_notifier/) for the bookmarklet (GitHub Markdown doesn't allow javascript: urls)
| jenkins_notifier
================
A bookmarklet that notifies you of Jenkins errors/successes, as well as restyling its fugly interface.
+
+ See the [GitHub Page](http://elstgav.github.io/jenkins_notifier/) for the bookmarklet (GitHub Markdown doesn't allow javascript: urls) | 2 | 0.5 | 2 | 0 |
132932747a1f7da67413b9c0cf7916707c1e3d19 | src/python/services/CVMFSAppVersions.py | src/python/services/CVMFSAppVersions.py | """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
version_re = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versions available
on CVMFS for a given app.
"""
def __init__(self, cvmfs_root, valid_apps):
"""Initialise."""
self.cvmfs_root = cvmfs_root
self.valid_apps = valid_apps
@cherrypy.expose
def index(self, appid=None):
"""Return the index page."""
print "IN CVMFSAppVersion: appid=(%s)" % appid
if appid not in self.valid_apps:
print "Invalid app type %s" % appid
return ''
html_ = html.HTML()
_, dirs, _ = os.walk(os.path.join(self.cvmfs_root, appid)).next()
for dir_ in natsorted(dirs):
for version in version_re.findall(dir_):
html_.option(version)
return str(html_)
| """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
VERSION_RE = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versions available
on CVMFS for a given app.
"""
def __init__(self, cvmfs_root, valid_apps):
"""Initialise."""
self.cvmfs_root = cvmfs_root
self.valid_apps = valid_apps
@cherrypy.expose
def index(self, appid=None):
"""Return the index page."""
print "IN CVMFSAppVersion: appid=(%s)" % appid
if appid not in self.valid_apps:
print "Invalid app type %s" % appid
return ''
html_ = html.HTML()
_, dirs, _ = os.walk(os.path.join(self.cvmfs_root, appid)).next()
for dir_ in natsorted(dirs):
for version in VERSION_RE.findall(dir_):
html_.option(version)
return str(html_)
| Change the re const name to uppercase. | Change the re const name to uppercase.
| Python | mit | alexanderrichards/LZProduction,alexanderrichards/LZProduction,alexanderrichards/LZProduction,alexanderrichards/LZProduction | python | ## Code Before:
"""CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
version_re = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versions available
on CVMFS for a given app.
"""
def __init__(self, cvmfs_root, valid_apps):
"""Initialise."""
self.cvmfs_root = cvmfs_root
self.valid_apps = valid_apps
@cherrypy.expose
def index(self, appid=None):
"""Return the index page."""
print "IN CVMFSAppVersion: appid=(%s)" % appid
if appid not in self.valid_apps:
print "Invalid app type %s" % appid
return ''
html_ = html.HTML()
_, dirs, _ = os.walk(os.path.join(self.cvmfs_root, appid)).next()
for dir_ in natsorted(dirs):
for version in version_re.findall(dir_):
html_.option(version)
return str(html_)
## Instruction:
Change the re const name to uppercase.
## Code After:
"""CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
VERSION_RE = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versions available
on CVMFS for a given app.
"""
def __init__(self, cvmfs_root, valid_apps):
"""Initialise."""
self.cvmfs_root = cvmfs_root
self.valid_apps = valid_apps
@cherrypy.expose
def index(self, appid=None):
"""Return the index page."""
print "IN CVMFSAppVersion: appid=(%s)" % appid
if appid not in self.valid_apps:
print "Invalid app type %s" % appid
return ''
html_ = html.HTML()
_, dirs, _ = os.walk(os.path.join(self.cvmfs_root, appid)).next()
for dir_ in natsorted(dirs):
for version in VERSION_RE.findall(dir_):
html_.option(version)
return str(html_)
| """CVMFS Servcice."""
import os
import re
import cherrypy
import html
from natsort import natsorted
- version_re = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
? ^^^^^^^ ^^
+ VERSION_RE = re.compile(r"^release-(\d{1,3}\.\d{1,3}\.\d{1,3})$")
? ^^^^^^^ ^^
@cherrypy.popargs('appid')
class CVMFSAppVersions(object):
"""
CVMFS App Version checking service.
CVMFS Service to get the list of versions available
on CVMFS for a given app.
"""
def __init__(self, cvmfs_root, valid_apps):
"""Initialise."""
self.cvmfs_root = cvmfs_root
self.valid_apps = valid_apps
@cherrypy.expose
def index(self, appid=None):
"""Return the index page."""
print "IN CVMFSAppVersion: appid=(%s)" % appid
if appid not in self.valid_apps:
print "Invalid app type %s" % appid
return ''
html_ = html.HTML()
_, dirs, _ = os.walk(os.path.join(self.cvmfs_root, appid)).next()
for dir_ in natsorted(dirs):
- for version in version_re.findall(dir_):
? ^^^^^^^ ^^
+ for version in VERSION_RE.findall(dir_):
? ^^^^^^^ ^^
html_.option(version)
return str(html_) | 4 | 0.108108 | 2 | 2 |
d5449465905120ee83651cfb480ff019c369a973 | src/main/java/com/alorma/github/sdk/services/pullrequest/GetPullRequestCommits.java | src/main/java/com/alorma/github/sdk/services/pullrequest/GetPullRequestCommits.java | package com.alorma.github.sdk.services.pullrequest;
import com.alorma.github.sdk.bean.dto.response.Commit;
import com.alorma.github.sdk.bean.info.IssueInfo;
import com.alorma.github.sdk.services.client.GithubListClient;
import java.util.List;
import retrofit.RestAdapter;
/**
* Created by Bernat on 17/06/2015.
*/
public class GetPullRequestCommits extends GithubListClient<List<Commit>> {
private IssueInfo info;
private int page;
public GetPullRequestCommits(IssueInfo info) {
this(info, 0);
}
public GetPullRequestCommits(IssueInfo info, int page) {
super();
this.info = info;
this.page = page;
}
@Override
protected ApiSubscriber getApiObservable(RestAdapter restAdapter) {
return new ApiSubscriber() {
@Override
protected void call(RestAdapter restAdapter) {
PullRequestsService pullRequestsService = restAdapter.create(PullRequestsService.class);
if (page == 0) {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, this);
} else {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, nextPage,
this);
}
}
};
}
}
| package com.alorma.github.sdk.services.pullrequest;
import com.alorma.github.sdk.bean.dto.response.Commit;
import com.alorma.github.sdk.bean.info.IssueInfo;
import com.alorma.github.sdk.services.client.GithubListClient;
import java.util.List;
import retrofit.RestAdapter;
public class GetPullRequestCommits extends GithubListClient<List<Commit>> {
private IssueInfo info;
private int page;
public GetPullRequestCommits(IssueInfo info) {
this(info, 0);
}
public GetPullRequestCommits(IssueInfo info, int page) {
super();
this.info = info;
this.page = page;
}
@Override
protected ApiSubscriber getApiObservable(RestAdapter restAdapter) {
return new ApiSubscriber() {
@Override
protected void call(RestAdapter restAdapter) {
PullRequestsService pullRequestsService = restAdapter.create(PullRequestsService.class);
if (page == 0) {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, this);
} else {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, nextPage,
this);
}
}
};
}
@Override
public String getAcceptHeader() {
return "application/vnd.github.cryptographer-preview+sha.json";
}
}
| Update PullRequest commits to verification preview | Update PullRequest commits to verification preview
| Java | mit | gitskarios/GithubAndroidSdk | java | ## Code Before:
package com.alorma.github.sdk.services.pullrequest;
import com.alorma.github.sdk.bean.dto.response.Commit;
import com.alorma.github.sdk.bean.info.IssueInfo;
import com.alorma.github.sdk.services.client.GithubListClient;
import java.util.List;
import retrofit.RestAdapter;
/**
* Created by Bernat on 17/06/2015.
*/
public class GetPullRequestCommits extends GithubListClient<List<Commit>> {
private IssueInfo info;
private int page;
public GetPullRequestCommits(IssueInfo info) {
this(info, 0);
}
public GetPullRequestCommits(IssueInfo info, int page) {
super();
this.info = info;
this.page = page;
}
@Override
protected ApiSubscriber getApiObservable(RestAdapter restAdapter) {
return new ApiSubscriber() {
@Override
protected void call(RestAdapter restAdapter) {
PullRequestsService pullRequestsService = restAdapter.create(PullRequestsService.class);
if (page == 0) {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, this);
} else {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, nextPage,
this);
}
}
};
}
}
## Instruction:
Update PullRequest commits to verification preview
## Code After:
package com.alorma.github.sdk.services.pullrequest;
import com.alorma.github.sdk.bean.dto.response.Commit;
import com.alorma.github.sdk.bean.info.IssueInfo;
import com.alorma.github.sdk.services.client.GithubListClient;
import java.util.List;
import retrofit.RestAdapter;
public class GetPullRequestCommits extends GithubListClient<List<Commit>> {
private IssueInfo info;
private int page;
public GetPullRequestCommits(IssueInfo info) {
this(info, 0);
}
public GetPullRequestCommits(IssueInfo info, int page) {
super();
this.info = info;
this.page = page;
}
@Override
protected ApiSubscriber getApiObservable(RestAdapter restAdapter) {
return new ApiSubscriber() {
@Override
protected void call(RestAdapter restAdapter) {
PullRequestsService pullRequestsService = restAdapter.create(PullRequestsService.class);
if (page == 0) {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, this);
} else {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, nextPage,
this);
}
}
};
}
@Override
public String getAcceptHeader() {
return "application/vnd.github.cryptographer-preview+sha.json";
}
}
| package com.alorma.github.sdk.services.pullrequest;
import com.alorma.github.sdk.bean.dto.response.Commit;
import com.alorma.github.sdk.bean.info.IssueInfo;
import com.alorma.github.sdk.services.client.GithubListClient;
import java.util.List;
import retrofit.RestAdapter;
- /**
- * Created by Bernat on 17/06/2015.
- */
public class GetPullRequestCommits extends GithubListClient<List<Commit>> {
private IssueInfo info;
private int page;
public GetPullRequestCommits(IssueInfo info) {
this(info, 0);
}
public GetPullRequestCommits(IssueInfo info, int page) {
super();
this.info = info;
this.page = page;
}
@Override
protected ApiSubscriber getApiObservable(RestAdapter restAdapter) {
return new ApiSubscriber() {
@Override
protected void call(RestAdapter restAdapter) {
PullRequestsService pullRequestsService = restAdapter.create(PullRequestsService.class);
if (page == 0) {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, this);
} else {
pullRequestsService.commits(info.repoInfo.owner, info.repoInfo.name, info.num, nextPage,
this);
}
}
};
}
+
+ @Override
+ public String getAcceptHeader() {
+ return "application/vnd.github.cryptographer-preview+sha.json";
+ }
} | 8 | 0.190476 | 5 | 3 |
5b65b8412a2b08e4dbd9658d1bd5314148f5126d | golang-project/cloudbuild.yaml | golang-project/cloudbuild.yaml |
steps:
- name: 'gcr.io/cloud-builders/go'
args: ['install', 'golang_project']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/$PROJECT_ID/golang-project', '.']
# Test the examples.
# examples/hello_world
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['hello', '--tag=hello_world']
dir: 'examples/hello_world'
# examples/multi_bin
- name: 'gcr.io/$PROJECT_ID/golang-project'
args:
- 'product/server'
- 'product/subtool'
- 'product/subtool/subpkg'
- '--entrypoint=server'
- '--tag=gcr.io/$PROJECT_ID/golang_project_multi_bin'
env: ['PROJECT_ROOT=product']
dir: 'examples/multi_bin'
# examples/static_webserver
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['server', '--tag=server_intermediate']
dir: 'examples/static_webserver'
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=server', '.']
dir: 'examples/static_webserver'
images: ['gcr.io/$PROJECT_ID/golang-project']
|
steps:
- name: 'gcr.io/cloud-builders/go'
args: ['install', 'golang_project']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--pull', '--tag=gcr.io/$PROJECT_ID/golang-project', '.']
# Test the examples.
# examples/hello_world
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['hello', '--tag=hello_world']
dir: 'examples/hello_world'
# examples/multi_bin
- name: 'gcr.io/$PROJECT_ID/golang-project'
args:
- 'product/server'
- 'product/subtool'
- 'product/subtool/subpkg'
- '--entrypoint=server'
- '--tag=gcr.io/$PROJECT_ID/golang_project_multi_bin'
env: ['PROJECT_ROOT=product']
dir: 'examples/multi_bin'
# examples/static_webserver
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['server', '--tag=server_intermediate']
dir: 'examples/static_webserver'
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=server', '.']
dir: 'examples/static_webserver'
images: ['gcr.io/$PROJECT_ID/golang-project']
| Use --pull when building steps that depend on other steps, so that they'll get the true latest instead of the cached version from the previous release. | Use --pull when building steps that depend on other steps, so that they'll get the true latest instead of the cached version from the previous release.
-------------
MOE_MIGRATED_REVID=129883732
APPROVED=
| YAML | apache-2.0 | GoogleCloudPlatform/cloud-builders,google-octo/cloud-builders,google-octo/cloud-builders,google-octo/cloud-builders,google-octo/cloud-builders,GoogleCloudPlatform/cloud-builders,google-octo/cloud-builders,GoogleCloudPlatform/cloud-builders,GoogleCloudPlatform/cloud-builders,GoogleCloudPlatform/cloud-builders,GoogleCloudPlatform/cloud-builders,GoogleCloudPlatform/cloud-builders,google-octo/cloud-builders,google-octo/cloud-builders | yaml | ## Code Before:
steps:
- name: 'gcr.io/cloud-builders/go'
args: ['install', 'golang_project']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/$PROJECT_ID/golang-project', '.']
# Test the examples.
# examples/hello_world
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['hello', '--tag=hello_world']
dir: 'examples/hello_world'
# examples/multi_bin
- name: 'gcr.io/$PROJECT_ID/golang-project'
args:
- 'product/server'
- 'product/subtool'
- 'product/subtool/subpkg'
- '--entrypoint=server'
- '--tag=gcr.io/$PROJECT_ID/golang_project_multi_bin'
env: ['PROJECT_ROOT=product']
dir: 'examples/multi_bin'
# examples/static_webserver
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['server', '--tag=server_intermediate']
dir: 'examples/static_webserver'
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=server', '.']
dir: 'examples/static_webserver'
images: ['gcr.io/$PROJECT_ID/golang-project']
## Instruction:
Use --pull when building steps that depend on other steps, so that they'll get the true latest instead of the cached version from the previous release.
-------------
MOE_MIGRATED_REVID=129883732
APPROVED=
## Code After:
steps:
- name: 'gcr.io/cloud-builders/go'
args: ['install', 'golang_project']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--pull', '--tag=gcr.io/$PROJECT_ID/golang-project', '.']
# Test the examples.
# examples/hello_world
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['hello', '--tag=hello_world']
dir: 'examples/hello_world'
# examples/multi_bin
- name: 'gcr.io/$PROJECT_ID/golang-project'
args:
- 'product/server'
- 'product/subtool'
- 'product/subtool/subpkg'
- '--entrypoint=server'
- '--tag=gcr.io/$PROJECT_ID/golang_project_multi_bin'
env: ['PROJECT_ROOT=product']
dir: 'examples/multi_bin'
# examples/static_webserver
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['server', '--tag=server_intermediate']
dir: 'examples/static_webserver'
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=server', '.']
dir: 'examples/static_webserver'
images: ['gcr.io/$PROJECT_ID/golang-project']
|
steps:
- name: 'gcr.io/cloud-builders/go'
args: ['install', 'golang_project']
- name: 'gcr.io/cloud-builders/docker'
- args: ['build', '--tag=gcr.io/$PROJECT_ID/golang-project', '.']
+ args: ['build', '--pull', '--tag=gcr.io/$PROJECT_ID/golang-project', '.']
? ++++++++++
# Test the examples.
# examples/hello_world
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['hello', '--tag=hello_world']
dir: 'examples/hello_world'
# examples/multi_bin
- name: 'gcr.io/$PROJECT_ID/golang-project'
args:
- 'product/server'
- 'product/subtool'
- 'product/subtool/subpkg'
- '--entrypoint=server'
- '--tag=gcr.io/$PROJECT_ID/golang_project_multi_bin'
env: ['PROJECT_ROOT=product']
dir: 'examples/multi_bin'
# examples/static_webserver
- name: 'gcr.io/$PROJECT_ID/golang-project'
args: ['server', '--tag=server_intermediate']
dir: 'examples/static_webserver'
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=server', '.']
dir: 'examples/static_webserver'
images: ['gcr.io/$PROJECT_ID/golang-project'] | 2 | 0.058824 | 1 | 1 |
51926343433440bdcdb252c4624c93688f84a94c | config/config.js | config/config.js | var path = require('path'),
rootPath = path.normalize(__dirname + '/..');
var dotenv = require('dotenv').config({path: rootPath + '/.env'});
var config = {
root: rootPath,
app: {
name: 'chatbot'
},
port: process.env.PORT || 3000,
db: process.env.DB_CONNECTION_STRING || '',
page_access_token: process.env.PAGE_ACCESS_TOKEN || '',
verify_token: process.env.VERIFY_TOCKEN || ''
};
module.exports = config;
| var path = require('path'),
rootPath = path.normalize(__dirname + '/..');
if (!process.env.IS_HEROKU) {
var dotenv = require('dotenv').config({path: rootPath + '/.env'});
}
var config = {
root: rootPath,
app: {
name: 'chatbot'
},
port: process.env.PORT || 3000,
db: process.env.DB_CONNECTION_STRING || '',
page_access_token: process.env.PAGE_ACCESS_TOKEN || '',
verify_token: process.env.VERIFY_TOCKEN || ''
};
module.exports = config;
| Handle the case where we deploy to Heroku. | Handle the case where we deploy to Heroku.
| JavaScript | mit | mstroeck/beavr-bot-boilerplate,mstroeck/beavr-bot-boilerplate,Beavr/fb-chatbot-boilerplate,Beavr/fb-chatbot-boilerplate | javascript | ## Code Before:
var path = require('path'),
rootPath = path.normalize(__dirname + '/..');
var dotenv = require('dotenv').config({path: rootPath + '/.env'});
var config = {
root: rootPath,
app: {
name: 'chatbot'
},
port: process.env.PORT || 3000,
db: process.env.DB_CONNECTION_STRING || '',
page_access_token: process.env.PAGE_ACCESS_TOKEN || '',
verify_token: process.env.VERIFY_TOCKEN || ''
};
module.exports = config;
## Instruction:
Handle the case where we deploy to Heroku.
## Code After:
var path = require('path'),
rootPath = path.normalize(__dirname + '/..');
if (!process.env.IS_HEROKU) {
var dotenv = require('dotenv').config({path: rootPath + '/.env'});
}
var config = {
root: rootPath,
app: {
name: 'chatbot'
},
port: process.env.PORT || 3000,
db: process.env.DB_CONNECTION_STRING || '',
page_access_token: process.env.PAGE_ACCESS_TOKEN || '',
verify_token: process.env.VERIFY_TOCKEN || ''
};
module.exports = config;
| var path = require('path'),
rootPath = path.normalize(__dirname + '/..');
+ if (!process.env.IS_HEROKU) {
- var dotenv = require('dotenv').config({path: rootPath + '/.env'});
+ var dotenv = require('dotenv').config({path: rootPath + '/.env'});
? ++++
+ }
var config = {
root: rootPath,
app: {
name: 'chatbot'
},
port: process.env.PORT || 3000,
db: process.env.DB_CONNECTION_STRING || '',
page_access_token: process.env.PAGE_ACCESS_TOKEN || '',
verify_token: process.env.VERIFY_TOCKEN || ''
};
module.exports = config; | 4 | 0.235294 | 3 | 1 |
c61aed7c6a65a7cf1ae3f9fbdd8719bcb727b37d | README.md | README.md | 
# middleman-breadcrumbs
Breadcrumbs helper for Middleman
## Installation
Install the gem as usual: put `gem 'middleman-breadcrumbs'` in Gemfile, then run `bundle install`.
Put `activate :breadcrumbs` in config.rb (*not* in the `configure :build` block).
## Usage
In your view files, just call `breadcrumbs(current_page)` to display breadcrumbs.
### Options
#### `:separator`
The breadcrumb levels are separated with ` > ` by default. If you want a different separator, use the `:separator` option—e.g., `breadcrumbs(current_page, separator: '|||')`.
#### `:wrapper`
If you want to wrap each breadcrumb level in a tag, pass the tag name to the `:wrapper` option. For example, if you want your breadcrumbs in a list:
```erb
<ul>
<%= breadcrumbs current_page, wrapper: :li, separator: nil %>
</ul>
```
This will wrap each breadcrumb level in a `<li>` element.
| 
# middleman-breadcrumbs
Breadcrumbs helper for [Middleman](https://middlemanapp.com/)
## Installation
Install the gem as usual: put `gem 'middleman-breadcrumbs'` in Gemfile, then run `bundle install`.
Put `activate :breadcrumbs` in config.rb (*not* in the `configure :build` block).
## Usage
In your view files, just call `breadcrumbs(current_page)` to display breadcrumbs.
### Options
#### `:separator`
The breadcrumb levels are separated with ` > ` by default. If you want a different separator, use the `:separator` option—e.g., `breadcrumbs(current_page, separator: '|||')`.
#### `:wrapper`
If you want to wrap each breadcrumb level in a tag, pass the tag name to the `:wrapper` option. For example, if you want your breadcrumbs in a list:
```erb
<ul>
<%= breadcrumbs current_page, wrapper: :li, separator: nil %>
</ul>
```
This will wrap each breadcrumb level in a `<li>` element.
| Add link to Middleman website. | Add link to Middleman website. | Markdown | mit | marnen/middleman-breadcrumbs,marnen/middleman-breadcrumbs | markdown | ## Code Before:

# middleman-breadcrumbs
Breadcrumbs helper for Middleman
## Installation
Install the gem as usual: put `gem 'middleman-breadcrumbs'` in Gemfile, then run `bundle install`.
Put `activate :breadcrumbs` in config.rb (*not* in the `configure :build` block).
## Usage
In your view files, just call `breadcrumbs(current_page)` to display breadcrumbs.
### Options
#### `:separator`
The breadcrumb levels are separated with ` > ` by default. If you want a different separator, use the `:separator` option—e.g., `breadcrumbs(current_page, separator: '|||')`.
#### `:wrapper`
If you want to wrap each breadcrumb level in a tag, pass the tag name to the `:wrapper` option. For example, if you want your breadcrumbs in a list:
```erb
<ul>
<%= breadcrumbs current_page, wrapper: :li, separator: nil %>
</ul>
```
This will wrap each breadcrumb level in a `<li>` element.
## Instruction:
Add link to Middleman website.
## Code After:

# middleman-breadcrumbs
Breadcrumbs helper for [Middleman](https://middlemanapp.com/)
## Installation
Install the gem as usual: put `gem 'middleman-breadcrumbs'` in Gemfile, then run `bundle install`.
Put `activate :breadcrumbs` in config.rb (*not* in the `configure :build` block).
## Usage
In your view files, just call `breadcrumbs(current_page)` to display breadcrumbs.
### Options
#### `:separator`
The breadcrumb levels are separated with ` > ` by default. If you want a different separator, use the `:separator` option—e.g., `breadcrumbs(current_page, separator: '|||')`.
#### `:wrapper`
If you want to wrap each breadcrumb level in a tag, pass the tag name to the `:wrapper` option. For example, if you want your breadcrumbs in a list:
```erb
<ul>
<%= breadcrumbs current_page, wrapper: :li, separator: nil %>
</ul>
```
This will wrap each breadcrumb level in a `<li>` element.
| 
# middleman-breadcrumbs
- Breadcrumbs helper for Middleman
+ Breadcrumbs helper for [Middleman](https://middlemanapp.com/)
## Installation
Install the gem as usual: put `gem 'middleman-breadcrumbs'` in Gemfile, then run `bundle install`.
Put `activate :breadcrumbs` in config.rb (*not* in the `configure :build` block).
## Usage
In your view files, just call `breadcrumbs(current_page)` to display breadcrumbs.
### Options
#### `:separator`
The breadcrumb levels are separated with ` > ` by default. If you want a different separator, use the `:separator` option—e.g., `breadcrumbs(current_page, separator: '|||')`.
#### `:wrapper`
If you want to wrap each breadcrumb level in a tag, pass the tag name to the `:wrapper` option. For example, if you want your breadcrumbs in a list:
```erb
<ul>
<%= breadcrumbs current_page, wrapper: :li, separator: nil %>
</ul>
```
This will wrap each breadcrumb level in a `<li>` element. | 2 | 0.0625 | 1 | 1 |
53a2ef395d501b60851f09447a8fca471df2239d | Releases/Manifests/5.11.0.json | Releases/Manifests/5.11.0.json | {
"FirebaseCore":"5.1.6",
"FirebaseMessaging":"3.2.1",
"FirebaseFirestore":"0.13.6",
"FirebaseAnalyticsInterop":"1.1.0"
}
| {
"FirebaseCore":"5.1.6",
"FirebaseDynamicLinks":"3.1.1",
"FirebaseMessaging":"3.2.1",
"FirebaseFirestore":"0.13.6",
"FirebaseAnalyticsInterop":"1.1.0"
}
| Add FDL to release manifest | Add FDL to release manifest
| JSON | apache-2.0 | firebase/firebase-ios-sdk,firebase/firebase-ios-sdk,firebase/firebase-ios-sdk,firebase/firebase-ios-sdk,firebase/firebase-ios-sdk,firebase/firebase-ios-sdk,firebase/firebase-ios-sdk | json | ## Code Before:
{
"FirebaseCore":"5.1.6",
"FirebaseMessaging":"3.2.1",
"FirebaseFirestore":"0.13.6",
"FirebaseAnalyticsInterop":"1.1.0"
}
## Instruction:
Add FDL to release manifest
## Code After:
{
"FirebaseCore":"5.1.6",
"FirebaseDynamicLinks":"3.1.1",
"FirebaseMessaging":"3.2.1",
"FirebaseFirestore":"0.13.6",
"FirebaseAnalyticsInterop":"1.1.0"
}
| {
"FirebaseCore":"5.1.6",
+ "FirebaseDynamicLinks":"3.1.1",
"FirebaseMessaging":"3.2.1",
"FirebaseFirestore":"0.13.6",
"FirebaseAnalyticsInterop":"1.1.0"
} | 1 | 0.166667 | 1 | 0 |
995e80bcc7408f57f44f1ca7544078bdb2ae58d9 | src/DBAL/Fixture/Loader/YamlLoader.php | src/DBAL/Fixture/Loader/YamlLoader.php | <?php
/**
* PHP version 5.6
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
namespace ComPHPPuebla\DBAL\Fixture\Loader;
use Symfony\Component\Yaml\Parser;
class YamlLoader implements Loader
{
/** @var string */
protected $path;
/** @var Parser */
protected $reader;
public function __construct($path, Parser $reader = null)
{
$this->path = $path;
$this->reader = $reader;
}
public function load()
{
if (!$this->reader) {
$this->reader = new Parser();
}
return $this->reader->parse(file_get_contents($this->path));
}
}
| <?php
/**
* PHP version 5.6
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
namespace ComPHPPuebla\DBAL\Fixture\Loader;
use Symfony\Component\Yaml\Parser;
class YamlLoader implements Loader
{
/** @var string */
protected $path;
/** @var Parser */
protected $reader;
/**
* @param string $path
* @param Parser|null $reader
*/
public function __construct($path, Parser $reader = null)
{
$this->path = $path;
$this->reader = $reader ?: new Parser();
}
/**
* @return array
*/
public function load()
{
return $this->reader->parse(file_get_contents($this->path));
}
}
| Set default parser value in constructor. | Set default parser value in constructor.
| PHP | mit | ComPHPPuebla/dbal-fixtures | php | ## Code Before:
<?php
/**
* PHP version 5.6
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
namespace ComPHPPuebla\DBAL\Fixture\Loader;
use Symfony\Component\Yaml\Parser;
class YamlLoader implements Loader
{
/** @var string */
protected $path;
/** @var Parser */
protected $reader;
public function __construct($path, Parser $reader = null)
{
$this->path = $path;
$this->reader = $reader;
}
public function load()
{
if (!$this->reader) {
$this->reader = new Parser();
}
return $this->reader->parse(file_get_contents($this->path));
}
}
## Instruction:
Set default parser value in constructor.
## Code After:
<?php
/**
* PHP version 5.6
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
namespace ComPHPPuebla\DBAL\Fixture\Loader;
use Symfony\Component\Yaml\Parser;
class YamlLoader implements Loader
{
/** @var string */
protected $path;
/** @var Parser */
protected $reader;
/**
* @param string $path
* @param Parser|null $reader
*/
public function __construct($path, Parser $reader = null)
{
$this->path = $path;
$this->reader = $reader ?: new Parser();
}
/**
* @return array
*/
public function load()
{
return $this->reader->parse(file_get_contents($this->path));
}
}
| <?php
/**
* PHP version 5.6
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
namespace ComPHPPuebla\DBAL\Fixture\Loader;
use Symfony\Component\Yaml\Parser;
class YamlLoader implements Loader
{
/** @var string */
protected $path;
/** @var Parser */
protected $reader;
+ /**
+ * @param string $path
+ * @param Parser|null $reader
+ */
public function __construct($path, Parser $reader = null)
{
$this->path = $path;
- $this->reader = $reader;
+ $this->reader = $reader ?: new Parser();
? ++++++++++++++++
}
+ /**
+ * @return array
+ */
public function load()
{
- if (!$this->reader) {
- $this->reader = new Parser();
- }
-
return $this->reader->parse(file_get_contents($this->path));
}
} | 13 | 0.393939 | 8 | 5 |
8c01d51577e3748d2c1b38b247d6c2cc4e7dbb08 | docker-compose.yml | docker-compose.yml | wekan:
image: mquandalle/wekan
links:
- wekandb
environment:
- MONGO_URL=mongodb://wekandb/wekan
- ROOT_URL=http://localhost:80
ports:
- 80:80
wekandb:
image: mongo
ports:
- 27017
|
wekandb:
image: mongo
# volumes:
# - ./data/runtime/db:/data/db
# - ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128
ports: 27017
wekan:
image: mquandalle/wekan
links:
- wekandb
environment:
- MONGO_URL=mongodb://wekandb/wekan
- ROOT_URL=http://localhost:80
ports:
- 80:80
| Complete the Docker Compose manifest | Complete the Docker Compose manifest
| YAML | mit | mario-orlicky/wekan,wykeith/cp2m,ddanssaert/wekan,AlexanderS/wekan,wekan/wekan,jtickle/wekan,nztqa/wekan,wekan/wekan,araczkowski/paczka.pro,nztqa/wekan,oliver4u/WEKAN_runpartner,johnleeming/wekan,GhassenRjab/wekan,ahmadassaf/libreboard,pro-to-tip/wekan,ddanssaert/wekan,Xperterra/wekan,ahmadassaf/libreboard,FSFTN/Wekan,floatinghotpot/wekan,jtickle/wekan,AlexanderS/wekan,oliver4u/WEKAN_runpartner,mario-orlicky/wekan,oliver4u/sap-wekan,araczkowski/paczka.pro,wekan/wekan,wykeith/cp2m,wekan/wekan,mario-orlicky/wekan,oliver4u/sap-wekan,Serubin/wekan,gelojavonitalla/wekan,gelojavonitalla/wekan,ahmadassaf/libreboard,libreboard/libreboard,oliver4u/WEKAN_runpartner,FSFTN/Wekan,Serubin/wekan,GhassenRjab/wekan,araczkowski/paczka.pro,johnleeming/wekan,jtickle/wekan,Xperterra/wekan,libreboard/libreboard,ddanssaert/wekan,nztqa/wekan,pro-to-tip/wekan,oliver4u/sap-wekan,floatinghotpot/wekan,GhassenRjab/wekan,johnleeming/wekan,wekan/wekan,Serubin/wekan,johnleeming/wekan | yaml | ## Code Before:
wekan:
image: mquandalle/wekan
links:
- wekandb
environment:
- MONGO_URL=mongodb://wekandb/wekan
- ROOT_URL=http://localhost:80
ports:
- 80:80
wekandb:
image: mongo
ports:
- 27017
## Instruction:
Complete the Docker Compose manifest
## Code After:
wekandb:
image: mongo
# volumes:
# - ./data/runtime/db:/data/db
# - ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128
ports: 27017
wekan:
image: mquandalle/wekan
links:
- wekandb
environment:
- MONGO_URL=mongodb://wekandb/wekan
- ROOT_URL=http://localhost:80
ports:
- 80:80
| +
+ wekandb:
+ image: mongo
+ # volumes:
+ # - ./data/runtime/db:/data/db
+ # - ./data/dump:/dump
+ command: mongod --smallfiles --oplogSize 128
+ ports: 27017
+
wekan:
image: mquandalle/wekan
links:
- wekandb
environment:
- MONGO_URL=mongodb://wekandb/wekan
- ROOT_URL=http://localhost:80
ports:
- 80:80
- wekandb:
- image: mongo
- ports:
- - 27017 | 13 | 0.928571 | 9 | 4 |
41ff89d2fc2c479973f48aaa3ff164cfab0830be | MainConsole.java | MainConsole.java | package tetris.game;
import java.awt.*;
import javax.swing.*;
public class MainConsole{
private JFrame frame;
private Canvas canvas;
public MainConsole(){
frame = new JFrame("Tetris");
frame.setSize((Canvas.WIDTH + 7) * Canvas.SIDE_OF_SQUARE,
(Canvas.HEIGHT + 1) * Canvas.SIDE_OF_SQUARE);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setResizable(false);
canvas = new Canvas();
frame.addKeyListener(canvas.getKeyListener());
frame.add(canvas,BorderLayout.CENTER);
}
public static void main(String [] args){
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run(){
new MainConsole();
}
});
}
}
| package tetris.game;
import java.awt.*;
import javax.swing.*;
public class MainConsole{
private JFrame frame;
private Canvas canvas;
public MainConsole(){
frame = new JFrame("Tetris");
frame.setSize((Canvas.WIDTH + 7) * Canvas.SIDE_OF_SQUARE,
(Canvas.HEIGHT + 1) * Canvas.SIDE_OF_SQUARE);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
canvas = new Canvas();
frame.addKeyListener(canvas.getKeyListener());
frame.add(canvas,BorderLayout.CENTER);
}
public static void main(String [] args){
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run(){
JOptionPane.showMessageDialog(null, "Press [up] key to rotate the blocks\n" +
"Press [down] key to move the blocks down\n" +
"Press [left] key to move the blocks to the left\n" +
"Press [right] key to move the blocks to the right\n" +
"Press [space] key to move the blocks all the way down\n" +
"Press [P] key to pause the game\n" +
"Press [R] key to resume the game\n");
new MainConsole();
}
});
}
}
| Update description with Canvas class | Update description with Canvas class | Java | mit | bill176/tetris,bill176/tetris | java | ## Code Before:
package tetris.game;
import java.awt.*;
import javax.swing.*;
public class MainConsole{
private JFrame frame;
private Canvas canvas;
public MainConsole(){
frame = new JFrame("Tetris");
frame.setSize((Canvas.WIDTH + 7) * Canvas.SIDE_OF_SQUARE,
(Canvas.HEIGHT + 1) * Canvas.SIDE_OF_SQUARE);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setResizable(false);
canvas = new Canvas();
frame.addKeyListener(canvas.getKeyListener());
frame.add(canvas,BorderLayout.CENTER);
}
public static void main(String [] args){
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run(){
new MainConsole();
}
});
}
}
## Instruction:
Update description with Canvas class
## Code After:
package tetris.game;
import java.awt.*;
import javax.swing.*;
public class MainConsole{
private JFrame frame;
private Canvas canvas;
public MainConsole(){
frame = new JFrame("Tetris");
frame.setSize((Canvas.WIDTH + 7) * Canvas.SIDE_OF_SQUARE,
(Canvas.HEIGHT + 1) * Canvas.SIDE_OF_SQUARE);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
canvas = new Canvas();
frame.addKeyListener(canvas.getKeyListener());
frame.add(canvas,BorderLayout.CENTER);
}
public static void main(String [] args){
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run(){
JOptionPane.showMessageDialog(null, "Press [up] key to rotate the blocks\n" +
"Press [down] key to move the blocks down\n" +
"Press [left] key to move the blocks to the left\n" +
"Press [right] key to move the blocks to the right\n" +
"Press [space] key to move the blocks all the way down\n" +
"Press [P] key to pause the game\n" +
"Press [R] key to resume the game\n");
new MainConsole();
}
});
}
}
| package tetris.game;
import java.awt.*;
import javax.swing.*;
public class MainConsole{
private JFrame frame;
private Canvas canvas;
public MainConsole(){
frame = new JFrame("Tetris");
frame.setSize((Canvas.WIDTH + 7) * Canvas.SIDE_OF_SQUARE,
(Canvas.HEIGHT + 1) * Canvas.SIDE_OF_SQUARE);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setResizable(false);
+ frame.setLocationRelativeTo(null);
canvas = new Canvas();
frame.addKeyListener(canvas.getKeyListener());
frame.add(canvas,BorderLayout.CENTER);
}
public static void main(String [] args){
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run(){
+ JOptionPane.showMessageDialog(null, "Press [up] key to rotate the blocks\n" +
+ "Press [down] key to move the blocks down\n" +
+ "Press [left] key to move the blocks to the left\n" +
+ "Press [right] key to move the blocks to the right\n" +
+ "Press [space] key to move the blocks all the way down\n" +
+ "Press [P] key to pause the game\n" +
+ "Press [R] key to resume the game\n");
new MainConsole();
}
});
}
} | 8 | 0.25 | 8 | 0 |
03eb0081a4037e36775271fb2373277f8e89835b | src/mcedit2/resourceloader.py | src/mcedit2/resourceloader.py | from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import zipfile
log = logging.getLogger(__name__)
class ResourceNotFound(KeyError):
pass
class ResourceLoader(object):
def __init__(self):
super(ResourceLoader, self).__init__()
self.zipFiles = []
def addZipFile(self, zipPath):
try:
zf = zipfile.ZipFile(zipPath)
except zipfile.BadZipfile as e:
raise IOError("Could not read %s as a zip file." % zipPath)
self.zipFiles.append(zf)
def openStream(self, path):
for zipFile in self.zipFiles:
try:
stream = zipFile.open(path)
break
except KeyError: # Not found in zip file
continue
else:
raise ResourceNotFound("Resource %s not found in search path" % path)
return stream
| from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import zipfile
log = logging.getLogger(__name__)
class ResourceNotFound(KeyError):
pass
class ResourceLoader(object):
def __init__(self):
super(ResourceLoader, self).__init__()
self.zipFiles = []
def addZipFile(self, zipPath):
try:
zf = zipfile.ZipFile(zipPath)
except zipfile.BadZipfile as e:
raise IOError("Could not read %s as a zip file." % zipPath)
self.zipFiles.append(zf)
def openStream(self, path):
for zipFile in self.zipFiles:
try:
stream = zipFile.open(path)
break
except KeyError: # Not found in zip file
continue
else:
raise ResourceNotFound("Resource %s not found in search path" % path)
return stream
def blockModelPaths(self):
for zf in self.zipFiles:
for name in zf.namelist():
if name.startswith("assets/minecraft/models/block"):
yield name
| Add function to ResourceLoader for listing all block models | Add function to ResourceLoader for listing all block models
xxx only lists Vanilla models. haven't looked at mods with models yet.
| Python | bsd-3-clause | vorburger/mcedit2,vorburger/mcedit2,Rubisk/mcedit2,Rubisk/mcedit2 | python | ## Code Before:
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import zipfile
log = logging.getLogger(__name__)
class ResourceNotFound(KeyError):
pass
class ResourceLoader(object):
def __init__(self):
super(ResourceLoader, self).__init__()
self.zipFiles = []
def addZipFile(self, zipPath):
try:
zf = zipfile.ZipFile(zipPath)
except zipfile.BadZipfile as e:
raise IOError("Could not read %s as a zip file." % zipPath)
self.zipFiles.append(zf)
def openStream(self, path):
for zipFile in self.zipFiles:
try:
stream = zipFile.open(path)
break
except KeyError: # Not found in zip file
continue
else:
raise ResourceNotFound("Resource %s not found in search path" % path)
return stream
## Instruction:
Add function to ResourceLoader for listing all block models
xxx only lists Vanilla models. haven't looked at mods with models yet.
## Code After:
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import zipfile
log = logging.getLogger(__name__)
class ResourceNotFound(KeyError):
pass
class ResourceLoader(object):
def __init__(self):
super(ResourceLoader, self).__init__()
self.zipFiles = []
def addZipFile(self, zipPath):
try:
zf = zipfile.ZipFile(zipPath)
except zipfile.BadZipfile as e:
raise IOError("Could not read %s as a zip file." % zipPath)
self.zipFiles.append(zf)
def openStream(self, path):
for zipFile in self.zipFiles:
try:
stream = zipFile.open(path)
break
except KeyError: # Not found in zip file
continue
else:
raise ResourceNotFound("Resource %s not found in search path" % path)
return stream
def blockModelPaths(self):
for zf in self.zipFiles:
for name in zf.namelist():
if name.startswith("assets/minecraft/models/block"):
yield name
| from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import zipfile
log = logging.getLogger(__name__)
class ResourceNotFound(KeyError):
pass
class ResourceLoader(object):
def __init__(self):
super(ResourceLoader, self).__init__()
self.zipFiles = []
def addZipFile(self, zipPath):
try:
zf = zipfile.ZipFile(zipPath)
except zipfile.BadZipfile as e:
raise IOError("Could not read %s as a zip file." % zipPath)
self.zipFiles.append(zf)
def openStream(self, path):
for zipFile in self.zipFiles:
try:
stream = zipFile.open(path)
break
except KeyError: # Not found in zip file
continue
else:
raise ResourceNotFound("Resource %s not found in search path" % path)
return stream
+
+ def blockModelPaths(self):
+ for zf in self.zipFiles:
+ for name in zf.namelist():
+ if name.startswith("assets/minecraft/models/block"):
+ yield name | 6 | 0.1875 | 6 | 0 |
6f901ac5a0f608e264f73ba47179df66a001769e | scripts/merge-counts.scala | scripts/merge-counts.scala | val outFile = opts.woFile("outFile","The file to write the merged counts to")
val args = opts.listOfArgs("files","The list of files to merge")
opts.verify
namedTask("Merge counts") {
val readers = args.map { arg => new util.PeekableIterator(opts.openInput(arg).getLines) }
val out = opts.openOutput(outFile)
while(readers.exists(_.hasNext)) {
val lines = readers.flatMap(_.peek)
val keyCounts = lines.map( line => {
(line.substring(0,line.lastIndexOf("|||") + 4), line.substring(line.lastIndexOf("|||")+4).toInt)
})
val minKey = keyCounts.map(_._1).min
val total = keyCounts.filter(_._1==minKey).map(_._2).sum
val active = readers.filter {
reader => {
reader.peek match {
case Some(line) => line.startsWith(minKey)
case None => false
}
}
}
active.foreach(_.next)
out.println(minKey + total)
}
out.flush
out.close
}
| val outFile = opts.woFile("outFile","The file to write the merged counts to")
val args = opts.listOfArgs("files","The list of files to merge")
opts.verify
namedTask("Merge counts") {
val readers = args.map { arg => new util.PeekableIterator(opts.openInput(arg).getLines) }
val out = opts.openOutput(outFile)
while(readers.exists(_.hasNext)) {
val lines = readers.flatMap(_.peek)
val keyCounts = lines.map( line => {
(line.substring(0,line.lastIndexOf("|||")), line.substring(line.lastIndexOf("|||") + 4).toInt)
})
val minKey = keyCounts.map(_._1).min
val total = keyCounts.filter(_._1==minKey).map(_._2).sum
val active = readers.filter {
reader => {
reader.peek match {
case Some(line) => line.substring(0,line.lastIndexOf("|||")) == minKey
case None => false
}
}
}
active.foreach(_.next)
out.println(minKey + "||| " + total)
}
out.flush
out.close
}
| Fix bug with duplicates in merge | Fix bug with duplicates in merge
| Scala | apache-2.0 | jmccrae/nimrod,jmccrae/nimrod | scala | ## Code Before:
val outFile = opts.woFile("outFile","The file to write the merged counts to")
val args = opts.listOfArgs("files","The list of files to merge")
opts.verify
namedTask("Merge counts") {
val readers = args.map { arg => new util.PeekableIterator(opts.openInput(arg).getLines) }
val out = opts.openOutput(outFile)
while(readers.exists(_.hasNext)) {
val lines = readers.flatMap(_.peek)
val keyCounts = lines.map( line => {
(line.substring(0,line.lastIndexOf("|||") + 4), line.substring(line.lastIndexOf("|||")+4).toInt)
})
val minKey = keyCounts.map(_._1).min
val total = keyCounts.filter(_._1==minKey).map(_._2).sum
val active = readers.filter {
reader => {
reader.peek match {
case Some(line) => line.startsWith(minKey)
case None => false
}
}
}
active.foreach(_.next)
out.println(minKey + total)
}
out.flush
out.close
}
## Instruction:
Fix bug with duplicates in merge
## Code After:
val outFile = opts.woFile("outFile","The file to write the merged counts to")
val args = opts.listOfArgs("files","The list of files to merge")
opts.verify
namedTask("Merge counts") {
val readers = args.map { arg => new util.PeekableIterator(opts.openInput(arg).getLines) }
val out = opts.openOutput(outFile)
while(readers.exists(_.hasNext)) {
val lines = readers.flatMap(_.peek)
val keyCounts = lines.map( line => {
(line.substring(0,line.lastIndexOf("|||")), line.substring(line.lastIndexOf("|||") + 4).toInt)
})
val minKey = keyCounts.map(_._1).min
val total = keyCounts.filter(_._1==minKey).map(_._2).sum
val active = readers.filter {
reader => {
reader.peek match {
case Some(line) => line.substring(0,line.lastIndexOf("|||")) == minKey
case None => false
}
}
}
active.foreach(_.next)
out.println(minKey + "||| " + total)
}
out.flush
out.close
}
| val outFile = opts.woFile("outFile","The file to write the merged counts to")
val args = opts.listOfArgs("files","The list of files to merge")
opts.verify
namedTask("Merge counts") {
val readers = args.map { arg => new util.PeekableIterator(opts.openInput(arg).getLines) }
val out = opts.openOutput(outFile)
while(readers.exists(_.hasNext)) {
val lines = readers.flatMap(_.peek)
val keyCounts = lines.map( line => {
- (line.substring(0,line.lastIndexOf("|||") + 4), line.substring(line.lastIndexOf("|||")+4).toInt)
? ----
+ (line.substring(0,line.lastIndexOf("|||")), line.substring(line.lastIndexOf("|||") + 4).toInt)
? + +
})
val minKey = keyCounts.map(_._1).min
val total = keyCounts.filter(_._1==minKey).map(_._2).sum
val active = readers.filter {
reader => {
reader.peek match {
- case Some(line) => line.startsWith(minKey)
+ case Some(line) => line.substring(0,line.lastIndexOf("|||")) == minKey
case None => false
}
}
}
active.foreach(_.next)
- out.println(minKey + total)
+ out.println(minKey + "||| " + total)
? +++++++++
}
out.flush
out.close
} | 6 | 0.206897 | 3 | 3 |
dc51fc509428b441423b2008a62aa2ab3fe00a01 | doc/source/install/next-steps.rst | doc/source/install/next-steps.rst | ==========
Next steps
==========
Your OpenStack environment now includes the dashboard.
After you install and configure the dashboard, you can
complete the following tasks:
* Provide users with a public IP address, a username, and a password
so they can access the dashboard through a web browser. In case of
any SSL certificate connection problems, point the server
IP address to a domain name, and give users access.
* Customize your dashboard. For details, see :doc:`/admin/customize-configure`.
* Set up session storage. For derails, see :doc:`/admin/sessions`.
* To use the VNC client with the dashboard, the browser
must support HTML5 Canvas and HTML5 WebSockets.
For details about browsers that support noVNC, see
`README
<https://github.com/novnc/noVNC/blob/master/README.md>`__
and `browser support
<https://github.com/novnc/noVNC/wiki/Browser-support>`__.
| ==========
Next steps
==========
Your OpenStack environment now includes the dashboard.
After you install and configure the dashboard, you can
complete the following tasks:
* Provide users with a public IP address, a username, and a password
so they can access the dashboard through a web browser. In case of
any SSL certificate connection problems, point the server
IP address to a domain name, and give users access.
* Customize your dashboard. For details, see :doc:`/admin/customize-configure`.
* Set up session storage. For derails, see :doc:`/admin/sessions`.
* To use the VNC client with the dashboard, the browser
must support HTML5 Canvas and HTML5 WebSockets.
For details about browsers that support noVNC, see
`README
<https://github.com/novnc/noVNC/blob/master/README.md>`__.
| Remove the "browser support" dead link in the doc | Remove the "browser support" dead link in the doc
Browser support list was removed from the noVNC wiki, but a summary is
still in their README.
Change-Id: I6bb3cd4462f40ba06aebaffd85dc9cda0e87164b
Closes-Bug: #1778424
| reStructuredText | apache-2.0 | openstack/horizon,noironetworks/horizon,NeCTAR-RC/horizon,ChameleonCloud/horizon,noironetworks/horizon,openstack/horizon,noironetworks/horizon,ChameleonCloud/horizon,ChameleonCloud/horizon,NeCTAR-RC/horizon,openstack/horizon,ChameleonCloud/horizon,NeCTAR-RC/horizon,NeCTAR-RC/horizon,openstack/horizon,noironetworks/horizon | restructuredtext | ## Code Before:
==========
Next steps
==========
Your OpenStack environment now includes the dashboard.
After you install and configure the dashboard, you can
complete the following tasks:
* Provide users with a public IP address, a username, and a password
so they can access the dashboard through a web browser. In case of
any SSL certificate connection problems, point the server
IP address to a domain name, and give users access.
* Customize your dashboard. For details, see :doc:`/admin/customize-configure`.
* Set up session storage. For derails, see :doc:`/admin/sessions`.
* To use the VNC client with the dashboard, the browser
must support HTML5 Canvas and HTML5 WebSockets.
For details about browsers that support noVNC, see
`README
<https://github.com/novnc/noVNC/blob/master/README.md>`__
and `browser support
<https://github.com/novnc/noVNC/wiki/Browser-support>`__.
## Instruction:
Remove the "browser support" dead link in the doc
Browser support list was removed from the noVNC wiki, but a summary is
still in their README.
Change-Id: I6bb3cd4462f40ba06aebaffd85dc9cda0e87164b
Closes-Bug: #1778424
## Code After:
==========
Next steps
==========
Your OpenStack environment now includes the dashboard.
After you install and configure the dashboard, you can
complete the following tasks:
* Provide users with a public IP address, a username, and a password
so they can access the dashboard through a web browser. In case of
any SSL certificate connection problems, point the server
IP address to a domain name, and give users access.
* Customize your dashboard. For details, see :doc:`/admin/customize-configure`.
* Set up session storage. For derails, see :doc:`/admin/sessions`.
* To use the VNC client with the dashboard, the browser
must support HTML5 Canvas and HTML5 WebSockets.
For details about browsers that support noVNC, see
`README
<https://github.com/novnc/noVNC/blob/master/README.md>`__.
| ==========
Next steps
==========
Your OpenStack environment now includes the dashboard.
After you install and configure the dashboard, you can
complete the following tasks:
* Provide users with a public IP address, a username, and a password
so they can access the dashboard through a web browser. In case of
any SSL certificate connection problems, point the server
IP address to a domain name, and give users access.
* Customize your dashboard. For details, see :doc:`/admin/customize-configure`.
* Set up session storage. For derails, see :doc:`/admin/sessions`.
* To use the VNC client with the dashboard, the browser
must support HTML5 Canvas and HTML5 WebSockets.
For details about browsers that support noVNC, see
`README
- <https://github.com/novnc/noVNC/blob/master/README.md>`__
+ <https://github.com/novnc/noVNC/blob/master/README.md>`__.
? +
- and `browser support
- <https://github.com/novnc/noVNC/wiki/Browser-support>`__. | 4 | 0.153846 | 1 | 3 |
92b5672a6f2219e64d38b6e2259ee8cc0bc86e30 | .travis.yml | .travis.yml | before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq tmux zsh git
install: script/cached-bundle install --deployment --without development --jobs 3 --retry 3
script: script/test
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
notifications:
email:
recipients:
- mislav.marohnic@gmail.com
on_success: never
env:
global:
- AMAZON_S3_BUCKET=ci-cache
- AMAZON_ACCESS_KEY_ID=AKIAJQCVTDEWQHRPBPGQ
- secure: "XAZv5xyNjWt7F9hG0MZhDANVJ5h/ajEZvfJOEIZRQlE3X5x6oVgI8blLh/MmlRSF0kIyLckcn6t2ccjSOvwN2hca5bwZSjIqoKbJyNe2cmkxfi2432vEOu3Ve6PT5hZWX4R5RgT+xWyMjIJcdF3gUMP7ErXl64aEncBzeW6OoXM="
| before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq tmux zsh git
install: script/cached-bundle install --deployment --without development --jobs 3 --retry 3
script: script/test
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
notifications:
email: false
env:
global:
- AMAZON_S3_BUCKET=ci-cache
- AMAZON_ACCESS_KEY_ID=AKIAJQCVTDEWQHRPBPGQ
- secure: "XAZv5xyNjWt7F9hG0MZhDANVJ5h/ajEZvfJOEIZRQlE3X5x6oVgI8blLh/MmlRSF0kIyLckcn6t2ccjSOvwN2hca5bwZSjIqoKbJyNe2cmkxfi2432vEOu3Ve6PT5hZWX4R5RgT+xWyMjIJcdF3gUMP7ErXl64aEncBzeW6OoXM="
| Disable CI email completely since configuration is not flexible | Disable CI email completely since configuration is not flexible
We can't let email configuration be the default since it would spam most
people in the GitHub org. However, we set it to a couple of addresses
explicitly, we get emailed with failures from other people's forks who
have set up CI for themselves.
| YAML | mit | RichardLitt/hub,hb9kns/hub,pwaller/hub,xantage/hub,cpick/hub,pcorpet/hub,naru0504/hub,sideci-sample/sideci-sample-hub,dongjoon-hyun/hub,RichardLitt/hub,jpkrohling/hub,AndBicScadMedia/hub,aereal/hub,nmfzone/hub,jpkrohling/hub,aspiers/hub,isundaylee/hub,pcorpet/hub,ASidlinskiy/hub,hb9kns/hub,elancom/hub,SanCoder-Q/hub,nlutsenko/hub,jpkrohling/hub,Gusto/hub,boris-rea/hub,rlugojr/hub,nlutsenko/hub,xantage/hub,AndBicScadMedia/hub,codydaig/hub,hopil/hub,elancom/hub,pankona/hub,github/hub,rlugojr/hub,ZenPayroll/hub,nmfzone/hub,haikyuu/hub,nlutsenko/hub,sideci-sample/sideci-sample-hub,whilp/hub,naru0504/hub,github/hub,Gusto/hub,aereal/hub,xantage/hub,aereal/hub,rlugojr/hub,naru0504/hub,codydaig/hub,ASidlinskiy/hub,tomasv/hub,tomasv/hub,adjohnson916/hub,adjohnson916/hub,whilp/hub,pankona/hub,hopil/hub,github/hub,codydaig/hub,SanCoder-Q/hub,hopil/hub,aspiers/hub,jingweno/hub,cpick/hub,github/hub,terry2000/hub,isundaylee/hub,whilp/hub,ryo33/hub,boris-rea/hub,isundaylee/hub,sbp/hub,AndBicScadMedia/hub,jingweno/hub,pwaller/hub,cpick/hub,sbp/hub,haikyuu/hub,terry2000/hub,boris-rea/hub,RichardLitt/hub,hb9kns/hub,ryo33/hub,pwaller/hub,pankona/hub,dev4mobile/hub,dongjoon-hyun/hub,dev4mobile/hub,elancom/hub,dongjoon-hyun/hub,pcorpet/hub,dev4mobile/hub,tomasv/hub,nmfzone/hub,terry2000/hub,sbp/hub,ryo33/hub,aspiers/hub,haikyuu/hub,adjohnson916/hub,ASidlinskiy/hub,ZenPayroll/hub,jingweno/hub,SanCoder-Q/hub | yaml | ## Code Before:
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq tmux zsh git
install: script/cached-bundle install --deployment --without development --jobs 3 --retry 3
script: script/test
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
notifications:
email:
recipients:
- mislav.marohnic@gmail.com
on_success: never
env:
global:
- AMAZON_S3_BUCKET=ci-cache
- AMAZON_ACCESS_KEY_ID=AKIAJQCVTDEWQHRPBPGQ
- secure: "XAZv5xyNjWt7F9hG0MZhDANVJ5h/ajEZvfJOEIZRQlE3X5x6oVgI8blLh/MmlRSF0kIyLckcn6t2ccjSOvwN2hca5bwZSjIqoKbJyNe2cmkxfi2432vEOu3Ve6PT5hZWX4R5RgT+xWyMjIJcdF3gUMP7ErXl64aEncBzeW6OoXM="
## Instruction:
Disable CI email completely since configuration is not flexible
We can't let email configuration be the default since it would spam most
people in the GitHub org. However, we set it to a couple of addresses
explicitly, we get emailed with failures from other people's forks who
have set up CI for themselves.
## Code After:
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq tmux zsh git
install: script/cached-bundle install --deployment --without development --jobs 3 --retry 3
script: script/test
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
notifications:
email: false
env:
global:
- AMAZON_S3_BUCKET=ci-cache
- AMAZON_ACCESS_KEY_ID=AKIAJQCVTDEWQHRPBPGQ
- secure: "XAZv5xyNjWt7F9hG0MZhDANVJ5h/ajEZvfJOEIZRQlE3X5x6oVgI8blLh/MmlRSF0kIyLckcn6t2ccjSOvwN2hca5bwZSjIqoKbJyNe2cmkxfi2432vEOu3Ve6PT5hZWX4R5RgT+xWyMjIJcdF3gUMP7ErXl64aEncBzeW6OoXM="
| before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq tmux zsh git
install: script/cached-bundle install --deployment --without development --jobs 3 --retry 3
script: script/test
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
notifications:
+ email: false
- email:
- recipients:
- - mislav.marohnic@gmail.com
- on_success: never
env:
global:
- AMAZON_S3_BUCKET=ci-cache
- AMAZON_ACCESS_KEY_ID=AKIAJQCVTDEWQHRPBPGQ
- secure: "XAZv5xyNjWt7F9hG0MZhDANVJ5h/ajEZvfJOEIZRQlE3X5x6oVgI8blLh/MmlRSF0kIyLckcn6t2ccjSOvwN2hca5bwZSjIqoKbJyNe2cmkxfi2432vEOu3Ve6PT5hZWX4R5RgT+xWyMjIJcdF3gUMP7ErXl64aEncBzeW6OoXM=" | 5 | 0.227273 | 1 | 4 |
df39e5dff9dd55fd506efa3936509a186e618159 | config/project_urls.yml | config/project_urls.yml | ---
- http://cruisecontrol401.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrolmssql401.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrol5.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrolmssql5.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrol510.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrol.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrolmssql.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrol-metrics.manageiq.com/XmlStatusReport.aspx
| ---
- http://cruisecontrol401.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrolmssql401.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrol5.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrolmssql5.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrol510.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrol.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrolmssql.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrol-metrics.manageiq.com:3333/XmlStatusReport.aspx
| Revert to using old URL's. CruiseControl URL's come back wrong when using a proxy pass. | Revert to using old URL's.
CruiseControl URL's come back wrong when using a proxy pass.
| YAML | apache-2.0 | ManageIQ/cc_monitor,ManageIQ/cc_monitor | yaml | ## Code Before:
---
- http://cruisecontrol401.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrolmssql401.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrol5.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrolmssql5.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrol510.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrol.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrolmssql.manageiq.com/XmlStatusReport.aspx
- http://cruisecontrol-metrics.manageiq.com/XmlStatusReport.aspx
## Instruction:
Revert to using old URL's.
CruiseControl URL's come back wrong when using a proxy pass.
## Code After:
---
- http://cruisecontrol401.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrolmssql401.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrol5.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrolmssql5.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrol510.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrol.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrolmssql.manageiq.com:3333/XmlStatusReport.aspx
- http://cruisecontrol-metrics.manageiq.com:3333/XmlStatusReport.aspx
| ---
- - http://cruisecontrol401.manageiq.com/XmlStatusReport.aspx
+ - http://cruisecontrol401.manageiq.com:3333/XmlStatusReport.aspx
? +++++
- - http://cruisecontrolmssql401.manageiq.com/XmlStatusReport.aspx
+ - http://cruisecontrolmssql401.manageiq.com:3333/XmlStatusReport.aspx
? +++++
- - http://cruisecontrol5.manageiq.com/XmlStatusReport.aspx
+ - http://cruisecontrol5.manageiq.com:3333/XmlStatusReport.aspx
? +++++
- - http://cruisecontrolmssql5.manageiq.com/XmlStatusReport.aspx
+ - http://cruisecontrolmssql5.manageiq.com:3333/XmlStatusReport.aspx
? +++++
- - http://cruisecontrol510.manageiq.com/XmlStatusReport.aspx
+ - http://cruisecontrol510.manageiq.com:3333/XmlStatusReport.aspx
? +++++
- - http://cruisecontrol.manageiq.com/XmlStatusReport.aspx
+ - http://cruisecontrol.manageiq.com:3333/XmlStatusReport.aspx
? +++++
- - http://cruisecontrolmssql.manageiq.com/XmlStatusReport.aspx
+ - http://cruisecontrolmssql.manageiq.com:3333/XmlStatusReport.aspx
? +++++
- - http://cruisecontrol-metrics.manageiq.com/XmlStatusReport.aspx
+ - http://cruisecontrol-metrics.manageiq.com:3333/XmlStatusReport.aspx
? +++++
| 16 | 1.777778 | 8 | 8 |
d2c16d9d8bf849a459900e6bc6e4b6b1a3fd27a8 | spec/importers/data_transformers/csv_transformer_spec.rb | spec/importers/data_transformers/csv_transformer_spec.rb | require 'rails_helper'
RSpec.describe CsvTransformer do
describe '#transform' do
context 'with good data' do
context 'headers in csv' do
# Return a File.read string just like the CsvDownloader class does:
let!(:file) { File.read("#{Rails.root}/spec/fixtures/fake_behavior_export.txt") }
let(:transformer) { CsvTransformer.new }
let(:output) { transformer.transform(file) }
it 'returns a CSV' do
expect(output).to be_a_kind_of CSV::Table
end
it 'has the correct headers' do
expect(output.headers).to match_array([
:event_date, :incident_code, :incident_description, :incident_location, :incident_time, :local_id, :school_local_id
])
end
end
context 'headers not in csv' do
# Return a File.read string just like the CsvDownloader class does:
let!(:file) { File.read("#{Rails.root}/spec/fixtures/fake_no_headers.csv") }
let(:headers) {["section_number","student_local_id","school_local_id","course_number","term_local_id","grade"]}
let(:headers_symbols) {[:section_number,:student_local_id,:school_local_id,:course_number,:term_local_id,:grade]}
let(:transformer) { CsvTransformer.new(headers:headers) }
let(:output) { transformer.transform(file) }
it 'returns a CSV' do
expect(output).to be_a_kind_of CSV::Table
end
it 'has the correct headers' do
expect(output.headers).to match_array(headers_symbols)
end
end
end
end
end
| require 'rails_helper'
RSpec.describe CsvTransformer do
describe '#transform' do
context 'with good data' do
context 'headers in csv' do
# Return a File.read string just like the CsvDownloader class does:
let!(:file) { File.read("#{Rails.root}/spec/fixtures/fake_behavior_export.txt") }
let(:transformer) { CsvTransformer.new }
let(:output) { transformer.transform(file) }
it 'returns a CSV' do
expect(output).to be_a_kind_of CSV::Table
end
it 'has the correct headers' do
expect(output.headers).to match_array([
:event_date, :incident_code, :incident_description, :incident_location, :incident_time, :local_id, :school_local_id
])
end
end
end
end
end
| Remove spec for scenario that doesn't exist in the project (no headers in CSV export file) | Remove spec for scenario that doesn't exist in the project (no headers in CSV export file)
| Ruby | mit | studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights | ruby | ## Code Before:
require 'rails_helper'
RSpec.describe CsvTransformer do
describe '#transform' do
context 'with good data' do
context 'headers in csv' do
# Return a File.read string just like the CsvDownloader class does:
let!(:file) { File.read("#{Rails.root}/spec/fixtures/fake_behavior_export.txt") }
let(:transformer) { CsvTransformer.new }
let(:output) { transformer.transform(file) }
it 'returns a CSV' do
expect(output).to be_a_kind_of CSV::Table
end
it 'has the correct headers' do
expect(output.headers).to match_array([
:event_date, :incident_code, :incident_description, :incident_location, :incident_time, :local_id, :school_local_id
])
end
end
context 'headers not in csv' do
# Return a File.read string just like the CsvDownloader class does:
let!(:file) { File.read("#{Rails.root}/spec/fixtures/fake_no_headers.csv") }
let(:headers) {["section_number","student_local_id","school_local_id","course_number","term_local_id","grade"]}
let(:headers_symbols) {[:section_number,:student_local_id,:school_local_id,:course_number,:term_local_id,:grade]}
let(:transformer) { CsvTransformer.new(headers:headers) }
let(:output) { transformer.transform(file) }
it 'returns a CSV' do
expect(output).to be_a_kind_of CSV::Table
end
it 'has the correct headers' do
expect(output.headers).to match_array(headers_symbols)
end
end
end
end
end
## Instruction:
Remove spec for scenario that doesn't exist in the project (no headers in CSV export file)
## Code After:
require 'rails_helper'
RSpec.describe CsvTransformer do
describe '#transform' do
context 'with good data' do
context 'headers in csv' do
# Return a File.read string just like the CsvDownloader class does:
let!(:file) { File.read("#{Rails.root}/spec/fixtures/fake_behavior_export.txt") }
let(:transformer) { CsvTransformer.new }
let(:output) { transformer.transform(file) }
it 'returns a CSV' do
expect(output).to be_a_kind_of CSV::Table
end
it 'has the correct headers' do
expect(output.headers).to match_array([
:event_date, :incident_code, :incident_description, :incident_location, :incident_time, :local_id, :school_local_id
])
end
end
end
end
end
| require 'rails_helper'
RSpec.describe CsvTransformer do
describe '#transform' do
context 'with good data' do
context 'headers in csv' do
# Return a File.read string just like the CsvDownloader class does:
let!(:file) { File.read("#{Rails.root}/spec/fixtures/fake_behavior_export.txt") }
let(:transformer) { CsvTransformer.new }
let(:output) { transformer.transform(file) }
it 'returns a CSV' do
expect(output).to be_a_kind_of CSV::Table
end
it 'has the correct headers' do
expect(output.headers).to match_array([
:event_date, :incident_code, :incident_description, :incident_location, :incident_time, :local_id, :school_local_id
])
end
end
- context 'headers not in csv' do
- # Return a File.read string just like the CsvDownloader class does:
- let!(:file) { File.read("#{Rails.root}/spec/fixtures/fake_no_headers.csv") }
-
- let(:headers) {["section_number","student_local_id","school_local_id","course_number","term_local_id","grade"]}
- let(:headers_symbols) {[:section_number,:student_local_id,:school_local_id,:course_number,:term_local_id,:grade]}
- let(:transformer) { CsvTransformer.new(headers:headers) }
- let(:output) { transformer.transform(file) }
- it 'returns a CSV' do
- expect(output).to be_a_kind_of CSV::Table
- end
- it 'has the correct headers' do
- expect(output.headers).to match_array(headers_symbols)
- end
- end
end
end
end | 15 | 0.384615 | 0 | 15 |
7640b84956b215f7bd4469341b96c143f7764961 | ansible/roles/api/files/build_api.sh | ansible/roles/api/files/build_api.sh |
USE_VERSION=$1
export PATH=$HOME/.rbenv/bin:$PATH
eval "`rbenv init -`"
cd /home/dpla/api
rbenv shell $USE_VERSION
bundle install
rbenv rehash
/usr/bin/rsync -ruptolg --checksum --delete --delay-updates \
--exclude 'var/log' \
--exclude 'tmp' \
--exclude '.git' \
/home/dpla/api/ /srv/www/api
if [ $? -ne 0 ]; then
exit 1
fi
# Log and temporary directories
dirs_to_check='/srv/www/api/var/log /srv/www/api/tmp'
for dir in $dirs_to_check; do
if [ ! -d $dir ]; then
mkdir $dir \
&& chown dpla:webapp $dir \
&& chmod 0775 $dir
fi
done
# Clear out the job queue, caches, and temporary files.
# Is it OK to do this here in one place, or will there be
# issues with upgrades? We'll at least want to ensure that
# the current application instance is taken out of any
# loadbalancer's rotation for the duration of this script.
# - mb
cd /srv/www/api
bundle exec rake jobs:clear \
&& bundle exec rake contentqa:delete_reports \
&& bundle exec rake tmp:clear \
&& bundle exec rake db:migrate
|
USE_VERSION=$1
export PATH=$HOME/.rbenv/bin:$PATH
eval "`rbenv init -`"
cd /home/dpla/api
rbenv shell $USE_VERSION
bundle install
rbenv rehash
/usr/bin/rsync -ruptolg --checksum --delete --delay-updates \
--exclude 'var/log' \
--exclude 'tmp' \
--exclude '.git' \
/home/dpla/api/ /srv/www/api
if [ $? -ne 0 ]; then
exit 1
fi
# Log and temporary directories
dirs_to_check='/srv/www/api/var/log /srv/www/api/tmp'
for dir in $dirs_to_check; do
if [ ! -d $dir ]; then
mkdir $dir \
&& chown dpla:webapp $dir \
&& chmod 0775 $dir
fi
done
# Clear out the job queue, caches, and temporary files.
# Is it OK to do this here in one place, or will there be
# issues with upgrades? We'll at least want to ensure that
# the current application instance is taken out of any
# loadbalancer's rotation for the duration of this script.
# - mb
cd /srv/www/api
bundle exec rake db:migrate \
&& bundle exec rake tmp:clear \
&& bundle exec rake jobs:clear \
&& bundle exec rake contentqa:delete_reports
| Fix api build rake tasks for new installation | Fix api build rake tasks for new installation
The order of rake tasks was wrong in the `api' role's build_api.sh.
Tasks that required the existence of the database were being run
before the database was being created in a brand-new installation.
| Shell | mit | dpla/automation,dpla/automation,dpla/automation | shell | ## Code Before:
USE_VERSION=$1
export PATH=$HOME/.rbenv/bin:$PATH
eval "`rbenv init -`"
cd /home/dpla/api
rbenv shell $USE_VERSION
bundle install
rbenv rehash
/usr/bin/rsync -ruptolg --checksum --delete --delay-updates \
--exclude 'var/log' \
--exclude 'tmp' \
--exclude '.git' \
/home/dpla/api/ /srv/www/api
if [ $? -ne 0 ]; then
exit 1
fi
# Log and temporary directories
dirs_to_check='/srv/www/api/var/log /srv/www/api/tmp'
for dir in $dirs_to_check; do
if [ ! -d $dir ]; then
mkdir $dir \
&& chown dpla:webapp $dir \
&& chmod 0775 $dir
fi
done
# Clear out the job queue, caches, and temporary files.
# Is it OK to do this here in one place, or will there be
# issues with upgrades? We'll at least want to ensure that
# the current application instance is taken out of any
# loadbalancer's rotation for the duration of this script.
# - mb
cd /srv/www/api
bundle exec rake jobs:clear \
&& bundle exec rake contentqa:delete_reports \
&& bundle exec rake tmp:clear \
&& bundle exec rake db:migrate
## Instruction:
Fix api build rake tasks for new installation
The order of rake tasks was wrong in the `api' role's build_api.sh.
Tasks that required the existence of the database were being run
before the database was being created in a brand-new installation.
## Code After:
USE_VERSION=$1
export PATH=$HOME/.rbenv/bin:$PATH
eval "`rbenv init -`"
cd /home/dpla/api
rbenv shell $USE_VERSION
bundle install
rbenv rehash
/usr/bin/rsync -ruptolg --checksum --delete --delay-updates \
--exclude 'var/log' \
--exclude 'tmp' \
--exclude '.git' \
/home/dpla/api/ /srv/www/api
if [ $? -ne 0 ]; then
exit 1
fi
# Log and temporary directories
dirs_to_check='/srv/www/api/var/log /srv/www/api/tmp'
for dir in $dirs_to_check; do
if [ ! -d $dir ]; then
mkdir $dir \
&& chown dpla:webapp $dir \
&& chmod 0775 $dir
fi
done
# Clear out the job queue, caches, and temporary files.
# Is it OK to do this here in one place, or will there be
# issues with upgrades? We'll at least want to ensure that
# the current application instance is taken out of any
# loadbalancer's rotation for the duration of this script.
# - mb
cd /srv/www/api
bundle exec rake db:migrate \
&& bundle exec rake tmp:clear \
&& bundle exec rake jobs:clear \
&& bundle exec rake contentqa:delete_reports
|
USE_VERSION=$1
export PATH=$HOME/.rbenv/bin:$PATH
eval "`rbenv init -`"
cd /home/dpla/api
rbenv shell $USE_VERSION
bundle install
rbenv rehash
/usr/bin/rsync -ruptolg --checksum --delete --delay-updates \
--exclude 'var/log' \
--exclude 'tmp' \
--exclude '.git' \
/home/dpla/api/ /srv/www/api
if [ $? -ne 0 ]; then
exit 1
fi
# Log and temporary directories
dirs_to_check='/srv/www/api/var/log /srv/www/api/tmp'
for dir in $dirs_to_check; do
if [ ! -d $dir ]; then
mkdir $dir \
&& chown dpla:webapp $dir \
&& chmod 0775 $dir
fi
done
# Clear out the job queue, caches, and temporary files.
# Is it OK to do this here in one place, or will there be
# issues with upgrades? We'll at least want to ensure that
# the current application instance is taken out of any
# loadbalancer's rotation for the duration of this script.
# - mb
cd /srv/www/api
- bundle exec rake jobs:clear \
? ^^ - ^^ --
+ bundle exec rake db:migrate \
? ^ ^^^^^^
- && bundle exec rake contentqa:delete_reports \
- && bundle exec rake tmp:clear \
+ && bundle exec rake tmp:clear \
? +
- && bundle exec rake db:migrate
? ^ ^^^ ^^^
+ && bundle exec rake jobs:clear \
? + ^^ + ^^^^ ^^
+ && bundle exec rake contentqa:delete_reports | 8 | 0.186047 | 4 | 4 |
501723a0de2a2e0e51a77f8d9cf1963d827a97f7 | src/client/es6/app.js | src/client/es6/app.js | import 'angular-material/angular-material.min.css';
import '../styles/main.scss';
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import ngMaterial from 'angular-material';
import ngResource from 'angular-resource';
import lbServices from './lb-services.js';
import CartRouters from './routers.js';
import Theming from './theme.js';
// Angular application initialization
let app = angular.module('app', [
uiRouter, ngMaterial, ngResource, lbServices
]);
// Angular UI router config
app.config(['$stateProvider', '$urlRouterProvider', CartRouters]);
// Angular Material Theme config
app.config(['$mdThemingProvider', Theming]);
| import 'angular-material/angular-material.min.css';
import '../styles/main.scss';
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import ngMaterial from 'angular-material';
import ngResource from 'angular-resource';
import lbServices from './lb-services.js';
import CartRouters from './routers.js';
import CartTheming from './theme.js';
// Angular application initialization
let app = angular.module('app', [
uiRouter, ngMaterial, ngResource, lbServices
]);
// Angular UI router config
app.config(CartRouters);
// Angular Material Theme config
app.config(CartTheming);
| Use injector to do angular config function. | Use injector to do angular config function.
| JavaScript | mit | agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart,agreatfool/Cart | javascript | ## Code Before:
import 'angular-material/angular-material.min.css';
import '../styles/main.scss';
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import ngMaterial from 'angular-material';
import ngResource from 'angular-resource';
import lbServices from './lb-services.js';
import CartRouters from './routers.js';
import Theming from './theme.js';
// Angular application initialization
let app = angular.module('app', [
uiRouter, ngMaterial, ngResource, lbServices
]);
// Angular UI router config
app.config(['$stateProvider', '$urlRouterProvider', CartRouters]);
// Angular Material Theme config
app.config(['$mdThemingProvider', Theming]);
## Instruction:
Use injector to do angular config function.
## Code After:
import 'angular-material/angular-material.min.css';
import '../styles/main.scss';
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import ngMaterial from 'angular-material';
import ngResource from 'angular-resource';
import lbServices from './lb-services.js';
import CartRouters from './routers.js';
import CartTheming from './theme.js';
// Angular application initialization
let app = angular.module('app', [
uiRouter, ngMaterial, ngResource, lbServices
]);
// Angular UI router config
app.config(CartRouters);
// Angular Material Theme config
app.config(CartTheming);
| import 'angular-material/angular-material.min.css';
import '../styles/main.scss';
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import ngMaterial from 'angular-material';
import ngResource from 'angular-resource';
import lbServices from './lb-services.js';
import CartRouters from './routers.js';
- import Theming from './theme.js';
+ import CartTheming from './theme.js';
? ++++
// Angular application initialization
let app = angular.module('app', [
uiRouter, ngMaterial, ngResource, lbServices
]);
// Angular UI router config
- app.config(['$stateProvider', '$urlRouterProvider', CartRouters]);
+ app.config(CartRouters);
// Angular Material Theme config
- app.config(['$mdThemingProvider', Theming]);
+ app.config(CartTheming); | 6 | 0.272727 | 3 | 3 |
e6e6e75dbf11892a43f4c595ae9c0d42bfd01782 | ansible/roles/archipelago-packages/tasks/main.yml | ansible/roles/archipelago-packages/tasks/main.yml | ---
- name: Install Application Packages
apt: pkg={{ item }} state=installed
with_items:
- mysql-server
- irssi
- exim4
| ---
- name: Install Application Packages
apt: pkg={{ item }} state=installed
with_items:
- mysql-server
- irssi
- exim4
- name: Install backported packages
apt: pkg={{ item }} state=installed default_release=jessie-backports
with_items:
- certbot
| Install letsencrypt/certbot client on archipelago | Install letsencrypt/certbot client on archipelago
| YAML | mit | aquarion/autopelago,aquarion/autopelago,aquarion/autopelago | yaml | ## Code Before:
---
- name: Install Application Packages
apt: pkg={{ item }} state=installed
with_items:
- mysql-server
- irssi
- exim4
## Instruction:
Install letsencrypt/certbot client on archipelago
## Code After:
---
- name: Install Application Packages
apt: pkg={{ item }} state=installed
with_items:
- mysql-server
- irssi
- exim4
- name: Install backported packages
apt: pkg={{ item }} state=installed default_release=jessie-backports
with_items:
- certbot
| ---
- name: Install Application Packages
apt: pkg={{ item }} state=installed
with_items:
- mysql-server
- irssi
- exim4
-
+
+ - name: Install backported packages
+ apt: pkg={{ item }} state=installed default_release=jessie-backports
+ with_items:
+ - certbot | 6 | 0.666667 | 5 | 1 |
ea063d143f140554aaa08606d9c8d58121e8a52c | requirements.txt | requirements.txt | PyQt5==5.8.2
hypothesis==3.6.0
pylint==1.7.2
pytest==3.0.4
| astroid==1.5.3
PyQt5==5.8.2
hypothesis==3.6.0
pylint==1.7.2
pytest==3.0.4
| Fix false pylint "unused variable" warning | Fix false pylint "unused variable" warning
A new version of 'astroid' package used by pylint causes warning upon
dynamically added vairable [1]. In order to prevent this, we use the
last version of astroid package having correct behavior.
1: https://github.com/PyCQA/pylint/issues/1609
| Text | mit | ahitrin/SiebenApp | text | ## Code Before:
PyQt5==5.8.2
hypothesis==3.6.0
pylint==1.7.2
pytest==3.0.4
## Instruction:
Fix false pylint "unused variable" warning
A new version of 'astroid' package used by pylint causes warning upon
dynamically added vairable [1]. In order to prevent this, we use the
last version of astroid package having correct behavior.
1: https://github.com/PyCQA/pylint/issues/1609
## Code After:
astroid==1.5.3
PyQt5==5.8.2
hypothesis==3.6.0
pylint==1.7.2
pytest==3.0.4
| + astroid==1.5.3
PyQt5==5.8.2
hypothesis==3.6.0
pylint==1.7.2
pytest==3.0.4 | 1 | 0.25 | 1 | 0 |
918f3d5b2d65ddda659842340319f3029bee3822 | _config.yml | _config.yml | permalink: pretty
relative_permalinks: true
# Setup
title: tnez.github.io
tagline: Software Developer + Data Wrangler
url: http://tnez.github.io
shorturl: tnesland.me
paginate: 5
baseurl: /
author:
name: Travis Nesland
url: http://tnesland.me
email: tnesland@gmail.com
# Navigation
pages_list:
Home: '/'
Archive: '/archive'
# Custom vars
version: 1.0.0
github:
repo: https://github.com/tnez/tnez.github.io
| permalink: pretty
relative_permalinks: true
# Setup
title: tnez.github.io
tagline: Software Developer + Data Wrangler
url: http://tnesland.me/blog
shorturl: tnesland.me
paginate: 5
baseurl: /
author:
name: Travis Nesland
url: http://tnesland.me
email: tnesland@gmail.com
# Navigation
pages_list:
Home: '/'
Archive: '/archive'
# Custom vars
version: 1.0.0
github:
repo: https://github.com/tnez/tnez.github.io
| Change url from tnez.github.io to tnesland.me/blog | Change url from tnez.github.io to tnesland.me/blog
| YAML | mit | tnez/tnez.github.io | yaml | ## Code Before:
permalink: pretty
relative_permalinks: true
# Setup
title: tnez.github.io
tagline: Software Developer + Data Wrangler
url: http://tnez.github.io
shorturl: tnesland.me
paginate: 5
baseurl: /
author:
name: Travis Nesland
url: http://tnesland.me
email: tnesland@gmail.com
# Navigation
pages_list:
Home: '/'
Archive: '/archive'
# Custom vars
version: 1.0.0
github:
repo: https://github.com/tnez/tnez.github.io
## Instruction:
Change url from tnez.github.io to tnesland.me/blog
## Code After:
permalink: pretty
relative_permalinks: true
# Setup
title: tnez.github.io
tagline: Software Developer + Data Wrangler
url: http://tnesland.me/blog
shorturl: tnesland.me
paginate: 5
baseurl: /
author:
name: Travis Nesland
url: http://tnesland.me
email: tnesland@gmail.com
# Navigation
pages_list:
Home: '/'
Archive: '/archive'
# Custom vars
version: 1.0.0
github:
repo: https://github.com/tnez/tnez.github.io
| permalink: pretty
relative_permalinks: true
# Setup
title: tnez.github.io
tagline: Software Developer + Data Wrangler
- url: http://tnez.github.io
? ^ --------
+ url: http://tnesland.me/blog
? ^^^^^ ++++++
shorturl: tnesland.me
paginate: 5
baseurl: /
author:
name: Travis Nesland
url: http://tnesland.me
email: tnesland@gmail.com
# Navigation
pages_list:
Home: '/'
Archive: '/archive'
# Custom vars
version: 1.0.0
github:
repo: https://github.com/tnez/tnez.github.io
| 2 | 0.08 | 1 | 1 |
ba2727911fedbb3eb3ffb35f8c725f2ab1a0d682 | .github/ISSUE_TEMPLATE.md | .github/ISSUE_TEMPLATE.md | <!-- Love AzuraCast? Please consider supporting our collective:
👉 https://opencollective.com/AzuraCast/donate --> | - **Installation Method:** <!-- Docker or Traditional -->
- **Host OS (if using Docker):** <!-- Ubuntu 16.04, CentOS 7, Windows, etc. -->
**Describe the issue in full detail, including screenshots if possible:**
<!-- Issue description --> | Update github new issue template. | Update github new issue template.
| Markdown | agpl-3.0 | AzuraCast/AzuraCast,SlvrEagle23/AzuraCast,SlvrEagle23/AzuraCast,SlvrEagle23/AzuraCast,AzuraCast/AzuraCast,AzuraCast/AzuraCast,SlvrEagle23/AzuraCast,SlvrEagle23/AzuraCast,AzuraCast/AzuraCast | markdown | ## Code Before:
<!-- Love AzuraCast? Please consider supporting our collective:
👉 https://opencollective.com/AzuraCast/donate -->
## Instruction:
Update github new issue template.
## Code After:
- **Installation Method:** <!-- Docker or Traditional -->
- **Host OS (if using Docker):** <!-- Ubuntu 16.04, CentOS 7, Windows, etc. -->
**Describe the issue in full detail, including screenshots if possible:**
<!-- Issue description --> | - <!-- Love AzuraCast? Please consider supporting our collective:
- 👉 https://opencollective.com/AzuraCast/donate -->
+ - **Installation Method:** <!-- Docker or Traditional -->
+ - **Host OS (if using Docker):** <!-- Ubuntu 16.04, CentOS 7, Windows, etc. -->
+
+ **Describe the issue in full detail, including screenshots if possible:**
+
+ <!-- Issue description --> | 8 | 4 | 6 | 2 |
d7b51d8a67d5e3fec5430ff05b1c9b09d8e367d1 | doc/README.md | doc/README.md |
- Typescript
- Angular2
### Backend
- Java
- Spring boot (use as rest server only)
- H2 (may use pg for production)
- Elasticsearch (for search)
- Mongodb or redis (for NoSQL or cache) |
- Typescript
- Angular2
### Backend
- Nginx (Openresty)
- Java
- Spring boot (use as rest server only)
- H2 (may use pg for production)
- Elasticsearch (for search)
- Mongodb or redis (for NoSQL or cache)
## Setup on Windows
- [Install Nginx](https://moonbingbing.gitbooks.io/openresty-best-practices/content/openresty/install_on_windows.html)
- Install Java
- Install Maven
- Install Node
- Install PostgreSQL
e.... so many to install, I think I need to use linux now.... | Add doc for setup on windows | Add doc for setup on windows
| Markdown | apache-2.0 | at15/bform,at15/bform | markdown | ## Code Before:
- Typescript
- Angular2
### Backend
- Java
- Spring boot (use as rest server only)
- H2 (may use pg for production)
- Elasticsearch (for search)
- Mongodb or redis (for NoSQL or cache)
## Instruction:
Add doc for setup on windows
## Code After:
- Typescript
- Angular2
### Backend
- Nginx (Openresty)
- Java
- Spring boot (use as rest server only)
- H2 (may use pg for production)
- Elasticsearch (for search)
- Mongodb or redis (for NoSQL or cache)
## Setup on Windows
- [Install Nginx](https://moonbingbing.gitbooks.io/openresty-best-practices/content/openresty/install_on_windows.html)
- Install Java
- Install Maven
- Install Node
- Install PostgreSQL
e.... so many to install, I think I need to use linux now.... |
- Typescript
- Angular2
### Backend
+ - Nginx (Openresty)
- Java
- Spring boot (use as rest server only)
- H2 (may use pg for production)
- Elasticsearch (for search)
- Mongodb or redis (for NoSQL or cache)
+
+ ## Setup on Windows
+
+ - [Install Nginx](https://moonbingbing.gitbooks.io/openresty-best-practices/content/openresty/install_on_windows.html)
+ - Install Java
+ - Install Maven
+ - Install Node
+ - Install PostgreSQL
+
+ e.... so many to install, I think I need to use linux now.... | 11 | 1 | 11 | 0 |
ae22bbc03160032cdd77f6c6f12a9458ce1cc0a6 | demo/src/main/java/me/yokeyword/sample/demo_wechat/base/BaseBackFragment.java | demo/src/main/java/me/yokeyword/sample/demo_wechat/base/BaseBackFragment.java | package me.yokeyword.sample.demo_wechat.base;
import android.support.v7.widget.Toolbar;
import android.view.View;
import me.yokeyword.fragmentation_swipeback.SwipeBackFragment;
import me.yokeyword.sample.R;
/**
* Created by YoKeyword on 16/2/7.
*/
public class BaseBackFragment extends SwipeBackFragment {
private static final String TAG = "Fragmentation";
protected void initToolbarNav(Toolbar toolbar) {
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
_mActivity.onBackPressed();
}
});
}
}
| package me.yokeyword.sample.demo_wechat.base;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import me.yokeyword.fragmentation_swipeback.SwipeBackFragment;
import me.yokeyword.sample.R;
/**
* Created by YoKeyword on 16/2/7.
*/
public class BaseBackFragment extends SwipeBackFragment {
private static final String TAG = "Fragmentation";
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setParallaxOffset(0.5f);
}
protected void initToolbarNav(Toolbar toolbar) {
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
_mActivity.onBackPressed();
}
});
}
}
| Add a sample of setParallaxOffset(). | Add a sample of setParallaxOffset().
| Java | apache-2.0 | YoKeyword/Fragmentation | java | ## Code Before:
package me.yokeyword.sample.demo_wechat.base;
import android.support.v7.widget.Toolbar;
import android.view.View;
import me.yokeyword.fragmentation_swipeback.SwipeBackFragment;
import me.yokeyword.sample.R;
/**
* Created by YoKeyword on 16/2/7.
*/
public class BaseBackFragment extends SwipeBackFragment {
private static final String TAG = "Fragmentation";
protected void initToolbarNav(Toolbar toolbar) {
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
_mActivity.onBackPressed();
}
});
}
}
## Instruction:
Add a sample of setParallaxOffset().
## Code After:
package me.yokeyword.sample.demo_wechat.base;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import me.yokeyword.fragmentation_swipeback.SwipeBackFragment;
import me.yokeyword.sample.R;
/**
* Created by YoKeyword on 16/2/7.
*/
public class BaseBackFragment extends SwipeBackFragment {
private static final String TAG = "Fragmentation";
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setParallaxOffset(0.5f);
}
protected void initToolbarNav(Toolbar toolbar) {
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
_mActivity.onBackPressed();
}
});
}
}
| package me.yokeyword.sample.demo_wechat.base;
+ import android.os.Bundle;
+ import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import me.yokeyword.fragmentation_swipeback.SwipeBackFragment;
import me.yokeyword.sample.R;
/**
* Created by YoKeyword on 16/2/7.
*/
public class BaseBackFragment extends SwipeBackFragment {
private static final String TAG = "Fragmentation";
+ @Override
+ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ setParallaxOffset(0.5f);
+ }
+
protected void initToolbarNav(Toolbar toolbar) {
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
_mActivity.onBackPressed();
}
});
}
} | 8 | 0.333333 | 8 | 0 |
67285ec9f073d2938f5111572a5c48976f558ee3 | metadata/org.schabi.terminightor.txt | metadata/org.schabi.terminightor.txt | Categories:Time
License:GPLv3+
Web Site:
Source Code:https://github.com/theScrabi/Terminightor
Issue Tracker:https://github.com/theScrabi/Terminightor/issues
Auto Name:Terminightor
Summary:Alarm clock based on NFC tags
Description:
A simple alarm clock with a spicy special: In order to put off an alarm, you
have to hold a NFC tag onto your phone. Unless you do that the alarm will not
stop, even if you try to kill the Terminightor service.
So if you put a tag for example into your bathroom, and set up an alarm with
that tag, it will ensure that you really get up in the morning.
Features:
* repeat/don't repeat alarms
* repeat alarms only on certain week days
* custom ring-tone
* put vibration on/off
* put alarms off via NFC tag
.
Repo Type:git
Repo:https://github.com/theScrabi/Terminightor
Build:0.8,1
commit=v0.8-beta
subdir=app
gradle=yes
Build:0.9,2
commit=v0.9
subdir=app
gradle=yes
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.9
Current Version Code:2
| Categories:Time
License:GPLv3+
Web Site:
Source Code:https://github.com/theScrabi/Terminightor
Issue Tracker:https://github.com/theScrabi/Terminightor/issues
Auto Name:Terminightor
Summary:Alarm clock based on NFC tags
Description:
A simple alarm clock with a spicy special: In order to put off an alarm, you
have to hold a NFC tag onto your phone. Unless you do that the alarm will not
stop, even if you try to kill the Terminightor service.
So if you put a tag for example into your bathroom, and set up an alarm with
that tag, it will ensure that you really get up in the morning.
Features:
* repeat/don't repeat alarms
* repeat alarms only on certain week days
* custom ring-tone
* put vibration on/off
* put alarms off via NFC tag
.
Repo Type:git
Repo:https://github.com/theScrabi/Terminightor
Build:0.8,1
commit=v0.8-beta
subdir=app
gradle=yes
Build:0.9,2
commit=v0.9
subdir=app
gradle=yes
Build:0.9.1,3
commit=v0.9.1
subdir=app
gradle=yes
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.9.1
Current Version Code:3
| Update Terminightor to 0.9.1 (3) | Update Terminightor to 0.9.1 (3)
| Text | agpl-3.0 | f-droid/fdroid-data,f-droid/fdroiddata,f-droid/fdroiddata | text | ## Code Before:
Categories:Time
License:GPLv3+
Web Site:
Source Code:https://github.com/theScrabi/Terminightor
Issue Tracker:https://github.com/theScrabi/Terminightor/issues
Auto Name:Terminightor
Summary:Alarm clock based on NFC tags
Description:
A simple alarm clock with a spicy special: In order to put off an alarm, you
have to hold a NFC tag onto your phone. Unless you do that the alarm will not
stop, even if you try to kill the Terminightor service.
So if you put a tag for example into your bathroom, and set up an alarm with
that tag, it will ensure that you really get up in the morning.
Features:
* repeat/don't repeat alarms
* repeat alarms only on certain week days
* custom ring-tone
* put vibration on/off
* put alarms off via NFC tag
.
Repo Type:git
Repo:https://github.com/theScrabi/Terminightor
Build:0.8,1
commit=v0.8-beta
subdir=app
gradle=yes
Build:0.9,2
commit=v0.9
subdir=app
gradle=yes
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.9
Current Version Code:2
## Instruction:
Update Terminightor to 0.9.1 (3)
## Code After:
Categories:Time
License:GPLv3+
Web Site:
Source Code:https://github.com/theScrabi/Terminightor
Issue Tracker:https://github.com/theScrabi/Terminightor/issues
Auto Name:Terminightor
Summary:Alarm clock based on NFC tags
Description:
A simple alarm clock with a spicy special: In order to put off an alarm, you
have to hold a NFC tag onto your phone. Unless you do that the alarm will not
stop, even if you try to kill the Terminightor service.
So if you put a tag for example into your bathroom, and set up an alarm with
that tag, it will ensure that you really get up in the morning.
Features:
* repeat/don't repeat alarms
* repeat alarms only on certain week days
* custom ring-tone
* put vibration on/off
* put alarms off via NFC tag
.
Repo Type:git
Repo:https://github.com/theScrabi/Terminightor
Build:0.8,1
commit=v0.8-beta
subdir=app
gradle=yes
Build:0.9,2
commit=v0.9
subdir=app
gradle=yes
Build:0.9.1,3
commit=v0.9.1
subdir=app
gradle=yes
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.9.1
Current Version Code:3
| Categories:Time
License:GPLv3+
Web Site:
Source Code:https://github.com/theScrabi/Terminightor
Issue Tracker:https://github.com/theScrabi/Terminightor/issues
Auto Name:Terminightor
Summary:Alarm clock based on NFC tags
Description:
A simple alarm clock with a spicy special: In order to put off an alarm, you
have to hold a NFC tag onto your phone. Unless you do that the alarm will not
stop, even if you try to kill the Terminightor service.
So if you put a tag for example into your bathroom, and set up an alarm with
that tag, it will ensure that you really get up in the morning.
Features:
* repeat/don't repeat alarms
* repeat alarms only on certain week days
* custom ring-tone
* put vibration on/off
* put alarms off via NFC tag
.
Repo Type:git
Repo:https://github.com/theScrabi/Terminightor
Build:0.8,1
commit=v0.8-beta
subdir=app
gradle=yes
Build:0.9,2
commit=v0.9
subdir=app
gradle=yes
+ Build:0.9.1,3
+ commit=v0.9.1
+ subdir=app
+ gradle=yes
+
Auto Update Mode:Version v%v
Update Check Mode:Tags
- Current Version:0.9
+ Current Version:0.9.1
? ++
- Current Version Code:2
? ^
+ Current Version Code:3
? ^
| 9 | 0.214286 | 7 | 2 |
b7efbb12160d134c749f5fb171d2a3ea97ace568 | google-cloud-sdk/google-cloud-sdk.zsh | google-cloud-sdk/google-cloud-sdk.zsh | source $HOME/code/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source $HOME/code/google-cloud-sdk/completion.zsh.inc
alias goapp=$HOME/code/google-cloud-sdk/platform/google_appengine/goapp
| export GOOGLE_CLOUD_SDK=$HOME/code/github/google-cloud-sdk
if [ -d "$GOOGLE_CLOUD_SDK" ]; then
# Update PATH for the Google Cloud SDK.
source $GOOGLE_CLOUD_SDK/path.zsh.inc
# Enable zsh completion for gcloud.
source $GOOGLE_CLOUD_SDK/completion.zsh.inc
alias goapp=$GOOGLE_CLOUD_SDK/platform/google_appengine/goapp
fi
| Check gcloud is installed before configuring | Check gcloud is installed before configuring
| Shell | mit | markscholtz/dotfiles,markscholtz/dotfiles | shell | ## Code Before:
source $HOME/code/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source $HOME/code/google-cloud-sdk/completion.zsh.inc
alias goapp=$HOME/code/google-cloud-sdk/platform/google_appengine/goapp
## Instruction:
Check gcloud is installed before configuring
## Code After:
export GOOGLE_CLOUD_SDK=$HOME/code/github/google-cloud-sdk
if [ -d "$GOOGLE_CLOUD_SDK" ]; then
# Update PATH for the Google Cloud SDK.
source $GOOGLE_CLOUD_SDK/path.zsh.inc
# Enable zsh completion for gcloud.
source $GOOGLE_CLOUD_SDK/completion.zsh.inc
alias goapp=$GOOGLE_CLOUD_SDK/platform/google_appengine/goapp
fi
| - source $HOME/code/google-cloud-sdk/path.zsh.inc
+ export GOOGLE_CLOUD_SDK=$HOME/code/github/google-cloud-sdk
- # The next line enables zsh completion for gcloud.
- source $HOME/code/google-cloud-sdk/completion.zsh.inc
+ if [ -d "$GOOGLE_CLOUD_SDK" ]; then
+ # Update PATH for the Google Cloud SDK.
+ source $GOOGLE_CLOUD_SDK/path.zsh.inc
- alias goapp=$HOME/code/google-cloud-sdk/platform/google_appengine/goapp
+ # Enable zsh completion for gcloud.
+ source $GOOGLE_CLOUD_SDK/completion.zsh.inc
+ alias goapp=$GOOGLE_CLOUD_SDK/platform/google_appengine/goapp
+ fi | 12 | 1.714286 | 8 | 4 |
63eaf55f3ec45366e1ef5dab02f1d98a096d1ea2 | dashboard.h | dashboard.h |
typedef struct {
int max_x;
int max_y;
int prev_x;
int prev_y;
char *fieldbar;
sysaux *system;
ps_node *process_list;
Tree *process_tree;
} Board;
void print_usage(void);
char set_sort_option(char *opt);
void dashboard_mainloop(char attr_sort);
void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys);
static int calculate_ln_diff(Board *board, int ln, int prev_ln);
Board *init_board(void);
void free_board(Board *board);
#endif
|
typedef struct {
int max_x;
int max_y;
int prev_x;
int prev_y;
char *fieldbar;
sysaux *system;
ps_node *process_list;
Tree *process_tree;
} Board;
void print_usage(void);
char set_sort_option(char *opt);
void dashboard_mainloop(char attr_sort);
void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys);
Board *init_board(void);
void free_board(Board *board);
#endif
| Remove static declaration of line diff | Remove static declaration of line diff
| C | mit | tijko/dashboard | c | ## Code Before:
typedef struct {
int max_x;
int max_y;
int prev_x;
int prev_y;
char *fieldbar;
sysaux *system;
ps_node *process_list;
Tree *process_tree;
} Board;
void print_usage(void);
char set_sort_option(char *opt);
void dashboard_mainloop(char attr_sort);
void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys);
static int calculate_ln_diff(Board *board, int ln, int prev_ln);
Board *init_board(void);
void free_board(Board *board);
#endif
## Instruction:
Remove static declaration of line diff
## Code After:
typedef struct {
int max_x;
int max_y;
int prev_x;
int prev_y;
char *fieldbar;
sysaux *system;
ps_node *process_list;
Tree *process_tree;
} Board;
void print_usage(void);
char set_sort_option(char *opt);
void dashboard_mainloop(char attr_sort);
void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys);
Board *init_board(void);
void free_board(Board *board);
#endif
|
typedef struct {
int max_x;
int max_y;
int prev_x;
int prev_y;
char *fieldbar;
sysaux *system;
ps_node *process_list;
Tree *process_tree;
} Board;
void print_usage(void);
char set_sort_option(char *opt);
void dashboard_mainloop(char attr_sort);
void update_process_stats(Tree *ps_tree, ps_node *ps, sysaux *sys);
- static int calculate_ln_diff(Board *board, int ln, int prev_ln);
-
Board *init_board(void);
void free_board(Board *board);
#endif | 2 | 0.071429 | 0 | 2 |
47f5a23f674c0f57dca6cf2a924d2bba1dc6c0c9 | lib/spontaneous/permissions.rb | lib/spontaneous/permissions.rb |
require 'base58'
module Spontaneous
module Permissions
autoload :UserLevel, "spontaneous/permissions/user_level"
autoload :User, "spontaneous/permissions/user"
autoload :AccessGroup, "spontaneous/permissions/access_group"
autoload :AccessKey, "spontaneous/permissions/access_key"
@@active_user = nil
class << self
# Convenience shortcut so we can do Permissions[:root]
def [](level_name)
UserLevel[level_name]
end
def root
UserLevel.root
end
def has_level?(level)
return true unless active_user
active_user.level >= level
end
def with_user(user)
self.active_user = user
yield if block_given?
ensure
self.active_user = nil
end
def active_user
Thread.current[:_permissions_active_user]
end
def active_user=(user)
Thread.current[:_permissions_active_user] = user
end
protected(:active_user=)
def random_string(length)
# can't be bothered to work out the real rules behind this
bytes = (length.to_f / 1.375).ceil + 2
string = Base58.encode(OpenSSL::Random.random_bytes(bytes).unpack("h*").first.to_i(16)) #=> 44 chars
string[0...(length)]
end
end
end
end
|
require 'base58'
module Spontaneous
module Permissions
autoload :UserLevel, "spontaneous/permissions/user_level"
autoload :User, "spontaneous/permissions/user"
autoload :AccessGroup, "spontaneous/permissions/access_group"
autoload :AccessKey, "spontaneous/permissions/access_key"
@@active_user = nil
class << self
# Convenience shortcut so we can do Permissions[:root]
def [](level_name)
UserLevel[level_name]
end
def root
UserLevel.root
end
def has_level?(level)
return true unless active_user
active_user.level >= level
end
def with_user(user)
self.active_user = user
yield if block_given?
ensure
self.active_user = nil
end
def active_user
Thread.current[:_permissions_active_user]
end
def active_user=(user)
Thread.current[:_permissions_active_user] = user
end
protected(:active_user=)
def random_string(length)
bytes = ((length * Math.log10(58))/(8 * Math.log10(2))).ceil + 2
string = Base58.encode(OpenSSL::Random.random_bytes(bytes).unpack("h*").first.to_i(16))
string[0...(length)]
end
end
end
end
| Correct calculation of number of bytes to generate for a particular length of random string | Correct calculation of number of bytes to generate for a particular length of random string
| Ruby | mit | SpontaneousCMS/spontaneous,mediagreenhouse/spontaneous,magnetised/spontaneous,opendesk/spontaneous,SpontaneousCMS/spontaneous,mediagreenhouse/spontaneous,magnetised/spontaneous,SpontaneousCMS/spontaneous,opendesk/spontaneous,mediagreenhouse/spontaneous,magnetised/spontaneous,opendesk/spontaneous | ruby | ## Code Before:
require 'base58'
module Spontaneous
module Permissions
autoload :UserLevel, "spontaneous/permissions/user_level"
autoload :User, "spontaneous/permissions/user"
autoload :AccessGroup, "spontaneous/permissions/access_group"
autoload :AccessKey, "spontaneous/permissions/access_key"
@@active_user = nil
class << self
# Convenience shortcut so we can do Permissions[:root]
def [](level_name)
UserLevel[level_name]
end
def root
UserLevel.root
end
def has_level?(level)
return true unless active_user
active_user.level >= level
end
def with_user(user)
self.active_user = user
yield if block_given?
ensure
self.active_user = nil
end
def active_user
Thread.current[:_permissions_active_user]
end
def active_user=(user)
Thread.current[:_permissions_active_user] = user
end
protected(:active_user=)
def random_string(length)
# can't be bothered to work out the real rules behind this
bytes = (length.to_f / 1.375).ceil + 2
string = Base58.encode(OpenSSL::Random.random_bytes(bytes).unpack("h*").first.to_i(16)) #=> 44 chars
string[0...(length)]
end
end
end
end
## Instruction:
Correct calculation of number of bytes to generate for a particular length of random string
## Code After:
require 'base58'
module Spontaneous
module Permissions
autoload :UserLevel, "spontaneous/permissions/user_level"
autoload :User, "spontaneous/permissions/user"
autoload :AccessGroup, "spontaneous/permissions/access_group"
autoload :AccessKey, "spontaneous/permissions/access_key"
@@active_user = nil
class << self
# Convenience shortcut so we can do Permissions[:root]
def [](level_name)
UserLevel[level_name]
end
def root
UserLevel.root
end
def has_level?(level)
return true unless active_user
active_user.level >= level
end
def with_user(user)
self.active_user = user
yield if block_given?
ensure
self.active_user = nil
end
def active_user
Thread.current[:_permissions_active_user]
end
def active_user=(user)
Thread.current[:_permissions_active_user] = user
end
protected(:active_user=)
def random_string(length)
bytes = ((length * Math.log10(58))/(8 * Math.log10(2))).ceil + 2
string = Base58.encode(OpenSSL::Random.random_bytes(bytes).unpack("h*").first.to_i(16))
string[0...(length)]
end
end
end
end
|
require 'base58'
module Spontaneous
module Permissions
autoload :UserLevel, "spontaneous/permissions/user_level"
autoload :User, "spontaneous/permissions/user"
autoload :AccessGroup, "spontaneous/permissions/access_group"
autoload :AccessKey, "spontaneous/permissions/access_key"
@@active_user = nil
class << self
# Convenience shortcut so we can do Permissions[:root]
def [](level_name)
UserLevel[level_name]
end
def root
UserLevel.root
end
def has_level?(level)
return true unless active_user
active_user.level >= level
end
def with_user(user)
self.active_user = user
yield if block_given?
ensure
self.active_user = nil
end
def active_user
Thread.current[:_permissions_active_user]
end
def active_user=(user)
Thread.current[:_permissions_active_user] = user
end
protected(:active_user=)
def random_string(length)
+ bytes = ((length * Math.log10(58))/(8 * Math.log10(2))).ceil + 2
- # can't be bothered to work out the real rules behind this
- bytes = (length.to_f / 1.375).ceil + 2
- string = Base58.encode(OpenSSL::Random.random_bytes(bytes).unpack("h*").first.to_i(16)) #=> 44 chars
? -------------
+ string = Base58.encode(OpenSSL::Random.random_bytes(bytes).unpack("h*").first.to_i(16))
string[0...(length)]
end
end
end
end | 5 | 0.090909 | 2 | 3 |
197c109ed2cb93268cba8c02066ac3df8812cd95 | src/main/java/hello/Application.java | src/main/java/hello/Application.java | package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan
@EnableAutoConfiguration
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| package hello;
import org.apache.catalina.session.FileStore;
import org.apache.catalina.session.PersistentManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import java.io.File;
import java.util.Arrays;
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class Application {
private Log log = LogFactory.getLog(Application.class);
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
return factory -> {
TomcatEmbeddedServletContainerFactory containerFactory = (TomcatEmbeddedServletContainerFactory) factory;
containerFactory.setTomcatContextCustomizers(Arrays.asList(context -> {
final PersistentManager persistentManager = new PersistentManager();
final FileStore store = new FileStore();
final String sessionDirectory = makeSessionDirectory();
log.info("Writing sessions to " + sessionDirectory);
store.setDirectory(sessionDirectory);
persistentManager.setStore(store);
context.setManager(persistentManager);
}));
};
}
private String makeSessionDirectory() {
final String cwd = System.getProperty("user.dir");
return cwd + File.separator + "sessions";
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| Use persistent file based sessions that survive application restarts. | Use persistent file based sessions that survive application restarts.
| Java | apache-2.0 | gsopu8065/spring-boot-spring-loaded-java8-example,joakim666/spring-boot-spring-loaded-java8-example,joakim666/spring-boot-spring-loaded-java8-example,gsopu8065/spring-boot-spring-loaded-java8-example | java | ## Code Before:
package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan
@EnableAutoConfiguration
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
## Instruction:
Use persistent file based sessions that survive application restarts.
## Code After:
package hello;
import org.apache.catalina.session.FileStore;
import org.apache.catalina.session.PersistentManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import java.io.File;
import java.util.Arrays;
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class Application {
private Log log = LogFactory.getLog(Application.class);
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
return factory -> {
TomcatEmbeddedServletContainerFactory containerFactory = (TomcatEmbeddedServletContainerFactory) factory;
containerFactory.setTomcatContextCustomizers(Arrays.asList(context -> {
final PersistentManager persistentManager = new PersistentManager();
final FileStore store = new FileStore();
final String sessionDirectory = makeSessionDirectory();
log.info("Writing sessions to " + sessionDirectory);
store.setDirectory(sessionDirectory);
persistentManager.setStore(store);
context.setManager(persistentManager);
}));
};
}
private String makeSessionDirectory() {
final String cwd = System.getProperty("user.dir");
return cwd + File.separator + "sessions";
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
| package hello;
+ import org.apache.catalina.session.FileStore;
+ import org.apache.catalina.session.PersistentManager;
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+ import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
+ import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
+ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
+ import org.springframework.context.annotation.Configuration;
+ import java.io.File;
+ import java.util.Arrays;
+
+ @Configuration
@ComponentScan
@EnableAutoConfiguration
public class Application {
+ private Log log = LogFactory.getLog(Application.class);
+
+ @Bean
+ public EmbeddedServletContainerCustomizer containerCustomizer() {
+ return factory -> {
+ TomcatEmbeddedServletContainerFactory containerFactory = (TomcatEmbeddedServletContainerFactory) factory;
+ containerFactory.setTomcatContextCustomizers(Arrays.asList(context -> {
+ final PersistentManager persistentManager = new PersistentManager();
+ final FileStore store = new FileStore();
+
+ final String sessionDirectory = makeSessionDirectory();
+ log.info("Writing sessions to " + sessionDirectory);
+ store.setDirectory(sessionDirectory);
+
+ persistentManager.setStore(store);
+ context.setManager(persistentManager);
+ }));
+ };
+ }
+
+ private String makeSessionDirectory() {
+ final String cwd = System.getProperty("user.dir");
+ return cwd + File.separator + "sessions";
+ }
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
} | 36 | 2.571429 | 36 | 0 |
69d3e65dbc2aa71588ab97b11bc1feb95463ae36 | templates/index.html.jinja | templates/index.html.jinja | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
{% include "templates/title.html" %}
{% include "templates/css.html" %}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
{% include "templates/logo.html" %}
<form method="GET" action="select">
<p>Contractor ID (or e-mail): <input type="text" name="contractor_id"></p>
<p>Password 1: <input type="password" name="fala"></p>
<p>Password 2: <input type="password" name="bala"></p>
<input type="submit" value="Login">
</form>
<p></p>
<img src="https://developers.google.com/appengine/images/appengine-noborder-120x30.gif"
alt="Powered by Google App Engine" />
</body>
</html>
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
{% include "templates/title.html" %}
{% include "templates/css.html" %}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
{% include "templates/logo.html" %}
<form method="GET" action="select">
<p>Contractor ID (or e-mail): <input type="text" name="contractor_id"></p>
<p>Password: <input type="password" name="falabala"></p>
<button type="submit" class="submitbutton" value="Login">Login</button>
</form>
<p></p>
<img src="https://developers.google.com/appengine/images/appengine-noborder-120x30.gif"
alt="Powered by Google App Engine" />
</body>
</html>
| Use modern style for login button | Use modern style for login button
| HTML+Django | mit | jfitz/hours-reporter | html+django | ## Code Before:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
{% include "templates/title.html" %}
{% include "templates/css.html" %}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
{% include "templates/logo.html" %}
<form method="GET" action="select">
<p>Contractor ID (or e-mail): <input type="text" name="contractor_id"></p>
<p>Password 1: <input type="password" name="fala"></p>
<p>Password 2: <input type="password" name="bala"></p>
<input type="submit" value="Login">
</form>
<p></p>
<img src="https://developers.google.com/appengine/images/appengine-noborder-120x30.gif"
alt="Powered by Google App Engine" />
</body>
</html>
## Instruction:
Use modern style for login button
## Code After:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
{% include "templates/title.html" %}
{% include "templates/css.html" %}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
{% include "templates/logo.html" %}
<form method="GET" action="select">
<p>Contractor ID (or e-mail): <input type="text" name="contractor_id"></p>
<p>Password: <input type="password" name="falabala"></p>
<button type="submit" class="submitbutton" value="Login">Login</button>
</form>
<p></p>
<img src="https://developers.google.com/appengine/images/appengine-noborder-120x30.gif"
alt="Powered by Google App Engine" />
</body>
</html>
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
{% include "templates/title.html" %}
{% include "templates/css.html" %}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
{% include "templates/logo.html" %}
<form method="GET" action="select">
<p>Contractor ID (or e-mail): <input type="text" name="contractor_id"></p>
- <p>Password 1: <input type="password" name="fala"></p>
? --
+ <p>Password: <input type="password" name="falabala"></p>
? ++++
+ <button type="submit" class="submitbutton" value="Login">Login</button>
- <p>Password 2: <input type="password" name="bala"></p>
- <input type="submit" value="Login">
</form>
<p></p>
<img src="https://developers.google.com/appengine/images/appengine-noborder-120x30.gif"
alt="Powered by Google App Engine" />
</body>
</html> | 5 | 0.238095 | 2 | 3 |
1ef82c281c5df2ded7dd4f1954fc0beb34e53899 | tasks/sismd.js | tasks/sismd.js | /* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
marked.setOptions({
breaks : true,
highlight: function(code, lang) {
var result = hljs.highlight(lang, code).value;
return result;
}
});
grunt.registerMultiTask('sismd', "Converts SIS-web markdown to html", function() {
var options = this.options({ });
this.files.forEach(function(file) {
var data = file.src.filter(function(path) {
if (!grunt.file.isFile(path)) {
grunt.log.warn("File does not exist. %s", source);
return false;
}
return true;
}).map(function(path) {
return grunt.file.read(path);
}).join("\n");
var dest = file.dest;
if (options.preprocess) {
data = options.preprocess(data);
}
var output = marked(data);
grunt.file.write(dest, output);
});
});
};
| /* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
var renderer = new marked.Renderer();
var oldLink = renderer.link;
renderer.link = function(href, title, text) {
if (href[0] === '#' && text.indexOf('.') !== -1) {
href = '#' + text.replace(/[^\w:]/g, '-').toLowerCase();
}
return oldLink.call(this, href, title, text);
};
marked.setOptions({
breaks : true,
highlight: function(code, lang) {
var result = hljs.highlight(lang, code).value;
return result;
},
renderer : renderer
});
grunt.registerMultiTask('sismd', "Converts SIS-web markdown to html", function() {
var options = this.options({ });
this.files.forEach(function(file) {
var data = file.src.filter(function(path) {
if (!grunt.file.isFile(path)) {
grunt.log.warn("File does not exist. %s", source);
return false;
}
return true;
}).map(function(path) {
return grunt.file.read(path);
}).join("\n");
var dest = file.dest;
if (options.preprocess) {
data = options.preprocess(data);
}
var output = marked(data);
grunt.file.write(dest, output);
});
});
};
| Fix a bug in documentation generation | Fix a bug in documentation generation
| JavaScript | bsd-3-clause | sis-cmdb/sis-ui,sis-cmdb/sis-ui | javascript | ## Code Before:
/* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
marked.setOptions({
breaks : true,
highlight: function(code, lang) {
var result = hljs.highlight(lang, code).value;
return result;
}
});
grunt.registerMultiTask('sismd', "Converts SIS-web markdown to html", function() {
var options = this.options({ });
this.files.forEach(function(file) {
var data = file.src.filter(function(path) {
if (!grunt.file.isFile(path)) {
grunt.log.warn("File does not exist. %s", source);
return false;
}
return true;
}).map(function(path) {
return grunt.file.read(path);
}).join("\n");
var dest = file.dest;
if (options.preprocess) {
data = options.preprocess(data);
}
var output = marked(data);
grunt.file.write(dest, output);
});
});
};
## Instruction:
Fix a bug in documentation generation
## Code After:
/* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
var renderer = new marked.Renderer();
var oldLink = renderer.link;
renderer.link = function(href, title, text) {
if (href[0] === '#' && text.indexOf('.') !== -1) {
href = '#' + text.replace(/[^\w:]/g, '-').toLowerCase();
}
return oldLink.call(this, href, title, text);
};
marked.setOptions({
breaks : true,
highlight: function(code, lang) {
var result = hljs.highlight(lang, code).value;
return result;
},
renderer : renderer
});
grunt.registerMultiTask('sismd', "Converts SIS-web markdown to html", function() {
var options = this.options({ });
this.files.forEach(function(file) {
var data = file.src.filter(function(path) {
if (!grunt.file.isFile(path)) {
grunt.log.warn("File does not exist. %s", source);
return false;
}
return true;
}).map(function(path) {
return grunt.file.read(path);
}).join("\n");
var dest = file.dest;
if (options.preprocess) {
data = options.preprocess(data);
}
var output = marked(data);
grunt.file.write(dest, output);
});
});
};
| /* task for generating html from sisdocs markdown */
module.exports = function(grunt) {
'use strict';
var marked = require('marked');
var hljs = require('highlight.js');
+ var renderer = new marked.Renderer();
+
+ var oldLink = renderer.link;
+ renderer.link = function(href, title, text) {
+ if (href[0] === '#' && text.indexOf('.') !== -1) {
+ href = '#' + text.replace(/[^\w:]/g, '-').toLowerCase();
+ }
+ return oldLink.call(this, href, title, text);
+ };
+
marked.setOptions({
breaks : true,
highlight: function(code, lang) {
var result = hljs.highlight(lang, code).value;
return result;
- }
+ },
? +
+ renderer : renderer
});
grunt.registerMultiTask('sismd', "Converts SIS-web markdown to html", function() {
var options = this.options({ });
this.files.forEach(function(file) {
var data = file.src.filter(function(path) {
if (!grunt.file.isFile(path)) {
grunt.log.warn("File does not exist. %s", source);
return false;
}
return true;
}).map(function(path) {
return grunt.file.read(path);
}).join("\n");
var dest = file.dest;
if (options.preprocess) {
data = options.preprocess(data);
}
var output = marked(data);
grunt.file.write(dest, output);
});
});
}; | 13 | 0.382353 | 12 | 1 |
5d652ad77ff1323688e3d5f22b9b92706534a413 | .travis.yml | .travis.yml | language: php
arch:
- amd64
- arm64
os: linux
php:
- "7.2"
services:
- docker
before_install:
- docker login --username $DOCKER_USER --password $DOCKER_PASSWORD $DOCKER_REGISTRY
script:
- cd php
- ./build.sh $TRAVIS_PHP_VERSION $DOCKER_USER $DOCKER_PASSWORD $DOCKER_REGISTRY
| language: php
arch:
- amd64
- arm64
php:
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
sudo: required
services:
- docker
before_install:
- docker login --username $DOCKER_USER --password $DOCKER_PASSWORD $DOCKER_REGISTRY
script:
- cd php
- ./build.sh $TRAVIS_PHP_VERSION $DOCKER_USER $DOCKER_PASSWORD $DOCKER_REGISTRY
| Revert "Try multi cpu arch (2)" | Revert "Try multi cpu arch (2)"
This reverts commit c2ee502e
| YAML | mit | byjg/docker-images,byjg/docker-images | yaml | ## Code Before:
language: php
arch:
- amd64
- arm64
os: linux
php:
- "7.2"
services:
- docker
before_install:
- docker login --username $DOCKER_USER --password $DOCKER_PASSWORD $DOCKER_REGISTRY
script:
- cd php
- ./build.sh $TRAVIS_PHP_VERSION $DOCKER_USER $DOCKER_PASSWORD $DOCKER_REGISTRY
## Instruction:
Revert "Try multi cpu arch (2)"
This reverts commit c2ee502e
## Code After:
language: php
arch:
- amd64
- arm64
php:
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
sudo: required
services:
- docker
before_install:
- docker login --username $DOCKER_USER --password $DOCKER_PASSWORD $DOCKER_REGISTRY
script:
- cd php
- ./build.sh $TRAVIS_PHP_VERSION $DOCKER_USER $DOCKER_PASSWORD $DOCKER_REGISTRY
| language: php
arch:
- amd64
- arm64
- os: linux
+ php:
+ - "5.6"
+ - "7.0"
+ - "7.1"
+ - "7.2"
+ - "7.3"
+ sudo: required
- php:
- - "7.2"
services:
- docker
before_install:
- docker login --username $DOCKER_USER --password $DOCKER_PASSWORD $DOCKER_REGISTRY
script:
- cd php
- ./build.sh $TRAVIS_PHP_VERSION $DOCKER_USER $DOCKER_PASSWORD $DOCKER_REGISTRY | 10 | 0.5 | 7 | 3 |
45716e764d069d1b635a402f4c821b9db349d989 | README.md | README.md | lexington-geocoder-flask
========================
A Flask version of [lexington-geocoder](https://github.com/codeforamerica/lexington-geocoder)
|
Streetscope is a service to allow people, but especially computer programs, to submit an address like '123 Main St.' and find its lat/lon coordinates and canonical parcel_id in the Lexington, KY Property Value Administrator's set of addresses.
### Why are we doing this?
City agencies in Lexington sometimes disagree on the correct way to reference a single address or taxlot. (And sometimes someone entering data just makes a typo. Oops!) That makes it really hard to get a complete picture of a single property.
Streetscope allows different databases to know they're talking about the same address, even if it's not spelled exactly the same. It returns a geographic location and a parcel ID for matching addresses across databases to enable connections between these datasets and get a true picture of the city.
### What will this do in the future?
* Accept files to geocode as a batch
* Emit performance metrics to indicate when this geocoder varies from other geocoders in geographic distance or ability to match an address
* Generalize for any city that has a reliable address dataset
### Who is this made by?
Lexingteam!
* [Erik Schwartz](https://github.com/eeeschwartz)
* [Lyzi Diamond](https://github.com/lyzidiamond)
* [Livien Yin](https://github.com/livienyin)
With completely indispensable help from Jonathan Hollinger and Shaye Rabold at [Lexington-Fayette Urban County Government](http://lexingtonky.gov/) and David O'Neill, the [Property Valuation Administrator](http://www.fayette-pva.com/)
| Add readme elements from lexington-geocoder | Add readme elements from lexington-geocoder
| Markdown | mit | codeforamerica/streetscope,codeforamerica/streetscope | markdown | ## Code Before:
lexington-geocoder-flask
========================
A Flask version of [lexington-geocoder](https://github.com/codeforamerica/lexington-geocoder)
## Instruction:
Add readme elements from lexington-geocoder
## Code After:
Streetscope is a service to allow people, but especially computer programs, to submit an address like '123 Main St.' and find its lat/lon coordinates and canonical parcel_id in the Lexington, KY Property Value Administrator's set of addresses.
### Why are we doing this?
City agencies in Lexington sometimes disagree on the correct way to reference a single address or taxlot. (And sometimes someone entering data just makes a typo. Oops!) That makes it really hard to get a complete picture of a single property.
Streetscope allows different databases to know they're talking about the same address, even if it's not spelled exactly the same. It returns a geographic location and a parcel ID for matching addresses across databases to enable connections between these datasets and get a true picture of the city.
### What will this do in the future?
* Accept files to geocode as a batch
* Emit performance metrics to indicate when this geocoder varies from other geocoders in geographic distance or ability to match an address
* Generalize for any city that has a reliable address dataset
### Who is this made by?
Lexingteam!
* [Erik Schwartz](https://github.com/eeeschwartz)
* [Lyzi Diamond](https://github.com/lyzidiamond)
* [Livien Yin](https://github.com/livienyin)
With completely indispensable help from Jonathan Hollinger and Shaye Rabold at [Lexington-Fayette Urban County Government](http://lexingtonky.gov/) and David O'Neill, the [Property Valuation Administrator](http://www.fayette-pva.com/)
| - lexington-geocoder-flask
- ========================
- A Flask version of [lexington-geocoder](https://github.com/codeforamerica/lexington-geocoder)
+ Streetscope is a service to allow people, but especially computer programs, to submit an address like '123 Main St.' and find its lat/lon coordinates and canonical parcel_id in the Lexington, KY Property Value Administrator's set of addresses.
+
+ ### Why are we doing this?
+
+ City agencies in Lexington sometimes disagree on the correct way to reference a single address or taxlot. (And sometimes someone entering data just makes a typo. Oops!) That makes it really hard to get a complete picture of a single property.
+
+ Streetscope allows different databases to know they're talking about the same address, even if it's not spelled exactly the same. It returns a geographic location and a parcel ID for matching addresses across databases to enable connections between these datasets and get a true picture of the city.
+
+ ### What will this do in the future?
+
+ * Accept files to geocode as a batch
+ * Emit performance metrics to indicate when this geocoder varies from other geocoders in geographic distance or ability to match an address
+ * Generalize for any city that has a reliable address dataset
+
+ ### Who is this made by?
+
+ Lexingteam!
+
+ * [Erik Schwartz](https://github.com/eeeschwartz)
+ * [Lyzi Diamond](https://github.com/lyzidiamond)
+ * [Livien Yin](https://github.com/livienyin)
+
+ With completely indispensable help from Jonathan Hollinger and Shaye Rabold at [Lexington-Fayette Urban County Government](http://lexingtonky.gov/) and David O'Neill, the [Property Valuation Administrator](http://www.fayette-pva.com/) | 26 | 6.5 | 23 | 3 |
19faf621c98996f334eb3d26c536f149bb841bd8 | _posts/2017-08-01-dense-net.md | _posts/2017-08-01-dense-net.md | ---
layout: post
title: Dense-Net
git: https://github.com/jamigibbs/fair-split-calculator
blog: 0
---
A feed-forward Neural Network library using computational gate approach supporting multiple optimizers, common activation and loss functions
| ---
layout: post
title: Dense-Net
git: https://github.com/achyudhk/Dense-Net
blog: 0
---
A feed-forward Neural Network library using computational gate approach supporting multiple optimizers, common activation and loss functions
| Fix Dense Net repo link | Fix Dense Net repo link
| Markdown | mit | achyudhk/achyudhk.github.io | markdown | ## Code Before:
---
layout: post
title: Dense-Net
git: https://github.com/jamigibbs/fair-split-calculator
blog: 0
---
A feed-forward Neural Network library using computational gate approach supporting multiple optimizers, common activation and loss functions
## Instruction:
Fix Dense Net repo link
## Code After:
---
layout: post
title: Dense-Net
git: https://github.com/achyudhk/Dense-Net
blog: 0
---
A feed-forward Neural Network library using computational gate approach supporting multiple optimizers, common activation and loss functions
| ---
layout: post
title: Dense-Net
- git: https://github.com/jamigibbs/fair-split-calculator
+ git: https://github.com/achyudhk/Dense-Net
blog: 0
---
A feed-forward Neural Network library using computational gate approach supporting multiple optimizers, common activation and loss functions | 2 | 0.25 | 1 | 1 |
137b834f166eea13781311b1f050f0eaf2e1d610 | podcasts/management/commands/updatepodcasts.py | podcasts/management/commands/updatepodcasts.py | from django.core.management import BaseCommand
from podcasts.models import Podcast
class Command(BaseCommand):
help = 'Initialize podcasts with data from their RSS feeds'
def handle(self, *args, **kwargs):
for podcast in Podcast.objects.all():
podcast.update()
| from django.core.management import BaseCommand
from optparse import make_option
from podcasts.models import Podcast
class Command(BaseCommand):
help = 'Initialize podcasts with data from their RSS feeds'
option_list = BaseCommand.option_list + (
make_option(
'--only-new',
action='store_true',
dest='only_new',
default=False,
help='Only update new podcasts'
),
)
def handle(self, *args, **options):
for podcast in Podcast.objects.all():
if options['only_new'] and podcast.title != "":
continue
podcast.update()
| Make it optional to only update metadata of new podcasts | Make it optional to only update metadata of new podcasts
| Python | mit | matachi/sputnik,matachi/sputnik,matachi/sputnik,matachi/sputnik | python | ## Code Before:
from django.core.management import BaseCommand
from podcasts.models import Podcast
class Command(BaseCommand):
help = 'Initialize podcasts with data from their RSS feeds'
def handle(self, *args, **kwargs):
for podcast in Podcast.objects.all():
podcast.update()
## Instruction:
Make it optional to only update metadata of new podcasts
## Code After:
from django.core.management import BaseCommand
from optparse import make_option
from podcasts.models import Podcast
class Command(BaseCommand):
help = 'Initialize podcasts with data from their RSS feeds'
option_list = BaseCommand.option_list + (
make_option(
'--only-new',
action='store_true',
dest='only_new',
default=False,
help='Only update new podcasts'
),
)
def handle(self, *args, **options):
for podcast in Podcast.objects.all():
if options['only_new'] and podcast.title != "":
continue
podcast.update()
| from django.core.management import BaseCommand
+ from optparse import make_option
from podcasts.models import Podcast
class Command(BaseCommand):
help = 'Initialize podcasts with data from their RSS feeds'
+ option_list = BaseCommand.option_list + (
+ make_option(
+ '--only-new',
+ action='store_true',
+ dest='only_new',
+ default=False,
+ help='Only update new podcasts'
+ ),
+ )
- def handle(self, *args, **kwargs):
? ^^^^^
+ def handle(self, *args, **options):
? ^^^^^^
for podcast in Podcast.objects.all():
+ if options['only_new'] and podcast.title != "":
+ continue
podcast.update() | 14 | 1.4 | 13 | 1 |
9a21f32acca22468e63643064861ebd2c8e2a2fb | src/flow/netbeans/markdown/highlighter/MarkdownLanguageHierarchy.java | src/flow/netbeans/markdown/highlighter/MarkdownLanguageHierarchy.java | package flow.netbeans.markdown.highlighter;
import java.util.Collection;
import java.util.EnumSet;
import org.netbeans.spi.lexer.LanguageHierarchy;
import org.netbeans.spi.lexer.Lexer;
import org.netbeans.spi.lexer.LexerRestartInfo;
public class MarkdownLanguageHierarchy extends LanguageHierarchy<MarkdownTokenId> {
@Override
protected synchronized Collection<MarkdownTokenId> createTokenIds () {
return EnumSet.allOf (MarkdownTokenId.class);
}
@Override
protected Lexer<MarkdownTokenId> createLexer (LexerRestartInfo<MarkdownTokenId> info) {
return new MarkdownLexer(info);
}
@Override
protected String mimeType () {
return "text/x-markdown";
}
}
| package flow.netbeans.markdown.highlighter;
import flow.netbeans.markdown.csl.MarkdownLanguageConfig;
import java.util.Collection;
import java.util.EnumSet;
import org.netbeans.spi.lexer.LanguageHierarchy;
import org.netbeans.spi.lexer.Lexer;
import org.netbeans.spi.lexer.LexerRestartInfo;
public class MarkdownLanguageHierarchy extends LanguageHierarchy<MarkdownTokenId> {
@Override
protected synchronized Collection<MarkdownTokenId> createTokenIds () {
return EnumSet.allOf (MarkdownTokenId.class);
}
@Override
protected Lexer<MarkdownTokenId> createLexer (LexerRestartInfo<MarkdownTokenId> info) {
return new MarkdownLexer(info);
}
@Override
protected String mimeType () {
return MarkdownLanguageConfig.MIME_TYPE;
}
}
| Make use of MarkdownLanguageConfig constants | Make use of MarkdownLanguageConfig constants | Java | mit | madflow/flow-netbeans-markdown,stengerh/flow-netbeans-markdown,dublebuble/flow-netbeans-markdown,dublebuble/flow-netbeans-markdown,madflow/flow-netbeans-markdown,stengerh/flow-netbeans-markdown | java | ## Code Before:
package flow.netbeans.markdown.highlighter;
import java.util.Collection;
import java.util.EnumSet;
import org.netbeans.spi.lexer.LanguageHierarchy;
import org.netbeans.spi.lexer.Lexer;
import org.netbeans.spi.lexer.LexerRestartInfo;
public class MarkdownLanguageHierarchy extends LanguageHierarchy<MarkdownTokenId> {
@Override
protected synchronized Collection<MarkdownTokenId> createTokenIds () {
return EnumSet.allOf (MarkdownTokenId.class);
}
@Override
protected Lexer<MarkdownTokenId> createLexer (LexerRestartInfo<MarkdownTokenId> info) {
return new MarkdownLexer(info);
}
@Override
protected String mimeType () {
return "text/x-markdown";
}
}
## Instruction:
Make use of MarkdownLanguageConfig constants
## Code After:
package flow.netbeans.markdown.highlighter;
import flow.netbeans.markdown.csl.MarkdownLanguageConfig;
import java.util.Collection;
import java.util.EnumSet;
import org.netbeans.spi.lexer.LanguageHierarchy;
import org.netbeans.spi.lexer.Lexer;
import org.netbeans.spi.lexer.LexerRestartInfo;
public class MarkdownLanguageHierarchy extends LanguageHierarchy<MarkdownTokenId> {
@Override
protected synchronized Collection<MarkdownTokenId> createTokenIds () {
return EnumSet.allOf (MarkdownTokenId.class);
}
@Override
protected Lexer<MarkdownTokenId> createLexer (LexerRestartInfo<MarkdownTokenId> info) {
return new MarkdownLexer(info);
}
@Override
protected String mimeType () {
return MarkdownLanguageConfig.MIME_TYPE;
}
}
| package flow.netbeans.markdown.highlighter;
+ import flow.netbeans.markdown.csl.MarkdownLanguageConfig;
import java.util.Collection;
import java.util.EnumSet;
import org.netbeans.spi.lexer.LanguageHierarchy;
import org.netbeans.spi.lexer.Lexer;
import org.netbeans.spi.lexer.LexerRestartInfo;
public class MarkdownLanguageHierarchy extends LanguageHierarchy<MarkdownTokenId> {
@Override
protected synchronized Collection<MarkdownTokenId> createTokenIds () {
return EnumSet.allOf (MarkdownTokenId.class);
}
@Override
protected Lexer<MarkdownTokenId> createLexer (LexerRestartInfo<MarkdownTokenId> info) {
return new MarkdownLexer(info);
}
@Override
protected String mimeType () {
- return "text/x-markdown";
+ return MarkdownLanguageConfig.MIME_TYPE;
}
} | 3 | 0.115385 | 2 | 1 |
796fe132fa2ad0ed0b9561306b46f1b946e74536 | ci-sonarAnalysis.sh | ci-sonarAnalysis.sh |
set +x
cleanup() {
rm -vf .env
docker-compose -f docker-compose.builder.yml down --volumes
}
trap cleanup EXIT
sudo rm -f .env
curl -o .env -L https://raw.githubusercontent.com/OpenLMIS/openlmis-ref-distro/master/settings-sample.env
sed -i '' -e "s#spring_profiles_active=.*#spring_profiles_active=#" .env 2>/dev/null || true
sed -i '' -e "s#^BASE_URL=.*#BASE_URL=http://localhost#" .env 2>/dev/null || true
sed -i '' -e "s#^VIRTUAL_HOST=.*#VIRTUAL_HOST=localhost#" .env 2>/dev/null || true
SONAR_LOGIN_TEMP=$(echo $SONAR_LOGIN | cut -f2 -d=)
SONAR_PASSWORD_TEMP=$(echo $SONAR_PASSWORD | cut -f2 -d=)
echo "SONAR_LOGIN=$SONAR_LOGIN_TEMP" >> .env
echo "SONAR_PASSWORD=$SONAR_PASSWORD_TEMP" >> .env
echo "SONAR_BRANCH=$GIT_BRANCH" >> .env
docker-compose -f docker-compose.builder.yml run sonar |
set +x
cleanup() {
docker-compose -f docker-compose.builder.yml down --volumes
rm -vf .env
}
trap cleanup EXIT
sudo rm -f .env
curl -o .env -L https://raw.githubusercontent.com/OpenLMIS/openlmis-ref-distro/master/settings-sample.env
sed -i '' -e "s#spring_profiles_active=.*#spring_profiles_active=#" .env 2>/dev/null || true
sed -i '' -e "s#^BASE_URL=.*#BASE_URL=http://localhost#" .env 2>/dev/null || true
sed -i '' -e "s#^VIRTUAL_HOST=.*#VIRTUAL_HOST=localhost#" .env 2>/dev/null || true
SONAR_LOGIN_TEMP=$(echo $SONAR_LOGIN | cut -f2 -d=)
SONAR_PASSWORD_TEMP=$(echo $SONAR_PASSWORD | cut -f2 -d=)
echo "SONAR_LOGIN=$SONAR_LOGIN_TEMP" >> .env
echo "SONAR_PASSWORD=$SONAR_PASSWORD_TEMP" >> .env
echo "SONAR_BRANCH=$GIT_BRANCH" >> .env
docker-compose -f docker-compose.builder.yml run sonar
| Remove env file after containers are stopped on sonar step | Remove env file after containers are stopped on sonar step
| Shell | agpl-3.0 | OpenLMIS/openlmis-referencedata,OpenLMIS/openlmis-referencedata,OpenLMIS/openlmis-referencedata,OpenLMIS/openlmis-referencedata | shell | ## Code Before:
set +x
cleanup() {
rm -vf .env
docker-compose -f docker-compose.builder.yml down --volumes
}
trap cleanup EXIT
sudo rm -f .env
curl -o .env -L https://raw.githubusercontent.com/OpenLMIS/openlmis-ref-distro/master/settings-sample.env
sed -i '' -e "s#spring_profiles_active=.*#spring_profiles_active=#" .env 2>/dev/null || true
sed -i '' -e "s#^BASE_URL=.*#BASE_URL=http://localhost#" .env 2>/dev/null || true
sed -i '' -e "s#^VIRTUAL_HOST=.*#VIRTUAL_HOST=localhost#" .env 2>/dev/null || true
SONAR_LOGIN_TEMP=$(echo $SONAR_LOGIN | cut -f2 -d=)
SONAR_PASSWORD_TEMP=$(echo $SONAR_PASSWORD | cut -f2 -d=)
echo "SONAR_LOGIN=$SONAR_LOGIN_TEMP" >> .env
echo "SONAR_PASSWORD=$SONAR_PASSWORD_TEMP" >> .env
echo "SONAR_BRANCH=$GIT_BRANCH" >> .env
docker-compose -f docker-compose.builder.yml run sonar
## Instruction:
Remove env file after containers are stopped on sonar step
## Code After:
set +x
cleanup() {
docker-compose -f docker-compose.builder.yml down --volumes
rm -vf .env
}
trap cleanup EXIT
sudo rm -f .env
curl -o .env -L https://raw.githubusercontent.com/OpenLMIS/openlmis-ref-distro/master/settings-sample.env
sed -i '' -e "s#spring_profiles_active=.*#spring_profiles_active=#" .env 2>/dev/null || true
sed -i '' -e "s#^BASE_URL=.*#BASE_URL=http://localhost#" .env 2>/dev/null || true
sed -i '' -e "s#^VIRTUAL_HOST=.*#VIRTUAL_HOST=localhost#" .env 2>/dev/null || true
SONAR_LOGIN_TEMP=$(echo $SONAR_LOGIN | cut -f2 -d=)
SONAR_PASSWORD_TEMP=$(echo $SONAR_PASSWORD | cut -f2 -d=)
echo "SONAR_LOGIN=$SONAR_LOGIN_TEMP" >> .env
echo "SONAR_PASSWORD=$SONAR_PASSWORD_TEMP" >> .env
echo "SONAR_BRANCH=$GIT_BRANCH" >> .env
docker-compose -f docker-compose.builder.yml run sonar
|
set +x
cleanup() {
+ docker-compose -f docker-compose.builder.yml down --volumes
rm -vf .env
- docker-compose -f docker-compose.builder.yml down --volumes
}
trap cleanup EXIT
sudo rm -f .env
curl -o .env -L https://raw.githubusercontent.com/OpenLMIS/openlmis-ref-distro/master/settings-sample.env
sed -i '' -e "s#spring_profiles_active=.*#spring_profiles_active=#" .env 2>/dev/null || true
sed -i '' -e "s#^BASE_URL=.*#BASE_URL=http://localhost#" .env 2>/dev/null || true
sed -i '' -e "s#^VIRTUAL_HOST=.*#VIRTUAL_HOST=localhost#" .env 2>/dev/null || true
SONAR_LOGIN_TEMP=$(echo $SONAR_LOGIN | cut -f2 -d=)
SONAR_PASSWORD_TEMP=$(echo $SONAR_PASSWORD | cut -f2 -d=)
echo "SONAR_LOGIN=$SONAR_LOGIN_TEMP" >> .env
echo "SONAR_PASSWORD=$SONAR_PASSWORD_TEMP" >> .env
echo "SONAR_BRANCH=$GIT_BRANCH" >> .env
docker-compose -f docker-compose.builder.yml run sonar | 2 | 0.083333 | 1 | 1 |
53f2b229cd750c0eb6a87d5a8deea57d4ef209e5 | _posts/2018-02-22-BlockChain-SmartContract.md | _posts/2018-02-22-BlockChain-SmartContract.md | ---
layout: post
title: " BlockChain :: What is Smart Contract? "
date: 2018-02-22
excerpt: " What is Smart Contract? "
cate : "post"
tag:
- BlockChain
---
## What is Smart Contract?
{% capture images %}
/assets/img/conference/bc_smartcontract_1.png
{% endcapture %}
{% include gallery images=images caption=" " cols=1 %}
\- 닉 자보(Nick Szabo)가 1994년 최초 제안한 개념
<br>
\- 디지털 명령어로 계약을 작성하면 조건에 다라 계약 내용을 자동으로 실행할 수 있다 주장
디지털로 된 계약서는 조건에 따른
계약 결과가 명확하고, 계약 내용을 즉각 이행 가능
<br>
조건과 행위가 정의되고 이를 강제적으로 수행되는
디지털 계약서 | ---
layout: post
title: " BlockChain :: What is Smart Contract? "
date: 2018-02-22
excerpt: " What is Smart Contract? "
cate : "post"
tag:
- BlockChain
---
## What is Smart Contract?
{% capture images %}
/assets/img/conference/bc_smartcontract_1.png
{% endcapture %}
{% include gallery images=images caption=" " cols=1 %}
\- 닉 자보(Nick Szabo)가 1994년 최초 제안한 개념
\- 디지털 명령어로 계약을 작성하면
조건에 따라 계약 내용을 자동으로 실행할 수 있다 주장
\- 디지털로 된 계약서는 조건에 따른
계약 결과가 명확하고, 계약 내용을 즉각 이행 가능
\- 조건과 행위가 정의되고
이를 강제적으로 수행되는 `디지털 계약서`
\- 블록체인의 장점 중 신뢰성이
스마트 컨트랙트와 접목이 되며
거래를 한 번에 깔끔하게 처리하는 것
\- 스크립트가 정상이면
거래를 정상을 본다는 일종의 계약 개념이 있으므로
`Contract Code`로 불리기도 한다.
\- 비트코인 스크립트는 반복문을 사용할 수 없고,
비트코인 잔고 외의 다른 정보를 관리 할 수 없는 한계가 있다.
\- 블록체인의 특이한 구조 때문에 비트코인 스크립트에서 반복문을 허용할 경우
스크립트 조건 때문에 무한 루프가 발생할 경우 네트워크 전체가 멈출 수 있다.
| Modify a BC Post ' BlockChain :: What is Smart Contract? ' | Modify a BC Post ' BlockChain :: What is Smart Contract? '
| Markdown | mit | goodGid/goodGid.github.io,goodGid/goodGid.github.io,goodGid/goodGid.github.io | markdown | ## Code Before:
---
layout: post
title: " BlockChain :: What is Smart Contract? "
date: 2018-02-22
excerpt: " What is Smart Contract? "
cate : "post"
tag:
- BlockChain
---
## What is Smart Contract?
{% capture images %}
/assets/img/conference/bc_smartcontract_1.png
{% endcapture %}
{% include gallery images=images caption=" " cols=1 %}
\- 닉 자보(Nick Szabo)가 1994년 최초 제안한 개념
<br>
\- 디지털 명령어로 계약을 작성하면 조건에 다라 계약 내용을 자동으로 실행할 수 있다 주장
디지털로 된 계약서는 조건에 따른
계약 결과가 명확하고, 계약 내용을 즉각 이행 가능
<br>
조건과 행위가 정의되고 이를 강제적으로 수행되는
디지털 계약서
## Instruction:
Modify a BC Post ' BlockChain :: What is Smart Contract? '
## Code After:
---
layout: post
title: " BlockChain :: What is Smart Contract? "
date: 2018-02-22
excerpt: " What is Smart Contract? "
cate : "post"
tag:
- BlockChain
---
## What is Smart Contract?
{% capture images %}
/assets/img/conference/bc_smartcontract_1.png
{% endcapture %}
{% include gallery images=images caption=" " cols=1 %}
\- 닉 자보(Nick Szabo)가 1994년 최초 제안한 개념
\- 디지털 명령어로 계약을 작성하면
조건에 따라 계약 내용을 자동으로 실행할 수 있다 주장
\- 디지털로 된 계약서는 조건에 따른
계약 결과가 명확하고, 계약 내용을 즉각 이행 가능
\- 조건과 행위가 정의되고
이를 강제적으로 수행되는 `디지털 계약서`
\- 블록체인의 장점 중 신뢰성이
스마트 컨트랙트와 접목이 되며
거래를 한 번에 깔끔하게 처리하는 것
\- 스크립트가 정상이면
거래를 정상을 본다는 일종의 계약 개념이 있으므로
`Contract Code`로 불리기도 한다.
\- 비트코인 스크립트는 반복문을 사용할 수 없고,
비트코인 잔고 외의 다른 정보를 관리 할 수 없는 한계가 있다.
\- 블록체인의 특이한 구조 때문에 비트코인 스크립트에서 반복문을 허용할 경우
스크립트 조건 때문에 무한 루프가 발생할 경우 네트워크 전체가 멈출 수 있다.
| ---
layout: post
title: " BlockChain :: What is Smart Contract? "
date: 2018-02-22
excerpt: " What is Smart Contract? "
cate : "post"
tag:
- BlockChain
---
## What is Smart Contract?
{% capture images %}
/assets/img/conference/bc_smartcontract_1.png
{% endcapture %}
{% include gallery images=images caption=" " cols=1 %}
\- 닉 자보(Nick Szabo)가 1994년 최초 제안한 개념
+ \- 디지털 명령어로 계약을 작성하면
- <br>
- \- 디지털 명령어로 계약을 작성하면 조건에 다라 계약 내용을 자동으로 실행할 수 있다 주장
+ 조건에 따라 계약 내용을 자동으로 실행할 수 있다 주장
- 디지털로 된 계약서는 조건에 따른
+ \- 디지털로 된 계약서는 조건에 따른
? +++
계약 결과가 명확하고, 계약 내용을 즉각 이행 가능
+ \- 조건과 행위가 정의되고
- <br>
+ 이를 강제적으로 수행되는 `디지털 계약서`
- 조건과 행위가 정의되고 이를 강제적으로 수행되는
+ \- 블록체인의 장점 중 신뢰성이
- 디지털 계약서
+ 스마트 컨트랙트와 접목이 되며
+
+ 거래를 한 번에 깔끔하게 처리하는 것
+
+ \- 스크립트가 정상이면
+
+ 거래를 정상을 본다는 일종의 계약 개념이 있으므로
+
+ `Contract Code`로 불리기도 한다.
+
+ \- 비트코인 스크립트는 반복문을 사용할 수 없고,
+
+ 비트코인 잔고 외의 다른 정보를 관리 할 수 없는 한계가 있다.
+
+ \- 블록체인의 특이한 구조 때문에 비트코인 스크립트에서 반복문을 허용할 경우
+
+ 스크립트 조건 때문에 무한 루프가 발생할 경우 네트워크 전체가 멈출 수 있다.
+ | 30 | 0.882353 | 24 | 6 |
040d1d0ef0ebd297b0f968abca2573661a977c07 | contrib/colors/config.el | contrib/colors/config.el | ;;; config.el --- Colors Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; ---------------------------------------------------------------------------
;; Prefixes
;; ---------------------------------------------------------------------------
;; Variables
(defvar colors-enable-rainbow-identifiers nil
"if non nil the `rainbow-identifers' package is enabled.")
(defvar colors-enable-nyan-cat-progress-bar nil
"if non nil all nyan cat packges are enabled (for now only `nyan-mode').")
;; Command prefixes
(setq colors/key-binding-prefixes '(("C" . "colors")))
(when colors-enable-rainbow-identifiers
(push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
colors/key-binding-prefixes)
| ;;; config.el --- Colors Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; Variables
(defvar colors-enable-rainbow-identifiers nil
"if non nil the `rainbow-identifers' package is enabled.")
(defvar colors-enable-nyan-cat-progress-bar nil
"if non nil all nyan cat packges are enabled (for now only `nyan-mode').")
;; Command prefixes
(setq colors/key-binding-prefixes '(("C" . "colors")))
(when colors-enable-rainbow-identifiers
(push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
colors/key-binding-prefixes)
| Remove dead comment in colors layer | Remove dead comment in colors layer
| Emacs Lisp | mit | tsonntag/dotemacs,tsonntag/dotemacs,tsonntag/dotemacs,tsonntag/dotemacs | emacs-lisp | ## Code Before:
;;; config.el --- Colors Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; ---------------------------------------------------------------------------
;; Prefixes
;; ---------------------------------------------------------------------------
;; Variables
(defvar colors-enable-rainbow-identifiers nil
"if non nil the `rainbow-identifers' package is enabled.")
(defvar colors-enable-nyan-cat-progress-bar nil
"if non nil all nyan cat packges are enabled (for now only `nyan-mode').")
;; Command prefixes
(setq colors/key-binding-prefixes '(("C" . "colors")))
(when colors-enable-rainbow-identifiers
(push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
colors/key-binding-prefixes)
## Instruction:
Remove dead comment in colors layer
## Code After:
;;; config.el --- Colors Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; Variables
(defvar colors-enable-rainbow-identifiers nil
"if non nil the `rainbow-identifers' package is enabled.")
(defvar colors-enable-nyan-cat-progress-bar nil
"if non nil all nyan cat packges are enabled (for now only `nyan-mode').")
;; Command prefixes
(setq colors/key-binding-prefixes '(("C" . "colors")))
(when colors-enable-rainbow-identifiers
(push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
colors/key-binding-prefixes)
| ;;; config.el --- Colors Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
-
- ;; ---------------------------------------------------------------------------
- ;; Prefixes
- ;; ---------------------------------------------------------------------------
;; Variables
(defvar colors-enable-rainbow-identifiers nil
"if non nil the `rainbow-identifers' package is enabled.")
(defvar colors-enable-nyan-cat-progress-bar nil
"if non nil all nyan cat packges are enabled (for now only `nyan-mode').")
;; Command prefixes
(setq colors/key-binding-prefixes '(("C" . "colors")))
(when colors-enable-rainbow-identifiers
(push (cons "Ci" "colors-identifiers") colors/key-binding-prefixes))
(mapc (lambda (x) (spacemacs/declare-prefix (car x) (cdr x)))
colors/key-binding-prefixes) | 4 | 0.129032 | 0 | 4 |
042cb410dd471a4bbf1e1c3e5cef6160f11407ef | nme/display/Bitmap.hx | nme/display/Bitmap.hx | package nme.display;
import nme.display.DisplayObject;
import nme.display.PixelSnapping;
class Bitmap extends DisplayObject {
public var bitmapData(default,nmeSetBitmapData) : BitmapData;
public var pixelSnapping : PixelSnapping;
public var smoothing : Bool;
var mGraphics:Graphics;
public function new(?inBitmapData : BitmapData, ?inPixelSnapping : PixelSnapping, ?inSmoothing : Bool) : Void {
super(DisplayObject.nme_create_display_object(),"Bitmap");
pixelSnapping = inPixelSnapping;
smoothing = inSmoothing;
nmeSetBitmapData(inBitmapData);
}
function nmeSetBitmapData(inBitmapData:BitmapData) : BitmapData
{
var gfx = graphics;
gfx.clear();
bitmapData = inBitmapData;
if (inBitmapData!=null)
{
gfx.beginBitmapFill(inBitmapData,false,smoothing);
gfx.drawRect(0,0,inBitmapData.width,inBitmapData.height);
gfx.endFill();
}
return inBitmapData;
}
}
| package nme.display;
import nme.display.DisplayObject;
import nme.display.PixelSnapping;
class Bitmap extends DisplayObject {
public var bitmapData(default,nmeSetBitmapData) : BitmapData;
public var pixelSnapping : PixelSnapping;
public var smoothing(default,nmeSetSmoothing) : Bool;
var mGraphics:Graphics;
public function new(?inBitmapData : BitmapData, ?inPixelSnapping : PixelSnapping, ?inSmoothing : Bool) : Void {
super(DisplayObject.nme_create_display_object(),"Bitmap");
pixelSnapping = inPixelSnapping;
smoothing = inSmoothing;
nmeSetBitmapData(inBitmapData);
}
function nmeRebuid()
{
var gfx = graphics;
gfx.clear();
if (bitmapData!=null)
{
gfx.beginBitmapFill(bitmapData,false,smoothing);
gfx.drawRect(0,0,bitmapData.width,bitmapData.height);
gfx.endFill();
}
}
function nmeSetSmoothing(inSmooth:Bool) : Bool
{
smoothing = inSmooth;
nmeRebuid();
return inSmooth;
}
function nmeSetBitmapData(inBitmapData:BitmapData) : BitmapData
{
bitmapData = inBitmapData;
nmeRebuid();
return inBitmapData;
}
}
| Allow smoothing to be set after creation | Allow smoothing to be set after creation
git-svn-id: 6cc2fa9b7d2830c930c171b991ffcd5e23f23d5e@689 1509560c-5e2a-0410-865c-31c25e1cfdef
| Haxe | mit | haxenme/nme,madrazo/nme,haxenme/nme,haxenme/nme,thomasuster/NME,haxenme/nme,thomasuster/NME,madrazo/nme,thomasuster/NME,madrazo/nme,madrazo/nme,haxenme/nme,thomasuster/NME,madrazo/nme,thomasuster/NME,thomasuster/NME,madrazo/nme | haxe | ## Code Before:
package nme.display;
import nme.display.DisplayObject;
import nme.display.PixelSnapping;
class Bitmap extends DisplayObject {
public var bitmapData(default,nmeSetBitmapData) : BitmapData;
public var pixelSnapping : PixelSnapping;
public var smoothing : Bool;
var mGraphics:Graphics;
public function new(?inBitmapData : BitmapData, ?inPixelSnapping : PixelSnapping, ?inSmoothing : Bool) : Void {
super(DisplayObject.nme_create_display_object(),"Bitmap");
pixelSnapping = inPixelSnapping;
smoothing = inSmoothing;
nmeSetBitmapData(inBitmapData);
}
function nmeSetBitmapData(inBitmapData:BitmapData) : BitmapData
{
var gfx = graphics;
gfx.clear();
bitmapData = inBitmapData;
if (inBitmapData!=null)
{
gfx.beginBitmapFill(inBitmapData,false,smoothing);
gfx.drawRect(0,0,inBitmapData.width,inBitmapData.height);
gfx.endFill();
}
return inBitmapData;
}
}
## Instruction:
Allow smoothing to be set after creation
git-svn-id: 6cc2fa9b7d2830c930c171b991ffcd5e23f23d5e@689 1509560c-5e2a-0410-865c-31c25e1cfdef
## Code After:
package nme.display;
import nme.display.DisplayObject;
import nme.display.PixelSnapping;
class Bitmap extends DisplayObject {
public var bitmapData(default,nmeSetBitmapData) : BitmapData;
public var pixelSnapping : PixelSnapping;
public var smoothing(default,nmeSetSmoothing) : Bool;
var mGraphics:Graphics;
public function new(?inBitmapData : BitmapData, ?inPixelSnapping : PixelSnapping, ?inSmoothing : Bool) : Void {
super(DisplayObject.nme_create_display_object(),"Bitmap");
pixelSnapping = inPixelSnapping;
smoothing = inSmoothing;
nmeSetBitmapData(inBitmapData);
}
function nmeRebuid()
{
var gfx = graphics;
gfx.clear();
if (bitmapData!=null)
{
gfx.beginBitmapFill(bitmapData,false,smoothing);
gfx.drawRect(0,0,bitmapData.width,bitmapData.height);
gfx.endFill();
}
}
function nmeSetSmoothing(inSmooth:Bool) : Bool
{
smoothing = inSmooth;
nmeRebuid();
return inSmooth;
}
function nmeSetBitmapData(inBitmapData:BitmapData) : BitmapData
{
bitmapData = inBitmapData;
nmeRebuid();
return inBitmapData;
}
}
| package nme.display;
import nme.display.DisplayObject;
import nme.display.PixelSnapping;
class Bitmap extends DisplayObject {
public var bitmapData(default,nmeSetBitmapData) : BitmapData;
public var pixelSnapping : PixelSnapping;
- public var smoothing : Bool;
+ public var smoothing(default,nmeSetSmoothing) : Bool;
var mGraphics:Graphics;
public function new(?inBitmapData : BitmapData, ?inPixelSnapping : PixelSnapping, ?inSmoothing : Bool) : Void {
super(DisplayObject.nme_create_display_object(),"Bitmap");
pixelSnapping = inPixelSnapping;
smoothing = inSmoothing;
nmeSetBitmapData(inBitmapData);
}
- function nmeSetBitmapData(inBitmapData:BitmapData) : BitmapData
+ function nmeRebuid()
{
var gfx = graphics;
gfx.clear();
- bitmapData = inBitmapData;
- if (inBitmapData!=null)
? ^^^
+ if (bitmapData!=null)
? ^
{
- gfx.beginBitmapFill(inBitmapData,false,smoothing);
? ^^^
+ gfx.beginBitmapFill(bitmapData,false,smoothing);
? ^
- gfx.drawRect(0,0,inBitmapData.width,inBitmapData.height);
? ^^^ ^^^
+ gfx.drawRect(0,0,bitmapData.width,bitmapData.height);
? ^ ^
gfx.endFill();
}
+ }
+
+ function nmeSetSmoothing(inSmooth:Bool) : Bool
+ {
+ smoothing = inSmooth;
+ nmeRebuid();
+ return inSmooth;
+ }
+
+ function nmeSetBitmapData(inBitmapData:BitmapData) : BitmapData
+ {
+ bitmapData = inBitmapData;
+ nmeRebuid();
- return inBitmapData;
? -
+ return inBitmapData;
}
}
| 26 | 0.742857 | 19 | 7 |
f8ae3cdcaacb29c7b56e546a9ddab1396b615f8f | src/test/run-pass/extern-pub.rs | src/test/run-pass/extern-pub.rs | use std::libc;
extern {
pub unsafe fn free(p: *libc::c_void);
}
pub fn main() {
}
| extern {
pub unsafe fn free(p: *u8);
}
pub fn main() {
}
| Fix test failure on windows | Fix test failure on windows
This patch ensures that the multiple extern definitions of `free` in the
run-pass tests have the same declaration, working around #7352.
| Rust | apache-2.0 | dwillmer/rust,GBGamer/rust,nham/rust,GBGamer/rust,ruud-v-a/rust,ruud-v-a/rust,LeoTestard/rust,barosl/rust,XMPPwocky/rust,mihneadb/rust,mihneadb/rust,XMPPwocky/rust,zachwick/rust,aneeshusa/rust,gifnksm/rust,aturon/rust,Ryman/rust,sae-bom/rust,quornian/rust,j16r/rust,ktossell/rust,andars/rust,nham/rust,mahkoh/rust,carols10cents/rust,defuz/rust,stepancheg/rust-ide-rust,SiegeLord/rust,carols10cents/rust,nwin/rust,seanrivera/rust,pythonesque/rust,reem/rust,defuz/rust,shepmaster/rand,ejjeong/rust,bombless/rust,aidancully/rust,barosl/rust,philyoon/rust,ebfull/rust,XMPPwocky/rust,fabricedesre/rust,erickt/rust,krzysz00/rust,jbclements/rust,kmcallister/rust,pshc/rust,bombless/rust,stepancheg/rust-ide-rust,pelmers/rust,omasanori/rust,ejjeong/rust,cllns/rust,ebfull/rust,sae-bom/rust,quornian/rust,mitsuhiko/rust,zaeleus/rust,zachwick/rust,nwin/rust,nham/rust,AerialX/rust-rt-minimal,fabricedesre/rust,fabricedesre/rust,jroesch/rust,pczarn/rust,carols10cents/rust,kmcallister/rust,jashank/rust,emk/rust,vhbit/rust,erickt/rust,P1start/rust,kimroen/rust,pelmers/rust,mvdnes/rust,GBGamer/rust,defuz/rust,jashank/rust,pshc/rust,pelmers/rust,miniupnp/rust,rprichard/rust,krzysz00/rust,cllns/rust,AerialX/rust,robertg/rust,GBGamer/rust,nwin/rust,pythonesque/rust,pythonesque/rust,KokaKiwi/rust,rohitjoshi/rust,aturon/rust,philyoon/rust,nwin/rust,carols10cents/rust,kimroen/rust,zachwick/rust,philyoon/rust,sarojaba/rust-doc-korean,dinfuehr/rust,krzysz00/rust,avdi/rust,Ryman/rust,mvdnes/rust,mdinger/rust,Ryman/rust,vhbit/rust,aepsil0n/rust,l0kod/rust,mdinger/rust,l0kod/rust,vhbit/rust,mahkoh/rust,stepancheg/rust-ide-rust,ebfull/rust,aidancully/rust,XMPPwocky/rust,graydon/rust,aneeshusa/rust,richo/rust,XMPPwocky/rust,krzysz00/rust,arthurprs/rand,mdinger/rust,ktossell/rust,victorvde/rust,nwin/rust,aturon/rust,seanrivera/rust,graydon/rust,hauleth/rust,pczarn/rust,aneeshusa/rust,seanrivera/rust,bombless/rust,jbclements/rust,bombless/rust,rprichard/rust,cllns/rust,zachwick/rust,servo/rust,aturon/rust,stepancheg/rust-ide-rust,emk/rust,barosl/rust,mvdnes/rust,victorvde/rust,ktossell/rust,mitsuhiko/rust,cllns/rust,quornian/rust,GBGamer/rust,jashank/rust,sarojaba/rust-doc-korean,philyoon/rust,robertg/rust,bombless/rust,omasanori/rust,j16r/rust,pythonesque/rust,omasanori/rust,zachwick/rust,avdi/rust,ktossell/rust,sarojaba/rust-doc-korean,michaelballantyne/rust-gpu,aepsil0n/rust,jashank/rust,jroesch/rust,0x73/rust,j16r/rust,kimroen/rust,SiegeLord/rust,victorvde/rust,servo/rust,aidancully/rust,mihneadb/rust,miniupnp/rust,seanrivera/rust,jbclements/rust,rprichard/rust,hauleth/rust,j16r/rust,l0kod/rust,richo/rust,gifnksm/rust,SiegeLord/rust,mitsuhiko/rust,philyoon/rust,kmcallister/rust,barosl/rust,zubron/rust,aneeshusa/rust,ebfull/rust,l0kod/rust,quornian/rust,rohitjoshi/rust,robertg/rust,michaelballantyne/rust-gpu,KokaKiwi/rust,barosl/rust,KokaKiwi/rust,stepancheg/rust-ide-rust,kmcallister/rust,kmcallister/rust,ejjeong/rust,servo/rust,untitaker/rust,jbclements/rust,jroesch/rust,dwillmer/rust,zaeleus/rust,fabricedesre/rust,barosl/rust,ruud-v-a/rust,emk/rust,dinfuehr/rust,mdinger/rust,AerialX/rust-rt-minimal,kwantam/rust,dwillmer/rust,P1start/rust,graydon/rust,gifnksm/rust,richo/rust,jroesch/rust,victorvde/rust,robertg/rust,ebfull/rust,nham/rust,erickt/rust,achanda/rand,jroesch/rust,nham/rust,sarojaba/rust-doc-korean,GBGamer/rust,gifnksm/rust,bombless/rust-docs-chinese,sae-bom/rust,Ryman/rust,victorvde/rust,pczarn/rust,untitaker/rust,omasanori/rust,hauleth/rust,mitsuhiko/rust,P1start/rust,cllns/rust,erickt/rust,nham/rust,LeoTestard/rust,miniupnp/rust,pythonesque/rust,ebfull/rand,emk/rust,barosl/rust,dwillmer/rust,untitaker/rust,andars/rust,untitaker/rust,AerialX/rust-rt-minimal,0x73/rust,miniupnp/rust,rohitjoshi/rust,rohitjoshi/rust,huonw/rand,j16r/rust,zaeleus/rust,stepancheg/rust-ide-rust,ktossell/rust,pelmers/rust,defuz/rust,l0kod/rust,AerialX/rust-rt-minimal,hauleth/rust,ejjeong/rust,pshc/rust,jbclements/rust,pelmers/rust,ktossell/rust,ebfull/rust,kimroen/rust,pshc/rust,0x73/rust,reem/rust,dinfuehr/rust,sarojaba/rust-doc-korean,jbclements/rust,graydon/rust,michaelballantyne/rust-gpu,erickt/rust,jroesch/rust,hauleth/rust,AerialX/rust,reem/rust,AerialX/rust,KokaKiwi/rust,andars/rust,mihneadb/rust,reem/rust,krzysz00/rust,KokaKiwi/rust,P1start/rust,SiegeLord/rust,jroesch/rust,bombless/rust,j16r/rust,jashank/rust,miniupnp/rust,LeoTestard/rust,erickt/rust,0x73/rust,pshc/rust,fabricedesre/rust,TheNeikos/rust,kwantam/rust,AerialX/rust-rt-minimal,l0kod/rust,omasanori/rust,bluss/rand,AerialX/rust,dwillmer/rust,mvdnes/rust,pczarn/rust,avdi/rust,vhbit/rust,avdi/rust,servo/rust,sarojaba/rust-doc-korean,P1start/rust,GBGamer/rust,miniupnp/rust,dwillmer/rust,aidancully/rust,pshc/rust,avdi/rust,aturon/rust,jbclements/rust,kimroen/rust,aidancully/rust,aneeshusa/rust,jroesch/rust,nwin/rust,quornian/rust,ruud-v-a/rust,aepsil0n/rust,krzysz00/rust,hauleth/rust,quornian/rust,untitaker/rust,graydon/rust,TheNeikos/rust,mahkoh/rust,robertg/rust,ejjeong/rust,SiegeLord/rust,pshc/rust,robertg/rust,nwin/rust,dinfuehr/rust,mitsuhiko/rust,0x73/rust,defuz/rust,vhbit/rust,rohitjoshi/rust,stepancheg/rust-ide-rust,dwillmer/rust,pythonesque/rust,pczarn/rust,pelmers/rust,carols10cents/rust,zubron/rust,miniupnp/rust,victorvde/rust,mihneadb/rust,AerialX/rust-rt-minimal,sarojaba/rust-doc-korean,aepsil0n/rust,nham/rust,TheNeikos/rust,AerialX/rust,richo/rust,LeoTestard/rust,fabricedesre/rust,0x73/rust,vhbit/rust,zubron/rust,mitsuhiko/rust,zaeleus/rust,zubron/rust,michaelballantyne/rust-gpu,andars/rust,zubron/rust,emk/rust,XMPPwocky/rust,vhbit/rust,AerialX/rust,bhickey/rand,quornian/rust,mihneadb/rust,jashank/rust,dinfuehr/rust,michaelballantyne/rust-gpu,LeoTestard/rust,reem/rust,aturon/rust,KokaKiwi/rust,SiegeLord/rust,servo/rust,zubron/rust,seanrivera/rust,carols10cents/rust,mvdnes/rust,jbclements/rust,ruud-v-a/rust,zaeleus/rust,untitaker/rust,cllns/rust,servo/rust,l0kod/rust,gifnksm/rust,pczarn/rust,emk/rust,servo/rust,retep998/rand,omasanori/rust,sae-bom/rust,aidancully/rust,miniupnp/rust,l0kod/rust,dinfuehr/rust,pythonesque/rust,kmcallister/rust,ruud-v-a/rust,kimroen/rust,kwantam/rust,waynenilsen/rand,TheNeikos/rust,rprichard/rust,kwantam/rust,dwillmer/rust,j16r/rust,Ryman/rust,aneeshusa/rust,0x73/rust,michaelballantyne/rust-gpu,erickt/rust,GBGamer/rust,andars/rust,rprichard/rust,graydon/rust,kimroen/rust,defuz/rust,jashank/rust,reem/rust,aepsil0n/rust,seanrivera/rust,richo/rust,LeoTestard/rust,mahkoh/rust,mitsuhiko/rust,P1start/rust,zubron/rust,fabricedesre/rust,ejjeong/rust,rprichard/rust,nwin/rust,Ryman/rust,zachwick/rust,aepsil0n/rust,sae-bom/rust,GrahamDennis/rand,richo/rust,philyoon/rust,zubron/rust,jashank/rust,P1start/rust,pshc/rust,SiegeLord/rust,jbclements/rust,mahkoh/rust,sae-bom/rust,andars/rust,LeoTestard/rust,mvdnes/rust,Ryman/rust,rohitjoshi/rust,michaelballantyne/rust-gpu,gifnksm/rust,ktossell/rust,pczarn/rust,TheNeikos/rust,mdinger/rust,emk/rust,avdi/rust,kwantam/rust,zaeleus/rust,vhbit/rust,kmcallister/rust,aturon/rust,TheNeikos/rust,kwantam/rust,mahkoh/rust,mdinger/rust | rust | ## Code Before:
use std::libc;
extern {
pub unsafe fn free(p: *libc::c_void);
}
pub fn main() {
}
## Instruction:
Fix test failure on windows
This patch ensures that the multiple extern definitions of `free` in the
run-pass tests have the same declaration, working around #7352.
## Code After:
extern {
pub unsafe fn free(p: *u8);
}
pub fn main() {
}
| - use std::libc;
-
extern {
- pub unsafe fn free(p: *libc::c_void);
? ^^^^^^^^^^^^
+ pub unsafe fn free(p: *u8);
? ^^
}
pub fn main() {
} | 4 | 0.5 | 1 | 3 |
9b45853b0d8bdb3e8778102f38f84f71f42ae461 | bud.gemspec | bud.gemspec | Gem::Specification.new do |s|
s.name = %q{bud}
s.version = "0.0.1"
s.date = %q{2010-07-19}
s.authors = ["Joseph M. Hellerstein"]
s.email = %q{jmh@berkeley.edu}
s.summary = %q{Provides a prototype Bloom-like sublanguage in Ruby.}
s.homepage = %q{http://bud.cs.berkeley.edu/}
s.description = %q{This gem provides a prototype Bloom-like declarative distributed sublanguage for Ruby.}
s.files = ["README", "LICENSE", "lib/bud.rb"]
s.files += Dir.entries("lib/bud").select{|f| f.include? ".rb"}.map{|f| "lib/bud/" + f}
s.add_dependency 'msgpack'
s.add_dependency 'eventmachine'
s.add_dependency 'superators'
s.add_dependency 'ParseTree'
s.add_dependency 'sexp_path'
s.add_dependency 'ruby2ruby'
s.add_dependency 'anise'
s.add_dependency 'ruby-graphviz'
s.add_dependency 'backports'
s.add_dependency 'tokyocabinet'
end
| Gem::Specification.new do |s|
s.name = %q{bud}
s.version = "0.0.1"
s.date = %q{2010-07-19}
s.authors = ["Joseph M. Hellerstein"]
s.email = %q{jmh@berkeley.edu}
s.summary = %q{Provides a prototype Bloom-like sublanguage in Ruby.}
s.homepage = %q{http://bud.cs.berkeley.edu/}
s.description = %q{This gem provides a prototype Bloom-like declarative distributed sublanguage for Ruby.}
s.files = ["README", "LICENSE", "lib/bud.rb"]
s.files += Dir.entries("lib/bud").select{|f| f.include? ".rb"}.map{|f| "lib/bud/" + f}
s.add_dependency 'msgpack'
s.add_dependency 'eventmachine'
s.add_dependency 'superators'
s.add_dependency 'ParseTree'
s.add_dependency 'sexp_path'
s.add_dependency 'ruby2ruby'
s.add_dependency 'anise'
s.add_dependency 'ruby-graphviz'
s.add_dependency 'backports'
s.add_dependency 'tokyocabinet'
s.add_dependency 'syntax'
end
| Add dependency on "syntax" gem. | Add dependency on "syntax" gem.
| Ruby | bsd-3-clause | bloom-lang/bud | ruby | ## Code Before:
Gem::Specification.new do |s|
s.name = %q{bud}
s.version = "0.0.1"
s.date = %q{2010-07-19}
s.authors = ["Joseph M. Hellerstein"]
s.email = %q{jmh@berkeley.edu}
s.summary = %q{Provides a prototype Bloom-like sublanguage in Ruby.}
s.homepage = %q{http://bud.cs.berkeley.edu/}
s.description = %q{This gem provides a prototype Bloom-like declarative distributed sublanguage for Ruby.}
s.files = ["README", "LICENSE", "lib/bud.rb"]
s.files += Dir.entries("lib/bud").select{|f| f.include? ".rb"}.map{|f| "lib/bud/" + f}
s.add_dependency 'msgpack'
s.add_dependency 'eventmachine'
s.add_dependency 'superators'
s.add_dependency 'ParseTree'
s.add_dependency 'sexp_path'
s.add_dependency 'ruby2ruby'
s.add_dependency 'anise'
s.add_dependency 'ruby-graphviz'
s.add_dependency 'backports'
s.add_dependency 'tokyocabinet'
end
## Instruction:
Add dependency on "syntax" gem.
## Code After:
Gem::Specification.new do |s|
s.name = %q{bud}
s.version = "0.0.1"
s.date = %q{2010-07-19}
s.authors = ["Joseph M. Hellerstein"]
s.email = %q{jmh@berkeley.edu}
s.summary = %q{Provides a prototype Bloom-like sublanguage in Ruby.}
s.homepage = %q{http://bud.cs.berkeley.edu/}
s.description = %q{This gem provides a prototype Bloom-like declarative distributed sublanguage for Ruby.}
s.files = ["README", "LICENSE", "lib/bud.rb"]
s.files += Dir.entries("lib/bud").select{|f| f.include? ".rb"}.map{|f| "lib/bud/" + f}
s.add_dependency 'msgpack'
s.add_dependency 'eventmachine'
s.add_dependency 'superators'
s.add_dependency 'ParseTree'
s.add_dependency 'sexp_path'
s.add_dependency 'ruby2ruby'
s.add_dependency 'anise'
s.add_dependency 'ruby-graphviz'
s.add_dependency 'backports'
s.add_dependency 'tokyocabinet'
s.add_dependency 'syntax'
end
| Gem::Specification.new do |s|
s.name = %q{bud}
s.version = "0.0.1"
s.date = %q{2010-07-19}
s.authors = ["Joseph M. Hellerstein"]
s.email = %q{jmh@berkeley.edu}
s.summary = %q{Provides a prototype Bloom-like sublanguage in Ruby.}
s.homepage = %q{http://bud.cs.berkeley.edu/}
s.description = %q{This gem provides a prototype Bloom-like declarative distributed sublanguage for Ruby.}
s.files = ["README", "LICENSE", "lib/bud.rb"]
s.files += Dir.entries("lib/bud").select{|f| f.include? ".rb"}.map{|f| "lib/bud/" + f}
s.add_dependency 'msgpack'
s.add_dependency 'eventmachine'
s.add_dependency 'superators'
s.add_dependency 'ParseTree'
s.add_dependency 'sexp_path'
s.add_dependency 'ruby2ruby'
s.add_dependency 'anise'
s.add_dependency 'ruby-graphviz'
s.add_dependency 'backports'
s.add_dependency 'tokyocabinet'
+ s.add_dependency 'syntax'
end | 1 | 0.041667 | 1 | 0 |
39256f49c952dbd5802d5321c8a74b2c41934e38 | timedelta/__init__.py | timedelta/__init__.py | import os
__version__ = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
try:
from fields import TimedeltaField
from helpers import (
divide, multiply, modulo,
parse, nice_repr,
percentage, decimal_percentage,
total_seconds
)
except ImportError:
pass | import os
__version__ = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
try:
import django
from fields import TimedeltaField
from helpers import (
divide, multiply, modulo,
parse, nice_repr,
percentage, decimal_percentage,
total_seconds
)
except (ImportError, django.core.exceptions.ImproperlyConfigured):
pass | Fix running on unconfigured virtualenv. | Fix running on unconfigured virtualenv.
| Python | bsd-3-clause | sookasa/django-timedelta-field | python | ## Code Before:
import os
__version__ = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
try:
from fields import TimedeltaField
from helpers import (
divide, multiply, modulo,
parse, nice_repr,
percentage, decimal_percentage,
total_seconds
)
except ImportError:
pass
## Instruction:
Fix running on unconfigured virtualenv.
## Code After:
import os
__version__ = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
try:
import django
from fields import TimedeltaField
from helpers import (
divide, multiply, modulo,
parse, nice_repr,
percentage, decimal_percentage,
total_seconds
)
except (ImportError, django.core.exceptions.ImproperlyConfigured):
pass | import os
__version__ = open(os.path.join(os.path.dirname(__file__), "VERSION")).read().strip()
try:
+ import django
from fields import TimedeltaField
from helpers import (
divide, multiply, modulo,
parse, nice_repr,
percentage, decimal_percentage,
total_seconds
)
- except ImportError:
+ except (ImportError, django.core.exceptions.ImproperlyConfigured):
pass | 3 | 0.214286 | 2 | 1 |
6a2dd77d82aa88d4f3af21aec895a93c200d6928 | README.md | README.md | phylostylotastic
================
Styled publication of NeXML/NeXSON trees
This is a proof-of-concept implementation, applying TSS styles to the
existing tree-visualization features of [ETE](https://pypi.python.org/pypi/ete2/).
#### Prerequisites
- Python 2.5+
- pip
- [ete2](https://pypi.python.org/pypi/ete2/)
- [tinycss](http://pythonhosted.org/tinycss/)
#### Quick start
```bash
easy_install pip
pip install tinycss
python pstastic.py examples/met1.xml default.nexss
```
| phylostylotastic
================
Styled publication of NeXML/NeXSON trees
This is a proof-of-concept implementation, applying TSS styles to the
existing tree-visualization features of [ETE](https://pypi.python.org/pypi/ete2/).
#### Prerequisites
- Python 2.5+
- pip
- [ete2](https://pypi.python.org/pypi/ete2/)
- [tinycss](http://pythonhosted.org/tinycss/)
#### Quick start
```bash
easy_install pip
pip install tinycss
python pstastic.py examples/met1.xml default.nexss
```
#### ETE gotchas and limitations
Not surprisingly, ETE doesn't support all of the styles and manipulations we would like.
```css
tree {tip-orientation: left;}
tree.upward {tip-orientation: top;}
```
We apparently can't rotate trees cleanly in ETE. That is, the entire diagram is rotated, so labels appear sideways or upside-down. There's no provision for legibility or spacing, so this is effectively useless.
```css
figure {
background-color: white;
width: 500px;
height: 500px;
}
```
Sadly, None of these seem to be available through ETE's `TreeStyle`. It seems to reckon width and height based on the tree and scale.
| Add section for ETE gotchas and limitations | Add section for ETE gotchas and limitations
| Markdown | mit | daisieh/phylostylotastic,OpenTreeOfLife/phylostylotastic,daisieh/phylostylotastic,OpenTreeOfLife/phylostylotastic,OpenTreeOfLife/phylostylotastic | markdown | ## Code Before:
phylostylotastic
================
Styled publication of NeXML/NeXSON trees
This is a proof-of-concept implementation, applying TSS styles to the
existing tree-visualization features of [ETE](https://pypi.python.org/pypi/ete2/).
#### Prerequisites
- Python 2.5+
- pip
- [ete2](https://pypi.python.org/pypi/ete2/)
- [tinycss](http://pythonhosted.org/tinycss/)
#### Quick start
```bash
easy_install pip
pip install tinycss
python pstastic.py examples/met1.xml default.nexss
```
## Instruction:
Add section for ETE gotchas and limitations
## Code After:
phylostylotastic
================
Styled publication of NeXML/NeXSON trees
This is a proof-of-concept implementation, applying TSS styles to the
existing tree-visualization features of [ETE](https://pypi.python.org/pypi/ete2/).
#### Prerequisites
- Python 2.5+
- pip
- [ete2](https://pypi.python.org/pypi/ete2/)
- [tinycss](http://pythonhosted.org/tinycss/)
#### Quick start
```bash
easy_install pip
pip install tinycss
python pstastic.py examples/met1.xml default.nexss
```
#### ETE gotchas and limitations
Not surprisingly, ETE doesn't support all of the styles and manipulations we would like.
```css
tree {tip-orientation: left;}
tree.upward {tip-orientation: top;}
```
We apparently can't rotate trees cleanly in ETE. That is, the entire diagram is rotated, so labels appear sideways or upside-down. There's no provision for legibility or spacing, so this is effectively useless.
```css
figure {
background-color: white;
width: 500px;
height: 500px;
}
```
Sadly, None of these seem to be available through ETE's `TreeStyle`. It seems to reckon width and height based on the tree and scale.
| phylostylotastic
================
Styled publication of NeXML/NeXSON trees
This is a proof-of-concept implementation, applying TSS styles to the
existing tree-visualization features of [ETE](https://pypi.python.org/pypi/ete2/).
#### Prerequisites
- Python 2.5+
- pip
- [ete2](https://pypi.python.org/pypi/ete2/)
- [tinycss](http://pythonhosted.org/tinycss/)
#### Quick start
```bash
easy_install pip
pip install tinycss
python pstastic.py examples/met1.xml default.nexss
```
+
+ #### ETE gotchas and limitations
+
+ Not surprisingly, ETE doesn't support all of the styles and manipulations we would like.
+
+ ```css
+ tree {tip-orientation: left;}
+ tree.upward {tip-orientation: top;}
+ ```
+ We apparently can't rotate trees cleanly in ETE. That is, the entire diagram is rotated, so labels appear sideways or upside-down. There's no provision for legibility or spacing, so this is effectively useless.
+
+ ```css
+ figure {
+ background-color: white;
+ width: 500px;
+ height: 500px;
+ }
+ ```
+ Sadly, None of these seem to be available through ETE's `TreeStyle`. It seems to reckon width and height based on the tree and scale. | 19 | 0.904762 | 19 | 0 |
417275b9e5d61f4151214f022cf0a0ec7ee4661e | lib/dm-salesforce/types.rb | lib/dm-salesforce/types.rb | module DataMapper::Salesforce
class Type < ::DataMapper::Type
end
module Types
end
end
require 'dm-salesforce/types/serial'
require 'dm-salesforce/types/boolean'
require 'dm-salesforce/types/integer'
require 'dm-salesforce/types/float'
| module DataMapper::Salesforce
class Type < ::DataMapper::Type
end
module Types
end
Property = Types
end
require 'dm-salesforce/types/serial'
require 'dm-salesforce/types/boolean'
require 'dm-salesforce/types/integer'
require 'dm-salesforce/types/float'
| Add Property reference in DM0.10 case so DM1'ized quote_value works. | Add Property reference in DM0.10 case so DM1'ized quote_value works.
| Ruby | mit | jpr5/dm-salesforce-0.10.x,halorgium/dm-salesforce | ruby | ## Code Before:
module DataMapper::Salesforce
class Type < ::DataMapper::Type
end
module Types
end
end
require 'dm-salesforce/types/serial'
require 'dm-salesforce/types/boolean'
require 'dm-salesforce/types/integer'
require 'dm-salesforce/types/float'
## Instruction:
Add Property reference in DM0.10 case so DM1'ized quote_value works.
## Code After:
module DataMapper::Salesforce
class Type < ::DataMapper::Type
end
module Types
end
Property = Types
end
require 'dm-salesforce/types/serial'
require 'dm-salesforce/types/boolean'
require 'dm-salesforce/types/integer'
require 'dm-salesforce/types/float'
| module DataMapper::Salesforce
class Type < ::DataMapper::Type
end
module Types
end
+
+ Property = Types
end
require 'dm-salesforce/types/serial'
require 'dm-salesforce/types/boolean'
require 'dm-salesforce/types/integer'
require 'dm-salesforce/types/float' | 2 | 0.166667 | 2 | 0 |
bbf5caae241de4078819b921b16125c69928c9ed | Readme.md | Readme.md | This procedure can improve the appearance of a correlation matrix in several ways. It requires that the SPSSINC MODIFY TABLES extension command is installed.
---
Requirements
----
- IBM SPSS Statistics 18 or later and the corresponding IBM SPSS Statistics-Integration Plug-in for Python.
---
Installation intructions
----
1. Open IBM SPSS Statistics
2. Navigate to Utilities -> Extension Bundles -> Download and Install Extension Bundles
3. Search for the name of the extension and click Ok. Your extension will be available.
---
License
----
- Apache 2.0
Contributors
----
- JKP, IBM SPSS
| This procedure can improve the appearance of a correlation matrix in several ways. It requires that the SPSSINC MODIFY TABLES extension command is installed.
### UI
<img width="787" alt="image" src="https://user-images.githubusercontent.com/19230800/193295105-9242c97a-60fb-4f60-90ca-11e67ffedbdf.png">
### Output
**Before**:
<img width="814" alt="image" src="https://user-images.githubusercontent.com/19230800/193294993-2102a718-d04e-4396-8204-f7b1dcd4ae84.png">
**After**:
<img width="801" alt="image" src="https://user-images.githubusercontent.com/19230800/193295189-6615febb-eb53-4e9b-b357-a29b1fa836ea.png">
---
Requirements
----
- IBM SPSS Statistics 18 or later and the corresponding IBM SPSS Statistics-Integration Plug-in for Python.
---
Installation intructions
----
1. Open IBM SPSS Statistics
2. Navigate to Utilities -> Extension Bundles -> Download and Install Extension Bundles
3. Search for the name of the extension and click Ok. Your extension will be available.
---
License
----
- Apache 2.0
Contributors
----
- JKP, IBM SPSS
| Add UI and output examples | Add UI and output examples | Markdown | apache-2.0 | IBMPredictiveAnalytics/FormatCorrelations | markdown | ## Code Before:
This procedure can improve the appearance of a correlation matrix in several ways. It requires that the SPSSINC MODIFY TABLES extension command is installed.
---
Requirements
----
- IBM SPSS Statistics 18 or later and the corresponding IBM SPSS Statistics-Integration Plug-in for Python.
---
Installation intructions
----
1. Open IBM SPSS Statistics
2. Navigate to Utilities -> Extension Bundles -> Download and Install Extension Bundles
3. Search for the name of the extension and click Ok. Your extension will be available.
---
License
----
- Apache 2.0
Contributors
----
- JKP, IBM SPSS
## Instruction:
Add UI and output examples
## Code After:
This procedure can improve the appearance of a correlation matrix in several ways. It requires that the SPSSINC MODIFY TABLES extension command is installed.
### UI
<img width="787" alt="image" src="https://user-images.githubusercontent.com/19230800/193295105-9242c97a-60fb-4f60-90ca-11e67ffedbdf.png">
### Output
**Before**:
<img width="814" alt="image" src="https://user-images.githubusercontent.com/19230800/193294993-2102a718-d04e-4396-8204-f7b1dcd4ae84.png">
**After**:
<img width="801" alt="image" src="https://user-images.githubusercontent.com/19230800/193295189-6615febb-eb53-4e9b-b357-a29b1fa836ea.png">
---
Requirements
----
- IBM SPSS Statistics 18 or later and the corresponding IBM SPSS Statistics-Integration Plug-in for Python.
---
Installation intructions
----
1. Open IBM SPSS Statistics
2. Navigate to Utilities -> Extension Bundles -> Download and Install Extension Bundles
3. Search for the name of the extension and click Ok. Your extension will be available.
---
License
----
- Apache 2.0
Contributors
----
- JKP, IBM SPSS
| This procedure can improve the appearance of a correlation matrix in several ways. It requires that the SPSSINC MODIFY TABLES extension command is installed.
+
+ ### UI
+
+ <img width="787" alt="image" src="https://user-images.githubusercontent.com/19230800/193295105-9242c97a-60fb-4f60-90ca-11e67ffedbdf.png">
+
+ ### Output
+
+ **Before**:
+
+ <img width="814" alt="image" src="https://user-images.githubusercontent.com/19230800/193294993-2102a718-d04e-4396-8204-f7b1dcd4ae84.png">
+
+ **After**:
+
+ <img width="801" alt="image" src="https://user-images.githubusercontent.com/19230800/193295189-6615febb-eb53-4e9b-b357-a29b1fa836ea.png">
+
---
Requirements
----
- IBM SPSS Statistics 18 or later and the corresponding IBM SPSS Statistics-Integration Plug-in for Python.
---
Installation intructions
----
1. Open IBM SPSS Statistics
2. Navigate to Utilities -> Extension Bundles -> Download and Install Extension Bundles
3. Search for the name of the extension and click Ok. Your extension will be available.
---
License
----
- Apache 2.0
Contributors
----
- JKP, IBM SPSS | 15 | 0.625 | 15 | 0 |
038456b92b89a3fc8ed7f63328c1fb2b1c7bb553 | README.md | README.md | Experimental homepage
This is my throw together got-a-domain-for-email-may-as-well-make-a-website web site.
In an attempt to actually put something up that stays updated, expect weird experiments, horrific undesign and no browser compatibility.
| Experimental homepage
This is my throw together got-a-domain-for-email-may-as-well-make-a-website web site.
In an attempt to actually put something up that stays updated, expect weird experiments, horrific undesign and no browser compatibility.
See it at https://conradj.co.uk
| Put a link to the site from the readme. | Put a link to the site from the readme.
Duh... | Markdown | mit | conradj/1mmonkeys | markdown | ## Code Before:
Experimental homepage
This is my throw together got-a-domain-for-email-may-as-well-make-a-website web site.
In an attempt to actually put something up that stays updated, expect weird experiments, horrific undesign and no browser compatibility.
## Instruction:
Put a link to the site from the readme.
Duh...
## Code After:
Experimental homepage
This is my throw together got-a-domain-for-email-may-as-well-make-a-website web site.
In an attempt to actually put something up that stays updated, expect weird experiments, horrific undesign and no browser compatibility.
See it at https://conradj.co.uk
| Experimental homepage
This is my throw together got-a-domain-for-email-may-as-well-make-a-website web site.
In an attempt to actually put something up that stays updated, expect weird experiments, horrific undesign and no browser compatibility.
+
+ See it at https://conradj.co.uk | 2 | 0.4 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.