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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fb68aed02a3107ab8b5052363e49dc38751e3544 | iso/bootlocal.sh | iso/bootlocal.sh | BOOT2DOCKER_DATA=`blkid -o device -l -t LABEL=boot2docker-data`
PARTNAME=`echo "$BOOT2DOCKER_DATA" | sed 's/.*\///'`
mkdir -p /mnt/$PARTNAME/var/lib/minishift
ln -s /mnt/$PARTNAME/var/lib/minishift /var/lib/minishift
| BOOT2DOCKER_DATA=`blkid -o device -l -t LABEL=boot2docker-data`
PARTNAME=`echo "$BOOT2DOCKER_DATA" | sed 's/.*\///'`
mkdir -p /mnt/$PARTNAME/var/lib/minishift
ln -s /mnt/$PARTNAME/var/lib/minishift /var/lib/minishift
mkdir -p /mnt/$PARTNAME/data
ln -s /mnt/$PARTNAME/data /data
| Configure /data as a persisted directory. | Configure /data as a persisted directory.
| Shell | apache-2.0 | LalatenduMohanty/minishift-b2d-iso,minishift/minishift-b2d-iso,LalatenduMohanty/minishift-b2d-iso,minishift/minishift-b2d-iso | shell | ## Code Before:
BOOT2DOCKER_DATA=`blkid -o device -l -t LABEL=boot2docker-data`
PARTNAME=`echo "$BOOT2DOCKER_DATA" | sed 's/.*\///'`
mkdir -p /mnt/$PARTNAME/var/lib/minishift
ln -s /mnt/$PARTNAME/var/lib/minishift /var/lib/minishift
## Instruction:
Configure /data as a persisted directory.
## Code After:
BOOT2DOCKER_DATA=`blkid -o device -l -t LABEL=boot2docker-data`
PARTNAME=`echo "$BOOT2DOCKER_DATA" | sed 's/.*\///'`
mkdir -p /mnt/$PARTNAME/var/lib/minishift
ln -s /mnt/$PARTNAME/var/lib/minishift /var/lib/minishift
mkdir -p /mnt/$PARTNAME/data
ln -s /mnt/$PARTNAME/data /data
| BOOT2DOCKER_DATA=`blkid -o device -l -t LABEL=boot2docker-data`
PARTNAME=`echo "$BOOT2DOCKER_DATA" | sed 's/.*\///'`
mkdir -p /mnt/$PARTNAME/var/lib/minishift
ln -s /mnt/$PARTNAME/var/lib/minishift /var/lib/minishift
+ mkdir -p /mnt/$PARTNAME/data
+ ln -s /mnt/$PARTNAME/data /data | 2 | 0.4 | 2 | 0 |
1887324e60ed2ec39a6800f0751a7885c89a3606 | .travis.yml | .travis.yml | language: objective-c
install:
- brew install cmake
- brew install eigen
- brew install cgal --imaging --with-eigen --with-lapack
script:
- cmake .
- make
after_script:
- make test
cache:
- bundler
| language: objective-c
before_install:
- rvm use ruby-2.0.0-p247
- brew update
- brew reinstall isl011
- brew install gcc48
install:
- brew install eigen
- brew install cgal --imaging --with-eigen --with-lapack
script:
- cmake .
- make
after_script:
- make test
cache:
- bundler
| Install GCC 4.8 and fix ruby path | Install GCC 4.8 and fix ruby path
| YAML | bsd-3-clause | acgetchell/CDT-plusplus,acgetchell/CDT-plusplus,acgetchell/CDT-plusplus | yaml | ## Code Before:
language: objective-c
install:
- brew install cmake
- brew install eigen
- brew install cgal --imaging --with-eigen --with-lapack
script:
- cmake .
- make
after_script:
- make test
cache:
- bundler
## Instruction:
Install GCC 4.8 and fix ruby path
## Code After:
language: objective-c
before_install:
- rvm use ruby-2.0.0-p247
- brew update
- brew reinstall isl011
- brew install gcc48
install:
- brew install eigen
- brew install cgal --imaging --with-eigen --with-lapack
script:
- cmake .
- make
after_script:
- make test
cache:
- bundler
| language: objective-c
-
+ before_install:
+ - rvm use ruby-2.0.0-p247
+ - brew update
+ - brew reinstall isl011
+ - brew install gcc48
install:
- - brew install cmake
- brew install eigen
- brew install cgal --imaging --with-eigen --with-lapack
script:
- cmake .
- make
after_script:
- make test
cache:
- bundler | 7 | 0.538462 | 5 | 2 |
752a243942b14b2b8c2616e845a68ca734d2ccdf | ithaca/frequenters.md | ithaca/frequenters.md | Frequenters
-----------
### [Christopher Froehlich](https://github.com/somecallmechief)
+ [OJ on Github](https://github.com/somecallmechief/oj)
+ [OJ on c9](https://c9.io/somecallmechief/ojs)
### [Leon Miller-Out](https://singlebrook.com/team)
### [Travis Vachon](https://github.com/travis)
+ [Assorted Unfinished Threads](https://github.com/travis?tab=repositories)
| Frequenters
-----------
### [Christopher Froehlich](https://github.com/somecallmechief)
+ [OJ on Github](https://github.com/somecallmechief/oj)
+ [OJ on c9](https://c9.io/somecallmechief/ojs)
### [Leon Miller-Out](https://github.com/sbleon)
+ Runs [Singlebrook](https://singlebrook.com) - our sponsor!
### [Travis Vachon](https://github.com/travis)
+ [Assorted Unfinished Threads](https://github.com/travis?tab=repositories)
| Make my links match everyone else's | Make my links match everyone else's
| Markdown | mit | ilikepi/openhack.github.com,ilikepi/openhack.github.com,dideler/openhack.github.com,robdudley/openhack.github.com,clone1018/openhack.github.com,twinn/openhack.github.com,ilikepi/openhack.github.com,NeftaliYagua/openhackve.github.io-bk,robdudley/openhack.github.com,geopet/openhack.github.com,clone1018/openhack.github.com,clone1018/openhack.github.com,dideler/openhack.github.com,robdudley/openhack.github.com,dideler/openhack.github.com,NeftaliYagua/openhackve.github.io-bk,geopet/openhack.github.com,OpenHack/openhack.github.com,ridingwolf/openhack.github.com,geopet/openhack.github.com,twinn/openhack.github.com,OpenHack/openhack.github.com,ridingwolf/openhack.github.com,ridingwolf/openhack.github.com,OpenHack/openhack.github.com,NeftaliYagua/openhackve.github.io-bk,twinn/openhack.github.com | markdown | ## Code Before:
Frequenters
-----------
### [Christopher Froehlich](https://github.com/somecallmechief)
+ [OJ on Github](https://github.com/somecallmechief/oj)
+ [OJ on c9](https://c9.io/somecallmechief/ojs)
### [Leon Miller-Out](https://singlebrook.com/team)
### [Travis Vachon](https://github.com/travis)
+ [Assorted Unfinished Threads](https://github.com/travis?tab=repositories)
## Instruction:
Make my links match everyone else's
## Code After:
Frequenters
-----------
### [Christopher Froehlich](https://github.com/somecallmechief)
+ [OJ on Github](https://github.com/somecallmechief/oj)
+ [OJ on c9](https://c9.io/somecallmechief/ojs)
### [Leon Miller-Out](https://github.com/sbleon)
+ Runs [Singlebrook](https://singlebrook.com) - our sponsor!
### [Travis Vachon](https://github.com/travis)
+ [Assorted Unfinished Threads](https://github.com/travis?tab=repositories)
| Frequenters
-----------
### [Christopher Froehlich](https://github.com/somecallmechief)
+ [OJ on Github](https://github.com/somecallmechief/oj)
+ [OJ on c9](https://c9.io/somecallmechief/ojs)
- ### [Leon Miller-Out](https://singlebrook.com/team)
? ^ ^^^^ ---- ^ ^^
+ ### [Leon Miller-Out](https://github.com/sbleon)
? ^ ^^^ ^^^ ^^
+ + Runs [Singlebrook](https://singlebrook.com) - our sponsor!
### [Travis Vachon](https://github.com/travis)
+ [Assorted Unfinished Threads](https://github.com/travis?tab=repositories) | 3 | 0.272727 | 2 | 1 |
a3c8aeab8b76d568fc27d42cc61a2a2077bd2e53 | app/api/models/guild-model.js | app/api/models/guild-model.js | const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const guildSchema = Schema({
id: {type: String, unique: true, required: true},
guildName: {type: String, required: true},
icon: {type: String, default: null},
commandPrefix: {type: String, default: '$', maxlength: 3},
customStickers: [{
name: {type: String, required: true, maxlength: 20},
url: {type: String, required: true},
uses: {type: Number, default: 0},
creatorId: {type: String, required: true, default: 'unknown'},
createdAt: {type: Date, default: Date.now},
createdVia: {type: String, required: true, default: 'unknown'},
groupType: {type: String, required: true, default: 'guild'},
groupId: {type: String, required: true, default: 'unknown'}
}],
recentStickers: [String],
stickerPacks: [String],
guildManagerIds: [String],
stickerManagerRole: {type: String, default: '@everyone', maxlength: 30},
stickerManagerIds: [String],
isActive: {type: Boolean, default: true}
});
let Guild = mongoose.model('Guild', guildSchema);
module.exports = Guild;
| const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const guildSchema = Schema({
id: {type: String, unique: true, required: true},
guildName: {type: String, required: true},
icon: {type: String, default: null},
commandPrefix: {type: String, default: '$', maxlength: 3},
customStickers: [{
name: {type: String, required: true, maxlength: 20},
url: {type: String, required: true},
uses: {type: Number, default: 0},
creatorId: {type: String, required: true, default: 'unknown'},
createdAt: {type: Date, default: Date.now},
createdVia: {type: String, required: true, default: 'unknown'},
groupType: {type: String, required: true, default: 'guild'},
groupId: {type: String, required: true, default: 'unknown'}
}],
recentStickers: [String],
stickerPacks: [String],
guildManagerIds: [String],
stickerManagerRole: {type: String, required: true, default: '@everyone'},
stickerManagerIds: [String],
isActive: {type: Boolean, default: true}
});
let Guild = mongoose.model('Guild', guildSchema);
module.exports = Guild;
| Remove unneeded maxlength attr from 'stickerManagerRole' field in Guild Model | Remove unneeded maxlength attr from 'stickerManagerRole' field in Guild Model
| JavaScript | mpl-2.0 | DarylPinto/stickers-for-discord,DarylPinto/stickers-for-discord,DarylPinto/stickers-for-discord | javascript | ## Code Before:
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const guildSchema = Schema({
id: {type: String, unique: true, required: true},
guildName: {type: String, required: true},
icon: {type: String, default: null},
commandPrefix: {type: String, default: '$', maxlength: 3},
customStickers: [{
name: {type: String, required: true, maxlength: 20},
url: {type: String, required: true},
uses: {type: Number, default: 0},
creatorId: {type: String, required: true, default: 'unknown'},
createdAt: {type: Date, default: Date.now},
createdVia: {type: String, required: true, default: 'unknown'},
groupType: {type: String, required: true, default: 'guild'},
groupId: {type: String, required: true, default: 'unknown'}
}],
recentStickers: [String],
stickerPacks: [String],
guildManagerIds: [String],
stickerManagerRole: {type: String, default: '@everyone', maxlength: 30},
stickerManagerIds: [String],
isActive: {type: Boolean, default: true}
});
let Guild = mongoose.model('Guild', guildSchema);
module.exports = Guild;
## Instruction:
Remove unneeded maxlength attr from 'stickerManagerRole' field in Guild Model
## Code After:
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const guildSchema = Schema({
id: {type: String, unique: true, required: true},
guildName: {type: String, required: true},
icon: {type: String, default: null},
commandPrefix: {type: String, default: '$', maxlength: 3},
customStickers: [{
name: {type: String, required: true, maxlength: 20},
url: {type: String, required: true},
uses: {type: Number, default: 0},
creatorId: {type: String, required: true, default: 'unknown'},
createdAt: {type: Date, default: Date.now},
createdVia: {type: String, required: true, default: 'unknown'},
groupType: {type: String, required: true, default: 'guild'},
groupId: {type: String, required: true, default: 'unknown'}
}],
recentStickers: [String],
stickerPacks: [String],
guildManagerIds: [String],
stickerManagerRole: {type: String, required: true, default: '@everyone'},
stickerManagerIds: [String],
isActive: {type: Boolean, default: true}
});
let Guild = mongoose.model('Guild', guildSchema);
module.exports = Guild;
| const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const guildSchema = Schema({
id: {type: String, unique: true, required: true},
guildName: {type: String, required: true},
icon: {type: String, default: null},
commandPrefix: {type: String, default: '$', maxlength: 3},
customStickers: [{
name: {type: String, required: true, maxlength: 20},
url: {type: String, required: true},
uses: {type: Number, default: 0},
creatorId: {type: String, required: true, default: 'unknown'},
createdAt: {type: Date, default: Date.now},
createdVia: {type: String, required: true, default: 'unknown'},
groupType: {type: String, required: true, default: 'guild'},
groupId: {type: String, required: true, default: 'unknown'}
}],
recentStickers: [String],
stickerPacks: [String],
guildManagerIds: [String],
- stickerManagerRole: {type: String, default: '@everyone', maxlength: 30},
? ---------------
+ stickerManagerRole: {type: String, required: true, default: '@everyone'},
? ++++++++++++++++
stickerManagerIds: [String],
isActive: {type: Boolean, default: true}
});
let Guild = mongoose.model('Guild', guildSchema);
module.exports = Guild; | 2 | 0.066667 | 1 | 1 |
f33d3ec5b1cc175c019acf67fada4a3845ad3992 | Code/Cleavir/Generate-AST/cleavir-generate-ast.asd | Code/Cleavir/Generate-AST/cleavir-generate-ast.asd | (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-generate-ast
:depends-on (:cleavir-ast
:cleavir-primop
:cleavir-code-utilities
:cleavir-environment)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "check-special-form-syntax")
(:file "minimal-compilation")
(:file "generate-ast")
(:file "convert-form")
(:file "convert-special")
(:file "convert-primop")))
| (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-generate-ast
:depends-on (:cleavir-ast
:cleavir-primop
:cleavir-code-utilities
:cleavir-environment)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "check-special-form-syntax")
(:file "environment-query")
(:file "minimal-compilation")
(:file "generate-ast")
(:file "convert-form")
(:file "convert-special")
(:file "convert-primop")))
| Add locally defined environment query functions as component. | Add locally defined environment query functions as component.
| Common Lisp | bsd-2-clause | vtomole/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL | common-lisp | ## Code Before:
(cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-generate-ast
:depends-on (:cleavir-ast
:cleavir-primop
:cleavir-code-utilities
:cleavir-environment)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "check-special-form-syntax")
(:file "minimal-compilation")
(:file "generate-ast")
(:file "convert-form")
(:file "convert-special")
(:file "convert-primop")))
## Instruction:
Add locally defined environment query functions as component.
## Code After:
(cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-generate-ast
:depends-on (:cleavir-ast
:cleavir-primop
:cleavir-code-utilities
:cleavir-environment)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "check-special-form-syntax")
(:file "environment-query")
(:file "minimal-compilation")
(:file "generate-ast")
(:file "convert-form")
(:file "convert-special")
(:file "convert-primop")))
| (cl:in-package #:common-lisp-user)
(asdf:defsystem :cleavir-generate-ast
:depends-on (:cleavir-ast
:cleavir-primop
:cleavir-code-utilities
:cleavir-environment)
:serial t
:components
((:file "packages")
(:file "conditions")
(:file "check-special-form-syntax")
+ (:file "environment-query")
(:file "minimal-compilation")
(:file "generate-ast")
(:file "convert-form")
(:file "convert-special")
(:file "convert-primop"))) | 1 | 0.058824 | 1 | 0 |
8cb5ea001d54b9672127865b274089191ab74b1b | spec/unit/io_listener_spec.rb | spec/unit/io_listener_spec.rb | require 'spec_helper'
module ActivityBroker
describe IOListener do
class FakeListener
def forwarding_follow_event
end
end
let!(:fake_listener) { FakeListener.new }
let!(:io_listener) { IOListener.new(fake_listener, :forwarding_follow_event) }
it 'is equal to other io listener when listener and event match' do
expect(io_listener).to eq IOListener.new(fake_listener, :forwarding_follow_event)
end
it 'is not equal to another io listener when event does not match' do
expect(io_listener).not_to eq IOListener.new(fake_listener, :forwarding_status_update)
end
it 'is not equal to anoother io listener when registered listener does not match' do
another_fake_listener = FakeListener.new
expect(io_listener).not_to eq IOListener.new(another_fake_listener, :forwarding_follow_event)
end
end
end
| require 'spec_helper'
module ActivityBroker
describe IOListener do
class FakeListener
def forwarding_follow_event
end
end
let!(:fake_listener) { FakeListener.new }
let!(:io_listener) { IOListener.new(fake_listener, :forwarding_follow_event) }
it 'is equal to another io listener when listener and event match' do
expect(io_listener).to eq IOListener.new(fake_listener, :forwarding_follow_event)
end
it 'is not equal to another io listener when registered events dont match' do
expect(io_listener).not_to eq IOListener.new(fake_listener, :forwarding_status_update)
end
it 'is not equal to another io listener when registered listeners dont match' do
another_fake_listener = FakeListener.new
expect(io_listener).not_to eq IOListener.new(another_fake_listener, :forwarding_follow_event)
end
end
end
| Improve test descriptions for io listener | Improve test descriptions for io listener
| Ruby | mit | omartell/activity_broker | ruby | ## Code Before:
require 'spec_helper'
module ActivityBroker
describe IOListener do
class FakeListener
def forwarding_follow_event
end
end
let!(:fake_listener) { FakeListener.new }
let!(:io_listener) { IOListener.new(fake_listener, :forwarding_follow_event) }
it 'is equal to other io listener when listener and event match' do
expect(io_listener).to eq IOListener.new(fake_listener, :forwarding_follow_event)
end
it 'is not equal to another io listener when event does not match' do
expect(io_listener).not_to eq IOListener.new(fake_listener, :forwarding_status_update)
end
it 'is not equal to anoother io listener when registered listener does not match' do
another_fake_listener = FakeListener.new
expect(io_listener).not_to eq IOListener.new(another_fake_listener, :forwarding_follow_event)
end
end
end
## Instruction:
Improve test descriptions for io listener
## Code After:
require 'spec_helper'
module ActivityBroker
describe IOListener do
class FakeListener
def forwarding_follow_event
end
end
let!(:fake_listener) { FakeListener.new }
let!(:io_listener) { IOListener.new(fake_listener, :forwarding_follow_event) }
it 'is equal to another io listener when listener and event match' do
expect(io_listener).to eq IOListener.new(fake_listener, :forwarding_follow_event)
end
it 'is not equal to another io listener when registered events dont match' do
expect(io_listener).not_to eq IOListener.new(fake_listener, :forwarding_status_update)
end
it 'is not equal to another io listener when registered listeners dont match' do
another_fake_listener = FakeListener.new
expect(io_listener).not_to eq IOListener.new(another_fake_listener, :forwarding_follow_event)
end
end
end
| require 'spec_helper'
module ActivityBroker
describe IOListener do
class FakeListener
def forwarding_follow_event
end
end
let!(:fake_listener) { FakeListener.new }
let!(:io_listener) { IOListener.new(fake_listener, :forwarding_follow_event) }
- it 'is equal to other io listener when listener and event match' do
+ it 'is equal to another io listener when listener and event match' do
? ++
expect(io_listener).to eq IOListener.new(fake_listener, :forwarding_follow_event)
end
- it 'is not equal to another io listener when event does not match' do
? --- -
+ it 'is not equal to another io listener when registered events dont match' do
? +++++++++++ +
expect(io_listener).not_to eq IOListener.new(fake_listener, :forwarding_status_update)
end
- it 'is not equal to anoother io listener when registered listener does not match' do
? - --- -
+ it 'is not equal to another io listener when registered listeners dont match' do
? +
another_fake_listener = FakeListener.new
expect(io_listener).not_to eq IOListener.new(another_fake_listener, :forwarding_follow_event)
end
end
end | 6 | 0.222222 | 3 | 3 |
1fee22bb2b9b755161315eae90b86d59e6a0fcfa | docs/lib/UI/Footer.js | docs/lib/UI/Footer.js | import React from 'react';
import { Container, Row, Col } from 'reactstrap';
export default () => {
return (
<div className="footer">
<Container>
<Row>
<Col className="text-center">
<p className="social">
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=star&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=fork&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
</p>
</Col>
</Row>
</Container>
</div>
);
};
| import React from 'react';
import { Container, Row, Col } from 'reactstrap';
export default () => {
return (
<div className="footer">
<Container>
<Row>
<Col className="text-center">
<p className="social">
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=star&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=fork&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
</p>
<a href="https://www.netlify.com">
<img src="https://www.netlify.com/img/global/badges/netlify-light.svg" alt="Deploys by Netlify" />
</a>
</Col>
</Row>
</Container>
</div>
);
};
| Add netlify badge to qualify for open source plan | Add netlify badge to qualify for open source plan | JavaScript | mit | reactstrap/reactstrap,reactstrap/reactstrap,reactstrap/reactstrap,reactstrap/reactstrap | javascript | ## Code Before:
import React from 'react';
import { Container, Row, Col } from 'reactstrap';
export default () => {
return (
<div className="footer">
<Container>
<Row>
<Col className="text-center">
<p className="social">
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=star&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=fork&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
</p>
</Col>
</Row>
</Container>
</div>
);
};
## Instruction:
Add netlify badge to qualify for open source plan
## Code After:
import React from 'react';
import { Container, Row, Col } from 'reactstrap';
export default () => {
return (
<div className="footer">
<Container>
<Row>
<Col className="text-center">
<p className="social">
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=star&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=fork&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
</p>
<a href="https://www.netlify.com">
<img src="https://www.netlify.com/img/global/badges/netlify-light.svg" alt="Deploys by Netlify" />
</a>
</Col>
</Row>
</Container>
</div>
);
};
| import React from 'react';
import { Container, Row, Col } from 'reactstrap';
export default () => {
return (
<div className="footer">
<Container>
<Row>
<Col className="text-center">
<p className="social">
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=star&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
<iframe src="https://ghbtns.com/github-btn.html?user=reactstrap&repo=reactstrap&type=fork&count=true" frameBorder="0" scrolling="0" width="100" height="20px" />
</p>
+ <a href="https://www.netlify.com">
+ <img src="https://www.netlify.com/img/global/badges/netlify-light.svg" alt="Deploys by Netlify" />
+ </a>
</Col>
</Row>
</Container>
</div>
);
}; | 3 | 0.157895 | 3 | 0 |
95b33b43e321234e7c6b927580fcab97005bd66f | download_model.sh | download_model.sh |
echo 'Downloading the 19-layer VGG ILSVRC-2014 model (http://www.robots.ox.ac.uk/~vgg/research/very_deep/).'
curl -O 'http://www.robots.ox.ac.uk/%7Evgg/software/very_deep/caffe/VGG_ILSVRC_19_layers.caffemodel'
|
echo 'Downloading the 19-layer VGG ILSVRC-2014 model (http://www.robots.ox.ac.uk/~vgg/research/very_deep/).'
curl -O 'https://style-transfer.s3-us-west-2.amazonaws.com/VGG_ILSVRC_19_layers.caffemodel'
| Move VGG model download path to own S3 bucket | Move VGG model download path to own S3 bucket
| Shell | mit | crowsonkb/style_transfer,crowsonkb/style_transfer,crowsonkb/style_transfer,crowsonkb/style_transfer | shell | ## Code Before:
echo 'Downloading the 19-layer VGG ILSVRC-2014 model (http://www.robots.ox.ac.uk/~vgg/research/very_deep/).'
curl -O 'http://www.robots.ox.ac.uk/%7Evgg/software/very_deep/caffe/VGG_ILSVRC_19_layers.caffemodel'
## Instruction:
Move VGG model download path to own S3 bucket
## Code After:
echo 'Downloading the 19-layer VGG ILSVRC-2014 model (http://www.robots.ox.ac.uk/~vgg/research/very_deep/).'
curl -O 'https://style-transfer.s3-us-west-2.amazonaws.com/VGG_ILSVRC_19_layers.caffemodel'
|
echo 'Downloading the 19-layer VGG ILSVRC-2014 model (http://www.robots.ox.ac.uk/~vgg/research/very_deep/).'
- curl -O 'http://www.robots.ox.ac.uk/%7Evgg/software/very_deep/caffe/VGG_ILSVRC_19_layers.caffemodel'
+ curl -O 'https://style-transfer.s3-us-west-2.amazonaws.com/VGG_ILSVRC_19_layers.caffemodel' | 2 | 0.5 | 1 | 1 |
ac3f56f4ed0826600b9adbbf8dfe3b99ce508ac6 | migrations/versions/0334_broadcast_message_number.py | migrations/versions/0334_broadcast_message_number.py | from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0334_broadcast_message_number'
down_revision = '0333_service_broadcast_provider'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("create sequence broadcast_provider_message_number_seq")
op.create_table(
'broadcast_provider_message_number',
sa.Column(
'broadcast_provider_message_number',
sa.Integer(),
server_default=sa.text("nextval('broadcast_provider_message_number_seq')"),
nullable=False
),
sa.Column('broadcast_provider_message_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.ForeignKeyConstraint(['broadcast_provider_message_id'], ['broadcast_provider_message.id'], ),
sa.PrimaryKeyConstraint('broadcast_provider_message_number')
)
op.execute(
"""
INSERT INTO
broadcast_provider_message_number (broadcast_provider_message_id)
SELECT
id
FROM
broadcast_provider_message
"""
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('broadcast_provider_message_number')
op.execute("drop sequence broadcast_provider_message_number_seq")
# ### end Alembic commands ###
| from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0334_broadcast_message_number'
down_revision = '0333_service_broadcast_provider'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("create sequence broadcast_provider_message_number_seq")
op.create_table(
'broadcast_provider_message_number',
sa.Column(
'broadcast_provider_message_number',
sa.Integer(),
server_default=sa.text("nextval('broadcast_provider_message_number_seq')"),
nullable=False
),
sa.Column('broadcast_provider_message_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.ForeignKeyConstraint(['broadcast_provider_message_id'], ['broadcast_provider_message.id'], ),
sa.PrimaryKeyConstraint('broadcast_provider_message_number')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('broadcast_provider_message_number')
op.execute("drop sequence broadcast_provider_message_number_seq")
# ### end Alembic commands ###
| Delete unneeded code form migration | Delete unneeded code form migration
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | python | ## Code Before:
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0334_broadcast_message_number'
down_revision = '0333_service_broadcast_provider'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("create sequence broadcast_provider_message_number_seq")
op.create_table(
'broadcast_provider_message_number',
sa.Column(
'broadcast_provider_message_number',
sa.Integer(),
server_default=sa.text("nextval('broadcast_provider_message_number_seq')"),
nullable=False
),
sa.Column('broadcast_provider_message_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.ForeignKeyConstraint(['broadcast_provider_message_id'], ['broadcast_provider_message.id'], ),
sa.PrimaryKeyConstraint('broadcast_provider_message_number')
)
op.execute(
"""
INSERT INTO
broadcast_provider_message_number (broadcast_provider_message_id)
SELECT
id
FROM
broadcast_provider_message
"""
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('broadcast_provider_message_number')
op.execute("drop sequence broadcast_provider_message_number_seq")
# ### end Alembic commands ###
## Instruction:
Delete unneeded code form migration
## Code After:
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0334_broadcast_message_number'
down_revision = '0333_service_broadcast_provider'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("create sequence broadcast_provider_message_number_seq")
op.create_table(
'broadcast_provider_message_number',
sa.Column(
'broadcast_provider_message_number',
sa.Integer(),
server_default=sa.text("nextval('broadcast_provider_message_number_seq')"),
nullable=False
),
sa.Column('broadcast_provider_message_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.ForeignKeyConstraint(['broadcast_provider_message_id'], ['broadcast_provider_message.id'], ),
sa.PrimaryKeyConstraint('broadcast_provider_message_number')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('broadcast_provider_message_number')
op.execute("drop sequence broadcast_provider_message_number_seq")
# ### end Alembic commands ###
| from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0334_broadcast_message_number'
down_revision = '0333_service_broadcast_provider'
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("create sequence broadcast_provider_message_number_seq")
op.create_table(
'broadcast_provider_message_number',
sa.Column(
'broadcast_provider_message_number',
sa.Integer(),
server_default=sa.text("nextval('broadcast_provider_message_number_seq')"),
nullable=False
),
sa.Column('broadcast_provider_message_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.ForeignKeyConstraint(['broadcast_provider_message_id'], ['broadcast_provider_message.id'], ),
sa.PrimaryKeyConstraint('broadcast_provider_message_number')
)
- op.execute(
- """
- INSERT INTO
- broadcast_provider_message_number (broadcast_provider_message_id)
- SELECT
- id
- FROM
- broadcast_provider_message
- """
- )
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('broadcast_provider_message_number')
op.execute("drop sequence broadcast_provider_message_number_seq")
# ### end Alembic commands ### | 10 | 0.243902 | 0 | 10 |
dc37f74de1036e7bc7192f9c55c8df12a59076e8 | sources/us/va/statewide.json | sources/us/va/statewide.json | {
"data": "https://ftp.vgingis.com/Download/VA_SiteAddress.txt.zip",
"website": "http://vgin.maps.arcgis.com/home/item.html?id=100e5e12ddc14748a5ec3b8b997af13a",
"license": {
"text": "public domain",
"attribution": false,
"share-alike": false
},
"compression": "zip",
"type": "http",
"year": 2014,
"coverage": {
"US Census": {
"geoid": "51",
"state": "Virginia"
},
"country": "us",
"state": "va"
},
"conform": {
"type": "csv",
"file": "VA_SiteAddress.txt",
"lon": "LONG",
"lat": "LAT",
"number": "ADDRNUM",
"street": "FULLNAME",
"city": "PO_NAME",
"district": "MUNICIPALITY",
"region": "STATE",
"postcode": {
"function": "regexp",
"field": "ZIP_5",
"pattern": "(\d+),(\d+)",
"replace": "$1$2"
}
}
}
| {
"data": "https://ftp.vgingis.com/Download/VA_SiteAddress.txt.zip",
"website": "http://vgin.maps.arcgis.com/home/item.html?id=100e5e12ddc14748a5ec3b8b997af13a",
"license": {
"text": "public domain",
"attribution": false,
"share-alike": false
},
"compression": "zip",
"type": "http",
"year": 2014,
"coverage": {
"US Census": {
"geoid": "51",
"state": "Virginia"
},
"country": "us",
"state": "va"
},
"conform": {
"type": "csv",
"file": "VA_SiteAddress.txt",
"lon": "LONG",
"lat": "LAT",
"number": "ADDRNUM",
"street": "FULLNAME",
"city": "PO_NAME",
"district": "MUNICIPALITY",
"region": "STATE",
"postcode": {
"function": "regexp",
"field": "ZIP_5",
"pattern": "([0-9]{2}),([0-9]{3})",
"replace": "$1$2"
}
}
}
| Use [0-9] to fix build error and specify exact match sizes | Use [0-9] to fix build error and specify exact match sizes
| JSON | bsd-3-clause | tyrasd/openaddresses,sabas/openaddresses,slibby/openaddresses,astoff/openaddresses,tyrasd/openaddresses,openaddresses/openaddresses,orangejulius/openaddresses,mmdolbow/openaddresses,orangejulius/openaddresses,davidchiles/openaddresses,davidchiles/openaddresses,openaddresses/openaddresses,sergiyprotsiv/openaddresses,davidchiles/openaddresses,sabas/openaddresses,slibby/openaddresses,tyrasd/openaddresses,openaddresses/openaddresses,sabas/openaddresses,astoff/openaddresses,sergiyprotsiv/openaddresses,sergiyprotsiv/openaddresses,orangejulius/openaddresses,slibby/openaddresses,mmdolbow/openaddresses,astoff/openaddresses,mmdolbow/openaddresses | json | ## Code Before:
{
"data": "https://ftp.vgingis.com/Download/VA_SiteAddress.txt.zip",
"website": "http://vgin.maps.arcgis.com/home/item.html?id=100e5e12ddc14748a5ec3b8b997af13a",
"license": {
"text": "public domain",
"attribution": false,
"share-alike": false
},
"compression": "zip",
"type": "http",
"year": 2014,
"coverage": {
"US Census": {
"geoid": "51",
"state": "Virginia"
},
"country": "us",
"state": "va"
},
"conform": {
"type": "csv",
"file": "VA_SiteAddress.txt",
"lon": "LONG",
"lat": "LAT",
"number": "ADDRNUM",
"street": "FULLNAME",
"city": "PO_NAME",
"district": "MUNICIPALITY",
"region": "STATE",
"postcode": {
"function": "regexp",
"field": "ZIP_5",
"pattern": "(\d+),(\d+)",
"replace": "$1$2"
}
}
}
## Instruction:
Use [0-9] to fix build error and specify exact match sizes
## Code After:
{
"data": "https://ftp.vgingis.com/Download/VA_SiteAddress.txt.zip",
"website": "http://vgin.maps.arcgis.com/home/item.html?id=100e5e12ddc14748a5ec3b8b997af13a",
"license": {
"text": "public domain",
"attribution": false,
"share-alike": false
},
"compression": "zip",
"type": "http",
"year": 2014,
"coverage": {
"US Census": {
"geoid": "51",
"state": "Virginia"
},
"country": "us",
"state": "va"
},
"conform": {
"type": "csv",
"file": "VA_SiteAddress.txt",
"lon": "LONG",
"lat": "LAT",
"number": "ADDRNUM",
"street": "FULLNAME",
"city": "PO_NAME",
"district": "MUNICIPALITY",
"region": "STATE",
"postcode": {
"function": "regexp",
"field": "ZIP_5",
"pattern": "([0-9]{2}),([0-9]{3})",
"replace": "$1$2"
}
}
}
| {
"data": "https://ftp.vgingis.com/Download/VA_SiteAddress.txt.zip",
"website": "http://vgin.maps.arcgis.com/home/item.html?id=100e5e12ddc14748a5ec3b8b997af13a",
"license": {
"text": "public domain",
"attribution": false,
"share-alike": false
},
"compression": "zip",
"type": "http",
"year": 2014,
"coverage": {
"US Census": {
"geoid": "51",
"state": "Virginia"
},
"country": "us",
"state": "va"
},
"conform": {
"type": "csv",
"file": "VA_SiteAddress.txt",
"lon": "LONG",
"lat": "LAT",
"number": "ADDRNUM",
"street": "FULLNAME",
"city": "PO_NAME",
"district": "MUNICIPALITY",
"region": "STATE",
"postcode": {
"function": "regexp",
"field": "ZIP_5",
- "pattern": "(\d+),(\d+)",
+ "pattern": "([0-9]{2}),([0-9]{3})",
"replace": "$1$2"
}
}
} | 2 | 0.054054 | 1 | 1 |
bfd34a7aaf903c823d41068173c09bc5b1a251bc | test/sasdataloader/test/utest_sesans.py | test/sasdataloader/test/utest_sesans.py |
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
f =self.loader.load("sphere3micron.ses")
# self.assertEqual(f, 5)
self.assertEqual(len(f.x), 40)
self.assertEqual(f.x[0], 391.56)
self.assertEqual(f.x[-1], 46099)
self.assertEqual(f.y[-1], -0.19956)
self.assertEqual(f.x_unit, "A")
self.assertEqual(f.y_unit, "A-2 cm-1")
self.assertEqual(f.sample.name, "Polystyrene 2 um in 53% H2O, 47% D2O")
self.assertEqual(f.sample.thickness, 0.2)
self.assertEqual(f.sample.zacceptance, (0.0168, "radians"))
if __name__ == "__main__":
unittest.main()
|
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
f =self.loader.load("sphere3micron.ses")
# self.assertEqual(f, 5)
self.assertEqual(len(f.x), 40)
self.assertEqual(f.x[0], 391.56)
self.assertEqual(f.x[-1], 46099)
self.assertEqual(f.y[-1], -0.19956)
self.assertEqual(f.x_unit, "A")
self.assertEqual(f.y_unit, "A-2 cm-1")
self.assertEqual(f.sample.name, "Polystyrene 2 um in 53% H2O, 47% D2O")
self.assertEqual(f.sample.thickness, 0.2)
self.assertEqual(f.sample.zacceptance, (0.0168, "radians"))
self.assertEqual(f.isSesans, True)
if __name__ == "__main__":
unittest.main()
| Test that .SES files are tagged as Sesans | Test that .SES files are tagged as Sesans
| Python | bsd-3-clause | lewisodriscoll/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview | python | ## Code Before:
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
f =self.loader.load("sphere3micron.ses")
# self.assertEqual(f, 5)
self.assertEqual(len(f.x), 40)
self.assertEqual(f.x[0], 391.56)
self.assertEqual(f.x[-1], 46099)
self.assertEqual(f.y[-1], -0.19956)
self.assertEqual(f.x_unit, "A")
self.assertEqual(f.y_unit, "A-2 cm-1")
self.assertEqual(f.sample.name, "Polystyrene 2 um in 53% H2O, 47% D2O")
self.assertEqual(f.sample.thickness, 0.2)
self.assertEqual(f.sample.zacceptance, (0.0168, "radians"))
if __name__ == "__main__":
unittest.main()
## Instruction:
Test that .SES files are tagged as Sesans
## Code After:
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
f =self.loader.load("sphere3micron.ses")
# self.assertEqual(f, 5)
self.assertEqual(len(f.x), 40)
self.assertEqual(f.x[0], 391.56)
self.assertEqual(f.x[-1], 46099)
self.assertEqual(f.y[-1], -0.19956)
self.assertEqual(f.x_unit, "A")
self.assertEqual(f.y_unit, "A-2 cm-1")
self.assertEqual(f.sample.name, "Polystyrene 2 um in 53% H2O, 47% D2O")
self.assertEqual(f.sample.thickness, 0.2)
self.assertEqual(f.sample.zacceptance, (0.0168, "radians"))
self.assertEqual(f.isSesans, True)
if __name__ == "__main__":
unittest.main()
|
import unittest
from sas.sascalc.dataloader.loader import Loader
import os.path
class sesans_reader(unittest.TestCase):
def setUp(self):
self.loader = Loader()
def test_sesans_load(self):
"""
Test .SES file loading
"""
f =self.loader.load("sphere3micron.ses")
# self.assertEqual(f, 5)
self.assertEqual(len(f.x), 40)
self.assertEqual(f.x[0], 391.56)
self.assertEqual(f.x[-1], 46099)
self.assertEqual(f.y[-1], -0.19956)
self.assertEqual(f.x_unit, "A")
self.assertEqual(f.y_unit, "A-2 cm-1")
self.assertEqual(f.sample.name, "Polystyrene 2 um in 53% H2O, 47% D2O")
self.assertEqual(f.sample.thickness, 0.2)
self.assertEqual(f.sample.zacceptance, (0.0168, "radians"))
+ self.assertEqual(f.isSesans, True)
if __name__ == "__main__":
unittest.main() | 1 | 0.034483 | 1 | 0 |
4e28756866640f9357c1d8cc573f27b6056652f8 | src/main/java/com/epam/ta/reportportal/ws/model/dashboard/AddWidgetRq.java | src/main/java/com/epam/ta/reportportal/ws/model/dashboard/AddWidgetRq.java | package com.epam.ta.reportportal.ws.model.dashboard;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/**
* @author Pavel Bortnik
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AddWidgetRq {
@Valid
@NotNull
@JsonProperty(value = "addWidget")
private DashboardResource.WidgetObjectModel objectModel;
public DashboardResource.WidgetObjectModel getObjectModel() {
return objectModel;
}
public void setObjectModel(DashboardResource.WidgetObjectModel objectModel) {
this.objectModel = objectModel;
}
}
| package com.epam.ta.reportportal.ws.model.dashboard;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/**
* @author Pavel Bortnik
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AddWidgetRq {
@Valid
@NotNull
@JsonProperty(value = "addWidget")
private DashboardResource.WidgetObjectModel addWidget;
@NotNull
public DashboardResource.WidgetObjectModel getAddWidget() {
return addWidget;
}
public void setAddWidget(@NotNull DashboardResource.WidgetObjectModel addWidget) {
this.addWidget = addWidget;
}
}
| Add widget property has been renamed | Add widget property has been renamed
| Java | apache-2.0 | reportportal/commons-model | java | ## Code Before:
package com.epam.ta.reportportal.ws.model.dashboard;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/**
* @author Pavel Bortnik
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AddWidgetRq {
@Valid
@NotNull
@JsonProperty(value = "addWidget")
private DashboardResource.WidgetObjectModel objectModel;
public DashboardResource.WidgetObjectModel getObjectModel() {
return objectModel;
}
public void setObjectModel(DashboardResource.WidgetObjectModel objectModel) {
this.objectModel = objectModel;
}
}
## Instruction:
Add widget property has been renamed
## Code After:
package com.epam.ta.reportportal.ws.model.dashboard;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/**
* @author Pavel Bortnik
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AddWidgetRq {
@Valid
@NotNull
@JsonProperty(value = "addWidget")
private DashboardResource.WidgetObjectModel addWidget;
@NotNull
public DashboardResource.WidgetObjectModel getAddWidget() {
return addWidget;
}
public void setAddWidget(@NotNull DashboardResource.WidgetObjectModel addWidget) {
this.addWidget = addWidget;
}
}
| package com.epam.ta.reportportal.ws.model.dashboard;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
/**
* @author Pavel Bortnik
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AddWidgetRq {
@Valid
@NotNull
@JsonProperty(value = "addWidget")
- private DashboardResource.WidgetObjectModel objectModel;
? ^^^ - -----
+ private DashboardResource.WidgetObjectModel addWidget;
? ^^^^^^^
+ @NotNull
- public DashboardResource.WidgetObjectModel getObjectModel() {
? ^^^ - -----
+ public DashboardResource.WidgetObjectModel getAddWidget() {
? ^^^^^^^
- return objectModel;
+ return addWidget;
}
- public void setObjectModel(DashboardResource.WidgetObjectModel objectModel) {
? ^^^ - ^ ^^ ^ ^^^ - -----
+ public void setAddWidget(@NotNull DashboardResource.WidgetObjectModel addWidget) {
? ^^^^^^^ ^^^ ^^^ ^^ ^^^^^^^
- this.objectModel = objectModel;
+ this.addWidget = addWidget;
}
} | 11 | 0.407407 | 6 | 5 |
e582dbd06e32ba657b00cc9f6fd96a515034ee69 | src/js/components/PaginationComponent/PaginationComponent.js | src/js/components/PaginationComponent/PaginationComponent.js | /**
* Created by FG0003 on 09/02/2017.
*/
import Template from './pagination.tpl.html';
import previous from './../../../icons/previous.svg';
import next from './../../../icons/next.svg';
import first from './../../../icons/first.svg';
import last from './../../../icons/last.svg';
class PaginationController{
constructor(AngularUtilService){
this.util = AngularUtilService;
this.previous = previous;
this.next = next;
this.first = first;
this.last = last;
}
get page(){
if(this.currentPage != null && this.currentPage != 0)
return this.currentPage;
return 1;
}
set page(value){
this.currentPage = value;
}
$onChanges(){
if(this.currentPage > this.numberOfPages){
this.currentPage = this.numberOfPages;
}
}
$onInit(){
}
get numberOfPages(){
if(this.nItems == 0)
return 1;
return Math.ceil(this.nItems/this.itemsPerPage);
}
}
PaginationController.$inject = ['AngularUtilService'];
export let PaginationComponent = {
selector:'mdPagination',
bindings:{
itemsPerPage:'=',
currentPage:'=',
nItems: '<',
isDisabled: '<'
},
controller:PaginationController,
controllerAs:'$pagination',
template: Template
};
| /**
* Created by FG0003 on 09/02/2017.
*/
import Template from './pagination.tpl.html';
import previous from './../../../icons/previous.svg';
import next from './../../../icons/next.svg';
import first from './../../../icons/first.svg';
import last from './../../../icons/last.svg';
class PaginationController{
constructor(AngularUtilService){
this.util = AngularUtilService;
this.previous = previous;
this.next = next;
this.first = first;
this.last = last;
}
get page(){
if(this.currentPage != null && this.currentPage != 0)
return this.currentPage;
return 1;
}
set page(value){
this.currentPage = value;
}
$onChanges(){
if(this.currentPage > this.numberOfPages){
this.currentPage = this.numberOfPages;
}
}
$onInit(){
if(this.util.isUndefined(this.currentPage)) this.currentPage = 1;
}
get numberOfPages(){
if(this.nItems == 0 || this.nItems == null)
return 1;
return Math.ceil(this.nItems/this.itemsPerPage);
}
}
PaginationController.$inject = ['AngularUtilService'];
export let PaginationComponent = {
selector:'mdPagination',
bindings:{
itemsPerPage:'=',
currentPage:'=',
nItems: '<',
isDisabled: '<'
},
controller:PaginationController,
controllerAs:'$pagination',
template: Template
};
| Fix numberOfPages when nItems is null | Fix numberOfPages when nItems is null
| JavaScript | mit | gleandroj/angular-material-simple-components,gleandroj/angular-material-simple-components | javascript | ## Code Before:
/**
* Created by FG0003 on 09/02/2017.
*/
import Template from './pagination.tpl.html';
import previous from './../../../icons/previous.svg';
import next from './../../../icons/next.svg';
import first from './../../../icons/first.svg';
import last from './../../../icons/last.svg';
class PaginationController{
constructor(AngularUtilService){
this.util = AngularUtilService;
this.previous = previous;
this.next = next;
this.first = first;
this.last = last;
}
get page(){
if(this.currentPage != null && this.currentPage != 0)
return this.currentPage;
return 1;
}
set page(value){
this.currentPage = value;
}
$onChanges(){
if(this.currentPage > this.numberOfPages){
this.currentPage = this.numberOfPages;
}
}
$onInit(){
}
get numberOfPages(){
if(this.nItems == 0)
return 1;
return Math.ceil(this.nItems/this.itemsPerPage);
}
}
PaginationController.$inject = ['AngularUtilService'];
export let PaginationComponent = {
selector:'mdPagination',
bindings:{
itemsPerPage:'=',
currentPage:'=',
nItems: '<',
isDisabled: '<'
},
controller:PaginationController,
controllerAs:'$pagination',
template: Template
};
## Instruction:
Fix numberOfPages when nItems is null
## Code After:
/**
* Created by FG0003 on 09/02/2017.
*/
import Template from './pagination.tpl.html';
import previous from './../../../icons/previous.svg';
import next from './../../../icons/next.svg';
import first from './../../../icons/first.svg';
import last from './../../../icons/last.svg';
class PaginationController{
constructor(AngularUtilService){
this.util = AngularUtilService;
this.previous = previous;
this.next = next;
this.first = first;
this.last = last;
}
get page(){
if(this.currentPage != null && this.currentPage != 0)
return this.currentPage;
return 1;
}
set page(value){
this.currentPage = value;
}
$onChanges(){
if(this.currentPage > this.numberOfPages){
this.currentPage = this.numberOfPages;
}
}
$onInit(){
if(this.util.isUndefined(this.currentPage)) this.currentPage = 1;
}
get numberOfPages(){
if(this.nItems == 0 || this.nItems == null)
return 1;
return Math.ceil(this.nItems/this.itemsPerPage);
}
}
PaginationController.$inject = ['AngularUtilService'];
export let PaginationComponent = {
selector:'mdPagination',
bindings:{
itemsPerPage:'=',
currentPage:'=',
nItems: '<',
isDisabled: '<'
},
controller:PaginationController,
controllerAs:'$pagination',
template: Template
};
| /**
* Created by FG0003 on 09/02/2017.
*/
import Template from './pagination.tpl.html';
import previous from './../../../icons/previous.svg';
import next from './../../../icons/next.svg';
import first from './../../../icons/first.svg';
import last from './../../../icons/last.svg';
class PaginationController{
constructor(AngularUtilService){
this.util = AngularUtilService;
this.previous = previous;
this.next = next;
this.first = first;
this.last = last;
}
get page(){
if(this.currentPage != null && this.currentPage != 0)
return this.currentPage;
return 1;
}
set page(value){
this.currentPage = value;
}
$onChanges(){
if(this.currentPage > this.numberOfPages){
this.currentPage = this.numberOfPages;
}
}
$onInit(){
-
+ if(this.util.isUndefined(this.currentPage)) this.currentPage = 1;
}
get numberOfPages(){
- if(this.nItems == 0)
+ if(this.nItems == 0 || this.nItems == null)
return 1;
return Math.ceil(this.nItems/this.itemsPerPage);
}
}
PaginationController.$inject = ['AngularUtilService'];
export let PaginationComponent = {
selector:'mdPagination',
bindings:{
itemsPerPage:'=',
currentPage:'=',
nItems: '<',
isDisabled: '<'
},
controller:PaginationController,
controllerAs:'$pagination',
template: Template
}; | 4 | 0.065574 | 2 | 2 |
fa75c57f9d0e1bf0739cc80f4c68168748b25a73 | graphics/README.md | graphics/README.md | Install console `st`
# TODO
Configure `st` with the borrowed `URxvt` settings
```
URxvt.termName: rxvt-256color
URxvt.reverseVideo: True
URxvt.font: xft:monaco:size=18
URxvt.letterSpace: -1
```
| Install console `st`
| Remove configuration borrowing TODO, not even applicable | Remove configuration borrowing TODO, not even applicable
| Markdown | unlicense | Jim-Holmstroem/ArchLinux | markdown | ## Code Before:
Install console `st`
# TODO
Configure `st` with the borrowed `URxvt` settings
```
URxvt.termName: rxvt-256color
URxvt.reverseVideo: True
URxvt.font: xft:monaco:size=18
URxvt.letterSpace: -1
```
## Instruction:
Remove configuration borrowing TODO, not even applicable
## Code After:
Install console `st`
| Install console `st`
-
- # TODO
- Configure `st` with the borrowed `URxvt` settings
- ```
- URxvt.termName: rxvt-256color
- URxvt.reverseVideo: True
- URxvt.font: xft:monaco:size=18
- URxvt.letterSpace: -1
- ``` | 9 | 0.9 | 0 | 9 |
53ca61adb41a616864e78d14ee75db28a948f6de | .travis.yml | .travis.yml | language: php
php:
- 7.0
before_script:
- composer install
| language: php
php:
- 7.0
before_script:
- composer install
script:
- php tools/phpunit.phar -c phpunit.xml.dist
- tools/check-code-cov
| Use our own version of PHPUnit and check code coverage | Use our own version of PHPUnit and check code coverage
| YAML | mit | mihaeu/dephpend,mihaeu/dephpend | yaml | ## Code Before:
language: php
php:
- 7.0
before_script:
- composer install
## Instruction:
Use our own version of PHPUnit and check code coverage
## Code After:
language: php
php:
- 7.0
before_script:
- composer install
script:
- php tools/phpunit.phar -c phpunit.xml.dist
- tools/check-code-cov
| language: php
php:
- 7.0
before_script:
- composer install
+
+ script:
+ - php tools/phpunit.phar -c phpunit.xml.dist
+ - tools/check-code-cov
+ | 5 | 0.714286 | 5 | 0 |
35e3cb4850ea72b43f64dd5b207d4f3c4369ad74 | app/models/local_restriction.rb | app/models/local_restriction.rb | class LocalRestriction
attr_reader :gss_code
def initialize(gss_code)
@gss_code = gss_code
end
def all_restrictions
@all_restrictions ||= YAML.load_file(file_name)
end
def restriction
all_restrictions[gss_code] || {}
end
def file_name
"lib/local_restrictions/local-restrictions.yaml"
end
def area_name
restriction["name"]
end
def current_alert_level
current["alert_level"] if current.present?
end
def future_alert_level
future["alert_level"] if future.present?
end
def current
restrictions = restriction["restrictions"]
current_restrictions = restrictions.select do |rest|
start_date = Time.zone.parse("#{rest['start_date']} #{rest['start_time']}")
start_date.past?
end
current_restrictions.max_by { |rest| rest["start_date"] }
end
def future
restrictions = restriction["restrictions"]
future_restrictions = restrictions.select do |rest|
start_date = Time.zone.parse("#{rest['start_date']} #{rest['start_time']}")
start_date.future?
end
future_restrictions.min_by { |rest| rest["start_date"] }
end
end
| class LocalRestriction
attr_reader :gss_code
def initialize(gss_code)
@gss_code = gss_code
@time_zone = Time.find_zone("London")
end
def all_restrictions
@all_restrictions ||= YAML.load_file(file_name)
end
def restriction
all_restrictions[gss_code] || {}
end
def file_name
"lib/local_restrictions/local-restrictions.yaml"
end
def area_name
restriction["name"]
end
def current_alert_level
current["alert_level"] if current.present?
end
def future_alert_level
future["alert_level"] if future.present?
end
def current
restrictions = restriction["restrictions"]
current_restrictions = restrictions.select do |rest|
start_date = @time_zone.parse("#{rest['start_date']} #{rest['start_time']}")
start_date.past?
end
current_restrictions.max_by { |rest| rest["start_date"] }
end
def future
restrictions = restriction["restrictions"]
future_restrictions = restrictions.select do |rest|
start_date = @time_zone.parse("#{rest['start_date']} #{rest['start_time']}")
start_date.future?
end
future_restrictions.min_by { |rest| rest["start_date"] }
end
end
| Set time zone to London | Set time zone to London
Borrowed from: https://github.com/alphagov/content-publisher/commit/4ae1c4ed683bf0b24eb11d135aebd3cdd1a8ffa6
We need to make sure the alert level changes go out at the correct time.
The time zone on the server is incorrect, which means that when we're using
dates and times to set the level they're an hour out of date during daylight saving
time. This sets the Local restrictions time zone to 'London'.
We tried doing this at the app level, but it broke a lot of unrelated tests.
| Ruby | mit | alphagov/collections,alphagov/collections,alphagov/collections,alphagov/collections | ruby | ## Code Before:
class LocalRestriction
attr_reader :gss_code
def initialize(gss_code)
@gss_code = gss_code
end
def all_restrictions
@all_restrictions ||= YAML.load_file(file_name)
end
def restriction
all_restrictions[gss_code] || {}
end
def file_name
"lib/local_restrictions/local-restrictions.yaml"
end
def area_name
restriction["name"]
end
def current_alert_level
current["alert_level"] if current.present?
end
def future_alert_level
future["alert_level"] if future.present?
end
def current
restrictions = restriction["restrictions"]
current_restrictions = restrictions.select do |rest|
start_date = Time.zone.parse("#{rest['start_date']} #{rest['start_time']}")
start_date.past?
end
current_restrictions.max_by { |rest| rest["start_date"] }
end
def future
restrictions = restriction["restrictions"]
future_restrictions = restrictions.select do |rest|
start_date = Time.zone.parse("#{rest['start_date']} #{rest['start_time']}")
start_date.future?
end
future_restrictions.min_by { |rest| rest["start_date"] }
end
end
## Instruction:
Set time zone to London
Borrowed from: https://github.com/alphagov/content-publisher/commit/4ae1c4ed683bf0b24eb11d135aebd3cdd1a8ffa6
We need to make sure the alert level changes go out at the correct time.
The time zone on the server is incorrect, which means that when we're using
dates and times to set the level they're an hour out of date during daylight saving
time. This sets the Local restrictions time zone to 'London'.
We tried doing this at the app level, but it broke a lot of unrelated tests.
## Code After:
class LocalRestriction
attr_reader :gss_code
def initialize(gss_code)
@gss_code = gss_code
@time_zone = Time.find_zone("London")
end
def all_restrictions
@all_restrictions ||= YAML.load_file(file_name)
end
def restriction
all_restrictions[gss_code] || {}
end
def file_name
"lib/local_restrictions/local-restrictions.yaml"
end
def area_name
restriction["name"]
end
def current_alert_level
current["alert_level"] if current.present?
end
def future_alert_level
future["alert_level"] if future.present?
end
def current
restrictions = restriction["restrictions"]
current_restrictions = restrictions.select do |rest|
start_date = @time_zone.parse("#{rest['start_date']} #{rest['start_time']}")
start_date.past?
end
current_restrictions.max_by { |rest| rest["start_date"] }
end
def future
restrictions = restriction["restrictions"]
future_restrictions = restrictions.select do |rest|
start_date = @time_zone.parse("#{rest['start_date']} #{rest['start_time']}")
start_date.future?
end
future_restrictions.min_by { |rest| rest["start_date"] }
end
end
| class LocalRestriction
attr_reader :gss_code
def initialize(gss_code)
@gss_code = gss_code
+ @time_zone = Time.find_zone("London")
end
def all_restrictions
@all_restrictions ||= YAML.load_file(file_name)
end
def restriction
all_restrictions[gss_code] || {}
end
def file_name
"lib/local_restrictions/local-restrictions.yaml"
end
def area_name
restriction["name"]
end
def current_alert_level
current["alert_level"] if current.present?
end
def future_alert_level
future["alert_level"] if future.present?
end
def current
restrictions = restriction["restrictions"]
current_restrictions = restrictions.select do |rest|
- start_date = Time.zone.parse("#{rest['start_date']} #{rest['start_time']}")
? ^ ^
+ start_date = @time_zone.parse("#{rest['start_date']} #{rest['start_time']}")
? ^^ ^
start_date.past?
end
current_restrictions.max_by { |rest| rest["start_date"] }
end
def future
restrictions = restriction["restrictions"]
future_restrictions = restrictions.select do |rest|
- start_date = Time.zone.parse("#{rest['start_date']} #{rest['start_time']}")
? ^ ^
+ start_date = @time_zone.parse("#{rest['start_date']} #{rest['start_time']}")
? ^^ ^
start_date.future?
end
future_restrictions.min_by { |rest| rest["start_date"] }
end
end | 5 | 0.098039 | 3 | 2 |
b5473ae4a6634337adaa7a4b3db3ac48bccf27b8 | README.rst | README.rst | *WARNING*: Under active development
.. image:: https://travis-ci.org/trungdong/prov.svg
:target: https://travis-ci.org/trungdong/prov
.. image:: https://coveralls.io/repos/trungdong/prov/badge.png?branch=master
:target: https://coveralls.io/r/trungdong/prov?branch=master
This package provides an implementation of the `PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
It provides in-memory classes for PROV assertions and can be serialized into `PROV-JSON representation <http://www.w3.org/Submission/prov-json/>`_.
In addition, the `prov.model.graph` module exports PROV documents into graphical formats (e.g. PDF, PNG, SVG).
See `prov/model/test/examples.py <https://github.com/trungdong/prov/blob/master/prov/model/test/examples.py>`_ for example usages.
Deployment: The package was used to build `ProvStore <https://provenance.ecs.soton.ac.uk/store/>`_, a repository for provenance documents.
| *WARNING*: Under active development
.. image:: https://travis-ci.org/trungdong/prov.svg
:target: https://travis-ci.org/trungdong/prov
.. image:: https://coveralls.io/repos/trungdong/prov/badge.png?branch=master
:target: https://coveralls.io/r/trungdong/prov?branch=master
This package provides an implementation of the `PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
It provides in-memory classes for PROV assertions and can be serialized into `PROV-JSON representation <http://www.w3.org/Submission/prov-json/>`_.
In addition, the `prov.model.graph` module exports PROV documents into graphical formats (e.g. PDF, PNG, SVG).
Deployment: The package was used to build `ProvStore <https://provenance.ecs.soton.ac.uk/store/>`_, a repository for provenance documents.
| Remove broken usage example link | Remove broken usage example link | reStructuredText | mit | krischer/prov,trungdong/prov,krischer/prov | restructuredtext | ## Code Before:
*WARNING*: Under active development
.. image:: https://travis-ci.org/trungdong/prov.svg
:target: https://travis-ci.org/trungdong/prov
.. image:: https://coveralls.io/repos/trungdong/prov/badge.png?branch=master
:target: https://coveralls.io/r/trungdong/prov?branch=master
This package provides an implementation of the `PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
It provides in-memory classes for PROV assertions and can be serialized into `PROV-JSON representation <http://www.w3.org/Submission/prov-json/>`_.
In addition, the `prov.model.graph` module exports PROV documents into graphical formats (e.g. PDF, PNG, SVG).
See `prov/model/test/examples.py <https://github.com/trungdong/prov/blob/master/prov/model/test/examples.py>`_ for example usages.
Deployment: The package was used to build `ProvStore <https://provenance.ecs.soton.ac.uk/store/>`_, a repository for provenance documents.
## Instruction:
Remove broken usage example link
## Code After:
*WARNING*: Under active development
.. image:: https://travis-ci.org/trungdong/prov.svg
:target: https://travis-ci.org/trungdong/prov
.. image:: https://coveralls.io/repos/trungdong/prov/badge.png?branch=master
:target: https://coveralls.io/r/trungdong/prov?branch=master
This package provides an implementation of the `PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
It provides in-memory classes for PROV assertions and can be serialized into `PROV-JSON representation <http://www.w3.org/Submission/prov-json/>`_.
In addition, the `prov.model.graph` module exports PROV documents into graphical formats (e.g. PDF, PNG, SVG).
Deployment: The package was used to build `ProvStore <https://provenance.ecs.soton.ac.uk/store/>`_, a repository for provenance documents.
| *WARNING*: Under active development
.. image:: https://travis-ci.org/trungdong/prov.svg
:target: https://travis-ci.org/trungdong/prov
.. image:: https://coveralls.io/repos/trungdong/prov/badge.png?branch=master
:target: https://coveralls.io/r/trungdong/prov?branch=master
This package provides an implementation of the `PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
It provides in-memory classes for PROV assertions and can be serialized into `PROV-JSON representation <http://www.w3.org/Submission/prov-json/>`_.
In addition, the `prov.model.graph` module exports PROV documents into graphical formats (e.g. PDF, PNG, SVG).
- See `prov/model/test/examples.py <https://github.com/trungdong/prov/blob/master/prov/model/test/examples.py>`_ for example usages.
-
Deployment: The package was used to build `ProvStore <https://provenance.ecs.soton.ac.uk/store/>`_, a repository for provenance documents. | 2 | 0.133333 | 0 | 2 |
554ad5149aada2045ca2e1559791194eb439a99e | README.md | README.md | KijiSchema ${project.version}
=============================
KijiSchema is a layout and schema management layer on top of Apache
HBase. KijiSchema supports complex, compound data types using Avro
serialization, as well as cell-level evolving schemas that dynamically
encode version information.
KijiSchema includes both commandline tools and a simple Java API to
manipulate tables, layouts, and data. It also provide native MapReduce
Input/Output formats for Kiji tables.
For more information about KijiSchema, see
[the Kiji project homepage](http://www.kiji.org).
Compilation
-----------
KijiSchema requires [Apache Maven 3](http://maven.apache.org/download.html) to build. It
may be built with the command
mvn clean package
or by executing `bin/kiji` from the root of a checkout. This will create a release in the
target directory.
Installation
------------
KijiSchema requires an HBase and Hadoop cluster to run. Confirm that `$HADOOP_HOME` and
`$HBASE_HOME` are set appropriately. Then issue the following command from your KijiSchema
root directory:
bin/kiji install
This will install a Kiji instance on the hbase cluster named 'default'.
Usage
-----
For commandline tool usage, issue the command:
bin/kiji
Further documentation is available at the Kiji project
[Documentation Portal](http://docs.kiji.org)
| KijiSchema
==========
KijiSchema is a layout and schema management layer on top of Apache
HBase. KijiSchema supports complex, compound data types using Avro
serialization, as well as cell-level evolving schemas that dynamically
encode version information.
KijiSchema includes both commandline tools and a simple Java API to
manipulate tables, layouts, and data. It also provide native MapReduce
Input/Output formats for Kiji tables.
For more information about KijiSchema, see
[the Kiji project homepage](http://www.kiji.org).
Compilation
-----------
KijiSchema requires [Apache Maven 3](http://maven.apache.org/download.html) to build. It
may be built with the command
mvn clean package
or by executing `bin/kiji` from the root of a checkout. This will create a release in the
target directory.
Installation
------------
KijiSchema requires an HBase and Hadoop cluster to run. Confirm that `$HADOOP_HOME` and
`$HBASE_HOME` are set appropriately. Then issue the following command from your KijiSchema
root directory:
bin/kiji install
This will install a Kiji instance on the hbase cluster named 'default'.
Usage
-----
For commandline tool usage, issue the command:
bin/kiji
Further documentation is available at the Kiji project
[Documentation Portal](http://docs.kiji.org)
| Remove version number from readme. | Remove version number from readme.
| Markdown | apache-2.0 | iafek/kiji-base,kijiproject/kiji-schema,rpinzon/kiji-schema,rpinzon/kiji-schema,kijiproject/kiji-schema,iafek/kiji-base | markdown | ## Code Before:
KijiSchema ${project.version}
=============================
KijiSchema is a layout and schema management layer on top of Apache
HBase. KijiSchema supports complex, compound data types using Avro
serialization, as well as cell-level evolving schemas that dynamically
encode version information.
KijiSchema includes both commandline tools and a simple Java API to
manipulate tables, layouts, and data. It also provide native MapReduce
Input/Output formats for Kiji tables.
For more information about KijiSchema, see
[the Kiji project homepage](http://www.kiji.org).
Compilation
-----------
KijiSchema requires [Apache Maven 3](http://maven.apache.org/download.html) to build. It
may be built with the command
mvn clean package
or by executing `bin/kiji` from the root of a checkout. This will create a release in the
target directory.
Installation
------------
KijiSchema requires an HBase and Hadoop cluster to run. Confirm that `$HADOOP_HOME` and
`$HBASE_HOME` are set appropriately. Then issue the following command from your KijiSchema
root directory:
bin/kiji install
This will install a Kiji instance on the hbase cluster named 'default'.
Usage
-----
For commandline tool usage, issue the command:
bin/kiji
Further documentation is available at the Kiji project
[Documentation Portal](http://docs.kiji.org)
## Instruction:
Remove version number from readme.
## Code After:
KijiSchema
==========
KijiSchema is a layout and schema management layer on top of Apache
HBase. KijiSchema supports complex, compound data types using Avro
serialization, as well as cell-level evolving schemas that dynamically
encode version information.
KijiSchema includes both commandline tools and a simple Java API to
manipulate tables, layouts, and data. It also provide native MapReduce
Input/Output formats for Kiji tables.
For more information about KijiSchema, see
[the Kiji project homepage](http://www.kiji.org).
Compilation
-----------
KijiSchema requires [Apache Maven 3](http://maven.apache.org/download.html) to build. It
may be built with the command
mvn clean package
or by executing `bin/kiji` from the root of a checkout. This will create a release in the
target directory.
Installation
------------
KijiSchema requires an HBase and Hadoop cluster to run. Confirm that `$HADOOP_HOME` and
`$HBASE_HOME` are set appropriately. Then issue the following command from your KijiSchema
root directory:
bin/kiji install
This will install a Kiji instance on the hbase cluster named 'default'.
Usage
-----
For commandline tool usage, issue the command:
bin/kiji
Further documentation is available at the Kiji project
[Documentation Portal](http://docs.kiji.org)
| - KijiSchema ${project.version}
- =============================
+ KijiSchema
+ ==========
KijiSchema is a layout and schema management layer on top of Apache
HBase. KijiSchema supports complex, compound data types using Avro
serialization, as well as cell-level evolving schemas that dynamically
encode version information.
KijiSchema includes both commandline tools and a simple Java API to
manipulate tables, layouts, and data. It also provide native MapReduce
Input/Output formats for Kiji tables.
For more information about KijiSchema, see
[the Kiji project homepage](http://www.kiji.org).
Compilation
-----------
KijiSchema requires [Apache Maven 3](http://maven.apache.org/download.html) to build. It
may be built with the command
mvn clean package
or by executing `bin/kiji` from the root of a checkout. This will create a release in the
target directory.
Installation
------------
KijiSchema requires an HBase and Hadoop cluster to run. Confirm that `$HADOOP_HOME` and
`$HBASE_HOME` are set appropriately. Then issue the following command from your KijiSchema
root directory:
bin/kiji install
This will install a Kiji instance on the hbase cluster named 'default'.
Usage
-----
For commandline tool usage, issue the command:
bin/kiji
Further documentation is available at the Kiji project
[Documentation Portal](http://docs.kiji.org)
| 4 | 0.085106 | 2 | 2 |
67749477da51e2fc890853adafcb0bde8e612b40 | metadata/eu.tilk.cdlcplayer.yml | metadata/eu.tilk.cdlcplayer.yml | Categories:
- Games
License: GPL-3.0-or-later
AuthorName: Marek Materzok
AuthorEmail: tilk@tilk.eu
SourceCode: https://github.com/tilk/cdlc_player
IssueTracker: https://github.com/tilk/cdlc_player/issues
Name: CDLC Player
AutoName: CDLC Player
RepoType: git
Repo: https://github.com/tilk/cdlc_player.git
Builds:
- versionName: 0.0.5
versionCode: 5
commit: 0.0.5
subdir: app
sudo:
- apt-get update -y
- apt-get install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
CurrentVersion: 0.0.5
CurrentVersionCode: 5
| Categories:
- Games
License: GPL-3.0-or-later
AuthorName: Marek Materzok
AuthorEmail: tilk@tilk.eu
SourceCode: https://github.com/tilk/cdlc_player
IssueTracker: https://github.com/tilk/cdlc_player/issues
Name: CDLC Player
AutoName: CDLC Player
RepoType: git
Repo: https://github.com/tilk/cdlc_player.git
Builds:
- versionName: 0.0.5
versionCode: 5
commit: 0.0.5
subdir: app
sudo:
- apt-get update -y
- apt-get install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
- versionName: 0.0.6
versionCode: 6
commit: 05c8dfb4aec799eac26d1a9ee4fdccb10c29d788
subdir: app
sudo:
- apt-get update -y
- apt-get install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
CurrentVersion: 0.0.6
CurrentVersionCode: 6
| Update CDLC Player to 0.0.6 (6) | Update CDLC Player to 0.0.6 (6)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
Categories:
- Games
License: GPL-3.0-or-later
AuthorName: Marek Materzok
AuthorEmail: tilk@tilk.eu
SourceCode: https://github.com/tilk/cdlc_player
IssueTracker: https://github.com/tilk/cdlc_player/issues
Name: CDLC Player
AutoName: CDLC Player
RepoType: git
Repo: https://github.com/tilk/cdlc_player.git
Builds:
- versionName: 0.0.5
versionCode: 5
commit: 0.0.5
subdir: app
sudo:
- apt-get update -y
- apt-get install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
CurrentVersion: 0.0.5
CurrentVersionCode: 5
## Instruction:
Update CDLC Player to 0.0.6 (6)
## Code After:
Categories:
- Games
License: GPL-3.0-or-later
AuthorName: Marek Materzok
AuthorEmail: tilk@tilk.eu
SourceCode: https://github.com/tilk/cdlc_player
IssueTracker: https://github.com/tilk/cdlc_player/issues
Name: CDLC Player
AutoName: CDLC Player
RepoType: git
Repo: https://github.com/tilk/cdlc_player.git
Builds:
- versionName: 0.0.5
versionCode: 5
commit: 0.0.5
subdir: app
sudo:
- apt-get update -y
- apt-get install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
- versionName: 0.0.6
versionCode: 6
commit: 05c8dfb4aec799eac26d1a9ee4fdccb10c29d788
subdir: app
sudo:
- apt-get update -y
- apt-get install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
CurrentVersion: 0.0.6
CurrentVersionCode: 6
| Categories:
- Games
License: GPL-3.0-or-later
AuthorName: Marek Materzok
AuthorEmail: tilk@tilk.eu
SourceCode: https://github.com/tilk/cdlc_player
IssueTracker: https://github.com/tilk/cdlc_player/issues
Name: CDLC Player
AutoName: CDLC Player
RepoType: git
Repo: https://github.com/tilk/cdlc_player.git
Builds:
- versionName: 0.0.5
versionCode: 5
commit: 0.0.5
subdir: app
sudo:
- apt-get update -y
- apt-get install -y openjdk-11-jdk
- update-alternatives --auto java
gradle:
- yes
+ - versionName: 0.0.6
+ versionCode: 6
+ commit: 05c8dfb4aec799eac26d1a9ee4fdccb10c29d788
+ subdir: app
+ sudo:
+ - apt-get update -y
+ - apt-get install -y openjdk-11-jdk
+ - update-alternatives --auto java
+ gradle:
+ - yes
+
AutoUpdateMode: Version %v
UpdateCheckMode: Tags
- CurrentVersion: 0.0.5
? ^
+ CurrentVersion: 0.0.6
? ^
- CurrentVersionCode: 5
? ^
+ CurrentVersionCode: 6
? ^
| 15 | 0.5 | 13 | 2 |
55c72a5297244ba51fba5ebc5b71efc3001e0dd4 | otz/__init__.py | otz/__init__.py | from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
| from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
from otz.Beam import Beam, Bead
| Add Beam, Bead to main module | Add Beam, Bead to main module
| Python | unlicense | ghallsimpsons/optical_tweezers | python | ## Code Before:
from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
## Instruction:
Add Beam, Bead to main module
## Code After:
from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
from otz.Beam import Beam, Bead
| from otz.Timestream import CalibrationTimestream, CapturedTimestream
from otz.Calibration import Calibration
+ from otz.Beam import Beam, Bead | 1 | 0.5 | 1 | 0 |
769510b07ade17e8b284a69a516924a4b3dfd4db | brew.sh | brew.sh | brew update
# Upgrade any already-installed formulae.
brew upgrade
# Install packages
brew install git # System git it's ok, but we install this to get and load the git bash auto complete script
brew install bash-completion
brew install stow
# Install completions.
brew install docker-completion
brew install docker-compose-completion
# Install binary Caskroom 'casks'
## System Essentials
brew cask install itsycal
#brew cask install flux # Disabling this for now, as I've been using macOS native Night Shift
brew cask install skyfonts
brew cask install java # Meh.
## Other
brew cask install dropbox
brew cask install 1password
brew cask install google-chrome
brew cask install spotify
brew cask install spotify-notifications
brew cask install sublime-text
brew cask install docker
brew cask install sourcetree
brew cask install kitematic
brew cask install steam
brew cask install aluxian-messenger
brew cask install skype # Meh.
brew cask install typora
brew cask install duet
brew cask install cyberduck
brew cask install utorrent
brew cask install vlc
brew cask install keka
# Remove outdated versions from the cellar
brew cleanup
| brew update
# Upgrade any already-installed formulae.
brew upgrade
# Install packages
brew install git # System git it's ok, but we install this to get and load the git bash auto complete script
brew install bash-completion
brew install stow
# Install completions.
brew install docker-completion
brew install docker-compose-completion
# Install binary Caskroom 'casks'
## System Essentials
brew cask install itsycal
#brew cask install flux # Disabling this for now, as I've been using macOS native Night Shift
brew cask install skyfonts
brew cask install java # Meh.
## Other
brew cask install dropbox
brew cask install 1password
brew cask install google-chrome
brew cask install spotify
brew cask install spotify-notifications
brew cask install sublime-text
brew cask install docker
brew cask install sourcetree
brew cask install kitematic
brew cask install steam
brew cask install caprine
brew cask install skype # Meh.
brew cask install typora
brew cask install duet
brew cask install cyberduck
brew cask install utorrent
brew cask install vlc
brew cask install keka
# Remove outdated versions from the cellar
brew cleanup
| Replace facebook messenger with caprine | Replace facebook messenger with caprine
| Shell | mit | pedrosanta/dotfiles | shell | ## Code Before:
brew update
# Upgrade any already-installed formulae.
brew upgrade
# Install packages
brew install git # System git it's ok, but we install this to get and load the git bash auto complete script
brew install bash-completion
brew install stow
# Install completions.
brew install docker-completion
brew install docker-compose-completion
# Install binary Caskroom 'casks'
## System Essentials
brew cask install itsycal
#brew cask install flux # Disabling this for now, as I've been using macOS native Night Shift
brew cask install skyfonts
brew cask install java # Meh.
## Other
brew cask install dropbox
brew cask install 1password
brew cask install google-chrome
brew cask install spotify
brew cask install spotify-notifications
brew cask install sublime-text
brew cask install docker
brew cask install sourcetree
brew cask install kitematic
brew cask install steam
brew cask install aluxian-messenger
brew cask install skype # Meh.
brew cask install typora
brew cask install duet
brew cask install cyberduck
brew cask install utorrent
brew cask install vlc
brew cask install keka
# Remove outdated versions from the cellar
brew cleanup
## Instruction:
Replace facebook messenger with caprine
## Code After:
brew update
# Upgrade any already-installed formulae.
brew upgrade
# Install packages
brew install git # System git it's ok, but we install this to get and load the git bash auto complete script
brew install bash-completion
brew install stow
# Install completions.
brew install docker-completion
brew install docker-compose-completion
# Install binary Caskroom 'casks'
## System Essentials
brew cask install itsycal
#brew cask install flux # Disabling this for now, as I've been using macOS native Night Shift
brew cask install skyfonts
brew cask install java # Meh.
## Other
brew cask install dropbox
brew cask install 1password
brew cask install google-chrome
brew cask install spotify
brew cask install spotify-notifications
brew cask install sublime-text
brew cask install docker
brew cask install sourcetree
brew cask install kitematic
brew cask install steam
brew cask install caprine
brew cask install skype # Meh.
brew cask install typora
brew cask install duet
brew cask install cyberduck
brew cask install utorrent
brew cask install vlc
brew cask install keka
# Remove outdated versions from the cellar
brew cleanup
| brew update
# Upgrade any already-installed formulae.
brew upgrade
# Install packages
brew install git # System git it's ok, but we install this to get and load the git bash auto complete script
brew install bash-completion
brew install stow
# Install completions.
brew install docker-completion
brew install docker-compose-completion
# Install binary Caskroom 'casks'
## System Essentials
brew cask install itsycal
#brew cask install flux # Disabling this for now, as I've been using macOS native Night Shift
brew cask install skyfonts
brew cask install java # Meh.
## Other
brew cask install dropbox
brew cask install 1password
brew cask install google-chrome
brew cask install spotify
brew cask install spotify-notifications
brew cask install sublime-text
brew cask install docker
brew cask install sourcetree
brew cask install kitematic
brew cask install steam
- brew cask install aluxian-messenger
+ brew cask install caprine
brew cask install skype # Meh.
brew cask install typora
brew cask install duet
brew cask install cyberduck
brew cask install utorrent
brew cask install vlc
brew cask install keka
# Remove outdated versions from the cellar
brew cleanup | 2 | 0.047619 | 1 | 1 |
6f1042bbd5eae0aa99682ca1164f2ee24ae4c878 | tests/Feature/RegisterTest.php | tests/Feature/RegisterTest.php | <?php
namespace Tests\Feature;
use Tests\TestCase;
class RegisterTest extends TestCase
{
/** @test */
public function can_register()
{
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => 'test@test.app',
'password' => 'secret',
'password_confirmation' => 'secret',
])
->assertSuccessful()
->assertJsonStructure(['id', 'name', 'email']);
}
}
| <?php
namespace Tests\Feature;
use Tests\TestCase;
use App\User;
class RegisterTest extends TestCase
{
/** @test */
public function can_register()
{
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => 'test@test.app',
'password' => 'secret',
'password_confirmation' => 'secret',
])
->assertSuccessful()
->assertJsonStructure(['id', 'name', 'email']);
}
/** @test */
public function can_not_register_with_existing_email()
{
factory(User::class)->create(['email' => 'test@test.app']);
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => 'test@test.app',
'password' => 'secret',
'password_confirmation' => 'secret',
])
->assertStatus(422)
->assertJsonValidationErrors(['email']);
}
}
| Test register with existing email | Test register with existing email
Closes #140
| PHP | mit | cretueusebiu/laravel-vue-spa,cretueusebiu/laravel-vue-spa | php | ## Code Before:
<?php
namespace Tests\Feature;
use Tests\TestCase;
class RegisterTest extends TestCase
{
/** @test */
public function can_register()
{
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => 'test@test.app',
'password' => 'secret',
'password_confirmation' => 'secret',
])
->assertSuccessful()
->assertJsonStructure(['id', 'name', 'email']);
}
}
## Instruction:
Test register with existing email
Closes #140
## Code After:
<?php
namespace Tests\Feature;
use Tests\TestCase;
use App\User;
class RegisterTest extends TestCase
{
/** @test */
public function can_register()
{
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => 'test@test.app',
'password' => 'secret',
'password_confirmation' => 'secret',
])
->assertSuccessful()
->assertJsonStructure(['id', 'name', 'email']);
}
/** @test */
public function can_not_register_with_existing_email()
{
factory(User::class)->create(['email' => 'test@test.app']);
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => 'test@test.app',
'password' => 'secret',
'password_confirmation' => 'secret',
])
->assertStatus(422)
->assertJsonValidationErrors(['email']);
}
}
| <?php
namespace Tests\Feature;
use Tests\TestCase;
+
+ use App\User;
class RegisterTest extends TestCase
{
/** @test */
public function can_register()
{
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => 'test@test.app',
'password' => 'secret',
'password_confirmation' => 'secret',
])
->assertSuccessful()
->assertJsonStructure(['id', 'name', 'email']);
}
+
+ /** @test */
+ public function can_not_register_with_existing_email()
+ {
+ factory(User::class)->create(['email' => 'test@test.app']);
+
+ $this->postJson('/api/register', [
+ 'name' => 'Test User',
+ 'email' => 'test@test.app',
+ 'password' => 'secret',
+ 'password_confirmation' => 'secret',
+ ])
+ ->assertStatus(422)
+ ->assertJsonValidationErrors(['email']);
+ }
} | 17 | 0.809524 | 17 | 0 |
59e4ebe405e91d048e14a794f9f7b5bd24a6c8c8 | cookbooks/passenger/attributes/default.rb | cookbooks/passenger/attributes/default.rb | default[:passenger][:ruby_version] = "2.5"
default[:passenger][:max_pool_size] = 6
default[:passenger][:pool_idle_time] = 300
default[:passenger][:instance_registry_dir] = "/run/passenger"
default[:apt][:sources] = node[:apt][:sources] | ["passenger"]
| if node[:lsb][:release].to_f < 20.04
default[:passenger][:ruby_version] = "2.5"
else
default[:passenger][:ruby_version] = "2.7"
end
default[:passenger][:max_pool_size] = 6
default[:passenger][:pool_idle_time] = 300
default[:passenger][:instance_registry_dir] = "/run/passenger"
default[:apt][:sources] = node[:apt][:sources] | ["passenger"]
| Use ruby 2.7 on Ubuntu 20.04 | Use ruby 2.7 on Ubuntu 20.04
| Ruby | apache-2.0 | zerebubuth/openstreetmap-chef,zerebubuth/openstreetmap-chef,zerebubuth/openstreetmap-chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,openstreetmap/chef,openstreetmap/chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,openstreetmap/chef,zerebubuth/openstreetmap-chef,openstreetmap/chef,openstreetmap/chef,openstreetmap/chef,tomhughes/openstreetmap-chef,zerebubuth/openstreetmap-chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef,tomhughes/openstreetmap-chef | ruby | ## Code Before:
default[:passenger][:ruby_version] = "2.5"
default[:passenger][:max_pool_size] = 6
default[:passenger][:pool_idle_time] = 300
default[:passenger][:instance_registry_dir] = "/run/passenger"
default[:apt][:sources] = node[:apt][:sources] | ["passenger"]
## Instruction:
Use ruby 2.7 on Ubuntu 20.04
## Code After:
if node[:lsb][:release].to_f < 20.04
default[:passenger][:ruby_version] = "2.5"
else
default[:passenger][:ruby_version] = "2.7"
end
default[:passenger][:max_pool_size] = 6
default[:passenger][:pool_idle_time] = 300
default[:passenger][:instance_registry_dir] = "/run/passenger"
default[:apt][:sources] = node[:apt][:sources] | ["passenger"]
| + if node[:lsb][:release].to_f < 20.04
- default[:passenger][:ruby_version] = "2.5"
+ default[:passenger][:ruby_version] = "2.5"
? ++
+ else
+ default[:passenger][:ruby_version] = "2.7"
+ end
+
default[:passenger][:max_pool_size] = 6
default[:passenger][:pool_idle_time] = 300
default[:passenger][:instance_registry_dir] = "/run/passenger"
default[:apt][:sources] = node[:apt][:sources] | ["passenger"] | 7 | 1.166667 | 6 | 1 |
073ece91b951291435391d3f5626f1ee957ee9e2 | _includes/js_samples/Ink_UI_ImageQuery_1.html | _includes/js_samples/Ink_UI_ImageQuery_1.html | <h2 class="fw-300">Basic usage</h2>
<p>To see this component in action, resize your browser window or look at this page on mobile.</p>
<p>ImageQuery will swap the image with a lower (or higher) resolution image as you resize.</p>
{% capture example_code %}
<div class="imageQueryExample column-group vspace">
<img src="/assets/img/examples/small/park.jpg" />
</div>
<script type="text/javascript">
Ink.requireModules( ['Ink.Dom.Selector_1', 'Ink.UI.ImageQuery_1'], function( Selector, ImageQuery ){
var imageQueryElement = Ink.s('.imageQueryExample img');
var imageQueryObj = new ImageQuery('.imageQueryExample img',{
src: '/assets/img/examples/{:label}/park.jpg',
queries: [
{
label: 'small',
width: 480
},
{
label: 'medium',
width: 640
},
{
label: 'large',
width: 1024
}
]
});
} );
</script>
{% endcapture %}
{{ example_code }}
<p class="example-title">Code</p>
{% highlight html %}
{{ example_code }}
{% endhighlight %}
| <h2 class="fw-300">Basic usage</h2>
<p>To see this component in action, resize your browser window or look at this page on a small device.</p>
<p>ImageQuery will swap the image with a lower (or higher) resolution image as you resize.</p>
{% capture example_code %}
<div class="imageQueryExample column-group vspace">
<img src="/assets/img/examples/small/park.jpg" />
</div>
<script type="text/javascript">
Ink.requireModules( ['Ink.Dom.Selector_1', 'Ink.UI.ImageQuery_1'], function( Selector, ImageQuery ){
var imageQueryObj = new ImageQuery('.imageQueryExample img',{
src: '/assets/img/examples/{:label}/park.jpg',
queries: [
{
label: 'small',
width: 480
},
{
label: 'medium',
width: 640
},
{
label: 'large',
width: 1024
}
]
});
} );
</script>
{% endcapture %}
{{ example_code }}
<p class="example-title">Code</p>
{% highlight html %}
{{ example_code }}
{% endhighlight %}
| Fix bad copy, unused variable | Fix bad copy, unused variable
| HTML | mit | sapo/Ink-doc,sapo/Ink-doc,sapo/Ink-doc | html | ## Code Before:
<h2 class="fw-300">Basic usage</h2>
<p>To see this component in action, resize your browser window or look at this page on mobile.</p>
<p>ImageQuery will swap the image with a lower (or higher) resolution image as you resize.</p>
{% capture example_code %}
<div class="imageQueryExample column-group vspace">
<img src="/assets/img/examples/small/park.jpg" />
</div>
<script type="text/javascript">
Ink.requireModules( ['Ink.Dom.Selector_1', 'Ink.UI.ImageQuery_1'], function( Selector, ImageQuery ){
var imageQueryElement = Ink.s('.imageQueryExample img');
var imageQueryObj = new ImageQuery('.imageQueryExample img',{
src: '/assets/img/examples/{:label}/park.jpg',
queries: [
{
label: 'small',
width: 480
},
{
label: 'medium',
width: 640
},
{
label: 'large',
width: 1024
}
]
});
} );
</script>
{% endcapture %}
{{ example_code }}
<p class="example-title">Code</p>
{% highlight html %}
{{ example_code }}
{% endhighlight %}
## Instruction:
Fix bad copy, unused variable
## Code After:
<h2 class="fw-300">Basic usage</h2>
<p>To see this component in action, resize your browser window or look at this page on a small device.</p>
<p>ImageQuery will swap the image with a lower (or higher) resolution image as you resize.</p>
{% capture example_code %}
<div class="imageQueryExample column-group vspace">
<img src="/assets/img/examples/small/park.jpg" />
</div>
<script type="text/javascript">
Ink.requireModules( ['Ink.Dom.Selector_1', 'Ink.UI.ImageQuery_1'], function( Selector, ImageQuery ){
var imageQueryObj = new ImageQuery('.imageQueryExample img',{
src: '/assets/img/examples/{:label}/park.jpg',
queries: [
{
label: 'small',
width: 480
},
{
label: 'medium',
width: 640
},
{
label: 'large',
width: 1024
}
]
});
} );
</script>
{% endcapture %}
{{ example_code }}
<p class="example-title">Code</p>
{% highlight html %}
{{ example_code }}
{% endhighlight %}
| <h2 class="fw-300">Basic usage</h2>
- <p>To see this component in action, resize your browser window or look at this page on mobile.</p>
? ^^ ^
+ <p>To see this component in action, resize your browser window or look at this page on a small device.</p>
? +++ ^^^^^^^ ^
<p>ImageQuery will swap the image with a lower (or higher) resolution image as you resize.</p>
{% capture example_code %}
<div class="imageQueryExample column-group vspace">
<img src="/assets/img/examples/small/park.jpg" />
</div>
<script type="text/javascript">
Ink.requireModules( ['Ink.Dom.Selector_1', 'Ink.UI.ImageQuery_1'], function( Selector, ImageQuery ){
- var imageQueryElement = Ink.s('.imageQueryExample img');
var imageQueryObj = new ImageQuery('.imageQueryExample img',{
src: '/assets/img/examples/{:label}/park.jpg',
queries: [
{
label: 'small',
width: 480
},
{
label: 'medium',
width: 640
},
{
label: 'large',
width: 1024
}
]
});
} );
</script>
{% endcapture %}
{{ example_code }}
<p class="example-title">Code</p>
{% highlight html %}
{{ example_code }}
{% endhighlight %}
| 3 | 0.076923 | 1 | 2 |
3d9880d5f52c4c37e3b658abc607a13f3c3d9545 | examples/CMakeLists.txt | examples/CMakeLists.txt | cmake_minimum_required(VERSION 2.8)
project(AnisotropicDiffusionLBR_Examples)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
add_executable(CoherenceEnhancingDiffusion
CoherenceEnhancingDiffusion.cxx)
target_link_libraries(CoherenceEnhancingDiffusion
${ITK_LIBRARIES})
enable_testing()
find_path(INPUT_DATA_DIR
NAMES PacMan.png
HINTS ${ITK_DIR}/ExternalData/Modules/Remote/AnisotropicDiffusionLBR/test/Input
${ITK_DIR}/ExternalData/Modules/External/AnisotropicDiffusionLBR/test/Input
)
set(TEST_OUTPUT_DIR ${AnisotropicDiffusionLBR_Examples_BINARY_DIR}/Testing/Temporary)
if(INPUT_DATA_DIR)
add_test(NAME CoherenceEnhancingDiffusionTest
COMMAND CoherenceEnhancingDiffusion ${INPUT_DATA_DIR}/PacMan.png
${TEST_OUTPUT_DIR}/PacManFiltered.png
20 0.05 cCED 3)
endif()
| cmake_minimum_required(VERSION 2.8)
project(AnisotropicDiffusionLBR_Examples)
find_package(ITK REQUIRED
COMPONENTS
AnisotropicDiffusionLBR
ITKIOPNG
)
include(${ITK_USE_FILE})
add_executable(CoherenceEnhancingDiffusion
CoherenceEnhancingDiffusion.cxx)
target_link_libraries(CoherenceEnhancingDiffusion
${ITK_LIBRARIES})
enable_testing()
find_path(INPUT_DATA_DIR
NAMES PacMan.png
HINTS ${ITK_DIR}/ExternalData/Modules/Remote/AnisotropicDiffusionLBR/test/Input
${ITK_DIR}/ExternalData/Modules/External/AnisotropicDiffusionLBR/test/Input
)
set(TEST_OUTPUT_DIR ${AnisotropicDiffusionLBR_Examples_BINARY_DIR}/Testing/Temporary)
if(INPUT_DATA_DIR)
add_test(NAME CoherenceEnhancingDiffusionTest
COMMAND CoherenceEnhancingDiffusion ${INPUT_DATA_DIR}/PacMan.png
${TEST_OUTPUT_DIR}/PacManFiltered.png
20 0.05 cCED 3)
endif()
| Add missing COMPONENTS to find_package example call | COMP: Add missing COMPONENTS to find_package example call
We need to explicitly specify the module in the COMPONENTS argument to
find_package(ITK when it is a remote module.
Addresses:
Cannot open include file: 'CoherenceEnhancingDiffusionFilter.h'
| Text | apache-2.0 | InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR,InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR,InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR | text | ## Code Before:
cmake_minimum_required(VERSION 2.8)
project(AnisotropicDiffusionLBR_Examples)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
add_executable(CoherenceEnhancingDiffusion
CoherenceEnhancingDiffusion.cxx)
target_link_libraries(CoherenceEnhancingDiffusion
${ITK_LIBRARIES})
enable_testing()
find_path(INPUT_DATA_DIR
NAMES PacMan.png
HINTS ${ITK_DIR}/ExternalData/Modules/Remote/AnisotropicDiffusionLBR/test/Input
${ITK_DIR}/ExternalData/Modules/External/AnisotropicDiffusionLBR/test/Input
)
set(TEST_OUTPUT_DIR ${AnisotropicDiffusionLBR_Examples_BINARY_DIR}/Testing/Temporary)
if(INPUT_DATA_DIR)
add_test(NAME CoherenceEnhancingDiffusionTest
COMMAND CoherenceEnhancingDiffusion ${INPUT_DATA_DIR}/PacMan.png
${TEST_OUTPUT_DIR}/PacManFiltered.png
20 0.05 cCED 3)
endif()
## Instruction:
COMP: Add missing COMPONENTS to find_package example call
We need to explicitly specify the module in the COMPONENTS argument to
find_package(ITK when it is a remote module.
Addresses:
Cannot open include file: 'CoherenceEnhancingDiffusionFilter.h'
## Code After:
cmake_minimum_required(VERSION 2.8)
project(AnisotropicDiffusionLBR_Examples)
find_package(ITK REQUIRED
COMPONENTS
AnisotropicDiffusionLBR
ITKIOPNG
)
include(${ITK_USE_FILE})
add_executable(CoherenceEnhancingDiffusion
CoherenceEnhancingDiffusion.cxx)
target_link_libraries(CoherenceEnhancingDiffusion
${ITK_LIBRARIES})
enable_testing()
find_path(INPUT_DATA_DIR
NAMES PacMan.png
HINTS ${ITK_DIR}/ExternalData/Modules/Remote/AnisotropicDiffusionLBR/test/Input
${ITK_DIR}/ExternalData/Modules/External/AnisotropicDiffusionLBR/test/Input
)
set(TEST_OUTPUT_DIR ${AnisotropicDiffusionLBR_Examples_BINARY_DIR}/Testing/Temporary)
if(INPUT_DATA_DIR)
add_test(NAME CoherenceEnhancingDiffusionTest
COMMAND CoherenceEnhancingDiffusion ${INPUT_DATA_DIR}/PacMan.png
${TEST_OUTPUT_DIR}/PacManFiltered.png
20 0.05 cCED 3)
endif()
| cmake_minimum_required(VERSION 2.8)
project(AnisotropicDiffusionLBR_Examples)
- find_package(ITK REQUIRED)
? -
+ find_package(ITK REQUIRED
+ COMPONENTS
+ AnisotropicDiffusionLBR
+ ITKIOPNG
+ )
include(${ITK_USE_FILE})
add_executable(CoherenceEnhancingDiffusion
CoherenceEnhancingDiffusion.cxx)
target_link_libraries(CoherenceEnhancingDiffusion
${ITK_LIBRARIES})
enable_testing()
find_path(INPUT_DATA_DIR
NAMES PacMan.png
HINTS ${ITK_DIR}/ExternalData/Modules/Remote/AnisotropicDiffusionLBR/test/Input
${ITK_DIR}/ExternalData/Modules/External/AnisotropicDiffusionLBR/test/Input
)
set(TEST_OUTPUT_DIR ${AnisotropicDiffusionLBR_Examples_BINARY_DIR}/Testing/Temporary)
if(INPUT_DATA_DIR)
add_test(NAME CoherenceEnhancingDiffusionTest
COMMAND CoherenceEnhancingDiffusion ${INPUT_DATA_DIR}/PacMan.png
${TEST_OUTPUT_DIR}/PacManFiltered.png
20 0.05 cCED 3)
endif() | 6 | 0.206897 | 5 | 1 |
259e196bb08d61c1e78b0666eca79aaa5f8f60e5 | src/test/java/com/github/ansell/csvsum/CSVSummariserTest.java | src/test/java/com/github/ansell/csvsum/CSVSummariserTest.java | /**
*
*/
package com.github.ansell.csvsum;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import joptsimple.OptionException;
/**
* Tests for {@link CSVSummariser}.
*
* @author Peter Ansell p_ansell@yahoo.com
*/
public class CSVSummariserTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
/**
* Test method for
* {@link com.github.ansell.csvsum.CSVSummariser#main(java.lang.String[])}.
*/
@Test
public final void testMainNoArgs() throws Exception {
thrown.expect(OptionException.class);
CSVSummariser.main();
}
}
| /**
*
*/
package com.github.ansell.csvsum;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import joptsimple.OptionException;
/**
* Tests for {@link CSVSummariser}.
*
* @author Peter Ansell p_ansell@yahoo.com
*/
public class CSVSummariserTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
/**
* Test method for
* {@link com.github.ansell.csvsum.CSVSummariser#main(java.lang.String[])}.
*/
@Test
public final void testMainNoArgs() throws Exception {
thrown.expect(OptionException.class);
CSVSummariser.main();
}
/**
* Test method for
* {@link com.github.ansell.csvsum.CSVSummariser#main(java.lang.String[])}.
*/
@Test
public final void testMainHelp() throws Exception {
CSVSummariser.main("--help");
}
}
| Add test for CSVSummariser help | Add test for CSVSummariser help | Java | bsd-2-clause | ansell/csvsum,ansell/csvsum | java | ## Code Before:
/**
*
*/
package com.github.ansell.csvsum;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import joptsimple.OptionException;
/**
* Tests for {@link CSVSummariser}.
*
* @author Peter Ansell p_ansell@yahoo.com
*/
public class CSVSummariserTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
/**
* Test method for
* {@link com.github.ansell.csvsum.CSVSummariser#main(java.lang.String[])}.
*/
@Test
public final void testMainNoArgs() throws Exception {
thrown.expect(OptionException.class);
CSVSummariser.main();
}
}
## Instruction:
Add test for CSVSummariser help
## Code After:
/**
*
*/
package com.github.ansell.csvsum;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import joptsimple.OptionException;
/**
* Tests for {@link CSVSummariser}.
*
* @author Peter Ansell p_ansell@yahoo.com
*/
public class CSVSummariserTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
/**
* Test method for
* {@link com.github.ansell.csvsum.CSVSummariser#main(java.lang.String[])}.
*/
@Test
public final void testMainNoArgs() throws Exception {
thrown.expect(OptionException.class);
CSVSummariser.main();
}
/**
* Test method for
* {@link com.github.ansell.csvsum.CSVSummariser#main(java.lang.String[])}.
*/
@Test
public final void testMainHelp() throws Exception {
CSVSummariser.main("--help");
}
}
| /**
*
*/
package com.github.ansell.csvsum;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import joptsimple.OptionException;
/**
* Tests for {@link CSVSummariser}.
*
* @author Peter Ansell p_ansell@yahoo.com
*/
public class CSVSummariserTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
/**
* Test method for
* {@link com.github.ansell.csvsum.CSVSummariser#main(java.lang.String[])}.
*/
@Test
public final void testMainNoArgs() throws Exception {
thrown.expect(OptionException.class);
CSVSummariser.main();
}
+ /**
+ * Test method for
+ * {@link com.github.ansell.csvsum.CSVSummariser#main(java.lang.String[])}.
+ */
+ @Test
+ public final void testMainHelp() throws Exception {
+ CSVSummariser.main("--help");
+ }
+
} | 9 | 0.25 | 9 | 0 |
d5be8bc034ba0fab519cac6b448c1a39f5ba6038 | .travis.yml | .travis.yml |
language: python
python:
- "3.5"
- "3.6"
install:
- pip install sympy sphinx
script:
- cd docs && make travis
|
language: python
python:
#- "3.5" # with this version we have some broken doctests
- "3.6"
install:
- pip install sympy sphinx
script:
- cd docs && make travis
| Remove Python 3.5 from Travis CI. | Remove Python 3.5 from Travis CI.
| YAML | mit | massimo-nocentini/simulation-methods,massimo-nocentini/simulation-methods | yaml | ## Code Before:
language: python
python:
- "3.5"
- "3.6"
install:
- pip install sympy sphinx
script:
- cd docs && make travis
## Instruction:
Remove Python 3.5 from Travis CI.
## Code After:
language: python
python:
#- "3.5" # with this version we have some broken doctests
- "3.6"
install:
- pip install sympy sphinx
script:
- cd docs && make travis
|
language: python
python:
- - "3.5"
+ #- "3.5" # with this version we have some broken doctests
- "3.6"
install:
- pip install sympy sphinx
script:
- cd docs && make travis | 2 | 0.166667 | 1 | 1 |
adf1ac0dda877fce7bf0a03e7aff47027eae2104 | lib/chef-dk/skeletons/code_generator/files/default/repo/README.md | lib/chef-dk/skeletons/code_generator/files/default/repo/README.md |
Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code.
While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code.
# Repository Directories
This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
- `cookbooks/` - Cookbooks you download or create.
- `data_bags/` - Store data bags and items in .json in the repository.
- `roles/` - Store roles in .rb or .json in the repository.
- `environments/` - Store environments in .rb or .json in the repository.
# Configuration
The config file, `.chef/knife.rb` is a repository specific configuration file for knife. If you're using the Chef Platform, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
<https://docs.chef.io/knife.html>
# Next Steps
Read the README file in each of the subdirectories for more information about what goes in those directories.
|
Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code.
While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code.
# Repository Directories
This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
- `cookbooks/` - Cookbooks you download or create.
- `data_bags/` - Store data bags and items in .json in the repository.
- `roles/` - Store roles in .rb or .json in the repository.
- `environments/` - Store environments in .rb or .json in the repository.
# Configuration
The config file, `.chef/config.rb` is a repository specific configuration file for knife. If you're using the Chef Platform, you can download one for your organization from the management console. You can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
<https://docs.chef.io/knife.html>
# Next Steps
Read the README file in each of the subdirectories for more information about what goes in those directories.
| Update our recommendation for configuring knife | Update our recommendation for configuring knife
knife.rb is the old config
There's no need to mention open source chef server. That's a 2014 thing.
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
| Markdown | apache-2.0 | chef/chef-dk,chef/chef-dk,chef/chef-dk | markdown | ## Code Before:
Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code.
While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code.
# Repository Directories
This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
- `cookbooks/` - Cookbooks you download or create.
- `data_bags/` - Store data bags and items in .json in the repository.
- `roles/` - Store roles in .rb or .json in the repository.
- `environments/` - Store environments in .rb or .json in the repository.
# Configuration
The config file, `.chef/knife.rb` is a repository specific configuration file for knife. If you're using the Chef Platform, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
<https://docs.chef.io/knife.html>
# Next Steps
Read the README file in each of the subdirectories for more information about what goes in those directories.
## Instruction:
Update our recommendation for configuring knife
knife.rb is the old config
There's no need to mention open source chef server. That's a 2014 thing.
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
## Code After:
Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code.
While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code.
# Repository Directories
This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
- `cookbooks/` - Cookbooks you download or create.
- `data_bags/` - Store data bags and items in .json in the repository.
- `roles/` - Store roles in .rb or .json in the repository.
- `environments/` - Store environments in .rb or .json in the repository.
# Configuration
The config file, `.chef/config.rb` is a repository specific configuration file for knife. If you're using the Chef Platform, you can download one for your organization from the management console. You can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
<https://docs.chef.io/knife.html>
# Next Steps
Read the README file in each of the subdirectories for more information about what goes in those directories.
|
Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code.
While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code.
# Repository Directories
This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
- `cookbooks/` - Cookbooks you download or create.
- `data_bags/` - Store data bags and items in .json in the repository.
- `roles/` - Store roles in .rb or .json in the repository.
- `environments/` - Store environments in .rb or .json in the repository.
# Configuration
- The config file, `.chef/knife.rb` is a repository specific configuration file for knife. If you're using the Chef Platform, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
? ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ The config file, `.chef/config.rb` is a repository specific configuration file for knife. If you're using the Chef Platform, you can download one for your organization from the management console. You can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
? ^^^^^^ ^
<https://docs.chef.io/knife.html>
# Next Steps
Read the README file in each of the subdirectories for more information about what goes in those directories. | 2 | 0.086957 | 1 | 1 |
688cae2d05c77703be1f6885035c174bfe6f6559 | views/partials/forms/checkbox-radio.handlebars | views/partials/forms/checkbox-radio.handlebars | <form class="pure-form">
<label class="pure-checkbox">
<input type="checkbox" value="">
Here's option one.
</label>
<label class="pure-radio">
<input type="radio" name="optionsRadios" value="option1" checked>
Here's a radio button. You can choose this one..
</label>
<label class="pure-radio">
<input type="radio" name="optionsRadios" value="option2">
..Or this one!
</label>
</form>
| <form class="pure-form">
<label for="{{id 'option-one'}}" class="pure-checkbox">
<input id="{{id 'option-one'}}" type="checkbox" value="">
Here's option one.
</label>
<label for="{{id 'option-two'}}" class="pure-radio">
<input id="{{id 'option-two'}}" type="radio" name="optionsRadios" value="option1" checked>
Here's a radio button. You can choose this one..
</label>
<label for="{{id 'option-three'}}" class="pure-radio">
<input id="{{id 'option-three'}}" type="radio" name="optionsRadios" value="option2">
..Or this one!
</label>
</form>
| Revert "Remove optional for attributes on input labels" | Revert "Remove optional for attributes on input labels"
This reverts commit e5f456fcc7ea6257c602d58485672a056393f0ba.
| Handlebars | bsd-3-clause | yahoo/pure-site,weigang992003/pure-css-chinese,jamesalley/pure-site,pandoraui/pure-site,chensy0203/pure-site,weigang992003/pure-css-chinese,yahoo/pure-site,jamesalley/pure-site | handlebars | ## Code Before:
<form class="pure-form">
<label class="pure-checkbox">
<input type="checkbox" value="">
Here's option one.
</label>
<label class="pure-radio">
<input type="radio" name="optionsRadios" value="option1" checked>
Here's a radio button. You can choose this one..
</label>
<label class="pure-radio">
<input type="radio" name="optionsRadios" value="option2">
..Or this one!
</label>
</form>
## Instruction:
Revert "Remove optional for attributes on input labels"
This reverts commit e5f456fcc7ea6257c602d58485672a056393f0ba.
## Code After:
<form class="pure-form">
<label for="{{id 'option-one'}}" class="pure-checkbox">
<input id="{{id 'option-one'}}" type="checkbox" value="">
Here's option one.
</label>
<label for="{{id 'option-two'}}" class="pure-radio">
<input id="{{id 'option-two'}}" type="radio" name="optionsRadios" value="option1" checked>
Here's a radio button. You can choose this one..
</label>
<label for="{{id 'option-three'}}" class="pure-radio">
<input id="{{id 'option-three'}}" type="radio" name="optionsRadios" value="option2">
..Or this one!
</label>
</form>
| <form class="pure-form">
- <label class="pure-checkbox">
+ <label for="{{id 'option-one'}}" class="pure-checkbox">
- <input type="checkbox" value="">
+ <input id="{{id 'option-one'}}" type="checkbox" value="">
? +++++++++++++++++++++++++
Here's option one.
</label>
- <label class="pure-radio">
+ <label for="{{id 'option-two'}}" class="pure-radio">
- <input type="radio" name="optionsRadios" value="option1" checked>
+ <input id="{{id 'option-two'}}" type="radio" name="optionsRadios" value="option1" checked>
? +++++++++++++++++++++++++
Here's a radio button. You can choose this one..
</label>
- <label class="pure-radio">
+ <label for="{{id 'option-three'}}" class="pure-radio">
- <input type="radio" name="optionsRadios" value="option2">
+ <input id="{{id 'option-three'}}" type="radio" name="optionsRadios" value="option2">
? +++++++++++++++++++++++++++
..Or this one!
</label>
</form> | 12 | 0.75 | 6 | 6 |
49b8dc12333396b83f62e48b61701eb25629e55d | app/views/books/index.html.haml | app/views/books/index.html.haml | %p#notice= notice
%h1 Listing Books
%table
%thead
%tr
%th Title
%th Content
%th User
%th(colspan=3)
%tbody
- @books.each do |book|
%tr
%td= book.title
%td= book.content
%td= book.user.name
%td= link_to 'Show', book
%td= link_to 'Edit', edit_book_path(book)
%td= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' }
%br
#{link_to 'New Book', new_book_path}
| %p#notice= notice
%h1 Listing Books
%table
%thead
%tr
%th Title
%th User
%th(colspan=3)
%tbody
- @books.each do |book|
%tr
%td= book.title
%td= book.user.name
%td= link_to 'Show', book
%td= link_to 'Edit', edit_book_path(book)
%td= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' }
%br
#{link_to 'New Book', new_book_path}
| Remove book content from index | Remove book content from index
| Haml | mit | kyletolle/marketdown,kyletolle/marketdown,kyletolle/marketdown | haml | ## Code Before:
%p#notice= notice
%h1 Listing Books
%table
%thead
%tr
%th Title
%th Content
%th User
%th(colspan=3)
%tbody
- @books.each do |book|
%tr
%td= book.title
%td= book.content
%td= book.user.name
%td= link_to 'Show', book
%td= link_to 'Edit', edit_book_path(book)
%td= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' }
%br
#{link_to 'New Book', new_book_path}
## Instruction:
Remove book content from index
## Code After:
%p#notice= notice
%h1 Listing Books
%table
%thead
%tr
%th Title
%th User
%th(colspan=3)
%tbody
- @books.each do |book|
%tr
%td= book.title
%td= book.user.name
%td= link_to 'Show', book
%td= link_to 'Edit', edit_book_path(book)
%td= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' }
%br
#{link_to 'New Book', new_book_path}
| %p#notice= notice
%h1 Listing Books
%table
%thead
%tr
%th Title
- %th Content
%th User
%th(colspan=3)
%tbody
- @books.each do |book|
%tr
%td= book.title
- %td= book.content
%td= book.user.name
%td= link_to 'Show', book
%td= link_to 'Edit', edit_book_path(book)
%td= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' }
%br
#{link_to 'New Book', new_book_path} | 2 | 0.08 | 0 | 2 |
7c637e02a10a8abd21d74644d04f6876d5f29f49 | README.markdown | README.markdown | As of this writing, PyPy isn't supported by virtualenv, fiddling with both,
I found a way to use them together and made this script to simplify it for
other developers. Supports Linux and (experimentally) OS X.
workon myenv
easy_install pypyenv
pypyenv install # Tries to install PyPy with JIT
pypyenv --nojit install # Forces non-JIT installation
pypyenv uninstall # Uninstalls PyPy from virtualenv
pypyenv will create a `pypy` executable in your virtualenv's `bin` folder,
but will not change your current `python` executable by default. If you want
to use PyPy exclusively in your virtualenv, do the following:
cd path/to/my/env
cd bin
mv python python.bak
ln -s pypy python
Good luck!
| As of this writing, PyPy isn't supported by virtualenv, fiddling with both,
I found a way to use them together and made this script to simplify it for
other developers. Supports Linux and (experimentally) OS X.
source myenv/bin/activate
easy_install pypyenv
pypyenv install # Tries to install PyPy with JIT
pypyenv --nojit install # Forces non-JIT installation
pypyenv uninstall # Uninstalls PyPy from virtualenv
pypyenv will create a `pypy` executable in your virtualenv's `bin` folder,
but will not change your current `python` executable by default. If you want
to use PyPy exclusively in your virtualenv, do the following:
cd path/to/my/env
cd bin
mv python python.bak
ln -s pypy python
Good luck!
| Replace 'workon' (a virualenvwrapper command) with virtualenv's own command. | Replace 'workon' (a virualenvwrapper command) with virtualenv's own command.
| Markdown | mit | boronine/pypyenv | markdown | ## Code Before:
As of this writing, PyPy isn't supported by virtualenv, fiddling with both,
I found a way to use them together and made this script to simplify it for
other developers. Supports Linux and (experimentally) OS X.
workon myenv
easy_install pypyenv
pypyenv install # Tries to install PyPy with JIT
pypyenv --nojit install # Forces non-JIT installation
pypyenv uninstall # Uninstalls PyPy from virtualenv
pypyenv will create a `pypy` executable in your virtualenv's `bin` folder,
but will not change your current `python` executable by default. If you want
to use PyPy exclusively in your virtualenv, do the following:
cd path/to/my/env
cd bin
mv python python.bak
ln -s pypy python
Good luck!
## Instruction:
Replace 'workon' (a virualenvwrapper command) with virtualenv's own command.
## Code After:
As of this writing, PyPy isn't supported by virtualenv, fiddling with both,
I found a way to use them together and made this script to simplify it for
other developers. Supports Linux and (experimentally) OS X.
source myenv/bin/activate
easy_install pypyenv
pypyenv install # Tries to install PyPy with JIT
pypyenv --nojit install # Forces non-JIT installation
pypyenv uninstall # Uninstalls PyPy from virtualenv
pypyenv will create a `pypy` executable in your virtualenv's `bin` folder,
but will not change your current `python` executable by default. If you want
to use PyPy exclusively in your virtualenv, do the following:
cd path/to/my/env
cd bin
mv python python.bak
ln -s pypy python
Good luck!
| As of this writing, PyPy isn't supported by virtualenv, fiddling with both,
I found a way to use them together and made this script to simplify it for
other developers. Supports Linux and (experimentally) OS X.
- workon myenv
+ source myenv/bin/activate
easy_install pypyenv
pypyenv install # Tries to install PyPy with JIT
pypyenv --nojit install # Forces non-JIT installation
pypyenv uninstall # Uninstalls PyPy from virtualenv
pypyenv will create a `pypy` executable in your virtualenv's `bin` folder,
but will not change your current `python` executable by default. If you want
to use PyPy exclusively in your virtualenv, do the following:
cd path/to/my/env
cd bin
mv python python.bak
ln -s pypy python
Good luck!
| 2 | 0.095238 | 1 | 1 |
30aa7f04b09062495d464a00bf367d1a051e709e | app/controllers/suggestions_controller.rb | app/controllers/suggestions_controller.rb | class SuggestionsController < ApplicationController
def new
@suggestion = Suggestion.new
end
def create
end
end
| class SuggestionsController < ApplicationController
def new
@suggestion = Suggestion.new
@sigs = Sig.all
end
def create
end
end
| Set up new method to get all sigs. | Set up new method to get all sigs.
| Ruby | mpl-2.0 | kahdojay/govscores,kahdojay/govscores,kahdojay/govscores | ruby | ## Code Before:
class SuggestionsController < ApplicationController
def new
@suggestion = Suggestion.new
end
def create
end
end
## Instruction:
Set up new method to get all sigs.
## Code After:
class SuggestionsController < ApplicationController
def new
@suggestion = Suggestion.new
@sigs = Sig.all
end
def create
end
end
| class SuggestionsController < ApplicationController
def new
@suggestion = Suggestion.new
+ @sigs = Sig.all
end
def create
end
end | 1 | 0.125 | 1 | 0 |
a60e4202341caf1537d772cb2639452783f8dbea | lambda-behave/src/main/java/com/insightfullogic/lambdabehave/expectations/StringExpectation.java | lambda-behave/src/main/java/com/insightfullogic/lambdabehave/expectations/StringExpectation.java | package com.insightfullogic.lambdabehave.expectations;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import static org.junit.Assert.assertThat;
/**
* .
*/
public final class StringExpectation extends BoundExpectation<String> {
public StringExpectation(final String str, final boolean positive) {
super(str, positive);
}
public StringExpectation isEmptyString() {
return matches(Matchers.isEmptyString());
}
public StringExpectation isEmptyOrNullString() {
return matches(Matchers.isEmptyOrNullString());
}
public StringExpectation equalToIgnoringCase(final String expectedString) {
return matches(Matchers.equalToIgnoringCase(expectedString));
}
public StringExpectation equalToIgnoringWhiteSpace(final String expectedString) {
return matches(Matchers.equalToIgnoringWhiteSpace(expectedString));
}
public StringExpectation containsString(final String substring) {
return matches(Matchers.containsString(substring));
}
public StringExpectation endsWith(final String suffix) {
return matches(Matchers.endsWith(suffix));
}
public StringExpectation startsWith(final String prefix) {
return matches(Matchers.startsWith(prefix));
}
private StringExpectation matches(final Matcher<String> matcher) {
assertThat(objectUnderTest, matcher);
return this;
}
}
| package com.insightfullogic.lambdabehave.expectations;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
/**
* .
*/
public final class StringExpectation extends BoundExpectation<String> {
public StringExpectation(final String str, final boolean positive) {
super(str, positive);
}
public StringExpectation isEmptyString() {
return matches(Matchers.isEmptyString());
}
public StringExpectation isEmptyOrNullString() {
return matches(Matchers.isEmptyOrNullString());
}
public StringExpectation equalToIgnoringCase(final String expectedString) {
return matches(Matchers.equalToIgnoringCase(expectedString));
}
public StringExpectation equalToIgnoringWhiteSpace(final String expectedString) {
return matches(Matchers.equalToIgnoringWhiteSpace(expectedString));
}
public StringExpectation containsString(final String substring) {
return matches(Matchers.containsString(substring));
}
public StringExpectation endsWith(final String suffix) {
return matches(Matchers.endsWith(suffix));
}
public StringExpectation startsWith(final String prefix) {
return matches(Matchers.startsWith(prefix));
}
private StringExpectation matches(final Matcher<String> matcher) {
assertThat(objectUnderTest, matcher);
return this;
}
public StringExpectation matches(String regex) {
assertTrue(objectUnderTest.matches(regex));
return this;
}
}
| Add method to check if a string matches a regular expression | Add method to check if a string matches a regular expression
| Java | mit | RichardWarburton/lambda-behave,Writtscher/lambda-behave,dhunziker/lambda-behave,RichardWarburton/lambda-behave,ofdrm/lambda-behave,jypma/lambda-behave,jypma/lambda-behave,Writtscher/lambda-behave,dhunziker/lambda-behave,ofdrm/lambda-behave | java | ## Code Before:
package com.insightfullogic.lambdabehave.expectations;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import static org.junit.Assert.assertThat;
/**
* .
*/
public final class StringExpectation extends BoundExpectation<String> {
public StringExpectation(final String str, final boolean positive) {
super(str, positive);
}
public StringExpectation isEmptyString() {
return matches(Matchers.isEmptyString());
}
public StringExpectation isEmptyOrNullString() {
return matches(Matchers.isEmptyOrNullString());
}
public StringExpectation equalToIgnoringCase(final String expectedString) {
return matches(Matchers.equalToIgnoringCase(expectedString));
}
public StringExpectation equalToIgnoringWhiteSpace(final String expectedString) {
return matches(Matchers.equalToIgnoringWhiteSpace(expectedString));
}
public StringExpectation containsString(final String substring) {
return matches(Matchers.containsString(substring));
}
public StringExpectation endsWith(final String suffix) {
return matches(Matchers.endsWith(suffix));
}
public StringExpectation startsWith(final String prefix) {
return matches(Matchers.startsWith(prefix));
}
private StringExpectation matches(final Matcher<String> matcher) {
assertThat(objectUnderTest, matcher);
return this;
}
}
## Instruction:
Add method to check if a string matches a regular expression
## Code After:
package com.insightfullogic.lambdabehave.expectations;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
/**
* .
*/
public final class StringExpectation extends BoundExpectation<String> {
public StringExpectation(final String str, final boolean positive) {
super(str, positive);
}
public StringExpectation isEmptyString() {
return matches(Matchers.isEmptyString());
}
public StringExpectation isEmptyOrNullString() {
return matches(Matchers.isEmptyOrNullString());
}
public StringExpectation equalToIgnoringCase(final String expectedString) {
return matches(Matchers.equalToIgnoringCase(expectedString));
}
public StringExpectation equalToIgnoringWhiteSpace(final String expectedString) {
return matches(Matchers.equalToIgnoringWhiteSpace(expectedString));
}
public StringExpectation containsString(final String substring) {
return matches(Matchers.containsString(substring));
}
public StringExpectation endsWith(final String suffix) {
return matches(Matchers.endsWith(suffix));
}
public StringExpectation startsWith(final String prefix) {
return matches(Matchers.startsWith(prefix));
}
private StringExpectation matches(final Matcher<String> matcher) {
assertThat(objectUnderTest, matcher);
return this;
}
public StringExpectation matches(String regex) {
assertTrue(objectUnderTest.matches(regex));
return this;
}
}
| package com.insightfullogic.lambdabehave.expectations;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import static org.junit.Assert.assertThat;
+ import static org.junit.Assert.assertTrue;
/**
* .
*/
public final class StringExpectation extends BoundExpectation<String> {
public StringExpectation(final String str, final boolean positive) {
super(str, positive);
}
public StringExpectation isEmptyString() {
return matches(Matchers.isEmptyString());
}
public StringExpectation isEmptyOrNullString() {
return matches(Matchers.isEmptyOrNullString());
}
public StringExpectation equalToIgnoringCase(final String expectedString) {
return matches(Matchers.equalToIgnoringCase(expectedString));
}
public StringExpectation equalToIgnoringWhiteSpace(final String expectedString) {
return matches(Matchers.equalToIgnoringWhiteSpace(expectedString));
}
public StringExpectation containsString(final String substring) {
return matches(Matchers.containsString(substring));
}
public StringExpectation endsWith(final String suffix) {
return matches(Matchers.endsWith(suffix));
}
public StringExpectation startsWith(final String prefix) {
return matches(Matchers.startsWith(prefix));
}
private StringExpectation matches(final Matcher<String> matcher) {
assertThat(objectUnderTest, matcher);
return this;
}
+
+ public StringExpectation matches(String regex) {
+ assertTrue(objectUnderTest.matches(regex));
+ return this;
+ }
+
} | 7 | 0.145833 | 7 | 0 |
cad2eb9339c0e52aeafabc5a3c220e01930d7ec3 | pages/contact.md | pages/contact.md | ---
layout: page
title: "Contact"
meta_title: "Contact"
subheadline: ""
teaser: ""
header:
image_fullwidth: yellow2100x553.jpg
permalink: "/contact/"
---
Need help with a mapping project? Just want to say hello? Use the contact form below.
<form action="https://formspree.io/nwilgruber@gmail.com"
method="POST">
<fieldset>
<label for="email">Email:</label>
<input type="email" name="Email" required>
<input type="textarea" name="text" placeholder="Say Hello!" required width="200px" height="40px>
<input type="submit" value="Send">
</fieldset>
</form>
| ---
layout: page
title: "Contact"
meta_title: "Contact"
subheadline: ""
teaser: ""
header:
image_fullwidth: yellow2100x553.jpg
permalink: "/contact/"
---
Need help with a mapping project? Just want to say hello? Use the contact form below.
<form action="https://formspree.io/nwilgruber@gmail.com"
method="POST">
<fieldset>
<label for="email">Email:</label>
<input type="email" name="Email" required>
<input type="textarea" name="text" placeholder="Say Hello!" required stlye="width:200px,height:40px">
<input type="submit" value="Send">
</fieldset>
</form>
| Update textarea size again(I hope?) | Update textarea size again(I hope?) | Markdown | mit | wontgruber/wontgruber.github.io,wontgruber/wontgruber.github.io,wontgruber/wontgruber.github.io | markdown | ## Code Before:
---
layout: page
title: "Contact"
meta_title: "Contact"
subheadline: ""
teaser: ""
header:
image_fullwidth: yellow2100x553.jpg
permalink: "/contact/"
---
Need help with a mapping project? Just want to say hello? Use the contact form below.
<form action="https://formspree.io/nwilgruber@gmail.com"
method="POST">
<fieldset>
<label for="email">Email:</label>
<input type="email" name="Email" required>
<input type="textarea" name="text" placeholder="Say Hello!" required width="200px" height="40px>
<input type="submit" value="Send">
</fieldset>
</form>
## Instruction:
Update textarea size again(I hope?)
## Code After:
---
layout: page
title: "Contact"
meta_title: "Contact"
subheadline: ""
teaser: ""
header:
image_fullwidth: yellow2100x553.jpg
permalink: "/contact/"
---
Need help with a mapping project? Just want to say hello? Use the contact form below.
<form action="https://formspree.io/nwilgruber@gmail.com"
method="POST">
<fieldset>
<label for="email">Email:</label>
<input type="email" name="Email" required>
<input type="textarea" name="text" placeholder="Say Hello!" required stlye="width:200px,height:40px">
<input type="submit" value="Send">
</fieldset>
</form>
| ---
layout: page
title: "Contact"
meta_title: "Contact"
subheadline: ""
teaser: ""
header:
image_fullwidth: yellow2100x553.jpg
permalink: "/contact/"
---
Need help with a mapping project? Just want to say hello? Use the contact form below.
<form action="https://formspree.io/nwilgruber@gmail.com"
method="POST">
<fieldset>
<label for="email">Email:</label>
<input type="email" name="Email" required>
- <input type="textarea" name="text" placeholder="Say Hello!" required width="200px" height="40px>
? ^^ ^^ ^^
+ <input type="textarea" name="text" placeholder="Say Hello!" required stlye="width:200px,height:40px">
? +++++++ ^ ^ ^ +
<input type="submit" value="Send">
</fieldset>
</form> | 2 | 0.090909 | 1 | 1 |
3fd3385d32af390598b870bd6bb8f07fe4427187 | composer.json | composer.json | {
"name": "egeloen/google-map-bundle",
"type": "symfony-bundle",
"description": "Provides a google map integration for your Symfony2 Project.",
"keywords": [ "google map" ],
"license": "MIT",
"authors": [
{
"name": "Eric GELOEN",
"email": "geloen.eric@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"symfony/framework-bundle": "~2.1",
"egeloen/google-map": "~1.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"symfony/form": "~2.1",
"symfony/yaml": "~2.0",
"twig/twig": "~1.12",
"widop/http-adapter-bundle": "~1.1.0",
"willdurand/geocoder": "~2.0",
"satooshi/php-coveralls": "~0.6"
},
"autoload": {
"psr-4": { "Ivory\\GoogleMapBundle\\": "" }
},
"config": {
"bin-dir": "bin/"
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
}
}
| {
"name": "egeloen/google-map-bundle",
"type": "symfony-bundle",
"description": "Provides a google map integration for your Symfony2 Project.",
"keywords": [ "google map" ],
"license": "MIT",
"authors": [
{
"name": "Eric GELOEN",
"email": "geloen.eric@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"symfony/framework-bundle": "~2.1|~3.0",
"egeloen/google-map": "~1.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"symfony/form": "~2.1|~3.0",
"symfony/yaml": "~2.0|~3.0",
"twig/twig": "~1.12",
"widop/http-adapter-bundle": "~1.1.0",
"willdurand/geocoder": "~2.0",
"satooshi/php-coveralls": "~0.6"
},
"autoload": {
"psr-4": { "Ivory\\GoogleMapBundle\\": "" }
},
"config": {
"bin-dir": "bin/"
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
}
}
| Add 3.0 as allowed Symfony version | Add 3.0 as allowed Symfony version
| JSON | mit | yappabe/IvoryGoogleMapBundle,yappabe/IvoryGoogleMapBundle | json | ## Code Before:
{
"name": "egeloen/google-map-bundle",
"type": "symfony-bundle",
"description": "Provides a google map integration for your Symfony2 Project.",
"keywords": [ "google map" ],
"license": "MIT",
"authors": [
{
"name": "Eric GELOEN",
"email": "geloen.eric@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"symfony/framework-bundle": "~2.1",
"egeloen/google-map": "~1.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"symfony/form": "~2.1",
"symfony/yaml": "~2.0",
"twig/twig": "~1.12",
"widop/http-adapter-bundle": "~1.1.0",
"willdurand/geocoder": "~2.0",
"satooshi/php-coveralls": "~0.6"
},
"autoload": {
"psr-4": { "Ivory\\GoogleMapBundle\\": "" }
},
"config": {
"bin-dir": "bin/"
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
}
}
## Instruction:
Add 3.0 as allowed Symfony version
## Code After:
{
"name": "egeloen/google-map-bundle",
"type": "symfony-bundle",
"description": "Provides a google map integration for your Symfony2 Project.",
"keywords": [ "google map" ],
"license": "MIT",
"authors": [
{
"name": "Eric GELOEN",
"email": "geloen.eric@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"symfony/framework-bundle": "~2.1|~3.0",
"egeloen/google-map": "~1.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"symfony/form": "~2.1|~3.0",
"symfony/yaml": "~2.0|~3.0",
"twig/twig": "~1.12",
"widop/http-adapter-bundle": "~1.1.0",
"willdurand/geocoder": "~2.0",
"satooshi/php-coveralls": "~0.6"
},
"autoload": {
"psr-4": { "Ivory\\GoogleMapBundle\\": "" }
},
"config": {
"bin-dir": "bin/"
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
}
}
| {
"name": "egeloen/google-map-bundle",
"type": "symfony-bundle",
"description": "Provides a google map integration for your Symfony2 Project.",
"keywords": [ "google map" ],
"license": "MIT",
"authors": [
{
"name": "Eric GELOEN",
"email": "geloen.eric@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
- "symfony/framework-bundle": "~2.1",
+ "symfony/framework-bundle": "~2.1|~3.0",
? +++++
"egeloen/google-map": "~1.4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
- "symfony/form": "~2.1",
+ "symfony/form": "~2.1|~3.0",
? +++++
- "symfony/yaml": "~2.0",
+ "symfony/yaml": "~2.0|~3.0",
? +++++
"twig/twig": "~1.12",
"widop/http-adapter-bundle": "~1.1.0",
"willdurand/geocoder": "~2.0",
"satooshi/php-coveralls": "~0.6"
},
"autoload": {
"psr-4": { "Ivory\\GoogleMapBundle\\": "" }
},
"config": {
"bin-dir": "bin/"
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
}
} | 6 | 0.157895 | 3 | 3 |
af1b4ad24cd4c4773498e25a9f6296e49e50d593 | test/Transforms/InstCombine/shift.ll | test/Transforms/InstCombine/shift.ll | ; This test makes sure that these instructions are properly eliminated.
;
; RUN: if as < %s | opt -instcombine | dis | grep sh
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int "test1"(int %A) {
%B = shl int %A, ubyte 0
ret int %B
}
int "test2"(ubyte %A) {
%B = shl int 0, ubyte %A
ret int %B
}
int "test3"(int %A) {
%B = shr int %A, ubyte 0
ret int %B
}
int "test4"(ubyte %A) {
%B = shr int 0, ubyte %A
ret int %B
}
uint "test5"(uint %A) {
%B = shr uint %A, ubyte 32 ;; shift all bits out
ret uint %B
}
uint %test6(uint %A) {
%B = shl uint %A, ubyte 1 ;; convert to an add instruction
ret uint %B
}
| ; This test makes sure that these instructions are properly eliminated.
;
; RUN: if as < %s | opt -instcombine | dis | grep sh
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int "test1"(int %A) {
%B = shl int %A, ubyte 0
ret int %B
}
int "test2"(ubyte %A) {
%B = shl int 0, ubyte %A
ret int %B
}
int "test3"(int %A) {
%B = shr int %A, ubyte 0
ret int %B
}
int "test4"(ubyte %A) {
%B = shr int 0, ubyte %A
ret int %B
}
uint "test5"(uint %A) {
%B = shr uint %A, ubyte 32 ;; shift all bits out
ret uint %B
}
uint %test6(uint %A) {
%B = shl uint %A, ubyte 1 ;; convert to an add instruction
ret uint %B
}
int %test7(ubyte %A) {
%B = shr int -1, ubyte %A ;; Always equal to -1
ret int %B
}
| Add new testcase for arithmetic shr of -1 | Add new testcase for arithmetic shr of -1
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@4069 91177308-0d34-0410-b5e6-96231b3b80d8
| LLVM | apache-2.0 | apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap | llvm | ## Code Before:
; This test makes sure that these instructions are properly eliminated.
;
; RUN: if as < %s | opt -instcombine | dis | grep sh
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int "test1"(int %A) {
%B = shl int %A, ubyte 0
ret int %B
}
int "test2"(ubyte %A) {
%B = shl int 0, ubyte %A
ret int %B
}
int "test3"(int %A) {
%B = shr int %A, ubyte 0
ret int %B
}
int "test4"(ubyte %A) {
%B = shr int 0, ubyte %A
ret int %B
}
uint "test5"(uint %A) {
%B = shr uint %A, ubyte 32 ;; shift all bits out
ret uint %B
}
uint %test6(uint %A) {
%B = shl uint %A, ubyte 1 ;; convert to an add instruction
ret uint %B
}
## Instruction:
Add new testcase for arithmetic shr of -1
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@4069 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
; This test makes sure that these instructions are properly eliminated.
;
; RUN: if as < %s | opt -instcombine | dis | grep sh
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int "test1"(int %A) {
%B = shl int %A, ubyte 0
ret int %B
}
int "test2"(ubyte %A) {
%B = shl int 0, ubyte %A
ret int %B
}
int "test3"(int %A) {
%B = shr int %A, ubyte 0
ret int %B
}
int "test4"(ubyte %A) {
%B = shr int 0, ubyte %A
ret int %B
}
uint "test5"(uint %A) {
%B = shr uint %A, ubyte 32 ;; shift all bits out
ret uint %B
}
uint %test6(uint %A) {
%B = shl uint %A, ubyte 1 ;; convert to an add instruction
ret uint %B
}
int %test7(ubyte %A) {
%B = shr int -1, ubyte %A ;; Always equal to -1
ret int %B
}
| ; This test makes sure that these instructions are properly eliminated.
;
; RUN: if as < %s | opt -instcombine | dis | grep sh
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi
implementation
int "test1"(int %A) {
%B = shl int %A, ubyte 0
ret int %B
}
int "test2"(ubyte %A) {
%B = shl int 0, ubyte %A
ret int %B
}
int "test3"(int %A) {
%B = shr int %A, ubyte 0
ret int %B
}
int "test4"(ubyte %A) {
%B = shr int 0, ubyte %A
ret int %B
}
uint "test5"(uint %A) {
%B = shr uint %A, ubyte 32 ;; shift all bits out
ret uint %B
}
uint %test6(uint %A) {
%B = shl uint %A, ubyte 1 ;; convert to an add instruction
ret uint %B
}
+
+ int %test7(ubyte %A) {
+ %B = shr int -1, ubyte %A ;; Always equal to -1
+ ret int %B
+ } | 5 | 0.128205 | 5 | 0 |
a8e375d52f79112e797eaf598ee86cbee2c906a2 | ci/tasks/mysql-tests.yml | ci/tasks/mysql-tests.yml | ---
image_resource:
type: docker-image
source: { repository: c2cnetworking/dev-mysql }
platform: linux
inputs:
- name: cf-networking-release
run:
path: cf-networking-release/scripts/unit-and-integration-tests
params:
GINKGO_EXTRA_FLAGS: "-race"
DB: mysql
| ---
image_resource:
type: docker-image
source:
repository: c2cnetworking/dev-mysql
tag: 0.18.0
platform: linux
inputs:
- name: cf-networking-release
run:
path: cf-networking-release/scripts/unit-and-integration-tests
params:
GINKGO_EXTRA_FLAGS: "-race"
DB: mysql
| Use pinned version of mysql image for tests | Use pinned version of mysql image for tests
- There is currently an issue with the latest version of mysql causing test failures
- A task was created in tracker to investigate this further
Signed-off-by: Aidan Obley <2667fa8e8663c9d9f622cbe0896041b5635a919f@pivotal.io>
| YAML | apache-2.0 | cloudfoundry-incubator/cf-networking-release,cloudfoundry-incubator/cf-networking-release,cloudfoundry-incubator/cf-networking-release,cloudfoundry-incubator/cf-networking-release | yaml | ## Code Before:
---
image_resource:
type: docker-image
source: { repository: c2cnetworking/dev-mysql }
platform: linux
inputs:
- name: cf-networking-release
run:
path: cf-networking-release/scripts/unit-and-integration-tests
params:
GINKGO_EXTRA_FLAGS: "-race"
DB: mysql
## Instruction:
Use pinned version of mysql image for tests
- There is currently an issue with the latest version of mysql causing test failures
- A task was created in tracker to investigate this further
Signed-off-by: Aidan Obley <2667fa8e8663c9d9f622cbe0896041b5635a919f@pivotal.io>
## Code After:
---
image_resource:
type: docker-image
source:
repository: c2cnetworking/dev-mysql
tag: 0.18.0
platform: linux
inputs:
- name: cf-networking-release
run:
path: cf-networking-release/scripts/unit-and-integration-tests
params:
GINKGO_EXTRA_FLAGS: "-race"
DB: mysql
| ---
image_resource:
type: docker-image
+ source:
- source: { repository: c2cnetworking/dev-mysql }
? ------- - --
+ repository: c2cnetworking/dev-mysql
+ tag: 0.18.0
platform: linux
inputs:
- name: cf-networking-release
run:
path: cf-networking-release/scripts/unit-and-integration-tests
params:
GINKGO_EXTRA_FLAGS: "-race"
DB: mysql | 4 | 0.25 | 3 | 1 |
d2eb775c6cf15d5215d70beba879b351a1371327 | packages/yx/yx.yaml | packages/yx/yx.yaml | homepage: https://github.com/mtth/yx
changelog-type: ''
hash: 2d9dcd1199179931e139193ca6e1200cf1c711321e6054df79a26d760639ddb6
test-bench-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
hspec: ! '>=2.5 && <2.6'
array: ! '>=0.5'
yx: -any
maintainer: matthieu.monsch@gmail.com
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
array: ! '>=0.5'
all-versions:
- '0.0.1.0'
author: Matthieu Monsch
latest: '0.0.1.0'
description-type: markdown
description: ! '# yx
'
license-name: BSD3
| homepage: https://github.com/mtth/yx
changelog-type: ''
hash: f90320b91fb941323b56385ec5187ab58bceab671b1986cb8ab100b75da258dc
test-bench-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
hspec: ! '>=2.5 && <2.6'
array: ! '>=0.5'
yx: -any
maintainer: matthieu.monsch@gmail.com
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
array: ! '>=0.5'
all-versions:
- '0.0.1.0'
- '0.0.1.1'
author: Matthieu Monsch
latest: '0.0.1.1'
description-type: markdown
description: ! '# yx
'
license-name: BSD3
| Update from Hackage at 2018-12-19T04:12:02Z | Update from Hackage at 2018-12-19T04:12:02Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/mtth/yx
changelog-type: ''
hash: 2d9dcd1199179931e139193ca6e1200cf1c711321e6054df79a26d760639ddb6
test-bench-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
hspec: ! '>=2.5 && <2.6'
array: ! '>=0.5'
yx: -any
maintainer: matthieu.monsch@gmail.com
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
array: ! '>=0.5'
all-versions:
- '0.0.1.0'
author: Matthieu Monsch
latest: '0.0.1.0'
description-type: markdown
description: ! '# yx
'
license-name: BSD3
## Instruction:
Update from Hackage at 2018-12-19T04:12:02Z
## Code After:
homepage: https://github.com/mtth/yx
changelog-type: ''
hash: f90320b91fb941323b56385ec5187ab58bceab671b1986cb8ab100b75da258dc
test-bench-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
hspec: ! '>=2.5 && <2.6'
array: ! '>=0.5'
yx: -any
maintainer: matthieu.monsch@gmail.com
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
array: ! '>=0.5'
all-versions:
- '0.0.1.0'
- '0.0.1.1'
author: Matthieu Monsch
latest: '0.0.1.1'
description-type: markdown
description: ! '# yx
'
license-name: BSD3
| homepage: https://github.com/mtth/yx
changelog-type: ''
- hash: 2d9dcd1199179931e139193ca6e1200cf1c711321e6054df79a26d760639ddb6
+ hash: f90320b91fb941323b56385ec5187ab58bceab671b1986cb8ab100b75da258dc
test-bench-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
hspec: ! '>=2.5 && <2.6'
array: ! '>=0.5'
yx: -any
maintainer: matthieu.monsch@gmail.com
synopsis: Row-major coordinates
changelog: ''
basic-deps:
bytestring: ! '>=0.10'
base: ! '>=4.7 && <5'
array: ! '>=0.5'
all-versions:
- '0.0.1.0'
+ - '0.0.1.1'
author: Matthieu Monsch
- latest: '0.0.1.0'
? ^
+ latest: '0.0.1.1'
? ^
description-type: markdown
description: ! '# yx
'
license-name: BSD3 | 5 | 0.2 | 3 | 2 |
5d2e0dfb0cdd237649ccce2e16d0b5ee4da8bde6 | lib/JWX/JWT/Parameter/ContentTypeParameter.php | lib/JWX/JWT/Parameter/ContentTypeParameter.php | <?php
namespace JWX\JWT\Parameter;
/**
* Implements 'Content Type' parameter.
*
* @link https://tools.ietf.org/html/rfc7515#section-4.1.10
*/
class ContentTypeParameter extends RegisteredJWTParameter
{
/**
* Constructor
*
* @param string $type
*/
public function __construct($type) {
parent::__construct(self::PARAM_CONTENT_TYPE, (string) $type);
}
}
| <?php
namespace JWX\JWT\Parameter;
/**
* Implements 'Content Type' parameter.
*
* @link https://tools.ietf.org/html/rfc7515#section-4.1.10
*/
class ContentTypeParameter extends RegisteredJWTParameter
{
/**
* Content type for the nested JWT.
*
* @var string
*/
const TYPE_JWT = "JWT";
/**
* Constructor
*
* @param string $type
*/
public function __construct($type) {
parent::__construct(self::PARAM_CONTENT_TYPE, (string) $type);
}
}
| Add JWT content type constant | Add JWT content type constant | PHP | mit | sop/jwx | php | ## Code Before:
<?php
namespace JWX\JWT\Parameter;
/**
* Implements 'Content Type' parameter.
*
* @link https://tools.ietf.org/html/rfc7515#section-4.1.10
*/
class ContentTypeParameter extends RegisteredJWTParameter
{
/**
* Constructor
*
* @param string $type
*/
public function __construct($type) {
parent::__construct(self::PARAM_CONTENT_TYPE, (string) $type);
}
}
## Instruction:
Add JWT content type constant
## Code After:
<?php
namespace JWX\JWT\Parameter;
/**
* Implements 'Content Type' parameter.
*
* @link https://tools.ietf.org/html/rfc7515#section-4.1.10
*/
class ContentTypeParameter extends RegisteredJWTParameter
{
/**
* Content type for the nested JWT.
*
* @var string
*/
const TYPE_JWT = "JWT";
/**
* Constructor
*
* @param string $type
*/
public function __construct($type) {
parent::__construct(self::PARAM_CONTENT_TYPE, (string) $type);
}
}
| <?php
namespace JWX\JWT\Parameter;
/**
* Implements 'Content Type' parameter.
*
* @link https://tools.ietf.org/html/rfc7515#section-4.1.10
*/
class ContentTypeParameter extends RegisteredJWTParameter
{
/**
+ * Content type for the nested JWT.
+ *
+ * @var string
+ */
+ const TYPE_JWT = "JWT";
+
+ /**
* Constructor
*
* @param string $type
*/
public function __construct($type) {
parent::__construct(self::PARAM_CONTENT_TYPE, (string) $type);
}
} | 7 | 0.333333 | 7 | 0 |
58f2dbbd1cd6d9dde056df8670d91a570ffa6899 | src/main/config/sql/current/4.0/tables/KC_TBL_FINANCIAL_ENTITY_ATTACHMENT.sql | src/main/config/sql/current/4.0/tables/KC_TBL_FINANCIAL_ENTITY_ATTACHMENT.sql | CREATE TABLE FINANCIAL_ENTITY_ATTACHMENT
(FINANCIAL_ENTITY_ATTACHMENT_ID NUMBER(12,0) NOT NULL ENABLE,
FINANCIAL_ENTITY_ID_FK NUMBER(12,0) NOT NULL ENABLE,
FILE_ID NUMBER(12,0) NOT NULL ENABLE,
DESCRIPTION VARCHAR2(200) NOT NULL ENABLE,
CONTACT_NAME VARCHAR2(30),
EMAIL_ADDRESS VARCHAR2(60),
PHONE_NUMBER VARCHAR2(20),
COMMENTS VARCHAR2(300),
OBJ_ID VARCHAR2(36) DEFAULT SYS_GUID() NOT NULL ENABLE,
UPDATE_TIMESTAMP DATE NOT NULL ENABLE,
UPDATE_USER VARCHAR2(10) NOT NULL ENABLE,
)
/
| CREATE TABLE FINANCIAL_ENTITY_ATTACHMENT
(FINANCIAL_ENTITY_ATTACHMENT_ID NUMBER(12,0) NOT NULL,
FINANCIAL_ENTITY_ID_FK NUMBER(12,0) NOT NULL,
FILE_ID NUMBER(12,0) NOT NULL,
DESCRIPTION VARCHAR2(200) NOT NULL,
CONTACT_NAME VARCHAR2(30),
EMAIL_ADDRESS VARCHAR2(60),
PHONE_NUMBER VARCHAR2(20),
COMMENTS VARCHAR2(300),
OBJ_ID VARCHAR2(36) NOT NULL,
UPDATE_TIMESTAMP DATE NOT NULL,
UPDATE_USER VARCHAR2(10) NOT NULL
)
/
| Add ability to associate attachments to Financial Entities | KCCOI-90: Add ability to associate attachments to Financial Entities
| SQL | agpl-3.0 | jwillia/kc-old1,UniversityOfHawaiiORS/kc,ColostateResearchServices/kc,mukadder/kc,geothomasp/kcmit,iu-uits-es/kc,UniversityOfHawaiiORS/kc,geothomasp/kcmit,geothomasp/kcmit,kuali/kc,ColostateResearchServices/kc,iu-uits-es/kc,kuali/kc,jwillia/kc-old1,jwillia/kc-old1,UniversityOfHawaiiORS/kc,geothomasp/kcmit,iu-uits-es/kc,mukadder/kc,geothomasp/kcmit,jwillia/kc-old1,ColostateResearchServices/kc,kuali/kc,mukadder/kc | sql | ## Code Before:
CREATE TABLE FINANCIAL_ENTITY_ATTACHMENT
(FINANCIAL_ENTITY_ATTACHMENT_ID NUMBER(12,0) NOT NULL ENABLE,
FINANCIAL_ENTITY_ID_FK NUMBER(12,0) NOT NULL ENABLE,
FILE_ID NUMBER(12,0) NOT NULL ENABLE,
DESCRIPTION VARCHAR2(200) NOT NULL ENABLE,
CONTACT_NAME VARCHAR2(30),
EMAIL_ADDRESS VARCHAR2(60),
PHONE_NUMBER VARCHAR2(20),
COMMENTS VARCHAR2(300),
OBJ_ID VARCHAR2(36) DEFAULT SYS_GUID() NOT NULL ENABLE,
UPDATE_TIMESTAMP DATE NOT NULL ENABLE,
UPDATE_USER VARCHAR2(10) NOT NULL ENABLE,
)
/
## Instruction:
KCCOI-90: Add ability to associate attachments to Financial Entities
## Code After:
CREATE TABLE FINANCIAL_ENTITY_ATTACHMENT
(FINANCIAL_ENTITY_ATTACHMENT_ID NUMBER(12,0) NOT NULL,
FINANCIAL_ENTITY_ID_FK NUMBER(12,0) NOT NULL,
FILE_ID NUMBER(12,0) NOT NULL,
DESCRIPTION VARCHAR2(200) NOT NULL,
CONTACT_NAME VARCHAR2(30),
EMAIL_ADDRESS VARCHAR2(60),
PHONE_NUMBER VARCHAR2(20),
COMMENTS VARCHAR2(300),
OBJ_ID VARCHAR2(36) NOT NULL,
UPDATE_TIMESTAMP DATE NOT NULL,
UPDATE_USER VARCHAR2(10) NOT NULL
)
/
| CREATE TABLE FINANCIAL_ENTITY_ATTACHMENT
- (FINANCIAL_ENTITY_ATTACHMENT_ID NUMBER(12,0) NOT NULL ENABLE,
? -------
+ (FINANCIAL_ENTITY_ATTACHMENT_ID NUMBER(12,0) NOT NULL,
- FINANCIAL_ENTITY_ID_FK NUMBER(12,0) NOT NULL ENABLE,
? -------
+ FINANCIAL_ENTITY_ID_FK NUMBER(12,0) NOT NULL,
- FILE_ID NUMBER(12,0) NOT NULL ENABLE,
? -------
+ FILE_ID NUMBER(12,0) NOT NULL,
- DESCRIPTION VARCHAR2(200) NOT NULL ENABLE,
? -------
+ DESCRIPTION VARCHAR2(200) NOT NULL,
CONTACT_NAME VARCHAR2(30),
EMAIL_ADDRESS VARCHAR2(60),
PHONE_NUMBER VARCHAR2(20),
COMMENTS VARCHAR2(300),
- OBJ_ID VARCHAR2(36) DEFAULT SYS_GUID() NOT NULL ENABLE,
+ OBJ_ID VARCHAR2(36) NOT NULL,
- UPDATE_TIMESTAMP DATE NOT NULL ENABLE,
? -------
+ UPDATE_TIMESTAMP DATE NOT NULL,
- UPDATE_USER VARCHAR2(10) NOT NULL ENABLE,
? --------
+ UPDATE_USER VARCHAR2(10) NOT NULL
)
/ | 14 | 1 | 7 | 7 |
9b21064d70a4c317b978a209bdbdf5650389a2b9 | README.md | README.md | GWT-OL3-Playground
==================
[](https://travis-ci.org/TDesjardins/GWT-OL3-Playground)
A [OpenLayers 3](http://openlayers.org/ "OpenLayers 3 website") - Wrapper for GWT using the new JSInterop-Features of the [GWT-SDK 2.7.0](http://www.gwtproject.org/versions.html "Link to GWT-SDK Downloads"). The project consists of two parts:
* a GWT wrapper for OpenLayers 3 (gwt-ol3-client)
* a demo module for showing wrapper functionality (gwt-ol3-demo)
You can build and run the application with Maven. If you would like to test superdev-mode you can run it on module `gwt-ol-demo` with the goal `gwt:run`. To only start the codeserver, e.g. using superdev-mode with your servlet container, use goal `gwt:run-codeserver`.
If you want to build the application without Maven please consider the following hints:
* Building the application with older GWT-SDK than 2.7.0 (e.g. SDK 2.6.1) will not work. You can download the latest SDK at http://www.gwtproject.org/versions.html
* It is essential to compile the application with compiler args `-XjsInteropMode JS`. | GWT-OL3-Playground
==================
[](https://travis-ci.org/TDesjardins/GWT-OL3-Playground)
A [OpenLayers 3](http://openlayers.org/ "OpenLayers 3 website") - Wrapper for GWT using the new JSInterop-Features of the [GWT-SDK 2.8.0](http://www.gwtproject.org/versions.html "Link to GWT-SDK Downloads"). The project consists of two parts:
* a GWT wrapper for OpenLayers 3 (gwt-ol3-client)
* a demo module for showing wrapper functionality (gwt-ol3-demo)
You can build and run the application with Maven. If you would like to test superdev-mode you can run it on module `gwt-ol-demo` with the goal `gwt:run`. To only start the codeserver, e.g. using superdev-mode with your servlet container, use goal `gwt:run-codeserver`.
If you want to build the application without Maven please consider the following hints:
* Building the application with older GWT-SDK than 2.8.0-beta1 (e.g. SDK 2.7.0) will not work. You can download the SDK 2.8.0-beta1 [here](http://goo.gl/62SeR5) | Update readme for GWT 2.8 | Update readme for GWT 2.8 | Markdown | apache-2.0 | TDesjardins/gwt-ol3,mazlixek/gwt-ol3,mazlixek/gwt-ol3,sebasbaumh/gwt-ol3,TDesjardins/gwt-ol3,TDesjardins/GWT-OL3-Playground,sebasbaumh/gwt-ol3,sebasbaumh/gwt-ol3,mazlixek/gwt-ol3,TDesjardins/GWT-OL3-Playground,TDesjardins/GWT-OL3-Playground,TDesjardins/gwt-ol3 | markdown | ## Code Before:
GWT-OL3-Playground
==================
[](https://travis-ci.org/TDesjardins/GWT-OL3-Playground)
A [OpenLayers 3](http://openlayers.org/ "OpenLayers 3 website") - Wrapper for GWT using the new JSInterop-Features of the [GWT-SDK 2.7.0](http://www.gwtproject.org/versions.html "Link to GWT-SDK Downloads"). The project consists of two parts:
* a GWT wrapper for OpenLayers 3 (gwt-ol3-client)
* a demo module for showing wrapper functionality (gwt-ol3-demo)
You can build and run the application with Maven. If you would like to test superdev-mode you can run it on module `gwt-ol-demo` with the goal `gwt:run`. To only start the codeserver, e.g. using superdev-mode with your servlet container, use goal `gwt:run-codeserver`.
If you want to build the application without Maven please consider the following hints:
* Building the application with older GWT-SDK than 2.7.0 (e.g. SDK 2.6.1) will not work. You can download the latest SDK at http://www.gwtproject.org/versions.html
* It is essential to compile the application with compiler args `-XjsInteropMode JS`.
## Instruction:
Update readme for GWT 2.8
## Code After:
GWT-OL3-Playground
==================
[](https://travis-ci.org/TDesjardins/GWT-OL3-Playground)
A [OpenLayers 3](http://openlayers.org/ "OpenLayers 3 website") - Wrapper for GWT using the new JSInterop-Features of the [GWT-SDK 2.8.0](http://www.gwtproject.org/versions.html "Link to GWT-SDK Downloads"). The project consists of two parts:
* a GWT wrapper for OpenLayers 3 (gwt-ol3-client)
* a demo module for showing wrapper functionality (gwt-ol3-demo)
You can build and run the application with Maven. If you would like to test superdev-mode you can run it on module `gwt-ol-demo` with the goal `gwt:run`. To only start the codeserver, e.g. using superdev-mode with your servlet container, use goal `gwt:run-codeserver`.
If you want to build the application without Maven please consider the following hints:
* Building the application with older GWT-SDK than 2.8.0-beta1 (e.g. SDK 2.7.0) will not work. You can download the SDK 2.8.0-beta1 [here](http://goo.gl/62SeR5) | GWT-OL3-Playground
==================
[](https://travis-ci.org/TDesjardins/GWT-OL3-Playground)
- A [OpenLayers 3](http://openlayers.org/ "OpenLayers 3 website") - Wrapper for GWT using the new JSInterop-Features of the [GWT-SDK 2.7.0](http://www.gwtproject.org/versions.html "Link to GWT-SDK Downloads"). The project consists of two parts:
? ^
+ A [OpenLayers 3](http://openlayers.org/ "OpenLayers 3 website") - Wrapper for GWT using the new JSInterop-Features of the [GWT-SDK 2.8.0](http://www.gwtproject.org/versions.html "Link to GWT-SDK Downloads"). The project consists of two parts:
? ^
* a GWT wrapper for OpenLayers 3 (gwt-ol3-client)
* a demo module for showing wrapper functionality (gwt-ol3-demo)
You can build and run the application with Maven. If you would like to test superdev-mode you can run it on module `gwt-ol-demo` with the goal `gwt:run`. To only start the codeserver, e.g. using superdev-mode with your servlet container, use goal `gwt:run-codeserver`.
If you want to build the application without Maven please consider the following hints:
- * Building the application with older GWT-SDK than 2.7.0 (e.g. SDK 2.6.1) will not work. You can download the latest SDK at http://www.gwtproject.org/versions.html
? ^ ^ ^ ------- ^ ^^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^^^
+ * Building the application with older GWT-SDK than 2.8.0-beta1 (e.g. SDK 2.7.0) will not work. You can download the SDK 2.8.0-beta1 [here](http://goo.gl/62SeR5)
? ^ ++++++ ^ ^ +++++++++ ^ +++++++ ^^^ ^^^^^ ^^^
-
- * It is essential to compile the application with compiler args `-XjsInteropMode JS`. | 6 | 0.352941 | 2 | 4 |
b79fc913157c62443bbb539f9588488329576894 | src/SepomexPhp/Locations.php | src/SepomexPhp/Locations.php | <?php
namespace SepomexPhp;
class Locations implements \IteratorAggregate, \Countable
{
/** @var Location[] */
private $collection;
public function __construct(Location ...$location)
{
$this->collection = $location;
}
public function getIterator()
{
return new \ArrayIterator($this->collection);
}
public function count(): int
{
return count($this->collection);
}
/**
* @return Cities|City[]
*/
public function cities(): Cities
{
$cities = [];
foreach ($this->collection as $location) {
if ($location->hasCity()) {
$city = $location->city();
if (! array_key_exists($city->id(), $cities)) {
$cities[$city->id()] = $location->city();
}
}
}
return new Cities(...$cities);
}
public function asArray(): array
{
$array = [];
foreach ($this->collection as $location) {
$array[] = $location->asArray();
}
return $array;
}
}
| <?php
namespace SepomexPhp;
class Locations implements \IteratorAggregate, \Countable
{
/** @var Location[] */
private $collection;
public function __construct(Location ...$location)
{
$this->collection = $location;
public static function extractUniqueCities(Location ...$locations): Cities
{
// This method is static because it does not use $this
$cities = [];
foreach ($locations as $location) {
if ($location->hasCity()) {
$city = $location->city();
if (! array_key_exists($city->id(), $cities)) {
$cities[$city->id()] = $location->city();
}
}
}
return new Cities(...$cities);
}
public function getIterator()
{
return new \ArrayIterator($this->collection);
}
public function count(): int
{
return count($this->collection);
}
/**
* @return Cities|City[]
*/
public function cities(): Cities
{
$cities = [];
foreach ($this->collection as $location) {
if ($location->hasCity()) {
$city = $location->city();
if (! array_key_exists($city->id(), $cities)) {
$cities[$city->id()] = $location->city();
}
}
}
return new Cities(...$cities);
}
public function asArray(): array
{
$array = [];
foreach ($this->collection as $location) {
$array[] = $location->asArray();
}
return $array;
}
}
| Add method to extract unique cities from locations array | Add method to extract unique cities from locations array
| PHP | mit | eclipxe13/sepomexphp | php | ## Code Before:
<?php
namespace SepomexPhp;
class Locations implements \IteratorAggregate, \Countable
{
/** @var Location[] */
private $collection;
public function __construct(Location ...$location)
{
$this->collection = $location;
}
public function getIterator()
{
return new \ArrayIterator($this->collection);
}
public function count(): int
{
return count($this->collection);
}
/**
* @return Cities|City[]
*/
public function cities(): Cities
{
$cities = [];
foreach ($this->collection as $location) {
if ($location->hasCity()) {
$city = $location->city();
if (! array_key_exists($city->id(), $cities)) {
$cities[$city->id()] = $location->city();
}
}
}
return new Cities(...$cities);
}
public function asArray(): array
{
$array = [];
foreach ($this->collection as $location) {
$array[] = $location->asArray();
}
return $array;
}
}
## Instruction:
Add method to extract unique cities from locations array
## Code After:
<?php
namespace SepomexPhp;
class Locations implements \IteratorAggregate, \Countable
{
/** @var Location[] */
private $collection;
public function __construct(Location ...$location)
{
$this->collection = $location;
public static function extractUniqueCities(Location ...$locations): Cities
{
// This method is static because it does not use $this
$cities = [];
foreach ($locations as $location) {
if ($location->hasCity()) {
$city = $location->city();
if (! array_key_exists($city->id(), $cities)) {
$cities[$city->id()] = $location->city();
}
}
}
return new Cities(...$cities);
}
public function getIterator()
{
return new \ArrayIterator($this->collection);
}
public function count(): int
{
return count($this->collection);
}
/**
* @return Cities|City[]
*/
public function cities(): Cities
{
$cities = [];
foreach ($this->collection as $location) {
if ($location->hasCity()) {
$city = $location->city();
if (! array_key_exists($city->id(), $cities)) {
$cities[$city->id()] = $location->city();
}
}
}
return new Cities(...$cities);
}
public function asArray(): array
{
$array = [];
foreach ($this->collection as $location) {
$array[] = $location->asArray();
}
return $array;
}
}
| <?php
namespace SepomexPhp;
class Locations implements \IteratorAggregate, \Countable
{
/** @var Location[] */
private $collection;
public function __construct(Location ...$location)
{
$this->collection = $location;
+
+ public static function extractUniqueCities(Location ...$locations): Cities
+ {
+ // This method is static because it does not use $this
+ $cities = [];
+ foreach ($locations as $location) {
+ if ($location->hasCity()) {
+ $city = $location->city();
+ if (! array_key_exists($city->id(), $cities)) {
+ $cities[$city->id()] = $location->city();
+ }
+ }
+ }
+ return new Cities(...$cities);
}
public function getIterator()
{
return new \ArrayIterator($this->collection);
}
public function count(): int
{
return count($this->collection);
}
/**
* @return Cities|City[]
*/
public function cities(): Cities
{
$cities = [];
foreach ($this->collection as $location) {
if ($location->hasCity()) {
$city = $location->city();
if (! array_key_exists($city->id(), $cities)) {
$cities[$city->id()] = $location->city();
}
}
}
return new Cities(...$cities);
}
public function asArray(): array
{
$array = [];
foreach ($this->collection as $location) {
$array[] = $location->asArray();
}
return $array;
}
} | 14 | 0.285714 | 14 | 0 |
b5429f99a49631390261994a5ca8283b548d0564 | rfc3797.go | rfc3797.go | package rfc3797
import (
"math"
)
func main() {
}
func Entropy(n int, p int) int {
i := 0
result := 0.0
// These cases represent invalid input values.
if (n < 1) || (n >= p) {
return 0.0
}
for i = p; i > (p - n); i-- {
result += math.Log(float64(i))
}
for i = n; i > 1; i-- {
result -= math.Log(float64(i))
}
// Convert to the number of bits required.
result /= math.Log(float64(2))
// Return the number of bits reqr'd.
return int(math.Ceil(result))
}
| package rfc3797
import (
"math"
)
func main() {
}
func usage() {
}
func Entropy(n int, p int) int {
i := 0
result := 0.0
// These cases represent invalid input values.
if (n < 1) || (n >= p) {
return 0
}
for i = p; i > (p - n); i-- {
result += math.Log(float64(i))
}
for i = n; i > 1; i-- {
result -= math.Log(float64(i))
}
// Convert to the number of bits required.
result /= math.Log(float64(2))
// Return the number of bits reqr'd.
return int(math.Ceil(result))
}
| Return value for degenerate cases is more clearly not a float. | Return value for degenerate cases is more clearly not a float.
| Go | isc | kyleroot/go-sortition | go | ## Code Before:
package rfc3797
import (
"math"
)
func main() {
}
func Entropy(n int, p int) int {
i := 0
result := 0.0
// These cases represent invalid input values.
if (n < 1) || (n >= p) {
return 0.0
}
for i = p; i > (p - n); i-- {
result += math.Log(float64(i))
}
for i = n; i > 1; i-- {
result -= math.Log(float64(i))
}
// Convert to the number of bits required.
result /= math.Log(float64(2))
// Return the number of bits reqr'd.
return int(math.Ceil(result))
}
## Instruction:
Return value for degenerate cases is more clearly not a float.
## Code After:
package rfc3797
import (
"math"
)
func main() {
}
func usage() {
}
func Entropy(n int, p int) int {
i := 0
result := 0.0
// These cases represent invalid input values.
if (n < 1) || (n >= p) {
return 0
}
for i = p; i > (p - n); i-- {
result += math.Log(float64(i))
}
for i = n; i > 1; i-- {
result -= math.Log(float64(i))
}
// Convert to the number of bits required.
result /= math.Log(float64(2))
// Return the number of bits reqr'd.
return int(math.Ceil(result))
}
| package rfc3797
import (
"math"
)
func main() {
}
+ func usage() {
+
+ }
+
func Entropy(n int, p int) int {
i := 0
result := 0.0
// These cases represent invalid input values.
if (n < 1) || (n >= p) {
- return 0.0
? --
+ return 0
}
for i = p; i > (p - n); i-- {
result += math.Log(float64(i))
}
for i = n; i > 1; i-- {
result -= math.Log(float64(i))
}
// Convert to the number of bits required.
result /= math.Log(float64(2))
// Return the number of bits reqr'd.
return int(math.Ceil(result))
} | 6 | 0.181818 | 5 | 1 |
ead960958b97975c73851633e4c530ada3f374b8 | gulpfile.js | gulpfile.js | 'use strict';
const gulp = require('gulp'),
fs = require('fs'),
plumber = require('gulp-plumber');
const options = {
source: 'templates',
dist: 'dist',
workingDir: 'tmp',
src: function plumbedSrc() {
return gulp.src.apply(gulp, arguments).pipe(plumber());
}
};
/**
* Load tasks from the '/tasks' directory.
*/
const build = require('./tasks/build')(options);
const checkDeps = require('./tasks/check-deps')(options);
const dupe = require('./tasks/dupe')(options);
const less = require('./tasks/less')(options);
const lint = require('./tasks/lint')(options);
const postcss = require('./tasks/postcss')(options);
const sass = require('./tasks/sass')(options);
/* By default templates will be built into '/dist' */
gulp.task(
'default',
gulp.series(
('dupe', 'less', 'sass', 'postcss', 'lint', 'build'),
() => {
/* gulp will watch for changes in '/templates'. */
gulp.watch(
[
options.source + '/**/*.html',
options.source + '/**/*.css',
options.source + '/**/*.scss',
options.source + '/**/*.less',
options.source + '/**/conf.json'
],
{ delay: 500 },
gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build')
)
}
)
);
| 'use strict';
const gulp = require('gulp'),
fs = require('fs'),
plumber = require('gulp-plumber');
const options = {
source: 'templates',
dist: 'dist',
workingDir: 'tmp',
src: function plumbedSrc() {
return gulp.src.apply(gulp, arguments).pipe(plumber());
}
};
/**
* Load tasks from the '/tasks' directory.
*/
const build = require('./tasks/build')(options);
const checkDeps = require('./tasks/check-deps')(options);
const dupe = require('./tasks/dupe')(options);
const less = require('./tasks/less')(options);
const lint = require('./tasks/lint')(options);
const postcss = require('./tasks/postcss')(options);
const sass = require('./tasks/sass')(options);
/* Runs the entire pipeline once. */
gulp.task('run-pipeline', gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build'));
/* By default templates will be built into '/dist'. */
gulp.task(
'default',
gulp.series(
'run-pipeline',
() => {
/* gulp will watch for changes in '/templates'. */
gulp.watch(
[
options.source + '/**/*.html',
options.source + '/**/*.css',
options.source + '/**/*.scss',
options.source + '/**/*.less',
options.source + '/**/conf.json'
],
{ delay: 500 },
gulp.series('run-pipeline')
)
}
)
);
| Create a gulp task to run pipeline once | Create a gulp task to run pipeline once
| JavaScript | mit | fadeit/responsive-html-email-signature,fadeit/responsive-html-email-signature | javascript | ## Code Before:
'use strict';
const gulp = require('gulp'),
fs = require('fs'),
plumber = require('gulp-plumber');
const options = {
source: 'templates',
dist: 'dist',
workingDir: 'tmp',
src: function plumbedSrc() {
return gulp.src.apply(gulp, arguments).pipe(plumber());
}
};
/**
* Load tasks from the '/tasks' directory.
*/
const build = require('./tasks/build')(options);
const checkDeps = require('./tasks/check-deps')(options);
const dupe = require('./tasks/dupe')(options);
const less = require('./tasks/less')(options);
const lint = require('./tasks/lint')(options);
const postcss = require('./tasks/postcss')(options);
const sass = require('./tasks/sass')(options);
/* By default templates will be built into '/dist' */
gulp.task(
'default',
gulp.series(
('dupe', 'less', 'sass', 'postcss', 'lint', 'build'),
() => {
/* gulp will watch for changes in '/templates'. */
gulp.watch(
[
options.source + '/**/*.html',
options.source + '/**/*.css',
options.source + '/**/*.scss',
options.source + '/**/*.less',
options.source + '/**/conf.json'
],
{ delay: 500 },
gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build')
)
}
)
);
## Instruction:
Create a gulp task to run pipeline once
## Code After:
'use strict';
const gulp = require('gulp'),
fs = require('fs'),
plumber = require('gulp-plumber');
const options = {
source: 'templates',
dist: 'dist',
workingDir: 'tmp',
src: function plumbedSrc() {
return gulp.src.apply(gulp, arguments).pipe(plumber());
}
};
/**
* Load tasks from the '/tasks' directory.
*/
const build = require('./tasks/build')(options);
const checkDeps = require('./tasks/check-deps')(options);
const dupe = require('./tasks/dupe')(options);
const less = require('./tasks/less')(options);
const lint = require('./tasks/lint')(options);
const postcss = require('./tasks/postcss')(options);
const sass = require('./tasks/sass')(options);
/* Runs the entire pipeline once. */
gulp.task('run-pipeline', gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build'));
/* By default templates will be built into '/dist'. */
gulp.task(
'default',
gulp.series(
'run-pipeline',
() => {
/* gulp will watch for changes in '/templates'. */
gulp.watch(
[
options.source + '/**/*.html',
options.source + '/**/*.css',
options.source + '/**/*.scss',
options.source + '/**/*.less',
options.source + '/**/conf.json'
],
{ delay: 500 },
gulp.series('run-pipeline')
)
}
)
);
| 'use strict';
const gulp = require('gulp'),
fs = require('fs'),
plumber = require('gulp-plumber');
const options = {
source: 'templates',
dist: 'dist',
workingDir: 'tmp',
src: function plumbedSrc() {
return gulp.src.apply(gulp, arguments).pipe(plumber());
}
};
/**
* Load tasks from the '/tasks' directory.
*/
const build = require('./tasks/build')(options);
const checkDeps = require('./tasks/check-deps')(options);
const dupe = require('./tasks/dupe')(options);
const less = require('./tasks/less')(options);
const lint = require('./tasks/lint')(options);
const postcss = require('./tasks/postcss')(options);
const sass = require('./tasks/sass')(options);
+ /* Runs the entire pipeline once. */
+ gulp.task('run-pipeline', gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build'));
+
- /* By default templates will be built into '/dist' */
+ /* By default templates will be built into '/dist'. */
? +
gulp.task(
'default',
gulp.series(
- ('dupe', 'less', 'sass', 'postcss', 'lint', 'build'),
+ 'run-pipeline',
() => {
/* gulp will watch for changes in '/templates'. */
gulp.watch(
[
options.source + '/**/*.html',
options.source + '/**/*.css',
options.source + '/**/*.scss',
options.source + '/**/*.less',
options.source + '/**/conf.json'
],
{ delay: 500 },
- gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build')
+ gulp.series('run-pipeline')
)
}
)
); | 9 | 0.191489 | 6 | 3 |
7ad15ba1578fd6fd4d4aa3cc86a2c02e0dc2efb5 | src/adapters.coffee | src/adapters.coffee | Rivets.adapters['.'] =
id: '_rv'
counter: 0
weakmap: {}
subscribe: (obj, keypath, callback) ->
unless obj[@id]?
obj[@id] = @counter++
@weakmap[obj[@id]] = {}
map = @weakmap[obj[@id]]
unless map[keypath]?
map[keypath] = []
value = obj[keypath]
Object.defineProperty obj, keypath,
get: -> value
set: (newValue) ->
if newValue isnt value
value = newValue
callback() for callback in map[keypath]
unless callback in map[keypath]
map[keypath].push callback
unsubscribe: (obj, keypath, callback) ->
callbacks = @weakmap[obj[@id]][keypath]
callbacks.splice callbacks.indexOf(callback), 1
read: (obj, keypath) ->
obj[keypath]
publish: (obj, keypath, value) ->
obj[keypath] = value
| Rivets.adapters['.'] =
id: '_rv'
counter: 0
weakmap: {}
subscribe: (obj, keypath, callback) ->
unless obj[@id]?
id = @counter++
Object.defineProperty obj, @id,
enumerable: false
configurable: false
writable: false
value: id
@weakmap[id] = {}
map = @weakmap[obj[@id]]
unless map[keypath]?
map[keypath] = []
value = obj[keypath]
Object.defineProperty obj, keypath,
get: -> value
set: (newValue) ->
if newValue isnt value
value = newValue
callback() for callback in map[keypath]
unless callback in map[keypath]
map[keypath].push callback
unsubscribe: (obj, keypath, callback) ->
callbacks = @weakmap[obj[@id]][keypath]
callbacks.splice callbacks.indexOf(callback), 1
read: (obj, keypath) ->
obj[keypath]
publish: (obj, keypath, value) ->
obj[keypath] = value
| Define the _rv object id as a non-enumerable, non-configurable, non-writable property on the object. | Define the _rv object id as a non-enumerable, non-configurable, non-writable property on the object.
| CoffeeScript | mit | mikeric/rivets,re-clone/rivets,zongkelong/rivets,zongkelong/rivets,re-clone/rivets,nopnop/rivets,zongkelong/rivets,MishaMykhalyuk/rivets,mikeric/rivets,MishaMykhalyuk/rivets,MishaMykhalyuk/rivets,kangax/rivets,QAPInt/rivets,nopnop/rivets,jccazeaux/rivets,jccazeaux/rivets,altmind/rivets,GerHobbelt/rivets,mikeric/rivets,altmind/rivets,GerHobbelt/rivets,benderTheCrime/tiny-rivets,nopnop/rivets,moneyadviceservice/rivets,GerHobbelt/rivets,jccazeaux/rivets,npmcomponent/mikeric-rivets,QAPInt/rivets,QAPInt/rivets,re-clone/rivets,altmind/rivets | coffeescript | ## Code Before:
Rivets.adapters['.'] =
id: '_rv'
counter: 0
weakmap: {}
subscribe: (obj, keypath, callback) ->
unless obj[@id]?
obj[@id] = @counter++
@weakmap[obj[@id]] = {}
map = @weakmap[obj[@id]]
unless map[keypath]?
map[keypath] = []
value = obj[keypath]
Object.defineProperty obj, keypath,
get: -> value
set: (newValue) ->
if newValue isnt value
value = newValue
callback() for callback in map[keypath]
unless callback in map[keypath]
map[keypath].push callback
unsubscribe: (obj, keypath, callback) ->
callbacks = @weakmap[obj[@id]][keypath]
callbacks.splice callbacks.indexOf(callback), 1
read: (obj, keypath) ->
obj[keypath]
publish: (obj, keypath, value) ->
obj[keypath] = value
## Instruction:
Define the _rv object id as a non-enumerable, non-configurable, non-writable property on the object.
## Code After:
Rivets.adapters['.'] =
id: '_rv'
counter: 0
weakmap: {}
subscribe: (obj, keypath, callback) ->
unless obj[@id]?
id = @counter++
Object.defineProperty obj, @id,
enumerable: false
configurable: false
writable: false
value: id
@weakmap[id] = {}
map = @weakmap[obj[@id]]
unless map[keypath]?
map[keypath] = []
value = obj[keypath]
Object.defineProperty obj, keypath,
get: -> value
set: (newValue) ->
if newValue isnt value
value = newValue
callback() for callback in map[keypath]
unless callback in map[keypath]
map[keypath].push callback
unsubscribe: (obj, keypath, callback) ->
callbacks = @weakmap[obj[@id]][keypath]
callbacks.splice callbacks.indexOf(callback), 1
read: (obj, keypath) ->
obj[keypath]
publish: (obj, keypath, value) ->
obj[keypath] = value
| Rivets.adapters['.'] =
id: '_rv'
counter: 0
weakmap: {}
subscribe: (obj, keypath, callback) ->
unless obj[@id]?
- obj[@id] = @counter++
? ----- -
+ id = @counter++
+
+ Object.defineProperty obj, @id,
+ enumerable: false
+ configurable: false
+ writable: false
+ value: id
+
- @weakmap[obj[@id]] = {}
? ----- -
+ @weakmap[id] = {}
map = @weakmap[obj[@id]]
unless map[keypath]?
map[keypath] = []
value = obj[keypath]
Object.defineProperty obj, keypath,
get: -> value
set: (newValue) ->
if newValue isnt value
value = newValue
callback() for callback in map[keypath]
unless callback in map[keypath]
map[keypath].push callback
unsubscribe: (obj, keypath, callback) ->
callbacks = @weakmap[obj[@id]][keypath]
callbacks.splice callbacks.indexOf(callback), 1
read: (obj, keypath) ->
obj[keypath]
publish: (obj, keypath, value) ->
obj[keypath] = value | 11 | 0.314286 | 9 | 2 |
886bf4779aea1e1a0d47fb2d8750a7f3b30112cc | _config.yml | _config.yml | title: Course title
email: your-email@domain.com
description: > # this means to ignore newlines until "baseurl:"
Name, Instructor • Course Number, Semester • Day, Time
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://yourdomain.com" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll
gems: [jekyll-paginate]
# Build settings
markdown: kramdown
# pagination
paginate: 5
paginate_path: "page:num"
# Collections
collections:
presentations:
output: true
| title: Web Projects
email: kegan@risd.edu
description: > # this means to ignore newlines until "baseurl:"
Kelly Egan, Instructor • Photo‐5345, Spring 2016 • Thurs., 1 – 6pm
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://web-projects-course.github.io" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll
gems: [jekyll-paginate]
# Build settings
markdown: kramdown
# pagination
paginate: 5
paginate_path: "page:num"
# Collections
collections:
presentations:
output: true
| Update config.yml to be semester specifics. | Update config.yml to be semester specifics.
| YAML | mit | Web-Projects-Course/web-projects-course.github.io,Web-Projects-Course/web-projects-course.github.io | yaml | ## Code Before:
title: Course title
email: your-email@domain.com
description: > # this means to ignore newlines until "baseurl:"
Name, Instructor • Course Number, Semester • Day, Time
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://yourdomain.com" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll
gems: [jekyll-paginate]
# Build settings
markdown: kramdown
# pagination
paginate: 5
paginate_path: "page:num"
# Collections
collections:
presentations:
output: true
## Instruction:
Update config.yml to be semester specifics.
## Code After:
title: Web Projects
email: kegan@risd.edu
description: > # this means to ignore newlines until "baseurl:"
Kelly Egan, Instructor • Photo‐5345, Spring 2016 • Thurs., 1 – 6pm
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://web-projects-course.github.io" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll
gems: [jekyll-paginate]
# Build settings
markdown: kramdown
# pagination
paginate: 5
paginate_path: "page:num"
# Collections
collections:
presentations:
output: true
| - title: Course title
- email: your-email@domain.com
+ title: Web Projects
+ email: kegan@risd.edu
description: > # this means to ignore newlines until "baseurl:"
- Name, Instructor • Course Number, Semester • Day, Time
+ Kelly Egan, Instructor • Photo‐5345, Spring 2016 • Thurs., 1 – 6pm
baseurl: "" # the subpath of your site, e.g. /blog
- url: "http://yourdomain.com" # the base hostname & protocol for your site
? ^ ^ --------
+ url: "http://web-projects-course.github.io" # the base hostname & protocol for your site
? ^^^^^^^^^^^^^^ ^^^^^^^^^^^
twitter_username: jekyllrb
github_username: jekyll
gems: [jekyll-paginate]
# Build settings
markdown: kramdown
# pagination
paginate: 5
paginate_path: "page:num"
# Collections
collections:
presentations:
output: true | 8 | 0.380952 | 4 | 4 |
f74bbf317f600916f058f32a0f429ae03cdd3a6f | README.md | README.md | WatchMe App for Android
=========
Android app for keeping track of movies.
| WatchMe App for Android
=========
Android app for keeping track of movies.
Develop
-------
git clone git://github.com/johanbrook/watchme.git
Import project into Eclipse.
Install and run
----------------
Find binary `WatchMe.apk` file in the `/bin` directory. Install on phone. | Update ReadMe with installation instructions | Update ReadMe with installation instructions
| Markdown | mit | johanbrook/watchme | markdown | ## Code Before:
WatchMe App for Android
=========
Android app for keeping track of movies.
## Instruction:
Update ReadMe with installation instructions
## Code After:
WatchMe App for Android
=========
Android app for keeping track of movies.
Develop
-------
git clone git://github.com/johanbrook/watchme.git
Import project into Eclipse.
Install and run
----------------
Find binary `WatchMe.apk` file in the `/bin` directory. Install on phone. | WatchMe App for Android
=========
Android app for keeping track of movies.
+
+ Develop
+ -------
+
+ git clone git://github.com/johanbrook/watchme.git
+
+ Import project into Eclipse.
+
+ Install and run
+ ----------------
+
+ Find binary `WatchMe.apk` file in the `/bin` directory. Install on phone. | 12 | 3 | 12 | 0 |
0447c2274e6ccbb0ffd3c343ba2bf7f4d1d089d3 | src/Listener/AddClientAssets.php | src/Listener/AddClientAssets.php | <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Auth\GitHub\Listener;
use Flarum\Event\ConfigureWebApp;
use Illuminate\Contracts\Events\Dispatcher;
class AddClientAssets
{
/**
* @param Dispatcher $events
*/
public function subscribe(Dispatcher $events)
{
$events->listen(ConfigureWebApp::class, [$this, 'addAssets']);
}
/**
* @param ConfigureClientView $event
*/
public function addAssets(ConfigureWebApp $event)
{
if ($event->isForum()) {
$event->addAssets([
__DIR__.'/../../js/forum/dist/extension.js',
__DIR__.'/../../less/forum/extension.less'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
if ($event->isAdmin()) {
$event->addAssets([
__DIR__.'/../../js/admin/dist/extension.js'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
}
}
| <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Auth\GitHub\Listener;
use Flarum\Frontend\Event\Rendering;
use Illuminate\Contracts\Events\Dispatcher;
class AddClientAssets
{
/**
* @param Dispatcher $events
*/
public function subscribe(Dispatcher $events)
{
$events->listen(Rendering::class, [$this, 'addAssets']);
}
/**
* @param Rendering $event
*/
public function addAssets(Rendering $event)
{
if ($event->isForum()) {
$event->addAssets([
__DIR__.'/../../js/forum/dist/extension.js',
__DIR__.'/../../less/forum/extension.less'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
if ($event->isAdmin()) {
$event->addAssets([
__DIR__.'/../../js/admin/dist/extension.js'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
}
}
| Update namespaces for beta 8 | Update namespaces for beta 8
Refs flarum/core#1235.
| PHP | mit | flarum/github,flarum/github,flarum/auth-github,flarum/auth-github,flarum/flarum-ext-auth-github,flarum/github,flarum/flarum-ext-auth-github | php | ## Code Before:
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Auth\GitHub\Listener;
use Flarum\Event\ConfigureWebApp;
use Illuminate\Contracts\Events\Dispatcher;
class AddClientAssets
{
/**
* @param Dispatcher $events
*/
public function subscribe(Dispatcher $events)
{
$events->listen(ConfigureWebApp::class, [$this, 'addAssets']);
}
/**
* @param ConfigureClientView $event
*/
public function addAssets(ConfigureWebApp $event)
{
if ($event->isForum()) {
$event->addAssets([
__DIR__.'/../../js/forum/dist/extension.js',
__DIR__.'/../../less/forum/extension.less'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
if ($event->isAdmin()) {
$event->addAssets([
__DIR__.'/../../js/admin/dist/extension.js'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
}
}
## Instruction:
Update namespaces for beta 8
Refs flarum/core#1235.
## Code After:
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Auth\GitHub\Listener;
use Flarum\Frontend\Event\Rendering;
use Illuminate\Contracts\Events\Dispatcher;
class AddClientAssets
{
/**
* @param Dispatcher $events
*/
public function subscribe(Dispatcher $events)
{
$events->listen(Rendering::class, [$this, 'addAssets']);
}
/**
* @param Rendering $event
*/
public function addAssets(Rendering $event)
{
if ($event->isForum()) {
$event->addAssets([
__DIR__.'/../../js/forum/dist/extension.js',
__DIR__.'/../../less/forum/extension.less'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
if ($event->isAdmin()) {
$event->addAssets([
__DIR__.'/../../js/admin/dist/extension.js'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
}
}
| <?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Auth\GitHub\Listener;
- use Flarum\Event\ConfigureWebApp;
+ use Flarum\Frontend\Event\Rendering;
use Illuminate\Contracts\Events\Dispatcher;
class AddClientAssets
{
/**
* @param Dispatcher $events
*/
public function subscribe(Dispatcher $events)
{
- $events->listen(ConfigureWebApp::class, [$this, 'addAssets']);
? ^^ ^ ---------
+ $events->listen(Rendering::class, [$this, 'addAssets']);
? ^^ ^^^ +
}
/**
- * @param ConfigureClientView $event
+ * @param Rendering $event
*/
- public function addAssets(ConfigureWebApp $event)
? ^^ ^ ---------
+ public function addAssets(Rendering $event)
? ^^ ^^^ +
{
if ($event->isForum()) {
$event->addAssets([
__DIR__.'/../../js/forum/dist/extension.js',
__DIR__.'/../../less/forum/extension.less'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
if ($event->isAdmin()) {
$event->addAssets([
__DIR__.'/../../js/admin/dist/extension.js'
]);
$event->addBootstrapper('flarum/auth/github/main');
}
}
} | 8 | 0.170213 | 4 | 4 |
83ea606278994d54be2f120f8544c689642a65ab | src/filters/moment-date.filter.coffee | src/filters/moment-date.filter.coffee | angular.module('impac.filters.moment-date', []).filter('momentDate', ($translate, ImpacTheming) ->
(date, component) ->
moment.locale($translate.use().toLowerCase())
validPeriods = ['daily', 'weekly', 'monthly', 'quarterly', 'yearly', 'default']
if !_.isEmpty(component) && validPeriods.includes(component.toLowerCase())
component = 'period-' + component.toLowerCase()
settings = ImpacTheming.get()
format = settings.dateFormatterSettings.default
if settings.dateFormatterSettings.formats && settings.dateFormatterSettings.formats[component]
format = settings.dateFormatterSettings.formats[component]
return moment(date).format(format)
)
| angular.module('impac.filters.moment-date', []).filter('momentDate', ($translate, ImpacTheming) ->
(date, component) ->
moment.locale($translate.use().toLowerCase())
validPeriods = ['daily', 'weekly', 'monthly', 'quarterly', 'yearly', 'default']
if !_.isEmpty(component) && _.includes(validPeriods, component.toLowerCase())
component = 'period-' + component.toLowerCase()
settings = ImpacTheming.get()
format = settings.dateFormatterSettings.default
if settings.dateFormatterSettings.formats && settings.dateFormatterSettings.formats[component]
format = settings.dateFormatterSettings.formats[component]
return moment(date).format(format)
)
| Refactor using lodash for ie11 | Refactor using lodash for ie11
| CoffeeScript | apache-2.0 | xaun/impac-angular,maestrano/impac-angular,xaun/impac-angular,maestrano/impac-angular | coffeescript | ## Code Before:
angular.module('impac.filters.moment-date', []).filter('momentDate', ($translate, ImpacTheming) ->
(date, component) ->
moment.locale($translate.use().toLowerCase())
validPeriods = ['daily', 'weekly', 'monthly', 'quarterly', 'yearly', 'default']
if !_.isEmpty(component) && validPeriods.includes(component.toLowerCase())
component = 'period-' + component.toLowerCase()
settings = ImpacTheming.get()
format = settings.dateFormatterSettings.default
if settings.dateFormatterSettings.formats && settings.dateFormatterSettings.formats[component]
format = settings.dateFormatterSettings.formats[component]
return moment(date).format(format)
)
## Instruction:
Refactor using lodash for ie11
## Code After:
angular.module('impac.filters.moment-date', []).filter('momentDate', ($translate, ImpacTheming) ->
(date, component) ->
moment.locale($translate.use().toLowerCase())
validPeriods = ['daily', 'weekly', 'monthly', 'quarterly', 'yearly', 'default']
if !_.isEmpty(component) && _.includes(validPeriods, component.toLowerCase())
component = 'period-' + component.toLowerCase()
settings = ImpacTheming.get()
format = settings.dateFormatterSettings.default
if settings.dateFormatterSettings.formats && settings.dateFormatterSettings.formats[component]
format = settings.dateFormatterSettings.formats[component]
return moment(date).format(format)
)
| angular.module('impac.filters.moment-date', []).filter('momentDate', ($translate, ImpacTheming) ->
(date, component) ->
moment.locale($translate.use().toLowerCase())
validPeriods = ['daily', 'weekly', 'monthly', 'quarterly', 'yearly', 'default']
- if !_.isEmpty(component) && validPeriods.includes(component.toLowerCase())
? ^^^^^^^^^^
+ if !_.isEmpty(component) && _.includes(validPeriods, component.toLowerCase())
? +++++++++++ ^^
component = 'period-' + component.toLowerCase()
settings = ImpacTheming.get()
format = settings.dateFormatterSettings.default
if settings.dateFormatterSettings.formats && settings.dateFormatterSettings.formats[component]
format = settings.dateFormatterSettings.formats[component]
return moment(date).format(format)
) | 2 | 0.125 | 1 | 1 |
40a5421507d3cdc69e321446dd098310ea456820 | app/models/appointment.rb | app/models/appointment.rb | class Appointment < ActiveRecord::Base
audited on: [:update]
enum status: %i(
pending
completed
no_show
ineligible_age
ineligible_pension_type
cancelled_by_customer
cancelled_by_pension_wise
)
before_validation :calculate_fulfilment_time, if: :proceeded_at_changed?
before_validation :calculate_fulfilment_window, if: :proceeded_at_changed?
belongs_to :booking_request
delegate :reference, to: :booking_request
validates :name, presence: true
validates :email, presence: true
validates :phone, presence: true
validates :location_id, presence: true
validates :guider_id, presence: true
validate :validate_proceeded_at
def updated?
audits.present?
end
def notify?
previous_changes.exclude?(:status)
end
private
def calculate_fulfilment_time
self.fulfilment_time_seconds = (proceeded_at.to_i - booking_request.created_at.to_i).abs
end
def calculate_fulfilment_window
return unless booking_request.primary_slot
self.fulfilment_window_seconds =
(proceeded_at.to_i - booking_request.primary_slot.mid_point.to_i).abs
end
def validate_proceeded_at
errors.add(:proceeded_at, 'must be present') unless proceeded_at.present?
Time.zone.parse(proceeded_at.to_s)
rescue ArgumentError
errors.add(:proceeded_at, 'must be formatted correctly')
end
end
| class Appointment < ActiveRecord::Base
audited on: [:update]
enum status: %i(
pending
completed
no_show
ineligible_age
ineligible_pension_type
cancelled_by_customer
cancelled_by_pension_wise
)
before_validation :calculate_statistics, if: :proceeded_at_changed?
belongs_to :booking_request
delegate :reference, to: :booking_request
validates :name, presence: true
validates :email, presence: true
validates :phone, presence: true
validates :location_id, presence: true
validates :guider_id, presence: true
validate :validate_proceeded_at
def updated?
audits.present?
end
def notify?
previous_changes.exclude?(:status)
end
def calculate_statistics
calculate_fulfilment_time
calculate_fulfilment_window
end
private
def calculate_fulfilment_time
self.fulfilment_time_seconds = (proceeded_at.to_i - booking_request.created_at.to_i).abs
end
def calculate_fulfilment_window
return unless booking_request.primary_slot
self.fulfilment_window_seconds =
(proceeded_at.to_i - booking_request.primary_slot.mid_point.to_i).abs
end
def validate_proceeded_at
errors.add(:proceeded_at, 'must be present') unless proceeded_at.present?
Time.zone.parse(proceeded_at.to_s)
rescue ArgumentError
errors.add(:proceeded_at, 'must be formatted correctly')
end
end
| Make statistics calculation general purpose | Make statistics calculation general purpose
There's no point calling these things seperately.
| Ruby | mit | guidance-guarantee-programme/planner,guidance-guarantee-programme/planner,guidance-guarantee-programme/planner | ruby | ## Code Before:
class Appointment < ActiveRecord::Base
audited on: [:update]
enum status: %i(
pending
completed
no_show
ineligible_age
ineligible_pension_type
cancelled_by_customer
cancelled_by_pension_wise
)
before_validation :calculate_fulfilment_time, if: :proceeded_at_changed?
before_validation :calculate_fulfilment_window, if: :proceeded_at_changed?
belongs_to :booking_request
delegate :reference, to: :booking_request
validates :name, presence: true
validates :email, presence: true
validates :phone, presence: true
validates :location_id, presence: true
validates :guider_id, presence: true
validate :validate_proceeded_at
def updated?
audits.present?
end
def notify?
previous_changes.exclude?(:status)
end
private
def calculate_fulfilment_time
self.fulfilment_time_seconds = (proceeded_at.to_i - booking_request.created_at.to_i).abs
end
def calculate_fulfilment_window
return unless booking_request.primary_slot
self.fulfilment_window_seconds =
(proceeded_at.to_i - booking_request.primary_slot.mid_point.to_i).abs
end
def validate_proceeded_at
errors.add(:proceeded_at, 'must be present') unless proceeded_at.present?
Time.zone.parse(proceeded_at.to_s)
rescue ArgumentError
errors.add(:proceeded_at, 'must be formatted correctly')
end
end
## Instruction:
Make statistics calculation general purpose
There's no point calling these things seperately.
## Code After:
class Appointment < ActiveRecord::Base
audited on: [:update]
enum status: %i(
pending
completed
no_show
ineligible_age
ineligible_pension_type
cancelled_by_customer
cancelled_by_pension_wise
)
before_validation :calculate_statistics, if: :proceeded_at_changed?
belongs_to :booking_request
delegate :reference, to: :booking_request
validates :name, presence: true
validates :email, presence: true
validates :phone, presence: true
validates :location_id, presence: true
validates :guider_id, presence: true
validate :validate_proceeded_at
def updated?
audits.present?
end
def notify?
previous_changes.exclude?(:status)
end
def calculate_statistics
calculate_fulfilment_time
calculate_fulfilment_window
end
private
def calculate_fulfilment_time
self.fulfilment_time_seconds = (proceeded_at.to_i - booking_request.created_at.to_i).abs
end
def calculate_fulfilment_window
return unless booking_request.primary_slot
self.fulfilment_window_seconds =
(proceeded_at.to_i - booking_request.primary_slot.mid_point.to_i).abs
end
def validate_proceeded_at
errors.add(:proceeded_at, 'must be present') unless proceeded_at.present?
Time.zone.parse(proceeded_at.to_s)
rescue ArgumentError
errors.add(:proceeded_at, 'must be formatted correctly')
end
end
| class Appointment < ActiveRecord::Base
audited on: [:update]
enum status: %i(
pending
completed
no_show
ineligible_age
ineligible_pension_type
cancelled_by_customer
cancelled_by_pension_wise
)
- before_validation :calculate_fulfilment_time, if: :proceeded_at_changed?
? ^^^^^^^^^ ^ ^^
+ before_validation :calculate_statistics, if: :proceeded_at_changed?
? ^ ^ ^^^^^
- before_validation :calculate_fulfilment_window, if: :proceeded_at_changed?
belongs_to :booking_request
delegate :reference, to: :booking_request
validates :name, presence: true
validates :email, presence: true
validates :phone, presence: true
validates :location_id, presence: true
validates :guider_id, presence: true
validate :validate_proceeded_at
def updated?
audits.present?
end
def notify?
previous_changes.exclude?(:status)
+ end
+
+ def calculate_statistics
+ calculate_fulfilment_time
+ calculate_fulfilment_window
end
private
def calculate_fulfilment_time
self.fulfilment_time_seconds = (proceeded_at.to_i - booking_request.created_at.to_i).abs
end
def calculate_fulfilment_window
return unless booking_request.primary_slot
self.fulfilment_window_seconds =
(proceeded_at.to_i - booking_request.primary_slot.mid_point.to_i).abs
end
def validate_proceeded_at
errors.add(:proceeded_at, 'must be present') unless proceeded_at.present?
Time.zone.parse(proceeded_at.to_s)
rescue ArgumentError
errors.add(:proceeded_at, 'must be formatted correctly')
end
end | 8 | 0.142857 | 6 | 2 |
ff6502fd8ecc4ee28cb05cb7ee8f11f75240ce47 | mini_project.py | mini_project.py | import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# Second task
print('A list of all the PV names for all BPMS')
for BPM in range(len(BPMS)):
# print(BPMS[BPM].pv())
print caget(BPMS[BPM].pv())
# Third task
QUADS = ap.getElements('QUAD')
print('String values for the setpoint currents')
#for QUAD in range(len(QUADS)):
# print(caget(QUADS[QUAD].pv(handle='readback')))
| import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# Second task
print('A list of all the PV names for all BPMS')
for BPM in range(len(BPMS)):
pvs = BPMS[BPM].pv()
print('PV names: {} PV values: {}'.format(pvs, caget(pvs)))
# Third task
QUADS = ap.getElements('QUAD')
print('String values for the setpoint currents')
#for QUAD in range(len(QUADS)):
# print(caget(QUADS[QUAD].pv(handle='readback')))
| Make the difference between PV names and values clearer. | Make the difference between PV names and values clearer.
| Python | apache-2.0 | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | python | ## Code Before:
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# Second task
print('A list of all the PV names for all BPMS')
for BPM in range(len(BPMS)):
# print(BPMS[BPM].pv())
print caget(BPMS[BPM].pv())
# Third task
QUADS = ap.getElements('QUAD')
print('String values for the setpoint currents')
#for QUAD in range(len(QUADS)):
# print(caget(QUADS[QUAD].pv(handle='readback')))
## Instruction:
Make the difference between PV names and values clearer.
## Code After:
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# Second task
print('A list of all the PV names for all BPMS')
for BPM in range(len(BPMS)):
pvs = BPMS[BPM].pv()
print('PV names: {} PV values: {}'.format(pvs, caget(pvs)))
# Third task
QUADS = ap.getElements('QUAD')
print('String values for the setpoint currents')
#for QUAD in range(len(QUADS)):
# print(caget(QUADS[QUAD].pv(handle='readback')))
| import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
# Other stuff
from cothread.catools import caget, caput, ca_nothing
# Load the machine
ap.machines.load('SRI21')
# First task
BPMS = ap.getElements('BPM')
print('There are {} BPM elements in the machine.'.format(len(BPMS)))
# Second task
print('A list of all the PV names for all BPMS')
for BPM in range(len(BPMS)):
- # print(BPMS[BPM].pv())
? - ^^^^^ -
+ pvs = BPMS[BPM].pv()
? ^^^^^
- print caget(BPMS[BPM].pv())
+ print('PV names: {} PV values: {}'.format(pvs, caget(pvs)))
# Third task
QUADS = ap.getElements('QUAD')
print('String values for the setpoint currents')
#for QUAD in range(len(QUADS)):
# print(caget(QUADS[QUAD].pv(handle='readback'))) | 4 | 0.16 | 2 | 2 |
a6da171e1021a9d414ab34c8bf11f6a829ed972a | views/et-credentials-form.html.twig | views/et-credentials-form.html.twig | {% extends "layout.html.twig" %}
{% block title %}Add ExactTarget credentials{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Add ExactTarget Credentials
</h1>
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li class="active">Add ExactTargetCredentials</li>
</ol>
</div>
</div>
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success">
{{ flashMessage }}
</div>
{% endfor %}
<form action="#" method="post">
{{form_start(etForm)}}
{{form_row(etForm.clientid, {'label' : 'Client ID'}) }}
{{form_row(etForm.clientsecret, {'label' : 'Client Secret'}) }}
<input type="submit" name="submit" value="Add credentials !" />
{{form_end(etForm)}}
</form>
</div>
{% endblock %}
| {% extends "layout.html.twig" %}
{% block title %}Add ExactTarget credentials{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Add ExactTarget Credentials
</h1>
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li class="active">Add ExactTargetCredentials</li>
</ol>
</div>
</div>
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success">
{{ flashMessage }}
</div>
{% endfor %}
<form action="#" method="post">
{{form_start(etForm)}}
{{form_row(etForm.clientid, {'label' : 'Client ID'}) }}
{{form_row(etForm.clientsecret, {'label' : 'Client Secret'}) }}
<input type="submit" name="submit" value="Add credentials !" />
<a href="https://code.exacttarget.com/apis-sdks/rest-api/using-app-center-to-get-an-api-key.html" target="_blank">Need help ?</a>
{{form_end(etForm)}}
</form>
</div>
{% endblock %}
| Add "Need help ?" links to ExactTarget setup page | Add "Need help ?" links to ExactTarget setup page
| Twig | mit | Sylpheo/skyflow.io,Sylpheo/skyflow.io | twig | ## Code Before:
{% extends "layout.html.twig" %}
{% block title %}Add ExactTarget credentials{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Add ExactTarget Credentials
</h1>
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li class="active">Add ExactTargetCredentials</li>
</ol>
</div>
</div>
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success">
{{ flashMessage }}
</div>
{% endfor %}
<form action="#" method="post">
{{form_start(etForm)}}
{{form_row(etForm.clientid, {'label' : 'Client ID'}) }}
{{form_row(etForm.clientsecret, {'label' : 'Client Secret'}) }}
<input type="submit" name="submit" value="Add credentials !" />
{{form_end(etForm)}}
</form>
</div>
{% endblock %}
## Instruction:
Add "Need help ?" links to ExactTarget setup page
## Code After:
{% extends "layout.html.twig" %}
{% block title %}Add ExactTarget credentials{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Add ExactTarget Credentials
</h1>
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li class="active">Add ExactTargetCredentials</li>
</ol>
</div>
</div>
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success">
{{ flashMessage }}
</div>
{% endfor %}
<form action="#" method="post">
{{form_start(etForm)}}
{{form_row(etForm.clientid, {'label' : 'Client ID'}) }}
{{form_row(etForm.clientsecret, {'label' : 'Client Secret'}) }}
<input type="submit" name="submit" value="Add credentials !" />
<a href="https://code.exacttarget.com/apis-sdks/rest-api/using-app-center-to-get-an-api-key.html" target="_blank">Need help ?</a>
{{form_end(etForm)}}
</form>
</div>
{% endblock %}
| {% extends "layout.html.twig" %}
{% block title %}Add ExactTarget credentials{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Add ExactTarget Credentials
</h1>
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li class="active">Add ExactTargetCredentials</li>
</ol>
</div>
</div>
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success">
{{ flashMessage }}
</div>
{% endfor %}
<form action="#" method="post">
{{form_start(etForm)}}
{{form_row(etForm.clientid, {'label' : 'Client ID'}) }}
{{form_row(etForm.clientsecret, {'label' : 'Client Secret'}) }}
-
<input type="submit" name="submit" value="Add credentials !" />
+ <a href="https://code.exacttarget.com/apis-sdks/rest-api/using-app-center-to-get-an-api-key.html" target="_blank">Need help ?</a>
{{form_end(etForm)}}
</form>
</div>
{% endblock %} | 2 | 0.060606 | 1 | 1 |
f8c049871018d993cf4321f4f99b0ca319540641 | src/Vectorface/MySQLite/MySQL/Comparison.php | src/Vectorface/MySQLite/MySQL/Comparison.php | <?php
namespace Vectorface\MySQLite\MySQL;
use InvalidArgumentException;
/**
* Provides Comparison MySQL compatibility functions for SQLite.
*
* http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html
*/
trait Comparison
{
/**
* LEAST - Return the smallest argument
*
* @param numeric ... One or more numeric arguments.
* @return numeric The argument whose value is smallest.
*/
public static function mysql_least()
{
$args = func_get_args();
if (!count($args)) {
throw new InvalidArgumentException('No arguments provided to SQLite LEAST');
}
return min($args);
}
}
| <?php
namespace Vectorface\MySQLite\MySQL;
use InvalidArgumentException;
/**
* Provides Comparison MySQL compatibility functions for SQLite.
*
* http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html
*/
trait Comparison
{
/**
* LEAST - Return the smallest argument
*
* @param mixed ... One or more numeric arguments.
* @return mixed The argument whose value is considered lowest.
*/
public static function mysql_least()
{
$args = func_get_args();
if (!count($args)) {
throw new InvalidArgumentException('No arguments provided to SQLite LEAST');
}
return min($args);
}
}
| Improve some comments a bit, making them more in-line with PHP docs: use "mixed" rather than "numeric". | Improve some comments a bit, making them more in-line with PHP docs: use "mixed" rather than "numeric".
| PHP | mit | Vectorface/MySQLite | php | ## Code Before:
<?php
namespace Vectorface\MySQLite\MySQL;
use InvalidArgumentException;
/**
* Provides Comparison MySQL compatibility functions for SQLite.
*
* http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html
*/
trait Comparison
{
/**
* LEAST - Return the smallest argument
*
* @param numeric ... One or more numeric arguments.
* @return numeric The argument whose value is smallest.
*/
public static function mysql_least()
{
$args = func_get_args();
if (!count($args)) {
throw new InvalidArgumentException('No arguments provided to SQLite LEAST');
}
return min($args);
}
}
## Instruction:
Improve some comments a bit, making them more in-line with PHP docs: use "mixed" rather than "numeric".
## Code After:
<?php
namespace Vectorface\MySQLite\MySQL;
use InvalidArgumentException;
/**
* Provides Comparison MySQL compatibility functions for SQLite.
*
* http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html
*/
trait Comparison
{
/**
* LEAST - Return the smallest argument
*
* @param mixed ... One or more numeric arguments.
* @return mixed The argument whose value is considered lowest.
*/
public static function mysql_least()
{
$args = func_get_args();
if (!count($args)) {
throw new InvalidArgumentException('No arguments provided to SQLite LEAST');
}
return min($args);
}
}
| <?php
namespace Vectorface\MySQLite\MySQL;
use InvalidArgumentException;
/**
* Provides Comparison MySQL compatibility functions for SQLite.
*
* http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html
*/
trait Comparison
{
/**
* LEAST - Return the smallest argument
*
- * @param numeric ... One or more numeric arguments.
? -- ^^^
+ * @param mixed ... One or more numeric arguments.
? ++ ^
- * @return numeric The argument whose value is smallest.
? -- ^^^ ^^ ^
+ * @return mixed The argument whose value is considered lowest.
? ++ ^ +++ ^^^^^^^ ^^
*/
public static function mysql_least()
{
$args = func_get_args();
if (!count($args)) {
throw new InvalidArgumentException('No arguments provided to SQLite LEAST');
}
return min($args);
}
} | 4 | 0.137931 | 2 | 2 |
9f2e548adbe7d162fd34790a24c744b573ce1f14 | pvn-template-app/src/main/java/com/incoming/example/incomingpvntemplate/PVNTemplateActivity.java | pvn-template-app/src/main/java/com/incoming/example/incomingpvntemplate/PVNTemplateActivity.java | /*******************************************************************************
* Copyright (c) Incoming Pty. Ltd. 2015
******************************************************************************/
package com.incoming.example.incomingpvntemplate;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import com.incoming.pvnsdk.PushVideo;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class PVNTemplateActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pvntemplate);
Set<String> filterKeys = new HashSet<>(Arrays.asList("AWS", "ApacheSpark", "GoogleVideos", "Stanford", "JavaScript"));
PushVideo.configureAudienceSegmentationKeys(filterKeys);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.pvntemplate, menu);
return true;
}
}
| /*******************************************************************************
* Copyright (c) Incoming Pty. Ltd. 2015
******************************************************************************/
package com.incoming.example.incomingpvntemplate;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
public class PVNTemplateActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pvntemplate);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.pvntemplate, menu);
return true;
}
}
| Remove setting of content targeting keys in launcher activity because the application class is used | Remove setting of content targeting keys in launcher activity because the application class is used
| Java | apache-2.0 | incoming-inc/android-template-app | java | ## Code Before:
/*******************************************************************************
* Copyright (c) Incoming Pty. Ltd. 2015
******************************************************************************/
package com.incoming.example.incomingpvntemplate;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import com.incoming.pvnsdk.PushVideo;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
public class PVNTemplateActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pvntemplate);
Set<String> filterKeys = new HashSet<>(Arrays.asList("AWS", "ApacheSpark", "GoogleVideos", "Stanford", "JavaScript"));
PushVideo.configureAudienceSegmentationKeys(filterKeys);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.pvntemplate, menu);
return true;
}
}
## Instruction:
Remove setting of content targeting keys in launcher activity because the application class is used
## Code After:
/*******************************************************************************
* Copyright (c) Incoming Pty. Ltd. 2015
******************************************************************************/
package com.incoming.example.incomingpvntemplate;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
public class PVNTemplateActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pvntemplate);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.pvntemplate, menu);
return true;
}
}
| /*******************************************************************************
* Copyright (c) Incoming Pty. Ltd. 2015
******************************************************************************/
package com.incoming.example.incomingpvntemplate;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
- import com.incoming.pvnsdk.PushVideo;
-
- import java.util.Arrays;
- import java.util.HashSet;
- import java.util.Set;
-
public class PVNTemplateActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pvntemplate);
-
- Set<String> filterKeys = new HashSet<>(Arrays.asList("AWS", "ApacheSpark", "GoogleVideos", "Stanford", "JavaScript"));
- PushVideo.configureAudienceSegmentationKeys(filterKeys);
-
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.pvntemplate, menu);
return true;
}
} | 10 | 0.285714 | 0 | 10 |
48cb42f7f935bf54ad4e056ea60bb899720821fa | lib/hubdown/cli_parser.rb | lib/hubdown/cli_parser.rb | require 'rubygems'
require 'mixlib/cli'
class CliParser
include Mixlib::CLI
option :output,
:short => "-o OUTPUT",
:long => "--output OUTPUT",
:description => "Name of the file to write the converted markdown into"
option :preview,
:short => "-p",
:long => "--preview",
:description => "Displays the output markdown in a browser",
:boolean => true
def run(argv=ARGV)
parse_options(argv)
end
end
| require 'rubygems'
require 'mixlib/cli'
class CliParser
include Mixlib::CLI
option :output,
:short => "-o OUTPUT",
:long => "--output OUTPUT",
:description => "Name of the file to write the converted markdown into"
option :wrap,
:short => "-w",
:long => "--wrap",
:description => "Wrap the markdown in html and add styles",
:boolean => true
def run(argv=ARGV)
parse_options(argv)
end
end
| Switch params to -w for wrap | Switch params to -w for wrap
Decided that using bcat internally was a bad idea... wrap allows for a user to pipe the output to bcat
| Ruby | mit | knomedia/hubdown,knomedia/hubdown | ruby | ## Code Before:
require 'rubygems'
require 'mixlib/cli'
class CliParser
include Mixlib::CLI
option :output,
:short => "-o OUTPUT",
:long => "--output OUTPUT",
:description => "Name of the file to write the converted markdown into"
option :preview,
:short => "-p",
:long => "--preview",
:description => "Displays the output markdown in a browser",
:boolean => true
def run(argv=ARGV)
parse_options(argv)
end
end
## Instruction:
Switch params to -w for wrap
Decided that using bcat internally was a bad idea... wrap allows for a user to pipe the output to bcat
## Code After:
require 'rubygems'
require 'mixlib/cli'
class CliParser
include Mixlib::CLI
option :output,
:short => "-o OUTPUT",
:long => "--output OUTPUT",
:description => "Name of the file to write the converted markdown into"
option :wrap,
:short => "-w",
:long => "--wrap",
:description => "Wrap the markdown in html and add styles",
:boolean => true
def run(argv=ARGV)
parse_options(argv)
end
end
| require 'rubygems'
require 'mixlib/cli'
class CliParser
include Mixlib::CLI
option :output,
:short => "-o OUTPUT",
:long => "--output OUTPUT",
:description => "Name of the file to write the converted markdown into"
- option :preview,
+ option :wrap,
- :short => "-p",
? ^
+ :short => "-w",
? ^
- :long => "--preview",
? ------
+ :long => "--wrap",
? +++
- :description => "Displays the output markdown in a browser",
+ :description => "Wrap the markdown in html and add styles",
:boolean => true
def run(argv=ARGV)
parse_options(argv)
end
end | 8 | 0.363636 | 4 | 4 |
09190451c23fe33dbf1e4ed8c8a79d667f230325 | README.md | README.md |
A tool that takes a Chaos Communication Congress schedule in XML format and spits it out in a format that's ready to be pasted into EtherPad.
## Usage
First, clone this repository and run `yarn install` (or `npm install`).
Then:
```sh
$ node index.js < curl https://events.ccc.de/congress/2015/Fahrplan/schedule.xml
```
Of course, the XML doesn't have to come from curl; you can just as well pipe in a local file.
This will spit out sequentially numbered files in your current working directory; one for each day of the conference (`day1.html`, `day2.html`, …).
Open each of them in a web browser, copy everything and paste it into an appropriate EtherPad.
## Licence
[The MIT License; see the LICENSE file.](LICENSE)
|
A tool that takes a Chaos Communication Congress schedule in XML format and spits it out in a format that's ready to be pasted into EtherPad.
## Usage
First, clone this repository and run `yarn install` (or `npm install`).
Then:
```sh
$ curl https://events.ccc.de/congress/2015/Fahrplan/schedule.xml | node index.js
```
Of course, the XML doesn't have to come from curl; you can just as well pipe in a local file.
This will spit out sequentially numbered files in your current working directory; one for each day of the conference (`day1.html`, `day2.html`, …).
Open each of them in a web browser, copy everything and paste it into an appropriate EtherPad.
## Licence
[The MIT License; see the LICENSE file.](LICENSE)
| Fix error in the example usage command | Fix error in the example usage command
| Markdown | mit | pbock/c3t-pad | markdown | ## Code Before:
A tool that takes a Chaos Communication Congress schedule in XML format and spits it out in a format that's ready to be pasted into EtherPad.
## Usage
First, clone this repository and run `yarn install` (or `npm install`).
Then:
```sh
$ node index.js < curl https://events.ccc.de/congress/2015/Fahrplan/schedule.xml
```
Of course, the XML doesn't have to come from curl; you can just as well pipe in a local file.
This will spit out sequentially numbered files in your current working directory; one for each day of the conference (`day1.html`, `day2.html`, …).
Open each of them in a web browser, copy everything and paste it into an appropriate EtherPad.
## Licence
[The MIT License; see the LICENSE file.](LICENSE)
## Instruction:
Fix error in the example usage command
## Code After:
A tool that takes a Chaos Communication Congress schedule in XML format and spits it out in a format that's ready to be pasted into EtherPad.
## Usage
First, clone this repository and run `yarn install` (or `npm install`).
Then:
```sh
$ curl https://events.ccc.de/congress/2015/Fahrplan/schedule.xml | node index.js
```
Of course, the XML doesn't have to come from curl; you can just as well pipe in a local file.
This will spit out sequentially numbered files in your current working directory; one for each day of the conference (`day1.html`, `day2.html`, …).
Open each of them in a web browser, copy everything and paste it into an appropriate EtherPad.
## Licence
[The MIT License; see the LICENSE file.](LICENSE)
|
A tool that takes a Chaos Communication Congress schedule in XML format and spits it out in a format that's ready to be pasted into EtherPad.
## Usage
First, clone this repository and run `yarn install` (or `npm install`).
Then:
```sh
- $ node index.js < curl https://events.ccc.de/congress/2015/Fahrplan/schedule.xml
? ----------------
+ $ curl https://events.ccc.de/congress/2015/Fahrplan/schedule.xml | node index.js
? ++++++++++++++++
```
Of course, the XML doesn't have to come from curl; you can just as well pipe in a local file.
This will spit out sequentially numbered files in your current working directory; one for each day of the conference (`day1.html`, `day2.html`, …).
Open each of them in a web browser, copy everything and paste it into an appropriate EtherPad.
## Licence
[The MIT License; see the LICENSE file.](LICENSE) | 2 | 0.090909 | 1 | 1 |
e38bb0523ef073fd79fcf111b1e357427ce77d81 | packages/core/src/Rules/PatchSyncTeX.js | packages/core/src/Rules/PatchSyncTeX.js | /* @flow */
import Rule from '../Rule'
import type { Phase } from '../types'
function escapePath (filePath) {
return filePath.replace(/\\/g, '\\\\')
}
export default class PatchSyncTeX extends Rule {
static parameterTypes: Array<Set<string>> = [
new Set(['KnitrConcordance']),
new Set(['SyncTeX'])
]
static phases: Set<Phase> = new Set(['finalize'])
static description: string = 'Patches SyncTeX files if LaTeX document was generated by knitr so PDF reverse sync will work.'
constructCommand () {
const filePath = escapePath(this.filePath)
const synctexPath = escapePath(this.resolvePath('$OUTDIR/$JOB'))
const lines = [
'library(patchSynctex)',
`patchSynctex('${filePath}',syncfile='${synctexPath}')`]
return {
args: ['Rscript', '-e', lines.join(';')],
severity: 'warning'
}
}
}
| /* @flow */
import Rule from '../Rule'
import type { Phase } from '../types'
function escapePath (filePath) {
return filePath.replace(/\\/g, '\\\\')
}
export default class PatchSyncTeX extends Rule {
static parameterTypes: Array<Set<string>> = [
new Set(['Knitr']),
new Set(['SyncTeX']),
new Set(['KnitrConcordance'])
]
static phases: Set<Phase> = new Set(['finalize'])
static description: string = 'Patches SyncTeX files if LaTeX document was generated by knitr so PDF reverse sync will work.'
constructCommand () {
const filePath = escapePath(this.firstParameter.filePath)
const synctexPath = escapePath(this.secondParameter.filePath.replace(/\.synctex(\.gz)?$/i, ''))
const lines = [
'library(patchSynctex)',
`patchSynctex('${filePath}',syncfile='${synctexPath}')`]
return {
args: ['Rscript', '-e', lines.join(';')],
severity: 'warning'
}
}
}
| Use parameters for path resolution | Use parameters for path resolution
| JavaScript | mit | yitzchak/ouroboros,yitzchak/dicy,yitzchak/dicy,yitzchak/ouroboros,yitzchak/dicy | javascript | ## Code Before:
/* @flow */
import Rule from '../Rule'
import type { Phase } from '../types'
function escapePath (filePath) {
return filePath.replace(/\\/g, '\\\\')
}
export default class PatchSyncTeX extends Rule {
static parameterTypes: Array<Set<string>> = [
new Set(['KnitrConcordance']),
new Set(['SyncTeX'])
]
static phases: Set<Phase> = new Set(['finalize'])
static description: string = 'Patches SyncTeX files if LaTeX document was generated by knitr so PDF reverse sync will work.'
constructCommand () {
const filePath = escapePath(this.filePath)
const synctexPath = escapePath(this.resolvePath('$OUTDIR/$JOB'))
const lines = [
'library(patchSynctex)',
`patchSynctex('${filePath}',syncfile='${synctexPath}')`]
return {
args: ['Rscript', '-e', lines.join(';')],
severity: 'warning'
}
}
}
## Instruction:
Use parameters for path resolution
## Code After:
/* @flow */
import Rule from '../Rule'
import type { Phase } from '../types'
function escapePath (filePath) {
return filePath.replace(/\\/g, '\\\\')
}
export default class PatchSyncTeX extends Rule {
static parameterTypes: Array<Set<string>> = [
new Set(['Knitr']),
new Set(['SyncTeX']),
new Set(['KnitrConcordance'])
]
static phases: Set<Phase> = new Set(['finalize'])
static description: string = 'Patches SyncTeX files if LaTeX document was generated by knitr so PDF reverse sync will work.'
constructCommand () {
const filePath = escapePath(this.firstParameter.filePath)
const synctexPath = escapePath(this.secondParameter.filePath.replace(/\.synctex(\.gz)?$/i, ''))
const lines = [
'library(patchSynctex)',
`patchSynctex('${filePath}',syncfile='${synctexPath}')`]
return {
args: ['Rscript', '-e', lines.join(';')],
severity: 'warning'
}
}
}
| /* @flow */
import Rule from '../Rule'
import type { Phase } from '../types'
function escapePath (filePath) {
return filePath.replace(/\\/g, '\\\\')
}
export default class PatchSyncTeX extends Rule {
static parameterTypes: Array<Set<string>> = [
+ new Set(['Knitr']),
+ new Set(['SyncTeX']),
- new Set(['KnitrConcordance']),
? -
+ new Set(['KnitrConcordance'])
- new Set(['SyncTeX'])
]
static phases: Set<Phase> = new Set(['finalize'])
static description: string = 'Patches SyncTeX files if LaTeX document was generated by knitr so PDF reverse sync will work.'
constructCommand () {
- const filePath = escapePath(this.filePath)
+ const filePath = escapePath(this.firstParameter.filePath)
? +++++++++++++++
- const synctexPath = escapePath(this.resolvePath('$OUTDIR/$JOB'))
+ const synctexPath = escapePath(this.secondParameter.filePath.replace(/\.synctex(\.gz)?$/i, ''))
const lines = [
'library(patchSynctex)',
`patchSynctex('${filePath}',syncfile='${synctexPath}')`]
return {
args: ['Rscript', '-e', lines.join(';')],
severity: 'warning'
}
}
} | 9 | 0.290323 | 5 | 4 |
1142d726cde4719bb95be95d24f57263374e10c3 | lib/Spark/Core/DevelopmentServer.php | lib/Spark/Core/DevelopmentServer.php | <?php
namespace Spark\Core;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\ProcessBuilder;
class DevelopmentServer
{
protected $documentRoot;
protected $router;
function __construct($documentRoot, $router)
{
$this->documentRoot = $documentRoot;
$this->router = $router;
}
function run($serverName = null, $port = null)
{
$serverName = $serverName ?: "localhost";
$port = $port ?: 3000;
$builder = new ProcessBuilder();
$builder->add((new PhpExecutableFinder)->find());
# Start PHP in development server mode
$builder->add('-S');
$builder->add("$serverName:$port");
# Add the document root
$builder->add('-t');
$builder->add($this->documentRoot);
# Add the router script
$builder->add($this->router);
$process = $builder->getProcess();
$process->setTimeout(null);
printf("Running development server on %s:%d ..." . PHP_EOL, $serverName, $port);
$process->run(function($type, $err) {
fwrite(STDERR, "$err\n");
});
}
}
| <?php
namespace Spark\Core;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\ProcessBuilder;
class DevelopmentServer
{
protected $documentRoot;
protected $router;
function __construct($documentRoot, $router)
{
$this->documentRoot = $documentRoot;
$this->router = $router;
}
function run($serverName = null, $port = null)
{
$serverName = $serverName ?: "localhost";
$port = $port ?: 3000;
$builder = new ProcessBuilder();
$builder->add((new PhpExecutableFinder)->find());
# Start PHP in development server mode
$builder->add('-S');
$builder->add("$serverName:$port");
# Add the document root
$builder->add('-t');
$builder->add($this->documentRoot);
# Add the router script
$builder->add($this->router);
$process = $builder->getProcess();
$process->setTimeout(null);
printf("Running development server on %s:%d ..." . PHP_EOL, $serverName, $port);
printf("Stop by pressing [CTRL] + [c]\n");
$process->run(function($type, $err) {
fwrite(STDERR, "$err\n");
});
}
}
| Add instruction for stopping dev server | Add instruction for stopping dev server
| PHP | mit | sparkframework/spark | php | ## Code Before:
<?php
namespace Spark\Core;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\ProcessBuilder;
class DevelopmentServer
{
protected $documentRoot;
protected $router;
function __construct($documentRoot, $router)
{
$this->documentRoot = $documentRoot;
$this->router = $router;
}
function run($serverName = null, $port = null)
{
$serverName = $serverName ?: "localhost";
$port = $port ?: 3000;
$builder = new ProcessBuilder();
$builder->add((new PhpExecutableFinder)->find());
# Start PHP in development server mode
$builder->add('-S');
$builder->add("$serverName:$port");
# Add the document root
$builder->add('-t');
$builder->add($this->documentRoot);
# Add the router script
$builder->add($this->router);
$process = $builder->getProcess();
$process->setTimeout(null);
printf("Running development server on %s:%d ..." . PHP_EOL, $serverName, $port);
$process->run(function($type, $err) {
fwrite(STDERR, "$err\n");
});
}
}
## Instruction:
Add instruction for stopping dev server
## Code After:
<?php
namespace Spark\Core;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\ProcessBuilder;
class DevelopmentServer
{
protected $documentRoot;
protected $router;
function __construct($documentRoot, $router)
{
$this->documentRoot = $documentRoot;
$this->router = $router;
}
function run($serverName = null, $port = null)
{
$serverName = $serverName ?: "localhost";
$port = $port ?: 3000;
$builder = new ProcessBuilder();
$builder->add((new PhpExecutableFinder)->find());
# Start PHP in development server mode
$builder->add('-S');
$builder->add("$serverName:$port");
# Add the document root
$builder->add('-t');
$builder->add($this->documentRoot);
# Add the router script
$builder->add($this->router);
$process = $builder->getProcess();
$process->setTimeout(null);
printf("Running development server on %s:%d ..." . PHP_EOL, $serverName, $port);
printf("Stop by pressing [CTRL] + [c]\n");
$process->run(function($type, $err) {
fwrite(STDERR, "$err\n");
});
}
}
| <?php
namespace Spark\Core;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\ProcessBuilder;
class DevelopmentServer
{
protected $documentRoot;
protected $router;
function __construct($documentRoot, $router)
{
$this->documentRoot = $documentRoot;
$this->router = $router;
}
function run($serverName = null, $port = null)
{
$serverName = $serverName ?: "localhost";
$port = $port ?: 3000;
$builder = new ProcessBuilder();
$builder->add((new PhpExecutableFinder)->find());
# Start PHP in development server mode
$builder->add('-S');
$builder->add("$serverName:$port");
# Add the document root
$builder->add('-t');
$builder->add($this->documentRoot);
# Add the router script
$builder->add($this->router);
$process = $builder->getProcess();
$process->setTimeout(null);
printf("Running development server on %s:%d ..." . PHP_EOL, $serverName, $port);
+ printf("Stop by pressing [CTRL] + [c]\n");
$process->run(function($type, $err) {
fwrite(STDERR, "$err\n");
});
}
} | 1 | 0.021277 | 1 | 0 |
f71897270d9a040930bfb41801bf955ea3d0a36e | slave/skia_slave_scripts/android_run_gm.py | slave/skia_slave_scripts/android_run_gm.py |
""" Run GM on an Android device. """
from android_build_step import AndroidBuildStep
from build_step import BuildStep
from run_gm import RunGM
import sys
class AndroidRunGM(AndroidBuildStep, RunGM):
def _Run(self):
self._gm_args.append('--nopdf')
RunGM._Run(self)
if '__main__' == __name__:
sys.exit(BuildStep.RunBuildStep(AndroidRunGM))
|
""" Run GM on an Android device. """
from android_build_step import AndroidBuildStep
from build_step import BuildStep
from run_gm import RunGM
import sys
class AndroidRunGM(AndroidBuildStep, RunGM):
def __init__(self, timeout=9600, **kwargs):
super(AndroidRunGM, self).__init__(timeout=timeout, **kwargs)
def _Run(self):
self._gm_args.append('--nopdf')
RunGM._Run(self)
if '__main__' == __name__:
sys.exit(BuildStep.RunBuildStep(AndroidRunGM))
| Increase timeout for GM on Android | Increase timeout for GM on Android
Unreviewed.
(SkipBuildbotRuns)
Review URL: https://codereview.chromium.org/18845002
git-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@9906 2bbb7eff-a529-9590-31e7-b0007b416f81
| Python | bsd-3-clause | google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot | python | ## Code Before:
""" Run GM on an Android device. """
from android_build_step import AndroidBuildStep
from build_step import BuildStep
from run_gm import RunGM
import sys
class AndroidRunGM(AndroidBuildStep, RunGM):
def _Run(self):
self._gm_args.append('--nopdf')
RunGM._Run(self)
if '__main__' == __name__:
sys.exit(BuildStep.RunBuildStep(AndroidRunGM))
## Instruction:
Increase timeout for GM on Android
Unreviewed.
(SkipBuildbotRuns)
Review URL: https://codereview.chromium.org/18845002
git-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@9906 2bbb7eff-a529-9590-31e7-b0007b416f81
## Code After:
""" Run GM on an Android device. """
from android_build_step import AndroidBuildStep
from build_step import BuildStep
from run_gm import RunGM
import sys
class AndroidRunGM(AndroidBuildStep, RunGM):
def __init__(self, timeout=9600, **kwargs):
super(AndroidRunGM, self).__init__(timeout=timeout, **kwargs)
def _Run(self):
self._gm_args.append('--nopdf')
RunGM._Run(self)
if '__main__' == __name__:
sys.exit(BuildStep.RunBuildStep(AndroidRunGM))
|
""" Run GM on an Android device. """
from android_build_step import AndroidBuildStep
from build_step import BuildStep
from run_gm import RunGM
import sys
class AndroidRunGM(AndroidBuildStep, RunGM):
+ def __init__(self, timeout=9600, **kwargs):
+ super(AndroidRunGM, self).__init__(timeout=timeout, **kwargs)
+
def _Run(self):
self._gm_args.append('--nopdf')
RunGM._Run(self)
if '__main__' == __name__:
sys.exit(BuildStep.RunBuildStep(AndroidRunGM)) | 3 | 0.176471 | 3 | 0 |
b9739a8444d1c51663fe1fa5445e8d8e179b9a37 | spec/support/mock_request.cr | spec/support/mock_request.cr | class MockRequest < HTTP::Request
def initialize
end
end
| class MockRequest
def initialize
end
def get(path : String, headers = Hash.new : Hash(String, String | Array(String)))
http_headers = HTTP::Headers.new
headers.each do |key, value|
http_headers.add(key, value)
end
HTTP::Request.new("GET", path, http_headers)
end
end
| Add a basic MockRequest for mocking a HTTP::Request | Add a basic MockRequest for mocking a HTTP::Request | Crystal | mit | benoist/carbon-crystal,benoist/carbon-crystal | crystal | ## Code Before:
class MockRequest < HTTP::Request
def initialize
end
end
## Instruction:
Add a basic MockRequest for mocking a HTTP::Request
## Code After:
class MockRequest
def initialize
end
def get(path : String, headers = Hash.new : Hash(String, String | Array(String)))
http_headers = HTTP::Headers.new
headers.each do |key, value|
http_headers.add(key, value)
end
HTTP::Request.new("GET", path, http_headers)
end
end
| - class MockRequest < HTTP::Request
+ class MockRequest
+
def initialize
+ end
+ def get(path : String, headers = Hash.new : Hash(String, String | Array(String)))
+ http_headers = HTTP::Headers.new
+
+ headers.each do |key, value|
+ http_headers.add(key, value)
+ end
+
+ HTTP::Request.new("GET", path, http_headers)
end
+
end | 13 | 2.6 | 12 | 1 |
4fdb71ffb638c5c1de0719311a41521d2fed8ace | lwt-unix/conduit_lwt_tls_dummy.ml | lwt-unix/conduit_lwt_tls_dummy.ml | module Client = struct
let connect ?src host sa =
Lwt.fail_with "Tls not available"
end
module Server = struct
let init' ?backlog ?stop ?timeout tls sa callback =
Lwt.fail_with "Tls not available"
let init ?backlog ~certfile ~keyfile ?stop ?timeout sa callback =
Lwt.fail_with "Tls not available"
end
let available = false
| module Client = struct
let connect ?src:_ _host _sa =
Lwt.fail_with "Tls not available"
end
module Server = struct
let init' ?backlog:_ ?stop:_ ?timeout:_ _tls _sa _callback =
Lwt.fail_with "Tls not available"
let init ?backlog:_ ~certfile:_ ~keyfile:_ ?stop:_ ?timeout:_ _sa _callback =
Lwt.fail_with "Tls not available"
end
let available = false
| Fix warnings when tls is missing | Fix warnings when tls is missing
| OCaml | isc | samoht/ocaml-conduit,djs55/ocaml-conduit,samoht/ocaml-conduit,avsm/ocaml-conduit,mirage/ocaml-conduit,djs55/ocaml-conduit | ocaml | ## Code Before:
module Client = struct
let connect ?src host sa =
Lwt.fail_with "Tls not available"
end
module Server = struct
let init' ?backlog ?stop ?timeout tls sa callback =
Lwt.fail_with "Tls not available"
let init ?backlog ~certfile ~keyfile ?stop ?timeout sa callback =
Lwt.fail_with "Tls not available"
end
let available = false
## Instruction:
Fix warnings when tls is missing
## Code After:
module Client = struct
let connect ?src:_ _host _sa =
Lwt.fail_with "Tls not available"
end
module Server = struct
let init' ?backlog:_ ?stop:_ ?timeout:_ _tls _sa _callback =
Lwt.fail_with "Tls not available"
let init ?backlog:_ ~certfile:_ ~keyfile:_ ?stop:_ ?timeout:_ _sa _callback =
Lwt.fail_with "Tls not available"
end
let available = false
| module Client = struct
- let connect ?src host sa =
+ let connect ?src:_ _host _sa =
? ++ + +
Lwt.fail_with "Tls not available"
end
module Server = struct
- let init' ?backlog ?stop ?timeout tls sa callback =
+ let init' ?backlog:_ ?stop:_ ?timeout:_ _tls _sa _callback =
? ++ ++ ++ + + +
Lwt.fail_with "Tls not available"
- let init ?backlog ~certfile ~keyfile ?stop ?timeout sa callback =
+ let init ?backlog:_ ~certfile:_ ~keyfile:_ ?stop:_ ?timeout:_ _sa _callback =
? ++ ++ ++ ++ ++ + +
Lwt.fail_with "Tls not available"
end
let available = false | 6 | 0.428571 | 3 | 3 |
a71a14846621dd4c45229116a876db4e6da0612c | geography/static/tpl/promo_banner.html | geography/static/tpl/promo_banner.html | <div class="bottom-alert text-center alert alert-info"
ng-if="!('promo1'|cookieExists)">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"
set-cookie-on-click="promo1"
track-click="close promo1 banner">
<span aria-hidden="true">×</span>
<span class="sr-only" translate>Zavřít</span>
</button>
Už jste vyzkoušeli naše další systémy
<a href="http://www.poznavackaprirody.cz/"
track-click="poznavackaprirody banner 2"
target="_blank"
class="btn btn-primary"
>
Poznávačka přírody
</a>
a
<a href="http://www.umimecesky.cz/"
track-click="umimecesky banner 2"
target="_blank"
class="btn btn-primary"
>
Umíme Česky
</a>
?
</div>
| <div class="bottom-alert text-center alert alert-info"
ng-if="!('promo2'|cookieExists)">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"
set-cookie-on-click="promo2"
track-click="close promo2 banner">
<span aria-hidden="true">×</span>
<span class="sr-only" translate>Zavřít</span>
</button>
Už jste vyzkoušeli naše další systémy
<a href="http://zlomky-hrave.cz/"
track-click="zlomky banner"
target="_blank"
class="btn btn-primary"
>
Zlomky hravě
</a>
a
<a href="http://www.poznavackaprirody.cz/"
track-click="poznavackaprirody banner 3"
target="_blank"
class="btn btn-primary"
>
Poznávačka přírody
</a>
?
</div>
| Add "Zlomky hravě" to promo banner | Add "Zlomky hravě" to promo banner
| HTML | mit | adaptive-learning/geography,adaptive-learning/geography,adaptive-learning/geography,adaptive-learning/geography | html | ## Code Before:
<div class="bottom-alert text-center alert alert-info"
ng-if="!('promo1'|cookieExists)">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"
set-cookie-on-click="promo1"
track-click="close promo1 banner">
<span aria-hidden="true">×</span>
<span class="sr-only" translate>Zavřít</span>
</button>
Už jste vyzkoušeli naše další systémy
<a href="http://www.poznavackaprirody.cz/"
track-click="poznavackaprirody banner 2"
target="_blank"
class="btn btn-primary"
>
Poznávačka přírody
</a>
a
<a href="http://www.umimecesky.cz/"
track-click="umimecesky banner 2"
target="_blank"
class="btn btn-primary"
>
Umíme Česky
</a>
?
</div>
## Instruction:
Add "Zlomky hravě" to promo banner
## Code After:
<div class="bottom-alert text-center alert alert-info"
ng-if="!('promo2'|cookieExists)">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"
set-cookie-on-click="promo2"
track-click="close promo2 banner">
<span aria-hidden="true">×</span>
<span class="sr-only" translate>Zavřít</span>
</button>
Už jste vyzkoušeli naše další systémy
<a href="http://zlomky-hrave.cz/"
track-click="zlomky banner"
target="_blank"
class="btn btn-primary"
>
Zlomky hravě
</a>
a
<a href="http://www.poznavackaprirody.cz/"
track-click="poznavackaprirody banner 3"
target="_blank"
class="btn btn-primary"
>
Poznávačka přírody
</a>
?
</div>
| <div class="bottom-alert text-center alert alert-info"
- ng-if="!('promo1'|cookieExists)">
? ^
+ ng-if="!('promo2'|cookieExists)">
? ^
<button type="button" class="close" data-dismiss="alert" aria-label="Close"
- set-cookie-on-click="promo1"
? ^
+ set-cookie-on-click="promo2"
? ^
- track-click="close promo1 banner">
? ^
+ track-click="close promo2 banner">
? ^
<span aria-hidden="true">×</span>
<span class="sr-only" translate>Zavřít</span>
</button>
Už jste vyzkoušeli naše další systémy
+ <a href="http://zlomky-hrave.cz/"
+ track-click="zlomky banner"
+ target="_blank"
+ class="btn btn-primary"
+ >
+ Zlomky hravě
+ </a>
+ a
<a href="http://www.poznavackaprirody.cz/"
- track-click="poznavackaprirody banner 2"
? ^
+ track-click="poznavackaprirody banner 3"
? ^
target="_blank"
class="btn btn-primary"
>
Poznávačka přírody
</a>
- a
- <a href="http://www.umimecesky.cz/"
- track-click="umimecesky banner 2"
- target="_blank"
- class="btn btn-primary"
- >
- Umíme Česky
- </a>
?
</div>
| 24 | 0.888889 | 12 | 12 |
24c6f586ddc359b6fb3af6c63231618cbf3600ad | src/vs/workbench/contrib/comments/browser/comments.contribution.ts | src/vs/workbench/contrib/comments/browser/comments.contribution.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { Registry } from 'vs/platform/registry/common/platform';
import 'vs/workbench/contrib/comments/browser/commentsEditorContribution';
import { ICommentService, CommentService } from 'vs/workbench/contrib/comments/browser/commentService';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
export interface ICommentsConfiguration {
openPanel: 'neverOpen' | 'openOnSessionStart' | 'openOnSessionStartWithComments';
}
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
id: 'comments',
order: 20,
title: nls.localize('commentsConfigurationTitle', "Comments"),
type: 'object',
properties: {
'comments.openPanel': {
enum: ['neverOpen', 'openOnSessionStart', 'openOnSessionStartWithComments'],
default: 'openOnSessionStartWithComments',
description: nls.localize('openComments', "Controls when the comments panel should open.")
}
}
});
registerSingleton(ICommentService, CommentService);
| /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { Registry } from 'vs/platform/registry/common/platform';
import 'vs/workbench/contrib/comments/browser/commentsEditorContribution';
import { ICommentService, CommentService } from 'vs/workbench/contrib/comments/browser/commentService';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
export interface ICommentsConfiguration {
openPanel: 'neverOpen' | 'openOnSessionStart' | 'openOnSessionStartWithComments';
}
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
id: 'comments',
order: 20,
title: nls.localize('commentsConfigurationTitle', "Comments"),
type: 'object',
properties: {
'comments.openPanel': {
enum: ['neverOpen', 'openOnSessionStart', 'openOnSessionStartWithComments'],
default: 'openOnSessionStartWithComments',
description: nls.localize('openComments', "Controls when the comments panel should open."),
requireTrust: false
}
}
});
registerSingleton(ICommentService, CommentService);
| Add requireTrust to comments.openPanel setting | Add requireTrust to comments.openPanel setting
| TypeScript | mit | Microsoft/vscode,microsoft/vscode,microsoft/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,Microsoft/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,microsoft/vscode,eamodio/vscode,eamodio/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,eamodio/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,microsoft/vscode,eamodio/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,Microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,microsoft/vscode,eamodio/vscode,microsoft/vscode,Microsoft/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,microsoft/vscode,microsoft/vscode,Microsoft/vscode,Microsoft/vscode,microsoft/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,Microsoft/vscode,eamodio/vscode,eamodio/vscode,microsoft/vscode,eamodio/vscode,Microsoft/vscode | typescript | ## Code Before:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { Registry } from 'vs/platform/registry/common/platform';
import 'vs/workbench/contrib/comments/browser/commentsEditorContribution';
import { ICommentService, CommentService } from 'vs/workbench/contrib/comments/browser/commentService';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
export interface ICommentsConfiguration {
openPanel: 'neverOpen' | 'openOnSessionStart' | 'openOnSessionStartWithComments';
}
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
id: 'comments',
order: 20,
title: nls.localize('commentsConfigurationTitle', "Comments"),
type: 'object',
properties: {
'comments.openPanel': {
enum: ['neverOpen', 'openOnSessionStart', 'openOnSessionStartWithComments'],
default: 'openOnSessionStartWithComments',
description: nls.localize('openComments', "Controls when the comments panel should open.")
}
}
});
registerSingleton(ICommentService, CommentService);
## Instruction:
Add requireTrust to comments.openPanel setting
## Code After:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { Registry } from 'vs/platform/registry/common/platform';
import 'vs/workbench/contrib/comments/browser/commentsEditorContribution';
import { ICommentService, CommentService } from 'vs/workbench/contrib/comments/browser/commentService';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
export interface ICommentsConfiguration {
openPanel: 'neverOpen' | 'openOnSessionStart' | 'openOnSessionStartWithComments';
}
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
id: 'comments',
order: 20,
title: nls.localize('commentsConfigurationTitle', "Comments"),
type: 'object',
properties: {
'comments.openPanel': {
enum: ['neverOpen', 'openOnSessionStart', 'openOnSessionStartWithComments'],
default: 'openOnSessionStartWithComments',
description: nls.localize('openComments', "Controls when the comments panel should open."),
requireTrust: false
}
}
});
registerSingleton(ICommentService, CommentService);
| /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { Registry } from 'vs/platform/registry/common/platform';
import 'vs/workbench/contrib/comments/browser/commentsEditorContribution';
import { ICommentService, CommentService } from 'vs/workbench/contrib/comments/browser/commentService';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
export interface ICommentsConfiguration {
openPanel: 'neverOpen' | 'openOnSessionStart' | 'openOnSessionStartWithComments';
}
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
id: 'comments',
order: 20,
title: nls.localize('commentsConfigurationTitle', "Comments"),
type: 'object',
properties: {
'comments.openPanel': {
enum: ['neverOpen', 'openOnSessionStart', 'openOnSessionStartWithComments'],
default: 'openOnSessionStartWithComments',
- description: nls.localize('openComments', "Controls when the comments panel should open.")
+ description: nls.localize('openComments', "Controls when the comments panel should open."),
? +
+ requireTrust: false
}
}
});
registerSingleton(ICommentService, CommentService); | 3 | 0.096774 | 2 | 1 |
c9d1a2eefb908b578f7e19cd15e2e27e06295729 | Cargo.toml | Cargo.toml | [package]
name = "rerast"
version = "0.1.26"
license = "Apache-2.0"
description = "An AST (abstract syntax tree) based search replace tool for code written in Rust"
repository = "https://github.com/google/rerast"
readme = "README.md"
categories = ["development-tools", "development-tools::cargo-plugins"]
authors = [
"David Lattimore <dvdlttmr@gmail.com>",
]
[dependencies]
rerast_macros = { version = "0.1.12", path = "rerast_macros" }
itertools = "0.5.*"
clap = "2.*"
json = "0.11.10"
diff = "0.1.10"
colored = "1.6.0"
clippy = {version = "0.*", optional = true}
failure = "0.1.1"
[dev-dependencies]
assert_cli = "0.5"
[features]
#default = ["clippy"]
| [package]
name = "rerast"
version = "0.1.26"
license = "Apache-2.0"
description = "An AST (abstract syntax tree) based search replace tool for code written in Rust"
repository = "https://github.com/google/rerast"
readme = "README.md"
categories = ["development-tools", "development-tools::cargo-plugins"]
authors = [
"David Lattimore <dvdlttmr@gmail.com>",
"Dale Wijnand",
"Kornel",
]
[dependencies]
rerast_macros = { version = "0.1.12", path = "rerast_macros" }
itertools = "0.5.*"
clap = "2.*"
json = "0.11.10"
diff = "0.1.10"
colored = "1.6.0"
clippy = {version = "0.*", optional = true}
failure = "0.1.1"
[dev-dependencies]
assert_cli = "0.5"
[features]
#default = ["clippy"]
| Add Dale and Kornel to the authors list | Add Dale and Kornel to the authors list
| TOML | apache-2.0 | google/rerast,google/rerast | toml | ## Code Before:
[package]
name = "rerast"
version = "0.1.26"
license = "Apache-2.0"
description = "An AST (abstract syntax tree) based search replace tool for code written in Rust"
repository = "https://github.com/google/rerast"
readme = "README.md"
categories = ["development-tools", "development-tools::cargo-plugins"]
authors = [
"David Lattimore <dvdlttmr@gmail.com>",
]
[dependencies]
rerast_macros = { version = "0.1.12", path = "rerast_macros" }
itertools = "0.5.*"
clap = "2.*"
json = "0.11.10"
diff = "0.1.10"
colored = "1.6.0"
clippy = {version = "0.*", optional = true}
failure = "0.1.1"
[dev-dependencies]
assert_cli = "0.5"
[features]
#default = ["clippy"]
## Instruction:
Add Dale and Kornel to the authors list
## Code After:
[package]
name = "rerast"
version = "0.1.26"
license = "Apache-2.0"
description = "An AST (abstract syntax tree) based search replace tool for code written in Rust"
repository = "https://github.com/google/rerast"
readme = "README.md"
categories = ["development-tools", "development-tools::cargo-plugins"]
authors = [
"David Lattimore <dvdlttmr@gmail.com>",
"Dale Wijnand",
"Kornel",
]
[dependencies]
rerast_macros = { version = "0.1.12", path = "rerast_macros" }
itertools = "0.5.*"
clap = "2.*"
json = "0.11.10"
diff = "0.1.10"
colored = "1.6.0"
clippy = {version = "0.*", optional = true}
failure = "0.1.1"
[dev-dependencies]
assert_cli = "0.5"
[features]
#default = ["clippy"]
| [package]
name = "rerast"
version = "0.1.26"
license = "Apache-2.0"
description = "An AST (abstract syntax tree) based search replace tool for code written in Rust"
repository = "https://github.com/google/rerast"
readme = "README.md"
categories = ["development-tools", "development-tools::cargo-plugins"]
authors = [
"David Lattimore <dvdlttmr@gmail.com>",
+ "Dale Wijnand",
+ "Kornel",
]
[dependencies]
rerast_macros = { version = "0.1.12", path = "rerast_macros" }
itertools = "0.5.*"
clap = "2.*"
json = "0.11.10"
diff = "0.1.10"
colored = "1.6.0"
clippy = {version = "0.*", optional = true}
failure = "0.1.1"
[dev-dependencies]
assert_cli = "0.5"
[features]
#default = ["clippy"] | 2 | 0.074074 | 2 | 0 |
1dab136246bf36696da1ad594752effcd735f851 | cmd/migrate/revisions/auth/1554171675_alter_auth_provider_password.up.sql | cmd/migrate/revisions/auth/1554171675_alter_auth_provider_password.up.sql | ALTER TABLE _auth_provider_password ALTER COLUMN auth_data TYPE text;
ALTER TABLE _auth_provider_password RENAME COLUMN auth_data TO login_id;
ALTER TABLE _auth_provider_password ADD login_id_key text; | /*
This migration script only alter auth_data type from jsonb to text,
and doesn't delete previous signup rows.
*/
ALTER TABLE _auth_provider_password ALTER COLUMN auth_data TYPE text;
ALTER TABLE _auth_provider_password RENAME COLUMN auth_data TO login_id;
ALTER TABLE _auth_provider_password ADD login_id_key text; | Add migration comments about type altering | Add migration comments about type altering
| SQL | apache-2.0 | SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server | sql | ## Code Before:
ALTER TABLE _auth_provider_password ALTER COLUMN auth_data TYPE text;
ALTER TABLE _auth_provider_password RENAME COLUMN auth_data TO login_id;
ALTER TABLE _auth_provider_password ADD login_id_key text;
## Instruction:
Add migration comments about type altering
## Code After:
/*
This migration script only alter auth_data type from jsonb to text,
and doesn't delete previous signup rows.
*/
ALTER TABLE _auth_provider_password ALTER COLUMN auth_data TYPE text;
ALTER TABLE _auth_provider_password RENAME COLUMN auth_data TO login_id;
ALTER TABLE _auth_provider_password ADD login_id_key text; | + /*
+ This migration script only alter auth_data type from jsonb to text,
+ and doesn't delete previous signup rows.
+ */
ALTER TABLE _auth_provider_password ALTER COLUMN auth_data TYPE text;
ALTER TABLE _auth_provider_password RENAME COLUMN auth_data TO login_id;
ALTER TABLE _auth_provider_password ADD login_id_key text; | 4 | 1.333333 | 4 | 0 |
cecdaa4aa9ad48a1d5cc2901e85e7367d2c623ad | app/pages/lab/translations/index.jsx | app/pages/lab/translations/index.jsx | import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as translationsActions from '../../../redux/ducks/translations';
class TranslationsManager extends React.Component {
render() {
return (
<p>Manage your project translations here.</p>
);
}
}
const mapStateToProps = state => ({
translations: state.translations
});
const mapDispatchToProps = dispatch => ({
actions: {
translations: bindActionCreators(translationsActions, dispatch)
}
});
export default connect(mapStateToProps, mapDispatchToProps)(TranslationsManager);
export { TranslationsManager };
| import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { Link } from 'react-router';
import * as translationsActions from '../../../redux/ducks/translations';
class TranslationsManager extends React.Component {
componentDidMount() {
const { translations } = this.props.actions;
translations.listLanguages('project', this.props.project.id);
}
render() {
const { languages } = this.props.translations;
const { project } = this.props;
return (
<div>
<p>Manage your project translations here.</p>
<ul>
{languages.project && languages.project.map(languageCode => (
<li key={languageCode}>
<Link to={`/projects/${project.slug}?language=${languageCode}`}>{languageCode}</Link>
</li>
))}
</ul>
</div>
);
}
}
const mapStateToProps = state => ({
translations: state.translations
});
const mapDispatchToProps = dispatch => ({
actions: {
translations: bindActionCreators(translationsActions, dispatch)
}
});
TranslationsManager.propTypes = {
actions: PropTypes.shape({
translations: PropTypes.shape({
listLanguages: PropTypes.func
})
}).isRequired,
translations: PropTypes.shape({
languages: PropTypes.shape({
project: PropTypes.arrayOf(PropTypes.string)
})
}),
project: PropTypes.shape({
id: PropTypes.string
}).isRequired
};
TranslationsManager.defaultProps = {
translations: {
languages: {
project: []
}
}
};
export default connect(mapStateToProps, mapDispatchToProps)(TranslationsManager);
export { TranslationsManager };
| Add a basic list of languages for the project List the available project language codes, each linked to the project in that language. | Add a basic list of languages for the project
List the available project language codes, each linked to the project in that language.
| JSX | apache-2.0 | amyrebecca/Panoptes-Front-End,amyrebecca/Panoptes-Front-End,zooniverse/Panoptes-Front-End,amyrebecca/Panoptes-Front-End | jsx | ## Code Before:
import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as translationsActions from '../../../redux/ducks/translations';
class TranslationsManager extends React.Component {
render() {
return (
<p>Manage your project translations here.</p>
);
}
}
const mapStateToProps = state => ({
translations: state.translations
});
const mapDispatchToProps = dispatch => ({
actions: {
translations: bindActionCreators(translationsActions, dispatch)
}
});
export default connect(mapStateToProps, mapDispatchToProps)(TranslationsManager);
export { TranslationsManager };
## Instruction:
Add a basic list of languages for the project
List the available project language codes, each linked to the project in that language.
## Code After:
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { Link } from 'react-router';
import * as translationsActions from '../../../redux/ducks/translations';
class TranslationsManager extends React.Component {
componentDidMount() {
const { translations } = this.props.actions;
translations.listLanguages('project', this.props.project.id);
}
render() {
const { languages } = this.props.translations;
const { project } = this.props;
return (
<div>
<p>Manage your project translations here.</p>
<ul>
{languages.project && languages.project.map(languageCode => (
<li key={languageCode}>
<Link to={`/projects/${project.slug}?language=${languageCode}`}>{languageCode}</Link>
</li>
))}
</ul>
</div>
);
}
}
const mapStateToProps = state => ({
translations: state.translations
});
const mapDispatchToProps = dispatch => ({
actions: {
translations: bindActionCreators(translationsActions, dispatch)
}
});
TranslationsManager.propTypes = {
actions: PropTypes.shape({
translations: PropTypes.shape({
listLanguages: PropTypes.func
})
}).isRequired,
translations: PropTypes.shape({
languages: PropTypes.shape({
project: PropTypes.arrayOf(PropTypes.string)
})
}),
project: PropTypes.shape({
id: PropTypes.string
}).isRequired
};
TranslationsManager.defaultProps = {
translations: {
languages: {
project: []
}
}
};
export default connect(mapStateToProps, mapDispatchToProps)(TranslationsManager);
export { TranslationsManager };
| import React from 'react';
+ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
+ import { Link } from 'react-router';
import * as translationsActions from '../../../redux/ducks/translations';
class TranslationsManager extends React.Component {
+ componentDidMount() {
+ const { translations } = this.props.actions;
+ translations.listLanguages('project', this.props.project.id);
+ }
+
render() {
+ const { languages } = this.props.translations;
+ const { project } = this.props;
return (
+ <div>
- <p>Manage your project translations here.</p>
+ <p>Manage your project translations here.</p>
? ++
+ <ul>
+ {languages.project && languages.project.map(languageCode => (
+ <li key={languageCode}>
+ <Link to={`/projects/${project.slug}?language=${languageCode}`}>{languageCode}</Link>
+ </li>
+ ))}
+ </ul>
+ </div>
);
}
}
const mapStateToProps = state => ({
translations: state.translations
});
const mapDispatchToProps = dispatch => ({
actions: {
translations: bindActionCreators(translationsActions, dispatch)
}
});
+ TranslationsManager.propTypes = {
+ actions: PropTypes.shape({
+ translations: PropTypes.shape({
+ listLanguages: PropTypes.func
+ })
+ }).isRequired,
+ translations: PropTypes.shape({
+ languages: PropTypes.shape({
+ project: PropTypes.arrayOf(PropTypes.string)
+ })
+ }),
+ project: PropTypes.shape({
+ id: PropTypes.string
+ }).isRequired
+ };
+
+ TranslationsManager.defaultProps = {
+ translations: {
+ languages: {
+ project: []
+ }
+ }
+ };
+
export default connect(mapStateToProps, mapDispatchToProps)(TranslationsManager);
export { TranslationsManager }; | 44 | 1.76 | 43 | 1 |
39a69fb6c520d7f4e272610a2d13795eb75dd1f1 | src/string.c | src/string.c |
void* memcpy(void* restrict destination, const void* restrict source, size_t length)
{
char* restrict dst = destination;
const char* restrict src = source;
/* I know this is naive, but compiler will optimized this because we have restrict. */
for (; length; --length)
{
*dst = *src;
++dst;
++src;
}
return destination;
}
|
void* memcpy(void* restrict destination, const void* restrict source, size_t length)
{
char* restrict dst = destination;
const char* restrict src = source;
/* I know this is naive, but compiler will optimized this because we have restrict. */
for (; length; --length)
*dst++ = *src++;
return destination;
}
| Simplify loop body of memcpy | Simplify loop body of memcpy
| C | mit | jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic | c | ## Code Before:
void* memcpy(void* restrict destination, const void* restrict source, size_t length)
{
char* restrict dst = destination;
const char* restrict src = source;
/* I know this is naive, but compiler will optimized this because we have restrict. */
for (; length; --length)
{
*dst = *src;
++dst;
++src;
}
return destination;
}
## Instruction:
Simplify loop body of memcpy
## Code After:
void* memcpy(void* restrict destination, const void* restrict source, size_t length)
{
char* restrict dst = destination;
const char* restrict src = source;
/* I know this is naive, but compiler will optimized this because we have restrict. */
for (; length; --length)
*dst++ = *src++;
return destination;
}
|
void* memcpy(void* restrict destination, const void* restrict source, size_t length)
{
char* restrict dst = destination;
const char* restrict src = source;
/* I know this is naive, but compiler will optimized this because we have restrict. */
for (; length; --length)
- {
- *dst = *src;
+ *dst++ = *src++;
? ++ ++
- ++dst;
- ++src;
- }
return destination;
} | 6 | 0.375 | 1 | 5 |
11605589501e266c34eff5c33915547187c81e03 | src/Sbts/Bundle/IssueBundle/Resources/config/process.yml | src/Sbts/Bundle/IssueBundle/Resources/config/process.yml | definitions:
issue_collaborators_definition:
label: 'Add collaborators on create and update issue'
enabled: true
entity: Sbts\Bundle\IssueBundle\Entity\Issue
order: 10
actions_configuration:
- @call_method:
conditions:
@not_blank: [$reporter]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$reporter]
- @call_method:
conditions:
@not_blank: [$owner]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$owner]
triggers:
issue_collaborators_definition:
-
event: create
queued: false
-
event: update
field: owner
queued: false
| definitions:
issue_collaborators_definition:
label: 'Add collaborators on create and update issue'
enabled: true
entity: Sbts\Bundle\IssueBundle\Entity\Issue
order: 10
actions_configuration:
- @call_method:
conditions:
@not_blank: [$reporter]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$reporter]
- @call_method:
conditions:
@not_blank: [$owner]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$owner]
issue_add_note_definition:
label: 'Add collaborator and refresh updatedAt on adding new note to issue'
enabled: true
entity: Oro\Bundle\NoteBundle\Entity\Note
order: 20
actions_configuration:
- @call_method:
object: $.data
attribute: $.isIssue
method: supportTarget
method_parameters: ['Issue']
- @create_datetime:
condition:
@true: $.isIssue
attribute: $.data.target.updatedAt
- @call_method:
condition:
@true: $.isIssue
object: $.data.target
method: addCollaborator
method_parameters: [$owner]
triggers:
issue_collaborators_definition:
-
event: create
queued: false
-
event: update
field: owner
queued: false
issue_add_note_definition:
-
event: create
queued: false
| Update collaborators and issue.updatedAt on adding note | OOT-637: Update collaborators and issue.updatedAt on adding note
| YAML | mit | teslitsky/sbts-oro,teslitsky/sbts-oro | yaml | ## Code Before:
definitions:
issue_collaborators_definition:
label: 'Add collaborators on create and update issue'
enabled: true
entity: Sbts\Bundle\IssueBundle\Entity\Issue
order: 10
actions_configuration:
- @call_method:
conditions:
@not_blank: [$reporter]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$reporter]
- @call_method:
conditions:
@not_blank: [$owner]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$owner]
triggers:
issue_collaborators_definition:
-
event: create
queued: false
-
event: update
field: owner
queued: false
## Instruction:
OOT-637: Update collaborators and issue.updatedAt on adding note
## Code After:
definitions:
issue_collaborators_definition:
label: 'Add collaborators on create and update issue'
enabled: true
entity: Sbts\Bundle\IssueBundle\Entity\Issue
order: 10
actions_configuration:
- @call_method:
conditions:
@not_blank: [$reporter]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$reporter]
- @call_method:
conditions:
@not_blank: [$owner]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$owner]
issue_add_note_definition:
label: 'Add collaborator and refresh updatedAt on adding new note to issue'
enabled: true
entity: Oro\Bundle\NoteBundle\Entity\Note
order: 20
actions_configuration:
- @call_method:
object: $.data
attribute: $.isIssue
method: supportTarget
method_parameters: ['Issue']
- @create_datetime:
condition:
@true: $.isIssue
attribute: $.data.target.updatedAt
- @call_method:
condition:
@true: $.isIssue
object: $.data.target
method: addCollaborator
method_parameters: [$owner]
triggers:
issue_collaborators_definition:
-
event: create
queued: false
-
event: update
field: owner
queued: false
issue_add_note_definition:
-
event: create
queued: false
| definitions:
issue_collaborators_definition:
label: 'Add collaborators on create and update issue'
enabled: true
entity: Sbts\Bundle\IssueBundle\Entity\Issue
order: 10
actions_configuration:
- @call_method:
conditions:
@not_blank: [$reporter]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$reporter]
- @call_method:
conditions:
@not_blank: [$owner]
parameters:
object: $.data
method: addCollaborator
method_parameters: [$owner]
+ issue_add_note_definition:
+ label: 'Add collaborator and refresh updatedAt on adding new note to issue'
+ enabled: true
+ entity: Oro\Bundle\NoteBundle\Entity\Note
+ order: 20
+ actions_configuration:
+ - @call_method:
+ object: $.data
+ attribute: $.isIssue
+ method: supportTarget
+ method_parameters: ['Issue']
+ - @create_datetime:
+ condition:
+ @true: $.isIssue
+ attribute: $.data.target.updatedAt
+ - @call_method:
+ condition:
+ @true: $.isIssue
+ object: $.data.target
+ method: addCollaborator
+ method_parameters: [$owner]
+
triggers:
issue_collaborators_definition:
-
event: create
queued: false
-
event: update
field: owner
queued: false
+ issue_add_note_definition:
+ -
+ event: create
+ queued: false | 26 | 0.83871 | 26 | 0 |
b5e7cb7946d87fa39c2a006808a0c07975f9c4d4 | endymion/box.py | endymion/box.py | from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vagrant box name
"""
json_url = ("https://atlas.hashicorp.com/{0}/boxes/{1}/"
.format(publisher, name))
request = urllib2.Request(json_url, None,
{'Accept': 'application/json'})
json_file = urllib2.urlopen(request)
self._data = json.loads(json_file.read())
def versions(self):
"""Return a tuple with all available box versions."""
return tuple(v['version'] for v in self._data['versions']
if v['status'] == 'active')
def providers(self, version):
"""Return a list of providers for a specific box version."""
_ver = ([v for v in self._data['versions']
if v['version'] == version])[0]
return [p['name'] for p in _ver['providers']]
def url(self, version, provider):
"""Return the download URL for a specific box version and provider."""
_ver = ([v for v in self._data['versions']
if v['version'] == version])[0]
return ([p for p in _ver['providers']
if p['name'] == provider])[0]['url']
| from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vagrant box name
"""
json_url = ("https://atlas.hashicorp.com/{0}/boxes/{1}/"
.format(publisher, name))
request = urllib2.Request(json_url, None,
{'Accept': 'application/json'})
json_file = urllib2.urlopen(request)
self._data = json.loads(json_file.read())
# We need to preserve the order of the versions
self._versions = tuple(v['version'] for v in self._data['versions'])
# Prepare a data structure for quick lookups
self._boxes = {}
for v in self._data['versions']:
_version = v['version']
self._boxes[_version] = {}
for p in v['providers']:
_provider = p['name']
self._boxes[_version][_provider] = {}
self._boxes[_version][_provider]['url'] = p['url']
def versions(self):
"""Return a tuple with all available box versions."""
return self._versions
def providers(self, version):
"""Return a list of providers for a specific box version."""
return self._boxes[version].keys()
def url(self, version, provider):
"""Return the download URL for a specific box version and provider."""
return self._boxes[version][provider]['url']
| Index the Atlas data by version and provider | Index the Atlas data by version and provider
| Python | mit | lpancescu/atlas-lint | python | ## Code Before:
from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vagrant box name
"""
json_url = ("https://atlas.hashicorp.com/{0}/boxes/{1}/"
.format(publisher, name))
request = urllib2.Request(json_url, None,
{'Accept': 'application/json'})
json_file = urllib2.urlopen(request)
self._data = json.loads(json_file.read())
def versions(self):
"""Return a tuple with all available box versions."""
return tuple(v['version'] for v in self._data['versions']
if v['status'] == 'active')
def providers(self, version):
"""Return a list of providers for a specific box version."""
_ver = ([v for v in self._data['versions']
if v['version'] == version])[0]
return [p['name'] for p in _ver['providers']]
def url(self, version, provider):
"""Return the download URL for a specific box version and provider."""
_ver = ([v for v in self._data['versions']
if v['version'] == version])[0]
return ([p for p in _ver['providers']
if p['name'] == provider])[0]['url']
## Instruction:
Index the Atlas data by version and provider
## Code After:
from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vagrant box name
"""
json_url = ("https://atlas.hashicorp.com/{0}/boxes/{1}/"
.format(publisher, name))
request = urllib2.Request(json_url, None,
{'Accept': 'application/json'})
json_file = urllib2.urlopen(request)
self._data = json.loads(json_file.read())
# We need to preserve the order of the versions
self._versions = tuple(v['version'] for v in self._data['versions'])
# Prepare a data structure for quick lookups
self._boxes = {}
for v in self._data['versions']:
_version = v['version']
self._boxes[_version] = {}
for p in v['providers']:
_provider = p['name']
self._boxes[_version][_provider] = {}
self._boxes[_version][_provider]['url'] = p['url']
def versions(self):
"""Return a tuple with all available box versions."""
return self._versions
def providers(self, version):
"""Return a list of providers for a specific box version."""
return self._boxes[version].keys()
def url(self, version, provider):
"""Return the download URL for a specific box version and provider."""
return self._boxes[version][provider]['url']
| from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vagrant box name
"""
json_url = ("https://atlas.hashicorp.com/{0}/boxes/{1}/"
.format(publisher, name))
request = urllib2.Request(json_url, None,
{'Accept': 'application/json'})
json_file = urllib2.urlopen(request)
self._data = json.loads(json_file.read())
+ # We need to preserve the order of the versions
+ self._versions = tuple(v['version'] for v in self._data['versions'])
+ # Prepare a data structure for quick lookups
+ self._boxes = {}
+ for v in self._data['versions']:
+ _version = v['version']
+ self._boxes[_version] = {}
+ for p in v['providers']:
+ _provider = p['name']
+ self._boxes[_version][_provider] = {}
+ self._boxes[_version][_provider]['url'] = p['url']
def versions(self):
"""Return a tuple with all available box versions."""
+ return self._versions
- return tuple(v['version'] for v in self._data['versions']
- if v['status'] == 'active')
def providers(self, version):
"""Return a list of providers for a specific box version."""
+ return self._boxes[version].keys()
- _ver = ([v for v in self._data['versions']
- if v['version'] == version])[0]
- return [p['name'] for p in _ver['providers']]
def url(self, version, provider):
"""Return the download URL for a specific box version and provider."""
+ return self._boxes[version][provider]['url']
- _ver = ([v for v in self._data['versions']
- if v['version'] == version])[0]
- return ([p for p in _ver['providers']
- if p['name'] == provider])[0]['url'] | 23 | 0.605263 | 14 | 9 |
64ba37f602bd36da0868f13eeb3794d5291247dd | Manifold/Module.swift | Manifold/Module.swift | // Copyright © 2015 Rob Rix. All rights reserved.
public struct Module<Recur> {
public typealias Environment = Expression<Recur>.Environment
public typealias Context = Expression<Recur>.Context
public init<D: SequenceType, S: SequenceType where D.Generator.Element == Module, S.Generator.Element == Binding<Recur>>(_ dependencies: D, _ definitions: S) {
self.dependencies = Array(dependencies)
self.definitions = Array(definitions)
}
public let dependencies: [Module]
public let definitions: [Binding<Recur>]
public var environment: Environment {
let dependencies = lazy(self.dependencies).map { $0.environment }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.value] }
return dependencies
.concat(definitions)
.reduce(Environment(), combine: +)
}
public var context: Context {
let dependencies = lazy(self.dependencies).map { $0.context }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.type] }
return dependencies
.concat(definitions)
.reduce(Context(), combine: +)
}
}
| // Copyright © 2015 Rob Rix. All rights reserved.
public struct Module<Recur> {
public typealias Environment = Expression<Recur>.Environment
public typealias Context = Expression<Recur>.Context
public init<D: SequenceType, S: SequenceType where D.Generator.Element == Module, S.Generator.Element == Binding<Recur>>(_ dependencies: D, _ definitions: S) {
self.dependencies = Array(dependencies)
self.definitions = Array(definitions)
}
public init<S: SequenceType where S.Generator.Element == Binding<Recur>>(_ definitions: S) {
self.init([], definitions)
}
public let dependencies: [Module]
public let definitions: [Binding<Recur>]
public var environment: Environment {
let dependencies = lazy(self.dependencies).map { $0.environment }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.value] }
return dependencies
.concat(definitions)
.reduce(Environment(), combine: +)
}
public var context: Context {
let dependencies = lazy(self.dependencies).map { $0.context }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.type] }
return dependencies
.concat(definitions)
.reduce(Context(), combine: +)
}
}
| Add a definitions-only module constructor. | Add a definitions-only module constructor.
| Swift | mit | antitypical/Manifold,antitypical/Manifold | swift | ## Code Before:
// Copyright © 2015 Rob Rix. All rights reserved.
public struct Module<Recur> {
public typealias Environment = Expression<Recur>.Environment
public typealias Context = Expression<Recur>.Context
public init<D: SequenceType, S: SequenceType where D.Generator.Element == Module, S.Generator.Element == Binding<Recur>>(_ dependencies: D, _ definitions: S) {
self.dependencies = Array(dependencies)
self.definitions = Array(definitions)
}
public let dependencies: [Module]
public let definitions: [Binding<Recur>]
public var environment: Environment {
let dependencies = lazy(self.dependencies).map { $0.environment }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.value] }
return dependencies
.concat(definitions)
.reduce(Environment(), combine: +)
}
public var context: Context {
let dependencies = lazy(self.dependencies).map { $0.context }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.type] }
return dependencies
.concat(definitions)
.reduce(Context(), combine: +)
}
}
## Instruction:
Add a definitions-only module constructor.
## Code After:
// Copyright © 2015 Rob Rix. All rights reserved.
public struct Module<Recur> {
public typealias Environment = Expression<Recur>.Environment
public typealias Context = Expression<Recur>.Context
public init<D: SequenceType, S: SequenceType where D.Generator.Element == Module, S.Generator.Element == Binding<Recur>>(_ dependencies: D, _ definitions: S) {
self.dependencies = Array(dependencies)
self.definitions = Array(definitions)
}
public init<S: SequenceType where S.Generator.Element == Binding<Recur>>(_ definitions: S) {
self.init([], definitions)
}
public let dependencies: [Module]
public let definitions: [Binding<Recur>]
public var environment: Environment {
let dependencies = lazy(self.dependencies).map { $0.environment }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.value] }
return dependencies
.concat(definitions)
.reduce(Environment(), combine: +)
}
public var context: Context {
let dependencies = lazy(self.dependencies).map { $0.context }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.type] }
return dependencies
.concat(definitions)
.reduce(Context(), combine: +)
}
}
| // Copyright © 2015 Rob Rix. All rights reserved.
public struct Module<Recur> {
public typealias Environment = Expression<Recur>.Environment
public typealias Context = Expression<Recur>.Context
public init<D: SequenceType, S: SequenceType where D.Generator.Element == Module, S.Generator.Element == Binding<Recur>>(_ dependencies: D, _ definitions: S) {
self.dependencies = Array(dependencies)
self.definitions = Array(definitions)
+ }
+
+ public init<S: SequenceType where S.Generator.Element == Binding<Recur>>(_ definitions: S) {
+ self.init([], definitions)
}
public let dependencies: [Module]
public let definitions: [Binding<Recur>]
public var environment: Environment {
let dependencies = lazy(self.dependencies).map { $0.environment }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.value] }
return dependencies
.concat(definitions)
.reduce(Environment(), combine: +)
}
public var context: Context {
let dependencies = lazy(self.dependencies).map { $0.context }
let definitions = lazy(self.definitions).map { [$0.symbol: $0.type] }
return dependencies
.concat(definitions)
.reduce(Context(), combine: +)
}
} | 4 | 0.133333 | 4 | 0 |
692c35b0f111cc1c861780e36f496232f5d631dd | bin/deploy.sh | bin/deploy.sh | tar xvf .travis/secrets.tar -C .travis
# Setup SSH agent
eval "$(ssh-agent -s)" #start the ssh agent
chmod 600 .travis/build-key.pem
ssh-add .travis/build-key.pem
# Setup git defaults
git config --global user.email "matthew+component@weierophinney.net"
git config --global user.name "Matthew Weier O'Phinney"
# Get box and build PHAR
wget https://box-project.github.io/box2/manifest.json
BOX_URL=$(php bin/parse-manifest.php manifest.json)
rm manifest.json
wget -O box.phar ${BOX_URL}
chmod 755 box.phar
./box.phar build -vv
mv zend-component-installer.phar zend-component-installer.phar.tmp
# Add SSH-based remote
git remote add deploy git@github.com:weierophinney/component-installer.git
git fetch deploy
# Checkout gh-pages and add PHAR file and version
git checkout -b gh-pages deploy/gh-pages
mv zend-component-installer.phar.tmp zend-component-installer.phar
sha1sum zend-component-installer.phar > zend-component-installer.phar.version
git add zend-component-installer.phar zend-component-installer.phar.version
# Commit and push
git commit -m 'Rebuilt phar'
git push deploy gh-pages:gh-pages
| tar xvf .travis/secrets.tar -C .travis
# Setup SSH agent
eval "$(ssh-agent -s)" #start the ssh agent
chmod 600 .travis/build-key.pem
ssh-add .travis/build-key.pem
# Setup git defaults
git config --global user.email "matthew+component@weierophinney.net"
git config --global user.name "Matthew Weier O'Phinney"
# Get box and build PHAR
wget https://box-project.github.io/box2/manifest.json
BOX_URL=$(php bin/parse-manifest.php manifest.json)
rm manifest.json
wget -O box.phar ${BOX_URL}
chmod 755 box.phar
./box.phar build -vv
mv zend-component-installer.phar zend-component-installer.phar.tmp
# Add SSH-based remote
git remote add deploy git@github.com:zendframework/zend-component-installer.git
git fetch deploy
# Checkout gh-pages and add PHAR file and version
git checkout -b gh-pages deploy/gh-pages
mv zend-component-installer.phar.tmp zend-component-installer.phar
sha1sum zend-component-installer.phar > zend-component-installer.phar.version
git add zend-component-installer.phar zend-component-installer.phar.version
# Commit and push
git commit -m 'Rebuilt phar'
git push deploy gh-pages:gh-pages
| Set new remote for gh-pages! | Set new remote for gh-pages!
| Shell | bsd-3-clause | zendframework/zend-component-installer | shell | ## Code Before:
tar xvf .travis/secrets.tar -C .travis
# Setup SSH agent
eval "$(ssh-agent -s)" #start the ssh agent
chmod 600 .travis/build-key.pem
ssh-add .travis/build-key.pem
# Setup git defaults
git config --global user.email "matthew+component@weierophinney.net"
git config --global user.name "Matthew Weier O'Phinney"
# Get box and build PHAR
wget https://box-project.github.io/box2/manifest.json
BOX_URL=$(php bin/parse-manifest.php manifest.json)
rm manifest.json
wget -O box.phar ${BOX_URL}
chmod 755 box.phar
./box.phar build -vv
mv zend-component-installer.phar zend-component-installer.phar.tmp
# Add SSH-based remote
git remote add deploy git@github.com:weierophinney/component-installer.git
git fetch deploy
# Checkout gh-pages and add PHAR file and version
git checkout -b gh-pages deploy/gh-pages
mv zend-component-installer.phar.tmp zend-component-installer.phar
sha1sum zend-component-installer.phar > zend-component-installer.phar.version
git add zend-component-installer.phar zend-component-installer.phar.version
# Commit and push
git commit -m 'Rebuilt phar'
git push deploy gh-pages:gh-pages
## Instruction:
Set new remote for gh-pages!
## Code After:
tar xvf .travis/secrets.tar -C .travis
# Setup SSH agent
eval "$(ssh-agent -s)" #start the ssh agent
chmod 600 .travis/build-key.pem
ssh-add .travis/build-key.pem
# Setup git defaults
git config --global user.email "matthew+component@weierophinney.net"
git config --global user.name "Matthew Weier O'Phinney"
# Get box and build PHAR
wget https://box-project.github.io/box2/manifest.json
BOX_URL=$(php bin/parse-manifest.php manifest.json)
rm manifest.json
wget -O box.phar ${BOX_URL}
chmod 755 box.phar
./box.phar build -vv
mv zend-component-installer.phar zend-component-installer.phar.tmp
# Add SSH-based remote
git remote add deploy git@github.com:zendframework/zend-component-installer.git
git fetch deploy
# Checkout gh-pages and add PHAR file and version
git checkout -b gh-pages deploy/gh-pages
mv zend-component-installer.phar.tmp zend-component-installer.phar
sha1sum zend-component-installer.phar > zend-component-installer.phar.version
git add zend-component-installer.phar zend-component-installer.phar.version
# Commit and push
git commit -m 'Rebuilt phar'
git push deploy gh-pages:gh-pages
| tar xvf .travis/secrets.tar -C .travis
# Setup SSH agent
eval "$(ssh-agent -s)" #start the ssh agent
chmod 600 .travis/build-key.pem
ssh-add .travis/build-key.pem
# Setup git defaults
git config --global user.email "matthew+component@weierophinney.net"
git config --global user.name "Matthew Weier O'Phinney"
# Get box and build PHAR
wget https://box-project.github.io/box2/manifest.json
BOX_URL=$(php bin/parse-manifest.php manifest.json)
rm manifest.json
wget -O box.phar ${BOX_URL}
chmod 755 box.phar
./box.phar build -vv
mv zend-component-installer.phar zend-component-installer.phar.tmp
# Add SSH-based remote
- git remote add deploy git@github.com:weierophinney/component-installer.git
? ------- ^^^^
+ git remote add deploy git@github.com:zendframework/zend-component-installer.git
? +++++++++ +++++ ^^
git fetch deploy
# Checkout gh-pages and add PHAR file and version
git checkout -b gh-pages deploy/gh-pages
mv zend-component-installer.phar.tmp zend-component-installer.phar
sha1sum zend-component-installer.phar > zend-component-installer.phar.version
git add zend-component-installer.phar zend-component-installer.phar.version
# Commit and push
git commit -m 'Rebuilt phar'
git push deploy gh-pages:gh-pages | 2 | 0.060606 | 1 | 1 |
30bfe04e0fa1386e263cbd0e8dbc6f3689f9cb21 | connector_carepoint/migrations/9.0.1.3.0/pre-migrate.py | connector_carepoint/migrations/9.0.1.3.0/pre-migrate.py |
def migrate(cr, version):
cr.execute('ALTER TABLE carepoint_medical_prescription_order_line '
'RENAME TO carepoint_rx_ord_ln')
cr.execute('ALTER TABLE carepoint_carepoint_organization '
'RENAME TO carepoint_org_bind')
|
import logging
_logger = logging.getLogger(__name__)
def migrate(cr, version):
try:
cr.execute('ALTER TABLE carepoint_medical_prescription_order_line '
'RENAME TO carepoint_rx_ord_ln')
except Exception:
cr.rollback()
_logger.exception('Cannot perform migration')
try:
cr.execute('ALTER TABLE carepoint_carepoint_organization '
'RENAME TO carepoint_org_bind')
except Exception:
cr.rollback()
_logger.exception('Cannot perform migration')
| Fix prescription migration * Add try/catch & rollback to db alterations in case server re-upgrades | [FIX] connector_carepoint: Fix prescription migration
* Add try/catch & rollback to db alterations in case server re-upgrades
| Python | agpl-3.0 | laslabs/odoo-connector-carepoint | python | ## Code Before:
def migrate(cr, version):
cr.execute('ALTER TABLE carepoint_medical_prescription_order_line '
'RENAME TO carepoint_rx_ord_ln')
cr.execute('ALTER TABLE carepoint_carepoint_organization '
'RENAME TO carepoint_org_bind')
## Instruction:
[FIX] connector_carepoint: Fix prescription migration
* Add try/catch & rollback to db alterations in case server re-upgrades
## Code After:
import logging
_logger = logging.getLogger(__name__)
def migrate(cr, version):
try:
cr.execute('ALTER TABLE carepoint_medical_prescription_order_line '
'RENAME TO carepoint_rx_ord_ln')
except Exception:
cr.rollback()
_logger.exception('Cannot perform migration')
try:
cr.execute('ALTER TABLE carepoint_carepoint_organization '
'RENAME TO carepoint_org_bind')
except Exception:
cr.rollback()
_logger.exception('Cannot perform migration')
| +
+ import logging
+
+ _logger = logging.getLogger(__name__)
def migrate(cr, version):
+ try:
- cr.execute('ALTER TABLE carepoint_medical_prescription_order_line '
+ cr.execute('ALTER TABLE carepoint_medical_prescription_order_line '
? ++++
- 'RENAME TO carepoint_rx_ord_ln')
+ 'RENAME TO carepoint_rx_ord_ln')
? ++++
+ except Exception:
+ cr.rollback()
+ _logger.exception('Cannot perform migration')
+ try:
- cr.execute('ALTER TABLE carepoint_carepoint_organization '
+ cr.execute('ALTER TABLE carepoint_carepoint_organization '
? ++++
- 'RENAME TO carepoint_org_bind')
+ 'RENAME TO carepoint_org_bind')
? ++++
+ except Exception:
+ cr.rollback()
+ _logger.exception('Cannot perform migration') | 20 | 2.5 | 16 | 4 |
dfa955b6d62ba6c0a03832dbdbac5abdaa82a8cc | week-3/chrome-devtools/positioning-reflection.md | week-3/chrome-devtools/positioning-reflection.md |  | 
### 2.

### 3.

### 4.

### 5.

### 6.

### 7.

### 8.

### 9.

| Add all screenshots to reflection. | Add all screenshots to reflection.
| Markdown | mit | countaight/phase-0,countaight/phase-0,countaight/phase-0 | markdown | ## Code Before:

## Instruction:
Add all screenshots to reflection.
## Code After:

### 2.

### 3.

### 4.

### 5.

### 6.

### 7.

### 8.

### 9.

| 
+
+ ### 2.
+ 
+
+ ### 3.
+ 
+
+ ### 4.
+ 
+
+ ### 5.
+ 
+
+ ### 6.
+ 
+
+ ### 7.
+ 
+
+ ### 8.
+ 
+
+ ### 9.
+ 
+ | 25 | 25 | 25 | 0 |
7edd4d5f3ae09c78590ffc5f2430095c62f17607 | app/Notification.php | app/Notification.php | <?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Notification extends Model {
//
}
| <?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Notification extends Model {
protected $fillable = [
'body',
'type',
'topic_id',
'reply_id',
'user_id',
'from_user_id',
];
public function user()
{
return $this->belongsTo('User');
}
public function topic()
{
return $this->belongsTo('Topic');
}
public function fromUser()
{
return $this->belongsTo('User', 'from_user_id');
}
}
| Set the relationships for the notification model. | Set the relationships for the notification model.
| PHP | mit | yiyangyi/cc98-laravel,yiyangyi/cc98-laravel | php | ## Code Before:
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Notification extends Model {
//
}
## Instruction:
Set the relationships for the notification model.
## Code After:
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Notification extends Model {
protected $fillable = [
'body',
'type',
'topic_id',
'reply_id',
'user_id',
'from_user_id',
];
public function user()
{
return $this->belongsTo('User');
}
public function topic()
{
return $this->belongsTo('Topic');
}
public function fromUser()
{
return $this->belongsTo('User', 'from_user_id');
}
}
| <?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Notification extends Model {
- //
+ protected $fillable = [
+ 'body',
+ 'type',
+ 'topic_id',
+ 'reply_id',
+ 'user_id',
+ 'from_user_id',
+ ];
+
+ public function user()
+ {
+ return $this->belongsTo('User');
+ }
+
+ public function topic()
+ {
+ return $this->belongsTo('Topic');
+ }
+
+ public function fromUser()
+ {
+ return $this->belongsTo('User', 'from_user_id');
+ }
} | 24 | 2.666667 | 23 | 1 |
8c2952399c702f4161b8df178232898539d0ec68 | tox.ini | tox.ini | [tox]
envlist =
{py34,py33,py32,py27}-{django18,django17},
coverage, flake8
[testenv]
deps =
django17: Django>=1.7,<1.8
django18: Django>=1.8,<1.9
setenv =
PYTHONPATH = .
DJANGO_SETTINGS_MODULE=test_settings
commands =
django-admin.py test logentry_admin
[testenv:coverage]
deps = coverage
commands =
coverage run --source=logentry_admin {envbindir}/django-admin.py test logentry_admin
coverage report --show-missing --fail-under=90
[testenv:flake8]
deps = flake8==2.5.1
commands = flake8 logentry_admin
| [tox]
envlist =
{py35,py34,py27}-django19,
{py35,py34,py33,py32,py27}-django18,
{py34,py33,py32,py27}-django17,
coverage, flake8
[testenv]
deps =
django17: Django>=1.7,<1.8
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
setenv =
PYTHONPATH = .
DJANGO_SETTINGS_MODULE=test_settings
commands =
django-admin.py test logentry_admin
[testenv:coverage]
deps = coverage
commands =
coverage run --source=logentry_admin {envbindir}/django-admin.py test logentry_admin
coverage report --show-missing --fail-under=90
[testenv:flake8]
deps = flake8==2.5.1
commands = flake8 logentry_admin
| Test on Python 3.5 + Django 1.9 | Test on Python 3.5 + Django 1.9
| INI | isc | yprez/django-logentry-admin,yprez/django-logentry-admin | ini | ## Code Before:
[tox]
envlist =
{py34,py33,py32,py27}-{django18,django17},
coverage, flake8
[testenv]
deps =
django17: Django>=1.7,<1.8
django18: Django>=1.8,<1.9
setenv =
PYTHONPATH = .
DJANGO_SETTINGS_MODULE=test_settings
commands =
django-admin.py test logentry_admin
[testenv:coverage]
deps = coverage
commands =
coverage run --source=logentry_admin {envbindir}/django-admin.py test logentry_admin
coverage report --show-missing --fail-under=90
[testenv:flake8]
deps = flake8==2.5.1
commands = flake8 logentry_admin
## Instruction:
Test on Python 3.5 + Django 1.9
## Code After:
[tox]
envlist =
{py35,py34,py27}-django19,
{py35,py34,py33,py32,py27}-django18,
{py34,py33,py32,py27}-django17,
coverage, flake8
[testenv]
deps =
django17: Django>=1.7,<1.8
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
setenv =
PYTHONPATH = .
DJANGO_SETTINGS_MODULE=test_settings
commands =
django-admin.py test logentry_admin
[testenv:coverage]
deps = coverage
commands =
coverage run --source=logentry_admin {envbindir}/django-admin.py test logentry_admin
coverage report --show-missing --fail-under=90
[testenv:flake8]
deps = flake8==2.5.1
commands = flake8 logentry_admin
| [tox]
envlist =
+ {py35,py34,py27}-django19,
+ {py35,py34,py33,py32,py27}-django18,
- {py34,py33,py32,py27}-{django18,django17},
? ---------- -
+ {py34,py33,py32,py27}-django17,
coverage, flake8
[testenv]
deps =
django17: Django>=1.7,<1.8
django18: Django>=1.8,<1.9
+ django19: Django>=1.9,<1.10
setenv =
PYTHONPATH = .
DJANGO_SETTINGS_MODULE=test_settings
commands =
django-admin.py test logentry_admin
[testenv:coverage]
deps = coverage
commands =
coverage run --source=logentry_admin {envbindir}/django-admin.py test logentry_admin
coverage report --show-missing --fail-under=90
[testenv:flake8]
deps = flake8==2.5.1
commands = flake8 logentry_admin | 5 | 0.208333 | 4 | 1 |
25f11f090dfcd7c5e9397c5ca6f8d86b66caeef5 | 101-data-lake-store-encryption-adls/metadata.json | 101-data-lake-store-encryption-adls/metadata.json | {
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
"type": "QuickStart",
"itemDisplayName": "Deploy Data Lake Store account with encryption(Data Lake)",
"description": "This template allows you to deploy an Azure Data Lake Store account with data encryption enabled. This account uses the Data Lake store account to manage the encryption key.",
"summary": "Deploy an Azure Data Lake Store account with data encryption using Data Lake for encryption key management.",
"githubUsername": "mumian",
"dateUpdated": "2020-09-13",
"environments": ["AzureCloud"]
} | {
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
"type": "QuickStart",
"itemDisplayName": "Deploy Data Lake Store account with encryption(Data Lake)",
"description": "This template allows you to deploy an Azure Data Lake Store account with data encryption enabled. This account uses the Data Lake store account to manage the encryption key.",
"summary": "Deploy an Azure Data Lake Store account with data encryption using Data Lake for encryption key management.",
"githubUsername": "mumian",
"dateUpdated": "2017-08-14"
}
| Revert "Remove US Gov support" | Revert "Remove US Gov support"
This reverts commit 1ec20568313b74823fca6ab2c07b44b08da0bd9f.
| JSON | mit | bmoore-msft/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,daltskin/azure-quickstart-templates,neudesic/azure-quickstart-templates,nzthiago/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,slapointe/azure-quickstart-templates,matt1883/azure-quickstart-templates,matt1883/azure-quickstart-templates,daltskin/azure-quickstart-templates,nzthiago/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,jmservera/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,jmservera/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,slapointe/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,slapointe/azure-quickstart-templates,slapointe/azure-quickstart-templates,Azure/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,johndowns/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,nzthiago/azure-quickstart-templates,jmservera/azure-quickstart-templates,johndowns/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,nzthiago/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,johndowns/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,johndowns/azure-quickstart-templates,johndowns/azure-quickstart-templates,slapointe/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,daltskin/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,jmservera/azure-quickstart-templates,nzthiago/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,neudesic/azure-quickstart-templates,neudesic/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,Azure/azure-quickstart-templates,Azure/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,jmservera/azure-quickstart-templates,slapointe/azure-quickstart-templates,nzthiago/azure-quickstart-templates,Azure/azure-quickstart-templates,neudesic/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,Azure/azure-quickstart-templates,johndowns/azure-quickstart-templates,matt1883/azure-quickstart-templates,neudesic/azure-quickstart-templates,jmservera/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,Azure/azure-quickstart-templates,neudesic/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,daltskin/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,matt1883/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates | json | ## Code Before:
{
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
"type": "QuickStart",
"itemDisplayName": "Deploy Data Lake Store account with encryption(Data Lake)",
"description": "This template allows you to deploy an Azure Data Lake Store account with data encryption enabled. This account uses the Data Lake store account to manage the encryption key.",
"summary": "Deploy an Azure Data Lake Store account with data encryption using Data Lake for encryption key management.",
"githubUsername": "mumian",
"dateUpdated": "2020-09-13",
"environments": ["AzureCloud"]
}
## Instruction:
Revert "Remove US Gov support"
This reverts commit 1ec20568313b74823fca6ab2c07b44b08da0bd9f.
## Code After:
{
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
"type": "QuickStart",
"itemDisplayName": "Deploy Data Lake Store account with encryption(Data Lake)",
"description": "This template allows you to deploy an Azure Data Lake Store account with data encryption enabled. This account uses the Data Lake store account to manage the encryption key.",
"summary": "Deploy an Azure Data Lake Store account with data encryption using Data Lake for encryption key management.",
"githubUsername": "mumian",
"dateUpdated": "2017-08-14"
}
| {
"$schema": "https://aka.ms/azure-quickstart-templates-metadata-schema#",
"type": "QuickStart",
"itemDisplayName": "Deploy Data Lake Store account with encryption(Data Lake)",
"description": "This template allows you to deploy an Azure Data Lake Store account with data encryption enabled. This account uses the Data Lake store account to manage the encryption key.",
"summary": "Deploy an Azure Data Lake Store account with data encryption using Data Lake for encryption key management.",
"githubUsername": "mumian",
- "dateUpdated": "2020-09-13",
? ^^ ^ ^ -
+ "dateUpdated": "2017-08-14"
? ^^ ^ ^
- "environments": ["AzureCloud"]
}
+
+ | 5 | 0.5 | 3 | 2 |
4c4b5a99e2fd02eff3451bf6c3a761163794a8ce | imageofmodel/admin.py | imageofmodel/admin.py |
from django.contrib import admin
from django import forms
from django.contrib.contenttypes.generic import GenericTabularInline, BaseGenericInlineFormSet
from models import ImageOfModel
class ImageFormset(BaseGenericInlineFormSet):
def clean(self):
if not self.files.values() and not self.instance.images.all():
raise forms.ValidationError(u'Загрузите хотябы одну фотографию')
class ImageOfModelInline(GenericTabularInline):
model = ImageOfModel
formset = ImageFormset
extra = 1 |
from django.contrib import admin
from django import forms
from django.contrib.contenttypes.generic import GenericTabularInline, BaseGenericInlineFormSet
from models import ImageOfModel
class ImageFormset(BaseGenericInlineFormSet):
def clean(self):
if not self.files.values() and not self.instance.images.all():
raise forms.ValidationError(u'Загрузите хотябы одну фотографию')
class ImageOfModelInline(GenericTabularInline):
model = ImageOfModel
formset = ImageFormset
extra = 1
class OptionalImageOfModelInline(GenericTabularInline):
model = ImageOfModel
extra = 1 | Add class OptionalImageOfModelInline for optional images | [+] Add class OptionalImageOfModelInline for optional images
| Python | bsd-3-clause | vixh/django-imageofmodel | python | ## Code Before:
from django.contrib import admin
from django import forms
from django.contrib.contenttypes.generic import GenericTabularInline, BaseGenericInlineFormSet
from models import ImageOfModel
class ImageFormset(BaseGenericInlineFormSet):
def clean(self):
if not self.files.values() and not self.instance.images.all():
raise forms.ValidationError(u'Загрузите хотябы одну фотографию')
class ImageOfModelInline(GenericTabularInline):
model = ImageOfModel
formset = ImageFormset
extra = 1
## Instruction:
[+] Add class OptionalImageOfModelInline for optional images
## Code After:
from django.contrib import admin
from django import forms
from django.contrib.contenttypes.generic import GenericTabularInline, BaseGenericInlineFormSet
from models import ImageOfModel
class ImageFormset(BaseGenericInlineFormSet):
def clean(self):
if not self.files.values() and not self.instance.images.all():
raise forms.ValidationError(u'Загрузите хотябы одну фотографию')
class ImageOfModelInline(GenericTabularInline):
model = ImageOfModel
formset = ImageFormset
extra = 1
class OptionalImageOfModelInline(GenericTabularInline):
model = ImageOfModel
extra = 1 |
from django.contrib import admin
from django import forms
from django.contrib.contenttypes.generic import GenericTabularInline, BaseGenericInlineFormSet
from models import ImageOfModel
class ImageFormset(BaseGenericInlineFormSet):
def clean(self):
if not self.files.values() and not self.instance.images.all():
raise forms.ValidationError(u'Загрузите хотябы одну фотографию')
class ImageOfModelInline(GenericTabularInline):
model = ImageOfModel
formset = ImageFormset
extra = 1
+
+
+ class OptionalImageOfModelInline(GenericTabularInline):
+ model = ImageOfModel
+ extra = 1 | 5 | 0.294118 | 5 | 0 |
94750d1c2050be06193279d654e74458328aa519 | pingdom_rum.php | pingdom_rum.php | <?php
namespace Grav\Plugin;
use Grav\Common\Plugin;
class Pingdom_RUMPlugin extends Plugin
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'onAssetsInitialized' => ['onAssetsInitialized', 0]
];
}
/**
* Add GoSquared JS in assets initialisation
*/
public function onAssetsInitialized()
{
/**
* Ok, we're ready to go
*/
$prumid = trim($this->config->get('plugins.pingdom_rum.prumid'));
if ($prumid) {
$gsjs = <<<PingdomRUMJS
var _prum = [['id', '5519be67abe53d310131abbc'],
['mark', 'firstbyte', (new Date()).getTime()]];
(function() {
var s = document.getElementsByTagName('script')[0]
, p = document.createElement('script');
p.async = 'async';
p.src = '//rum-static.pingdom.net/prum.min.js';
s.parentNode.insertBefore(p, s);
})();
PingdomRUMJS;
$this->grav['assets']->addInlineJs($gsjs);
}
}
}
| <?php
namespace Grav\Plugin;
use Grav\Common\Plugin;
class Pingdom_RUMPlugin extends Plugin
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'onAssetsInitialized' => ['onAssetsInitialized', 0]
];
}
/**
* Add GoSquared JS in assets initialisation
*/
public function onAssetsInitialized()
{
/**
* Ok, we're ready to go
*/
$prumid = trim($this->config->get('plugins.pingdom_rum.prumid'));
if ($prumid) {
$gsjs = <<<PingdomRUMJS
var _prum = [['id', '$prumid'],
['mark', 'firstbyte', (new Date()).getTime()]];
(function() {
var s = document.getElementsByTagName('script')[0]
, p = document.createElement('script');
p.async = 'async';
p.src = '//rum-static.pingdom.net/prum.min.js';
s.parentNode.insertBefore(p, s);
})();
PingdomRUMJS;
$this->grav['assets']->addInlineJs($gsjs);
}
}
}
| Fix copy/pasta mistake and use ID from configuration yaml | Fix copy/pasta mistake and use ID from configuration yaml
| PHP | mit | CPPL/grav-pingdom_rum | php | ## Code Before:
<?php
namespace Grav\Plugin;
use Grav\Common\Plugin;
class Pingdom_RUMPlugin extends Plugin
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'onAssetsInitialized' => ['onAssetsInitialized', 0]
];
}
/**
* Add GoSquared JS in assets initialisation
*/
public function onAssetsInitialized()
{
/**
* Ok, we're ready to go
*/
$prumid = trim($this->config->get('plugins.pingdom_rum.prumid'));
if ($prumid) {
$gsjs = <<<PingdomRUMJS
var _prum = [['id', '5519be67abe53d310131abbc'],
['mark', 'firstbyte', (new Date()).getTime()]];
(function() {
var s = document.getElementsByTagName('script')[0]
, p = document.createElement('script');
p.async = 'async';
p.src = '//rum-static.pingdom.net/prum.min.js';
s.parentNode.insertBefore(p, s);
})();
PingdomRUMJS;
$this->grav['assets']->addInlineJs($gsjs);
}
}
}
## Instruction:
Fix copy/pasta mistake and use ID from configuration yaml
## Code After:
<?php
namespace Grav\Plugin;
use Grav\Common\Plugin;
class Pingdom_RUMPlugin extends Plugin
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'onAssetsInitialized' => ['onAssetsInitialized', 0]
];
}
/**
* Add GoSquared JS in assets initialisation
*/
public function onAssetsInitialized()
{
/**
* Ok, we're ready to go
*/
$prumid = trim($this->config->get('plugins.pingdom_rum.prumid'));
if ($prumid) {
$gsjs = <<<PingdomRUMJS
var _prum = [['id', '$prumid'],
['mark', 'firstbyte', (new Date()).getTime()]];
(function() {
var s = document.getElementsByTagName('script')[0]
, p = document.createElement('script');
p.async = 'async';
p.src = '//rum-static.pingdom.net/prum.min.js';
s.parentNode.insertBefore(p, s);
})();
PingdomRUMJS;
$this->grav['assets']->addInlineJs($gsjs);
}
}
}
| <?php
namespace Grav\Plugin;
use Grav\Common\Plugin;
class Pingdom_RUMPlugin extends Plugin
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'onAssetsInitialized' => ['onAssetsInitialized', 0]
];
}
/**
* Add GoSquared JS in assets initialisation
*/
public function onAssetsInitialized()
{
/**
* Ok, we're ready to go
*/
$prumid = trim($this->config->get('plugins.pingdom_rum.prumid'));
if ($prumid) {
$gsjs = <<<PingdomRUMJS
- var _prum = [['id', '5519be67abe53d310131abbc'],
+ var _prum = [['id', '$prumid'],
['mark', 'firstbyte', (new Date()).getTime()]];
(function() {
var s = document.getElementsByTagName('script')[0]
, p = document.createElement('script');
p.async = 'async';
p.src = '//rum-static.pingdom.net/prum.min.js';
s.parentNode.insertBefore(p, s);
})();
PingdomRUMJS;
$this->grav['assets']->addInlineJs($gsjs);
}
}
} | 2 | 0.04878 | 1 | 1 |
0699cb24ffd0a4c1db86afc70733019bf00a0d4e | src/ocf-2020-council-ward-2.txt | src/ocf-2020-council-ward-2.txt | =overall
I analyzed the DC Office of Campaign Finance (OCF) reports for Ward 2 council candidates for the period
ending July 31 (including amended filings for Fanning, Grossman, and Kennedy).
Since all five candidates are seeking to qualify for public campaign financing under the Fair Elections Act,
contributions all come from individuals and are limited to $50 (except for the candidate and their family,
who can give up to $2,500). Therefore most of this analysis focuses on the number of contributors rather the
amount raised, and there's nothing about corporate contributions because the candidates are prohibited from
taking them.
The contributor numbers are interesting because they give a clue about how much support a candidate has.
There were 11 people who gave to more than 1 candidate, including 1 who gave to 3, 1 who gave to 4,
and 1 who gave to all 5.
=stats
John Fanning has not been certified for the program yet, but I included Fair Elections funds for him
because he seems to have enough DC contributors (I assume there's a minor problem like bad addresses
that can be corrected).
Daniel Hernandez is nowhere near qualifying yet.
Note that Jordan Grossman's total amount raised will likely drop by $7,716 that he will need to refund
because OCF changed its interpretation of the law limiting candidate and family contributions.
It looks like Kishan Putta has 3 contributors who gave $50 twice each, so he may have to refund $150
(or maybe that's a reporting error, but his total would still be $150 lower).
| =overall
I analyzed the DC Office of Campaign Finance (OCF) reports for Ward 2 council candidates for the period
ending July 31 (including amended filings for Fanning, Grossman, and Kennedy).
Since all five candidates are seeking to qualify for public campaign financing under the Fair Elections Act,
contributions all come from individuals and are limited to $50 (except for the candidate and their family,
who can give up to $2,500). Therefore most of this analysis focuses on the number of contributors rather the
amount raised, and there's nothing about corporate contributions because the candidates are prohibited from
taking them.
The contributor numbers are interesting because they give a clue about how much support a candidate has.
There were 11 people who gave to more than 1 candidate, including 1 who gave to 3, 1 who gave to 4,
and 1 who gave to all 5.
=stats
Note that Jordan Grossman's amount to refund results from OCF changing its interpretation of the law
limiting candidate and family contributions.
| Edit Ward 2 extra explanation | Edit Ward 2 extra explanation
| Text | isc | kcivey/dc-ocf,kcivey/dc-ocf,kcivey/dc-ocf | text | ## Code Before:
=overall
I analyzed the DC Office of Campaign Finance (OCF) reports for Ward 2 council candidates for the period
ending July 31 (including amended filings for Fanning, Grossman, and Kennedy).
Since all five candidates are seeking to qualify for public campaign financing under the Fair Elections Act,
contributions all come from individuals and are limited to $50 (except for the candidate and their family,
who can give up to $2,500). Therefore most of this analysis focuses on the number of contributors rather the
amount raised, and there's nothing about corporate contributions because the candidates are prohibited from
taking them.
The contributor numbers are interesting because they give a clue about how much support a candidate has.
There were 11 people who gave to more than 1 candidate, including 1 who gave to 3, 1 who gave to 4,
and 1 who gave to all 5.
=stats
John Fanning has not been certified for the program yet, but I included Fair Elections funds for him
because he seems to have enough DC contributors (I assume there's a minor problem like bad addresses
that can be corrected).
Daniel Hernandez is nowhere near qualifying yet.
Note that Jordan Grossman's total amount raised will likely drop by $7,716 that he will need to refund
because OCF changed its interpretation of the law limiting candidate and family contributions.
It looks like Kishan Putta has 3 contributors who gave $50 twice each, so he may have to refund $150
(or maybe that's a reporting error, but his total would still be $150 lower).
## Instruction:
Edit Ward 2 extra explanation
## Code After:
=overall
I analyzed the DC Office of Campaign Finance (OCF) reports for Ward 2 council candidates for the period
ending July 31 (including amended filings for Fanning, Grossman, and Kennedy).
Since all five candidates are seeking to qualify for public campaign financing under the Fair Elections Act,
contributions all come from individuals and are limited to $50 (except for the candidate and their family,
who can give up to $2,500). Therefore most of this analysis focuses on the number of contributors rather the
amount raised, and there's nothing about corporate contributions because the candidates are prohibited from
taking them.
The contributor numbers are interesting because they give a clue about how much support a candidate has.
There were 11 people who gave to more than 1 candidate, including 1 who gave to 3, 1 who gave to 4,
and 1 who gave to all 5.
=stats
Note that Jordan Grossman's amount to refund results from OCF changing its interpretation of the law
limiting candidate and family contributions.
| =overall
I analyzed the DC Office of Campaign Finance (OCF) reports for Ward 2 council candidates for the period
ending July 31 (including amended filings for Fanning, Grossman, and Kennedy).
Since all five candidates are seeking to qualify for public campaign financing under the Fair Elections Act,
contributions all come from individuals and are limited to $50 (except for the candidate and their family,
who can give up to $2,500). Therefore most of this analysis focuses on the number of contributors rather the
amount raised, and there's nothing about corporate contributions because the candidates are prohibited from
taking them.
The contributor numbers are interesting because they give a clue about how much support a candidate has.
There were 11 people who gave to more than 1 candidate, including 1 who gave to 3, 1 who gave to 4,
and 1 who gave to all 5.
=stats
+ Note that Jordan Grossman's amount to refund results from OCF changing its interpretation of the law
+ limiting candidate and family contributions.
- John Fanning has not been certified for the program yet, but I included Fair Elections funds for him
- because he seems to have enough DC contributors (I assume there's a minor problem like bad addresses
- that can be corrected).
- Daniel Hernandez is nowhere near qualifying yet.
-
- Note that Jordan Grossman's total amount raised will likely drop by $7,716 that he will need to refund
- because OCF changed its interpretation of the law limiting candidate and family contributions.
- It looks like Kishan Putta has 3 contributors who gave $50 twice each, so he may have to refund $150
- (or maybe that's a reporting error, but his total would still be $150 lower). | 11 | 0.423077 | 2 | 9 |
40fd8c680f335ebd1bc217f35a47f169c336530c | pyosf/tools.py | pyosf/tools.py |
def find_by_key(in_list, key, val):
"""Returns the first item with key matching val
"""
return (item for item in in_list if item[key] == val).next()
def dict_from_list(in_list, key):
"""From a list of dicts creates a dict of dicts using a given key name
"""
d = {}
for entry in in_list:
d[entry[key]] = entry
return d
|
def find_by_key(in_list, key, val):
"""Returns the first item with key matching val
"""
return next(item for item in in_list if item[key] == val)
def dict_from_list(in_list, key):
"""From a list of dicts creates a dict of dicts using a given key name
"""
d = {}
for entry in in_list:
d[entry[key]] = entry
return d
| Fix compatibility with Py3 (generators no longer have next()) | Fix compatibility with Py3 (generators no longer have next())
But there is a next() function as a general built-in and works in 2.6 too
| Python | mit | psychopy/pyosf | python | ## Code Before:
def find_by_key(in_list, key, val):
"""Returns the first item with key matching val
"""
return (item for item in in_list if item[key] == val).next()
def dict_from_list(in_list, key):
"""From a list of dicts creates a dict of dicts using a given key name
"""
d = {}
for entry in in_list:
d[entry[key]] = entry
return d
## Instruction:
Fix compatibility with Py3 (generators no longer have next())
But there is a next() function as a general built-in and works in 2.6 too
## Code After:
def find_by_key(in_list, key, val):
"""Returns the first item with key matching val
"""
return next(item for item in in_list if item[key] == val)
def dict_from_list(in_list, key):
"""From a list of dicts creates a dict of dicts using a given key name
"""
d = {}
for entry in in_list:
d[entry[key]] = entry
return d
|
def find_by_key(in_list, key, val):
"""Returns the first item with key matching val
"""
- return (item for item in in_list if item[key] == val).next()
? -------
+ return next(item for item in in_list if item[key] == val)
? ++++
def dict_from_list(in_list, key):
"""From a list of dicts creates a dict of dicts using a given key name
"""
d = {}
for entry in in_list:
d[entry[key]] = entry
return d | 2 | 0.133333 | 1 | 1 |
a5cfee4926b90a7bae2b59b75f4112a7cd0c270b | examples/specs/stacked_bar_h_order.json | examples/specs/stacked_bar_h_order.json | {
"data": {"url": "data/barley.json"},
"mark": "bar",
"encoding": {
"x": {"aggregate": "sum", "field": "yield", "type": "quantitative"},
"y": {"field": "variety", "type": "nominal"},
"color": {"field": "site", "type": "nominal"},
"order": {"aggregate": "sum", "field": "yield", "type": "nominal"}
}
}
| {
"data": {"url": "data/barley.json"},
"mark": "bar",
"encoding": {
"x": {"aggregate": "sum", "field": "yield", "type": "quantitative"},
"y": {"field": "variety", "type": "nominal"},
"color": {"field": "site", "type": "nominal"},
"order": {"aggregate": "sum", "field": "yield", "type": "quantitative"}
}
}
| Correct type for stacked bar horizontal order example | Correct type for stacked bar horizontal order example
| JSON | bsd-3-clause | vega/vega-lite,vega/vega-lite,vega/vega-lite,uwdata/vega-lite,vega/vega-lite,vega/vega-lite,uwdata/vega-lite,uwdata/vega-lite,uwdata/vega-lite,uwdata/vega-lite | json | ## Code Before:
{
"data": {"url": "data/barley.json"},
"mark": "bar",
"encoding": {
"x": {"aggregate": "sum", "field": "yield", "type": "quantitative"},
"y": {"field": "variety", "type": "nominal"},
"color": {"field": "site", "type": "nominal"},
"order": {"aggregate": "sum", "field": "yield", "type": "nominal"}
}
}
## Instruction:
Correct type for stacked bar horizontal order example
## Code After:
{
"data": {"url": "data/barley.json"},
"mark": "bar",
"encoding": {
"x": {"aggregate": "sum", "field": "yield", "type": "quantitative"},
"y": {"field": "variety", "type": "nominal"},
"color": {"field": "site", "type": "nominal"},
"order": {"aggregate": "sum", "field": "yield", "type": "quantitative"}
}
}
| {
"data": {"url": "data/barley.json"},
"mark": "bar",
"encoding": {
"x": {"aggregate": "sum", "field": "yield", "type": "quantitative"},
"y": {"field": "variety", "type": "nominal"},
"color": {"field": "site", "type": "nominal"},
- "order": {"aggregate": "sum", "field": "yield", "type": "nominal"}
? ^^ ^ ^
+ "order": {"aggregate": "sum", "field": "yield", "type": "quantitative"}
? +++ ^ ^ ^^^^
}
} | 2 | 0.2 | 1 | 1 |
5027ab8c8be4ca2045e6aa98ee26b942b518dcb8 | src/matchercreationdialog.cpp | src/matchercreationdialog.cpp |
MatcherCreationDialog::MatcherCreationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MatcherCreationDialog)
{
ui->setupUi(this);
}
MatcherCreationDialog::~MatcherCreationDialog()
{
delete ui;
}
int MatcherCreationDialog::xblocks()
{
return ui->xblocks->value();
}
int MatcherCreationDialog::yblocks()
{
return ui->yblocks->value();
}
int MatcherCreationDialog::windowSize()
{
return ui->window_size->value();
}
CharacterSets MatcherCreationDialog::set()
{
switch(ui->set->currentIndex()) {
case 1:
return CharacterSets::CHINESE;
case 2:
return CharacterSets::LATIN;
case 0:
default:
return CharacterSets::CHINESE_REDUCED;
}
}
|
MatcherCreationDialog::MatcherCreationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MatcherCreationDialog)
{
ui->setupUi(this);
QSettings settings;
ui->xblocks->setValue(settings.value("xblocks").toInt());
ui->yblocks->setValue(settings.value("yblocks").toInt());
ui->window_size->setValue(settings.value("windowSize").toInt());
switch(settings.value("characterSet").value<CharacterSets>()) {
case CharacterSets::CHINESE:
ui->set->setCurrentIndex(1);
break;
case CharacterSets::LATIN:
ui->set->setCurrentIndex(2);
break;
case CharacterSets::CHINESE_REDUCED:
default:
ui->set->setCurrentIndex(0);
break;
}
}
MatcherCreationDialog::~MatcherCreationDialog()
{
delete ui;
}
int MatcherCreationDialog::xblocks()
{
return ui->xblocks->value();
}
int MatcherCreationDialog::yblocks()
{
return ui->yblocks->value();
}
int MatcherCreationDialog::windowSize()
{
return ui->window_size->value();
}
CharacterSets MatcherCreationDialog::set()
{
switch(ui->set->currentIndex()) {
case 1:
return CharacterSets::CHINESE;
case 2:
return CharacterSets::LATIN;
case 0:
default:
return CharacterSets::CHINESE_REDUCED;
}
}
| Load values in MatcherCreationDialog from settings | Load values in MatcherCreationDialog from settings
| C++ | mit | pawloKoder/Chin | c++ | ## Code Before:
MatcherCreationDialog::MatcherCreationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MatcherCreationDialog)
{
ui->setupUi(this);
}
MatcherCreationDialog::~MatcherCreationDialog()
{
delete ui;
}
int MatcherCreationDialog::xblocks()
{
return ui->xblocks->value();
}
int MatcherCreationDialog::yblocks()
{
return ui->yblocks->value();
}
int MatcherCreationDialog::windowSize()
{
return ui->window_size->value();
}
CharacterSets MatcherCreationDialog::set()
{
switch(ui->set->currentIndex()) {
case 1:
return CharacterSets::CHINESE;
case 2:
return CharacterSets::LATIN;
case 0:
default:
return CharacterSets::CHINESE_REDUCED;
}
}
## Instruction:
Load values in MatcherCreationDialog from settings
## Code After:
MatcherCreationDialog::MatcherCreationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MatcherCreationDialog)
{
ui->setupUi(this);
QSettings settings;
ui->xblocks->setValue(settings.value("xblocks").toInt());
ui->yblocks->setValue(settings.value("yblocks").toInt());
ui->window_size->setValue(settings.value("windowSize").toInt());
switch(settings.value("characterSet").value<CharacterSets>()) {
case CharacterSets::CHINESE:
ui->set->setCurrentIndex(1);
break;
case CharacterSets::LATIN:
ui->set->setCurrentIndex(2);
break;
case CharacterSets::CHINESE_REDUCED:
default:
ui->set->setCurrentIndex(0);
break;
}
}
MatcherCreationDialog::~MatcherCreationDialog()
{
delete ui;
}
int MatcherCreationDialog::xblocks()
{
return ui->xblocks->value();
}
int MatcherCreationDialog::yblocks()
{
return ui->yblocks->value();
}
int MatcherCreationDialog::windowSize()
{
return ui->window_size->value();
}
CharacterSets MatcherCreationDialog::set()
{
switch(ui->set->currentIndex()) {
case 1:
return CharacterSets::CHINESE;
case 2:
return CharacterSets::LATIN;
case 0:
default:
return CharacterSets::CHINESE_REDUCED;
}
}
| +
MatcherCreationDialog::MatcherCreationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MatcherCreationDialog)
{
ui->setupUi(this);
+ QSettings settings;
+ ui->xblocks->setValue(settings.value("xblocks").toInt());
+ ui->yblocks->setValue(settings.value("yblocks").toInt());
+ ui->window_size->setValue(settings.value("windowSize").toInt());
+
+ switch(settings.value("characterSet").value<CharacterSets>()) {
+ case CharacterSets::CHINESE:
+ ui->set->setCurrentIndex(1);
+ break;
+ case CharacterSets::LATIN:
+ ui->set->setCurrentIndex(2);
+ break;
+ case CharacterSets::CHINESE_REDUCED:
+ default:
+ ui->set->setCurrentIndex(0);
+ break;
+ }
}
+
MatcherCreationDialog::~MatcherCreationDialog()
{
delete ui;
}
int MatcherCreationDialog::xblocks()
{
return ui->xblocks->value();
}
int MatcherCreationDialog::yblocks()
{
return ui->yblocks->value();
}
int MatcherCreationDialog::windowSize()
{
return ui->window_size->value();
}
CharacterSets MatcherCreationDialog::set()
{
switch(ui->set->currentIndex()) {
case 1:
return CharacterSets::CHINESE;
case 2:
return CharacterSets::LATIN;
case 0:
default:
return CharacterSets::CHINESE_REDUCED;
}
} | 19 | 0.431818 | 19 | 0 |
ecb300f62aff2f5b303891c89c7abed58c8cbcd3 | checker.go | checker.go | package main
import (
"net/http"
)
type Checker func(*MonitorConf) (bool, error)
func checkHTTPStatus(mc *MonitorConf) (bool, error) {
resp, err := http.Get("http://" + mc.Url)
if err != nil {
return false, err
}
if resp.StatusCode != 200 {
return false, nil
}
return true, nil
}
| package main
import (
"net/http"
)
type Checker func(*MonitorConf) (bool, error)
func checkHTTPStatus(mc *MonitorConf) (bool, error) {
resp, err := http.Head("http://" + mc.Url)
if err != nil {
return false, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return false, nil
}
return true, nil
}
| Add resp.body.Close() & use http.Head() in checkHTTPStatus() | Add resp.body.Close() & use http.Head() in checkHTTPStatus()
Fixes #3 | Go | mit | oguzbilgic/pandik,arthurpro/pandik | go | ## Code Before:
package main
import (
"net/http"
)
type Checker func(*MonitorConf) (bool, error)
func checkHTTPStatus(mc *MonitorConf) (bool, error) {
resp, err := http.Get("http://" + mc.Url)
if err != nil {
return false, err
}
if resp.StatusCode != 200 {
return false, nil
}
return true, nil
}
## Instruction:
Add resp.body.Close() & use http.Head() in checkHTTPStatus()
Fixes #3
## Code After:
package main
import (
"net/http"
)
type Checker func(*MonitorConf) (bool, error)
func checkHTTPStatus(mc *MonitorConf) (bool, error) {
resp, err := http.Head("http://" + mc.Url)
if err != nil {
return false, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return false, nil
}
return true, nil
}
| package main
import (
"net/http"
)
type Checker func(*MonitorConf) (bool, error)
func checkHTTPStatus(mc *MonitorConf) (bool, error) {
- resp, err := http.Get("http://" + mc.Url)
? ^ ^
+ resp, err := http.Head("http://" + mc.Url)
? ^ ^^
if err != nil {
return false, err
}
+ defer resp.Body.Close()
if resp.StatusCode != 200 {
return false, nil
}
return true, nil
} | 3 | 0.15 | 2 | 1 |
ca25b89d744b15774b11e20f5c3a82041a50988b | src/js/me-namespace.js | src/js/me-namespace.js | // Namespace
var mejs = mejs || {};
// version number
mejs.version = '2.10.3';
// player number (for missing, same id attr)
mejs.meIndex = 0;
// media types accepted by plugins
mejs.plugins = {
silverlight: [
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
],
flash: [
{version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/rtmp','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg', 'video/youtube', 'video/x-youtube']}
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
],
youtube: [
{version: null, types: ['video/youtube', 'video/x-youtube']}
],
vimeo: [
{version: null, types: ['video/vimeo', 'video/x-vimeo']}
]
}; | // Namespace
var mejs = mejs || {};
// version number
mejs.version = '2.10.3';
// player number (for missing, same id attr)
mejs.meIndex = 0;
// media types accepted by plugins
mejs.plugins = {
silverlight: [
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
],
flash: [
{version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/rtmp','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg', 'video/youtube', 'video/x-youtube']}
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
],
youtube: [
{version: null, types: ['video/youtube', 'video/x-youtube', 'audio/youtube', 'audio/x-youtube']}
],
vimeo: [
{version: null, types: ['video/vimeo', 'video/x-vimeo']}
]
};
| Make possible to open youtube links as audio only | Make possible to open youtube links as audio only
This add to youtube plugin the ability to open youtube links as audio only (without image, only the control panel)
| JavaScript | agpl-3.0 | libeo/Vibeo,libeo/Vibeo,libeo/Vibeo,libeo/Vibeo | javascript | ## Code Before:
// Namespace
var mejs = mejs || {};
// version number
mejs.version = '2.10.3';
// player number (for missing, same id attr)
mejs.meIndex = 0;
// media types accepted by plugins
mejs.plugins = {
silverlight: [
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
],
flash: [
{version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/rtmp','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg', 'video/youtube', 'video/x-youtube']}
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
],
youtube: [
{version: null, types: ['video/youtube', 'video/x-youtube']}
],
vimeo: [
{version: null, types: ['video/vimeo', 'video/x-vimeo']}
]
};
## Instruction:
Make possible to open youtube links as audio only
This add to youtube plugin the ability to open youtube links as audio only (without image, only the control panel)
## Code After:
// Namespace
var mejs = mejs || {};
// version number
mejs.version = '2.10.3';
// player number (for missing, same id attr)
mejs.meIndex = 0;
// media types accepted by plugins
mejs.plugins = {
silverlight: [
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
],
flash: [
{version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/rtmp','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg', 'video/youtube', 'video/x-youtube']}
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
],
youtube: [
{version: null, types: ['video/youtube', 'video/x-youtube', 'audio/youtube', 'audio/x-youtube']}
],
vimeo: [
{version: null, types: ['video/vimeo', 'video/x-vimeo']}
]
};
| // Namespace
var mejs = mejs || {};
// version number
mejs.version = '2.10.3';
// player number (for missing, same id attr)
mejs.meIndex = 0;
// media types accepted by plugins
mejs.plugins = {
silverlight: [
{version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/m4a','audio/mp3','audio/wav','audio/mpeg']}
],
flash: [
{version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','video/rtmp','video/x-flv','audio/flv','audio/x-flv','audio/mp3','audio/m4a','audio/mpeg', 'video/youtube', 'video/x-youtube']}
//,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!)
],
youtube: [
- {version: null, types: ['video/youtube', 'video/x-youtube']}
+ {version: null, types: ['video/youtube', 'video/x-youtube', 'audio/youtube', 'audio/x-youtube']}
? ++++++++++++++++++++++++++++++++++++
],
vimeo: [
{version: null, types: ['video/vimeo', 'video/x-vimeo']}
]
}; | 2 | 0.08 | 1 | 1 |
8ef238325aa8eb360882098eb783a108116b8739 | libraries/helpers.rb | libraries/helpers.rb | module Helpers
# Helpers::Docker module
module Docker
def cli_args(spec)
cli_line = ''
spec.each_pair do |arg, value|
case value
when Array
cli_line += value.map { |a| " -#{arg} " + a }.join
when FalseClass
cli_line += " -#{arg}=false"
when Fixnum, Integer, String
cli_line += " -#{arg} #{value}"
when TrueClass
cli_line += " -#{arg}=true"
#cli_line += " -#{arg}"
end
end
cli_line
end
end
end
| module Helpers
# Helpers::Docker module
module Docker
def cli_args(spec)
cli_line = ''
spec.each_pair do |arg, value|
case value
when Array
cli_line += value.map { |a| " -#{arg} " + a }.join
when FalseClass
cli_line += " -#{arg}=false"
when Fixnum, Integer, String
cli_line += " -#{arg} #{value}"
when TrueClass
cli_line += " -#{arg}=true"
end
end
cli_line
end
end
end
| Remove extraneous comment in cli_args helper | Remove extraneous comment in cli_args helper
| Ruby | apache-2.0 | chef-cookbooks/docker,fxposter/chef-docker,chef-cookbooks/docker,fxposter/chef-docker,fxposter/chef-docker,chef-cookbooks/docker | ruby | ## Code Before:
module Helpers
# Helpers::Docker module
module Docker
def cli_args(spec)
cli_line = ''
spec.each_pair do |arg, value|
case value
when Array
cli_line += value.map { |a| " -#{arg} " + a }.join
when FalseClass
cli_line += " -#{arg}=false"
when Fixnum, Integer, String
cli_line += " -#{arg} #{value}"
when TrueClass
cli_line += " -#{arg}=true"
#cli_line += " -#{arg}"
end
end
cli_line
end
end
end
## Instruction:
Remove extraneous comment in cli_args helper
## Code After:
module Helpers
# Helpers::Docker module
module Docker
def cli_args(spec)
cli_line = ''
spec.each_pair do |arg, value|
case value
when Array
cli_line += value.map { |a| " -#{arg} " + a }.join
when FalseClass
cli_line += " -#{arg}=false"
when Fixnum, Integer, String
cli_line += " -#{arg} #{value}"
when TrueClass
cli_line += " -#{arg}=true"
end
end
cli_line
end
end
end
| module Helpers
# Helpers::Docker module
module Docker
def cli_args(spec)
cli_line = ''
spec.each_pair do |arg, value|
case value
when Array
cli_line += value.map { |a| " -#{arg} " + a }.join
when FalseClass
cli_line += " -#{arg}=false"
when Fixnum, Integer, String
cli_line += " -#{arg} #{value}"
when TrueClass
cli_line += " -#{arg}=true"
- #cli_line += " -#{arg}"
end
end
cli_line
end
end
end | 1 | 0.045455 | 0 | 1 |
d606fe61fedee2a4e788167d06855a00e3fabfc4 | membership/templates/membership/membership_list_plaintext.html | membership/templates/membership/membership_list_plaintext.html | <pre>
{% for member in member_list %}{{member.id}} {{member.name}}{% if forloop.last %}.{% elif forloop.revcounter == 2 %} ja {% else %},{% endif %}
{% endfor %}
</pre> | <pre>
{% for member in member_list %}#{{member.id}} {{member.name}}
{% endfor %}
</pre> | Edit dissociation requested plaintext template | Edit dissociation requested plaintext template
| HTML | mit | kapsiry/sikteeri,kapsiry/sikteeri,annttu/sikteeri,annttu/sikteeri,kapsiry/sikteeri,kapsiry/sikteeri,annttu/sikteeri,annttu/sikteeri | html | ## Code Before:
<pre>
{% for member in member_list %}{{member.id}} {{member.name}}{% if forloop.last %}.{% elif forloop.revcounter == 2 %} ja {% else %},{% endif %}
{% endfor %}
</pre>
## Instruction:
Edit dissociation requested plaintext template
## Code After:
<pre>
{% for member in member_list %}#{{member.id}} {{member.name}}
{% endfor %}
</pre> | <pre>
- {% for member in member_list %}{{member.id}} {{member.name}}{% if forloop.last %}.{% elif forloop.revcounter == 2 %} ja {% else %},{% endif %}
+ {% for member in member_list %}#{{member.id}} {{member.name}}
{% endfor %}
</pre> | 2 | 0.5 | 1 | 1 |
7d4ec88e34dc37cb4d7a87fa81de39983f37a6e2 | src/net/request.js | src/net/request.js | /**
* @file Centrally configured web client.
* @module net/request
*/
'use strict'
// Imports
const requestStandard = require('request-promise-native')
// Configure
const request = requestStandard.defaults()
// Expose
module.exports = request
| /**
* @file Centrally configured web client.
* @module net/request
*/
'use strict'
// Imports
const userAgent = require('./useragent')
const requestStandard = require('request-promise-native')
// Configure
const request = requestStandard.defaults({
headers: {
'User-Agent': userAgent
}
})
// Expose
module.exports = request
| Set user agent for web client | Set user agent for web client
| JavaScript | unlicense | jestcrows/ethtaint,jestcrows/ethtaint | javascript | ## Code Before:
/**
* @file Centrally configured web client.
* @module net/request
*/
'use strict'
// Imports
const requestStandard = require('request-promise-native')
// Configure
const request = requestStandard.defaults()
// Expose
module.exports = request
## Instruction:
Set user agent for web client
## Code After:
/**
* @file Centrally configured web client.
* @module net/request
*/
'use strict'
// Imports
const userAgent = require('./useragent')
const requestStandard = require('request-promise-native')
// Configure
const request = requestStandard.defaults({
headers: {
'User-Agent': userAgent
}
})
// Expose
module.exports = request
| /**
* @file Centrally configured web client.
* @module net/request
*/
'use strict'
// Imports
+ const userAgent = require('./useragent')
const requestStandard = require('request-promise-native')
// Configure
- const request = requestStandard.defaults()
? ^
+ const request = requestStandard.defaults({
? ^
+ headers: {
+ 'User-Agent': userAgent
+ }
+ })
// Expose
module.exports = request | 7 | 0.466667 | 6 | 1 |
26b86cd43228ecf2d0208bdd41a9ebdc46e0dcd4 | .travis.yml | .travis.yml | language: cpp
compiler: gcc
sudo: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
- cmake
- zlib1g-dev
- libsdl1.2-dev
- libssl-dev
- libglew-dev
- libfreetype6-dev
- libtinyxml-dev
- libunittest++-dev
before_install:
- ./projects/install-libzip.sh
- ./projects/install-premake5.sh
- ./projects/install-box2d.sh
- ./projects/install-libantlr3.sh
- ./projects/install-libsquish.sh
- export CXX="g++-5" CC="gcc-5"
script:
- premake-core/bin/release/premake5 --travis gmake
- cd build
- make
- cd ../bin && LD_LIBRARY_PATH=. ./UnitTestd
| dist: bionic
language: cpp
compiler: gcc
sudo: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- cmake
- zlib1g-dev
- libsdl1.2-dev
- libssl-dev
- libglew-dev
- libfreetype6-dev
- libtinyxml-dev
- libunittest++-dev
before_install:
- ./projects/install-libzip.sh
- ./projects/install-premake5.sh
- ./projects/install-box2d.sh
- ./projects/install-libantlr3.sh
- ./projects/install-libsquish.sh
- export CXX="g++-5" CC="gcc-5"
script:
- premake-core/bin/release/premake5 --travis gmake
- cd build
- make
- cd ../bin && LD_LIBRARY_PATH=. ./UnitTestd
| Use newer Travis environment for C++ 17 support | Use newer Travis environment for C++ 17 support | YAML | lgpl-2.1 | crafter2d/crafter2d,crafter2d/crafter2d,crafter2d/crafter2d | yaml | ## Code Before:
language: cpp
compiler: gcc
sudo: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
- cmake
- zlib1g-dev
- libsdl1.2-dev
- libssl-dev
- libglew-dev
- libfreetype6-dev
- libtinyxml-dev
- libunittest++-dev
before_install:
- ./projects/install-libzip.sh
- ./projects/install-premake5.sh
- ./projects/install-box2d.sh
- ./projects/install-libantlr3.sh
- ./projects/install-libsquish.sh
- export CXX="g++-5" CC="gcc-5"
script:
- premake-core/bin/release/premake5 --travis gmake
- cd build
- make
- cd ../bin && LD_LIBRARY_PATH=. ./UnitTestd
## Instruction:
Use newer Travis environment for C++ 17 support
## Code After:
dist: bionic
language: cpp
compiler: gcc
sudo: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- cmake
- zlib1g-dev
- libsdl1.2-dev
- libssl-dev
- libglew-dev
- libfreetype6-dev
- libtinyxml-dev
- libunittest++-dev
before_install:
- ./projects/install-libzip.sh
- ./projects/install-premake5.sh
- ./projects/install-box2d.sh
- ./projects/install-libantlr3.sh
- ./projects/install-libsquish.sh
- export CXX="g++-5" CC="gcc-5"
script:
- premake-core/bin/release/premake5 --travis gmake
- cd build
- make
- cd ../bin && LD_LIBRARY_PATH=. ./UnitTestd
| + dist: bionic
language: cpp
compiler: gcc
sudo: true
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- - gcc-5
? ^
+ - gcc-7
? ^
- - g++-5
- cmake
- zlib1g-dev
- libsdl1.2-dev
- libssl-dev
- libglew-dev
- libfreetype6-dev
- libtinyxml-dev
- libunittest++-dev
before_install:
- ./projects/install-libzip.sh
- ./projects/install-premake5.sh
- ./projects/install-box2d.sh
- ./projects/install-libantlr3.sh
- ./projects/install-libsquish.sh
- export CXX="g++-5" CC="gcc-5"
script:
- premake-core/bin/release/premake5 --travis gmake
- cd build
- make
- cd ../bin && LD_LIBRARY_PATH=. ./UnitTestd
| 4 | 0.117647 | 2 | 2 |
9bd07114af553cada940671582e125840b65999f | README.md | README.md | Twigg collects statistics for a set of Git repositories. It assumes that
all the repositories are in one directory and up-to-date.
# twigg-stats (command-line tool)
A script to show how many commits each person has made in a given
timespan and in what repositories.
Usage:
twigg-stats [--verbose|-v] repos dir> <number of days>
# twigg-app (web app)
The web app shows the same information as `twigg-stats`. To run it,
copy `config.yml.example` to `config.yml` and set `repositories_directory`
to the directory that contains all the repositories you want to analyze.
Usage:
twigg-app
# Why "Twigg"
According to Merriam-Webster:
twig (transitive verb)
1 : notice, observe
2 : to understand the meaning of : comprehend
Originally, the gem was to be called "twig", but there is a pre-existing project
with that name, so we chose "twigg".
# Requirements
Twigg requires Ruby 1.9 or above.
Twigg is often used with, but does not require, Rubygems. If you wish to use
Rubygems with Twigg you may need to:
export RUBYOPT=rubygems
| Twigg collects statistics for a set of Git repositories. It assumes that
all the repositories are in one directory and up-to-date.
# twigg-stats (command-line tool)
A script to show how many commits each person has made in a given
timespan and in what repositories.
Usage:
twigg-stats [--verbose|-v] repos dir> <number of days>
# twigg-app (web app)
The web app shows the same information as `twigg-stats`. To run it,
copy `config.yml.example` to `config.yml` and set `repositories_directory`
to the directory that contains all the repositories you want to analyze.
Usage:
twigg-app
# Why "Twigg"
According to Merriam-Webster:
> twig (transitive verb)<br>
> <br>
> 1. notice, observe<br>
> 2. to understand the meaning of : comprehend
Originally, the gem was to be called "twig", but there is a pre-existing project
with that name, so we chose "twigg".
# Requirements
Twigg requires Ruby 1.9 or above.
Twigg is often used with, but does not require, Rubygems. If you wish to use
Rubygems with Twigg you may need to:
export RUBYOPT=rubygems
| Fix markdown syntax for number list | Fix markdown syntax for number list
While we're at it, mark it up with blockquote syntax.
Change-Id: I24c5a5c40f2c3a6563aca3483d184570fdb29e81
Reviewed-on: https://gerrit.causes.com/24895
Reviewed-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
Tested-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
| Markdown | mit | causes/twigg,causes/twigg | markdown | ## Code Before:
Twigg collects statistics for a set of Git repositories. It assumes that
all the repositories are in one directory and up-to-date.
# twigg-stats (command-line tool)
A script to show how many commits each person has made in a given
timespan and in what repositories.
Usage:
twigg-stats [--verbose|-v] repos dir> <number of days>
# twigg-app (web app)
The web app shows the same information as `twigg-stats`. To run it,
copy `config.yml.example` to `config.yml` and set `repositories_directory`
to the directory that contains all the repositories you want to analyze.
Usage:
twigg-app
# Why "Twigg"
According to Merriam-Webster:
twig (transitive verb)
1 : notice, observe
2 : to understand the meaning of : comprehend
Originally, the gem was to be called "twig", but there is a pre-existing project
with that name, so we chose "twigg".
# Requirements
Twigg requires Ruby 1.9 or above.
Twigg is often used with, but does not require, Rubygems. If you wish to use
Rubygems with Twigg you may need to:
export RUBYOPT=rubygems
## Instruction:
Fix markdown syntax for number list
While we're at it, mark it up with blockquote syntax.
Change-Id: I24c5a5c40f2c3a6563aca3483d184570fdb29e81
Reviewed-on: https://gerrit.causes.com/24895
Reviewed-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
Tested-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
## Code After:
Twigg collects statistics for a set of Git repositories. It assumes that
all the repositories are in one directory and up-to-date.
# twigg-stats (command-line tool)
A script to show how many commits each person has made in a given
timespan and in what repositories.
Usage:
twigg-stats [--verbose|-v] repos dir> <number of days>
# twigg-app (web app)
The web app shows the same information as `twigg-stats`. To run it,
copy `config.yml.example` to `config.yml` and set `repositories_directory`
to the directory that contains all the repositories you want to analyze.
Usage:
twigg-app
# Why "Twigg"
According to Merriam-Webster:
> twig (transitive verb)<br>
> <br>
> 1. notice, observe<br>
> 2. to understand the meaning of : comprehend
Originally, the gem was to be called "twig", but there is a pre-existing project
with that name, so we chose "twigg".
# Requirements
Twigg requires Ruby 1.9 or above.
Twigg is often used with, but does not require, Rubygems. If you wish to use
Rubygems with Twigg you may need to:
export RUBYOPT=rubygems
| Twigg collects statistics for a set of Git repositories. It assumes that
all the repositories are in one directory and up-to-date.
# twigg-stats (command-line tool)
A script to show how many commits each person has made in a given
timespan and in what repositories.
Usage:
twigg-stats [--verbose|-v] repos dir> <number of days>
# twigg-app (web app)
The web app shows the same information as `twigg-stats`. To run it,
copy `config.yml.example` to `config.yml` and set `repositories_directory`
to the directory that contains all the repositories you want to analyze.
Usage:
twigg-app
# Why "Twigg"
According to Merriam-Webster:
- twig (transitive verb)
? ^
+ > twig (transitive verb)<br>
? ^ ++++
+ > <br>
- 1 : notice, observe
? ^ ^^
+ > 1. notice, observe<br>
? ^ ^ ++++
- 2 : to understand the meaning of : comprehend
? ^ ^^
+ > 2. to understand the meaning of : comprehend
? ^ ^
Originally, the gem was to be called "twig", but there is a pre-existing project
with that name, so we chose "twigg".
# Requirements
Twigg requires Ruby 1.9 or above.
Twigg is often used with, but does not require, Rubygems. If you wish to use
Rubygems with Twigg you may need to:
export RUBYOPT=rubygems | 7 | 0.170732 | 4 | 3 |
4767de606654d59c528ffe07d156dbee0413195d | lib/install/prune-tree.js | lib/install/prune-tree.js | 'use strict'
var validate = require('aproba')
var flattenTree = require('./flatten-tree.js')
function isNotPackage (mod) {
return function (parentMod) { return mod !== parentMod }
}
module.exports = function pruneTree (tree) {
validate('O', arguments)
var flat = flattenTree(tree)
// we just do this repeatedly until there are no more orphaned packages
// which isn't as effecient as it could be on a REALLY big tree
// but we'll face that if it proves to be an issue
var removedPackage
do {
removedPackage = false
Object.keys(flat).forEach(function (flatname) {
var child = flat[flatname]
if (!child.parent) return
child.package._requiredBy = (child.package._requiredBy || []).filter(function (req) {
return req[0] === '#' || flat[req]
})
if (!child.package._requiredBy.length) {
removedPackage = true
delete flat[flatname]
child.parent.children = child.parent.children.filter(isNotPackage(child))
}
})
} while (removedPackage)
}
| 'use strict'
var validate = require('aproba')
var flattenTree = require('./flatten-tree.js')
function isNotPackage (mod) {
return function (parentMod) { return mod !== parentMod }
}
module.exports = function pruneTree (tree) {
validate('O', arguments)
var flat = flattenTree(tree)
// we just do this repeatedly until there are no more orphaned packages
// which isn't as effecient as it could be on a REALLY big tree
// but we'll face that if it proves to be an issue
var removedPackage
do {
removedPackage = false
Object.keys(flat).forEach(function (flatname) {
var child = flat[flatname]
if (!child.parent) return
child.package._requiredBy = (child.package._requiredBy || []).filter(function (req) {
var isDev = req.substr(0,4) === '#DEV'
if (req[0] === '#' && !isDev) return true
if (flat[req]) return true
return isDev && flat[req.substr(5)]
})
if (!child.package._requiredBy.length) {
removedPackage = true
delete flat[flatname]
child.parent.children = child.parent.children.filter(isNotPackage(child))
}
})
} while (removedPackage)
}
| Fix bug in tree pruning caused by change in dev module flagging | Fix bug in tree pruning caused by change in dev module flagging
| JavaScript | artistic-2.0 | lxe/npm,haggholm/npm,yibn2008/npm,TimeToogo/npm,cchamberlain/npm,misterbyrne/npm,Volune/npm,kimshinelove/naver-npm,rsp/npm,DaveEmmerson/npm,segrey/npm,haggholm/npm,segrey/npm,xalopp/npm,xalopp/npm,midniteio/npm,princeofdarkness76/npm,cchamberlain/npm,evanlucas/npm,ekmartin/npm,evocateur/npm,chadnickbok/npm,DIREKTSPEED-LTD/npm,yodeyer/npm,thomblake/npm,segrey/npm,misterbyrne/npm,kemitchell/npm,thomblake/npm,midniteio/npm,chadnickbok/npm,yodeyer/npm,princeofdarkness76/npm,ekmartin/npm,evanlucas/npm,lxe/npm,princeofdarkness76/npm,Volune/npm,DIREKTSPEED-LTD/npm,ekmartin/npm,Volune/npm,kimshinelove/naver-npm,midniteio/npm,xalopp/npm,rsp/npm,DaveEmmerson/npm,TimeToogo/npm,yodeyer/npm,cchamberlain/npm,chadnickbok/npm,evanlucas/npm,kimshinelove/naver-npm,cchamberlain/npm-msys2,misterbyrne/npm,DIREKTSPEED-LTD/npm,cchamberlain/npm-msys2,lxe/npm,yibn2008/npm,kemitchell/npm,kemitchell/npm,cchamberlain/npm-msys2,TimeToogo/npm,thomblake/npm,rsp/npm,haggholm/npm,evocateur/npm,yibn2008/npm,evocateur/npm,DaveEmmerson/npm | javascript | ## Code Before:
'use strict'
var validate = require('aproba')
var flattenTree = require('./flatten-tree.js')
function isNotPackage (mod) {
return function (parentMod) { return mod !== parentMod }
}
module.exports = function pruneTree (tree) {
validate('O', arguments)
var flat = flattenTree(tree)
// we just do this repeatedly until there are no more orphaned packages
// which isn't as effecient as it could be on a REALLY big tree
// but we'll face that if it proves to be an issue
var removedPackage
do {
removedPackage = false
Object.keys(flat).forEach(function (flatname) {
var child = flat[flatname]
if (!child.parent) return
child.package._requiredBy = (child.package._requiredBy || []).filter(function (req) {
return req[0] === '#' || flat[req]
})
if (!child.package._requiredBy.length) {
removedPackage = true
delete flat[flatname]
child.parent.children = child.parent.children.filter(isNotPackage(child))
}
})
} while (removedPackage)
}
## Instruction:
Fix bug in tree pruning caused by change in dev module flagging
## Code After:
'use strict'
var validate = require('aproba')
var flattenTree = require('./flatten-tree.js')
function isNotPackage (mod) {
return function (parentMod) { return mod !== parentMod }
}
module.exports = function pruneTree (tree) {
validate('O', arguments)
var flat = flattenTree(tree)
// we just do this repeatedly until there are no more orphaned packages
// which isn't as effecient as it could be on a REALLY big tree
// but we'll face that if it proves to be an issue
var removedPackage
do {
removedPackage = false
Object.keys(flat).forEach(function (flatname) {
var child = flat[flatname]
if (!child.parent) return
child.package._requiredBy = (child.package._requiredBy || []).filter(function (req) {
var isDev = req.substr(0,4) === '#DEV'
if (req[0] === '#' && !isDev) return true
if (flat[req]) return true
return isDev && flat[req.substr(5)]
})
if (!child.package._requiredBy.length) {
removedPackage = true
delete flat[flatname]
child.parent.children = child.parent.children.filter(isNotPackage(child))
}
})
} while (removedPackage)
}
| 'use strict'
var validate = require('aproba')
var flattenTree = require('./flatten-tree.js')
function isNotPackage (mod) {
return function (parentMod) { return mod !== parentMod }
}
module.exports = function pruneTree (tree) {
validate('O', arguments)
var flat = flattenTree(tree)
// we just do this repeatedly until there are no more orphaned packages
// which isn't as effecient as it could be on a REALLY big tree
// but we'll face that if it proves to be an issue
var removedPackage
do {
removedPackage = false
Object.keys(flat).forEach(function (flatname) {
var child = flat[flatname]
if (!child.parent) return
child.package._requiredBy = (child.package._requiredBy || []).filter(function (req) {
- return req[0] === '#' || flat[req]
+ var isDev = req.substr(0,4) === '#DEV'
+ if (req[0] === '#' && !isDev) return true
+ if (flat[req]) return true
+ return isDev && flat[req.substr(5)]
})
if (!child.package._requiredBy.length) {
removedPackage = true
delete flat[flatname]
child.parent.children = child.parent.children.filter(isNotPackage(child))
}
})
} while (removedPackage)
} | 5 | 0.16129 | 4 | 1 |
7653f2c6e4f72e40eefee5d70d83ceafb8bc4282 | lib/extend.py | lib/extend.py | from collections import OrderedDict
import ruamel.yaml
yaml = ruamel.yaml.YAML()
class Operation():
def __init__(self, extension):
self.extension = extension
class Merge(Operation):
def apply(self, base):
ret = base.copy()
for key, value in self.extension.items():
if key in base and isinstance(value, Operation):
ret[key] = value.apply(base[key])
else:
ret[key] = value
return ret
class Prepend(Operation):
def apply(self, base):
return self.extension + base
def merge(*items): return Merge(OrderedDict(items))
def prepend(*items): return Prepend(list(items))
def extend(*items):
extension = OrderedDict(items)
base = extension['_base']
del extension['_base']
syntax = yaml.load( open(base, 'r') )
return Merge(extension).apply(syntax) | from collections import OrderedDict
import ruamel.yaml
yaml = ruamel.yaml.YAML()
class Operation():
def __init__(self, extension):
self.extension = extension
class Merge(Operation):
def apply(self, base):
ret = base.copy()
for key, value in self.extension.items():
if key in base and isinstance(value, Operation):
ret[key] = value.apply(base[key])
else:
ret[key] = value
return ret
class Prepend(Operation):
def apply(self, base):
return self.extension + base
def merge(*items): return Merge(OrderedDict(items))
def prepend(*items): return Prepend(list(items))
def extend(*items):
extension = OrderedDict(items)
base = extension['_base']
del extension['_base']
with open(base, 'r') as base_file:
syntax = yaml.load(base_file)
return Merge(extension).apply(syntax)
| Use context manager to read syntax file | Use context manager to read syntax file
| Python | mit | Thom1729/YAML-Macros | python | ## Code Before:
from collections import OrderedDict
import ruamel.yaml
yaml = ruamel.yaml.YAML()
class Operation():
def __init__(self, extension):
self.extension = extension
class Merge(Operation):
def apply(self, base):
ret = base.copy()
for key, value in self.extension.items():
if key in base and isinstance(value, Operation):
ret[key] = value.apply(base[key])
else:
ret[key] = value
return ret
class Prepend(Operation):
def apply(self, base):
return self.extension + base
def merge(*items): return Merge(OrderedDict(items))
def prepend(*items): return Prepend(list(items))
def extend(*items):
extension = OrderedDict(items)
base = extension['_base']
del extension['_base']
syntax = yaml.load( open(base, 'r') )
return Merge(extension).apply(syntax)
## Instruction:
Use context manager to read syntax file
## Code After:
from collections import OrderedDict
import ruamel.yaml
yaml = ruamel.yaml.YAML()
class Operation():
def __init__(self, extension):
self.extension = extension
class Merge(Operation):
def apply(self, base):
ret = base.copy()
for key, value in self.extension.items():
if key in base and isinstance(value, Operation):
ret[key] = value.apply(base[key])
else:
ret[key] = value
return ret
class Prepend(Operation):
def apply(self, base):
return self.extension + base
def merge(*items): return Merge(OrderedDict(items))
def prepend(*items): return Prepend(list(items))
def extend(*items):
extension = OrderedDict(items)
base = extension['_base']
del extension['_base']
with open(base, 'r') as base_file:
syntax = yaml.load(base_file)
return Merge(extension).apply(syntax)
| from collections import OrderedDict
import ruamel.yaml
yaml = ruamel.yaml.YAML()
class Operation():
def __init__(self, extension):
self.extension = extension
class Merge(Operation):
def apply(self, base):
ret = base.copy()
for key, value in self.extension.items():
if key in base and isinstance(value, Operation):
ret[key] = value.apply(base[key])
else:
ret[key] = value
return ret
class Prepend(Operation):
def apply(self, base):
return self.extension + base
def merge(*items): return Merge(OrderedDict(items))
def prepend(*items): return Prepend(list(items))
def extend(*items):
extension = OrderedDict(items)
base = extension['_base']
del extension['_base']
- syntax = yaml.load( open(base, 'r') )
+ with open(base, 'r') as base_file:
+ syntax = yaml.load(base_file)
return Merge(extension).apply(syntax) | 3 | 0.083333 | 2 | 1 |
1b31337b27ca6c7423964420c0678d45637aba57 | webpack.config.js | webpack.config.js | const commonConfig = require('./webpack.common');
const path = require('path');
const Webpack = require('webpack');
const { version } = require('./package.json');
module.exports = Object.assign(commonConfig, {
entry: './src/main.js',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/assets/',
filename: 'rekapi.js',
library: 'rekapi',
libraryTarget: 'umd',
umdNamedDefine: true
},
externals: {
shifty: 'shifty',
lodash: 'lodash',
},
plugins: [
new Webpack.BannerPlugin(version)
]
});
| const commonConfig = require('./webpack.common');
const path = require('path');
const Webpack = require('webpack');
const { version } = require('./package.json');
module.exports = Object.assign(commonConfig, {
entry: './src/main.js',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/assets/',
filename: 'rekapi.js',
library: 'rekapi',
libraryTarget: 'umd',
umdNamedDefine: true
},
plugins: [
new Webpack.BannerPlugin(version)
]
});
| Revert "Externalize Shifty and Lodash" | Revert "Externalize Shifty and Lodash"
This reverts commit ebc2fd169272b7bfec9ae2fbdf4e1ef4fb52b7cd.
This is fixes the fact that Rekapi will not load properly in web
environments if the dependencies are not bundled into the binary. This
may not be ideal and warrants further investigation for a better
solution.
| JavaScript | mit | jeremyckahn/rekapi,jeremyckahn/rekapi | javascript | ## Code Before:
const commonConfig = require('./webpack.common');
const path = require('path');
const Webpack = require('webpack');
const { version } = require('./package.json');
module.exports = Object.assign(commonConfig, {
entry: './src/main.js',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/assets/',
filename: 'rekapi.js',
library: 'rekapi',
libraryTarget: 'umd',
umdNamedDefine: true
},
externals: {
shifty: 'shifty',
lodash: 'lodash',
},
plugins: [
new Webpack.BannerPlugin(version)
]
});
## Instruction:
Revert "Externalize Shifty and Lodash"
This reverts commit ebc2fd169272b7bfec9ae2fbdf4e1ef4fb52b7cd.
This is fixes the fact that Rekapi will not load properly in web
environments if the dependencies are not bundled into the binary. This
may not be ideal and warrants further investigation for a better
solution.
## Code After:
const commonConfig = require('./webpack.common');
const path = require('path');
const Webpack = require('webpack');
const { version } = require('./package.json');
module.exports = Object.assign(commonConfig, {
entry: './src/main.js',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/assets/',
filename: 'rekapi.js',
library: 'rekapi',
libraryTarget: 'umd',
umdNamedDefine: true
},
plugins: [
new Webpack.BannerPlugin(version)
]
});
| const commonConfig = require('./webpack.common');
const path = require('path');
const Webpack = require('webpack');
const { version } = require('./package.json');
module.exports = Object.assign(commonConfig, {
entry: './src/main.js',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/assets/',
filename: 'rekapi.js',
library: 'rekapi',
libraryTarget: 'umd',
umdNamedDefine: true
},
- externals: {
- shifty: 'shifty',
- lodash: 'lodash',
- },
plugins: [
new Webpack.BannerPlugin(version)
]
}); | 4 | 0.166667 | 0 | 4 |
384ff96b255b03b92aee50d5d036cb78971950b8 | tests/kernel/interrupt/testcase.yaml | tests/kernel/interrupt/testcase.yaml | tests:
arch.interrupt:
# nios2 excluded, see #22956
arch_exclude: nios2
# FIXME: qemu_cortex_a53 is excluded, see #49491
platform_exclude: qemu_cortex_a53 qemu_cortex_a53_smp
tags: kernel interrupt
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
arch.interrupt.linker_generator:
platform_allow: qemu_cortex_m3
tags: kernel interrupt linker_generator
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
extra_configs:
- CONFIG_CMAKE_LINKER_GENERATOR=y
| tests:
arch.interrupt:
# nios2 excluded, see #22956
arch_exclude: nios2
tags: kernel interrupt
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
arch.interrupt.linker_generator:
platform_allow: qemu_cortex_m3
tags: kernel interrupt linker_generator
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
extra_configs:
- CONFIG_CMAKE_LINKER_GENERATOR=y
| Revert "tests: kernel: interrupt: Disable on ARM64 QEMU targets" | Revert "tests: kernel: interrupt: Disable on ARM64 QEMU targets"
This reverts the commit 7d8a1192132a32b519ab319073d5f38aa2633b90
because GCC is now configured to not emit ldp/stp Qn instructions for
consecutive 32-byte loads and stores, and the nested interrupt handling
failure due to the missing emulation of these instructions no longer
occurs.
For more details, refer to the GitHub issue #49491 and #49806.
Signed-off-by: Stephanos Ioannidis <dc76e9f0c0006e8f919e0c515c66dbba3982f785@stephanos.io>
| YAML | apache-2.0 | zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr | yaml | ## Code Before:
tests:
arch.interrupt:
# nios2 excluded, see #22956
arch_exclude: nios2
# FIXME: qemu_cortex_a53 is excluded, see #49491
platform_exclude: qemu_cortex_a53 qemu_cortex_a53_smp
tags: kernel interrupt
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
arch.interrupt.linker_generator:
platform_allow: qemu_cortex_m3
tags: kernel interrupt linker_generator
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
extra_configs:
- CONFIG_CMAKE_LINKER_GENERATOR=y
## Instruction:
Revert "tests: kernel: interrupt: Disable on ARM64 QEMU targets"
This reverts the commit 7d8a1192132a32b519ab319073d5f38aa2633b90
because GCC is now configured to not emit ldp/stp Qn instructions for
consecutive 32-byte loads and stores, and the nested interrupt handling
failure due to the missing emulation of these instructions no longer
occurs.
For more details, refer to the GitHub issue #49491 and #49806.
Signed-off-by: Stephanos Ioannidis <dc76e9f0c0006e8f919e0c515c66dbba3982f785@stephanos.io>
## Code After:
tests:
arch.interrupt:
# nios2 excluded, see #22956
arch_exclude: nios2
tags: kernel interrupt
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
arch.interrupt.linker_generator:
platform_allow: qemu_cortex_m3
tags: kernel interrupt linker_generator
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
extra_configs:
- CONFIG_CMAKE_LINKER_GENERATOR=y
| tests:
arch.interrupt:
# nios2 excluded, see #22956
arch_exclude: nios2
- # FIXME: qemu_cortex_a53 is excluded, see #49491
- platform_exclude: qemu_cortex_a53 qemu_cortex_a53_smp
tags: kernel interrupt
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
arch.interrupt.linker_generator:
platform_allow: qemu_cortex_m3
tags: kernel interrupt linker_generator
filter: not CONFIG_TRUSTED_EXECUTION_NONSECURE
extra_configs:
- CONFIG_CMAKE_LINKER_GENERATOR=y | 2 | 0.133333 | 0 | 2 |
9e71a823741687e0da79cc2b7f8eecad32ce2ea8 | benchmarks/hash_schemas.rb | benchmarks/hash_schemas.rb | $LOAD_PATH.unshift('lib')
require 'bundler/setup'
require 'dry-types'
module SchemaBench
def self.hash_schema(type)
Dry::Types['hash'].public_send(type,
email: Dry::Types['string'],
age: Dry::Types['form.int'],
admin: Dry::Types['form.bool'],
address: Dry::Types['hash'].public_send(type,
city: Dry::Types['string'],
street: Dry::Types['string']
)
)
end
private_class_method(:hash_schema)
SCHEMAS =
Dry::Types::Hash
.public_instance_methods(false)
.map { |schema_type| [schema_type, hash_schema(schema_type)] }
.to_h
INPUT = {
email: 'jane@doe.org',
age: '20',
admin: '1',
address: { city: 'NYC', street: 'Street 1/2' }
}
end
require 'benchmark/ips'
Benchmark.ips do |x|
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#call") do
schema.call(SchemaBench::INPUT)
end
end
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#try") do
schema.try(SchemaBench::INPUT)
end
end
end
| $LOAD_PATH.unshift('lib')
require 'bundler/setup'
require 'dry-types'
module SchemaBench
def self.hash_schema(type)
Dry::Types['hash'].public_send(type,
email: Dry::Types['string'],
age: Dry::Types['form.int'],
admin: Dry::Types['form.bool'],
address: Dry::Types['hash'].public_send(type,
city: Dry::Types['string'],
street: Dry::Types['string']
)
)
end
private_class_method(:hash_schema)
SCHEMAS =
Dry::Types::Hash
.public_instance_methods(false)
.map { |schema_type| [schema_type, hash_schema(schema_type)] }
.to_h
INPUT = {
email: 'jane@doe.org',
age: '20',
admin: '1',
address: { city: 'NYC', street: 'Street 1/2' }
}
end
require 'benchmark/ips'
Benchmark.ips do |x|
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#call") do
schema.call(SchemaBench::INPUT)
end
end
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#try") do
schema.try(SchemaBench::INPUT)
end
end
x.compare!
end
| Add `compare!` to benchmarks | Add `compare!` to benchmarks [ci skip]
| Ruby | mit | dryrb/dry-data,dryrb/dry-types,dryrb/dry-data,dryrb/dry-types | ruby | ## Code Before:
$LOAD_PATH.unshift('lib')
require 'bundler/setup'
require 'dry-types'
module SchemaBench
def self.hash_schema(type)
Dry::Types['hash'].public_send(type,
email: Dry::Types['string'],
age: Dry::Types['form.int'],
admin: Dry::Types['form.bool'],
address: Dry::Types['hash'].public_send(type,
city: Dry::Types['string'],
street: Dry::Types['string']
)
)
end
private_class_method(:hash_schema)
SCHEMAS =
Dry::Types::Hash
.public_instance_methods(false)
.map { |schema_type| [schema_type, hash_schema(schema_type)] }
.to_h
INPUT = {
email: 'jane@doe.org',
age: '20',
admin: '1',
address: { city: 'NYC', street: 'Street 1/2' }
}
end
require 'benchmark/ips'
Benchmark.ips do |x|
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#call") do
schema.call(SchemaBench::INPUT)
end
end
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#try") do
schema.try(SchemaBench::INPUT)
end
end
end
## Instruction:
Add `compare!` to benchmarks [ci skip]
## Code After:
$LOAD_PATH.unshift('lib')
require 'bundler/setup'
require 'dry-types'
module SchemaBench
def self.hash_schema(type)
Dry::Types['hash'].public_send(type,
email: Dry::Types['string'],
age: Dry::Types['form.int'],
admin: Dry::Types['form.bool'],
address: Dry::Types['hash'].public_send(type,
city: Dry::Types['string'],
street: Dry::Types['string']
)
)
end
private_class_method(:hash_schema)
SCHEMAS =
Dry::Types::Hash
.public_instance_methods(false)
.map { |schema_type| [schema_type, hash_schema(schema_type)] }
.to_h
INPUT = {
email: 'jane@doe.org',
age: '20',
admin: '1',
address: { city: 'NYC', street: 'Street 1/2' }
}
end
require 'benchmark/ips'
Benchmark.ips do |x|
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#call") do
schema.call(SchemaBench::INPUT)
end
end
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#try") do
schema.try(SchemaBench::INPUT)
end
end
x.compare!
end
| $LOAD_PATH.unshift('lib')
require 'bundler/setup'
require 'dry-types'
module SchemaBench
def self.hash_schema(type)
Dry::Types['hash'].public_send(type,
email: Dry::Types['string'],
age: Dry::Types['form.int'],
admin: Dry::Types['form.bool'],
address: Dry::Types['hash'].public_send(type,
city: Dry::Types['string'],
street: Dry::Types['string']
)
)
end
private_class_method(:hash_schema)
SCHEMAS =
Dry::Types::Hash
.public_instance_methods(false)
.map { |schema_type| [schema_type, hash_schema(schema_type)] }
.to_h
INPUT = {
email: 'jane@doe.org',
age: '20',
admin: '1',
address: { city: 'NYC', street: 'Street 1/2' }
}
end
require 'benchmark/ips'
Benchmark.ips do |x|
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#call") do
schema.call(SchemaBench::INPUT)
end
end
SchemaBench::SCHEMAS.each do |schema_type, schema|
x.report("#{schema_type}#try") do
schema.try(SchemaBench::INPUT)
end
end
+
+ x.compare!
end | 2 | 0.040816 | 2 | 0 |
aadeb9656be6224a5d2a12b405ff8e394f70e240 | docs/networking.md | docs/networking.md |
The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command.
Any services of type `NodePort` can be accessed over that IP address, on the NodePort.
To determine the NodePort for your service, you can use a `kubectl` command like this:
`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].NodePort}"'`
We also have a shortcut for fetching the minikube IP and a service's `NodePort`:
`minikube service --url $SERVICE`
|
The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command.
Any services of type `NodePort` can be accessed over that IP address, on the NodePort.
To determine the NodePort for your service, you can use a `kubectl` command like this (note that `nodePort` begins with lowercase `n` in JSON output):
`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'`
We also have a shortcut for fetching the minikube IP and a service's `NodePort`:
`minikube service --url $SERVICE`
| Fix jsonpath syntax to use lowercase nodePort | Fix jsonpath syntax to use lowercase nodePort
Documentation fix.
Resolves #2559
| Markdown | apache-2.0 | warmchang/minikube,dlorenc/minikube,kubernetes/minikube,dlorenc/minikube,warmchang/minikube,r2d4/minikube,aaron-prindle/minikube,dalehamel/minikube,warmchang/minikube,kubernetes/minikube,dlorenc/minikube,aaron-prindle/minikube,dlorenc/minikube,dims/minikube,kubernetes/minikube,dlorenc/minikube,aaron-prindle/minikube,dlorenc/minikube,dalehamel/minikube,r2d4/minikube,warmchang/minikube,warmchang/minikube,warmchang/minikube,dalehamel/minikube,dims/minikube,dlorenc/minikube,kubernetes/minikube,warmchang/minikube,kubernetes/minikube,dlorenc/minikube,dims/minikube,kubernetes/minikube,kubernetes/minikube,r2d4/minikube | markdown | ## Code Before:
The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command.
Any services of type `NodePort` can be accessed over that IP address, on the NodePort.
To determine the NodePort for your service, you can use a `kubectl` command like this:
`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].NodePort}"'`
We also have a shortcut for fetching the minikube IP and a service's `NodePort`:
`minikube service --url $SERVICE`
## Instruction:
Fix jsonpath syntax to use lowercase nodePort
Documentation fix.
Resolves #2559
## Code After:
The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command.
Any services of type `NodePort` can be accessed over that IP address, on the NodePort.
To determine the NodePort for your service, you can use a `kubectl` command like this (note that `nodePort` begins with lowercase `n` in JSON output):
`kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'`
We also have a shortcut for fetching the minikube IP and a service's `NodePort`:
`minikube service --url $SERVICE`
|
The minikube VM is exposed to the host system via a host-only IP address, that can be obtained with the `minikube ip` command.
Any services of type `NodePort` can be accessed over that IP address, on the NodePort.
- To determine the NodePort for your service, you can use a `kubectl` command like this:
+ To determine the NodePort for your service, you can use a `kubectl` command like this (note that `nodePort` begins with lowercase `n` in JSON output):
- `kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].NodePort}"'`
? ^
+ `kubectl get service $SERVICE --output='jsonpath="{.spec.ports[0].nodePort}"'`
? ^
We also have a shortcut for fetching the minikube IP and a service's `NodePort`:
`minikube service --url $SERVICE` | 4 | 0.363636 | 2 | 2 |
c9056b55d8399b4736a1c0fb0a1858ac87d985fd | README.md | README.md |
[Docker](http://www.docker.com/) image to run [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/#overview).
## What's Inside
This image is based of Debian Jessie
* Sencha SenchaCmd-5.1.3.61
* Ruby 2.1
* Java OpenJDK 7
* A non-root user named `enduser` and in a `enduser` group
## How to use this image
Basic usage
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd [<options>]
For example, to generate new ExtJS application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd -sdk /path/to/ext-x.x.x.x MyApp .
To build an application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd app build
Or, you can use [Docker Compose](https://docs.docker.com/compose/)'s docker-compose.yml
sencha:
image: herloct/sencha-cmd
working_dir: /app
volumes:
- /local/path:/app
And run it via
docker-compose run sencha [<options>]
|
[Docker](http://www.docker.com/) image to run [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/#overview).
## What's Inside
This image is based of Debian Jessie
* Sencha SenchaCmd-5.1.3.61
* Ruby 2.1
* Java OpenJDK 7
* A non-root user named `enduser` (UID 1000) and in a `enduser` (GID 1000) group
## How to use this image
Basic usage
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd [<options>]
For example, to generate new ExtJS application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd -sdk /path/to/ext-x.x.x.x MyApp .
To build an application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd app build
Or, you can use [Docker Compose](https://docs.docker.com/compose/)'s docker-compose.yml
sencha:
image: herloct/sencha-cmd
working_dir: /app
volumes:
- /local/path:/app
And run it via
docker-compose run sencha [<options>]
| Add UID and GID info. | Add UID and GID info.
| Markdown | mit | herloct/docker-sencha-cmd | markdown | ## Code Before:
[Docker](http://www.docker.com/) image to run [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/#overview).
## What's Inside
This image is based of Debian Jessie
* Sencha SenchaCmd-5.1.3.61
* Ruby 2.1
* Java OpenJDK 7
* A non-root user named `enduser` and in a `enduser` group
## How to use this image
Basic usage
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd [<options>]
For example, to generate new ExtJS application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd -sdk /path/to/ext-x.x.x.x MyApp .
To build an application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd app build
Or, you can use [Docker Compose](https://docs.docker.com/compose/)'s docker-compose.yml
sencha:
image: herloct/sencha-cmd
working_dir: /app
volumes:
- /local/path:/app
And run it via
docker-compose run sencha [<options>]
## Instruction:
Add UID and GID info.
## Code After:
[Docker](http://www.docker.com/) image to run [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/#overview).
## What's Inside
This image is based of Debian Jessie
* Sencha SenchaCmd-5.1.3.61
* Ruby 2.1
* Java OpenJDK 7
* A non-root user named `enduser` (UID 1000) and in a `enduser` (GID 1000) group
## How to use this image
Basic usage
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd [<options>]
For example, to generate new ExtJS application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd -sdk /path/to/ext-x.x.x.x MyApp .
To build an application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd app build
Or, you can use [Docker Compose](https://docs.docker.com/compose/)'s docker-compose.yml
sencha:
image: herloct/sencha-cmd
working_dir: /app
volumes:
- /local/path:/app
And run it via
docker-compose run sencha [<options>]
|
[Docker](http://www.docker.com/) image to run [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/#overview).
## What's Inside
This image is based of Debian Jessie
* Sencha SenchaCmd-5.1.3.61
* Ruby 2.1
* Java OpenJDK 7
- * A non-root user named `enduser` and in a `enduser` group
+ * A non-root user named `enduser` (UID 1000) and in a `enduser` (GID 1000) group
? +++++++++++ +++++++++++
## How to use this image
Basic usage
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd [<options>]
For example, to generate new ExtJS application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd -sdk /path/to/ext-x.x.x.x MyApp .
To build an application
docker run --rm -w /app -v /local/path:/app herloct/sencha-cmd app build
Or, you can use [Docker Compose](https://docs.docker.com/compose/)'s docker-compose.yml
sencha:
image: herloct/sencha-cmd
working_dir: /app
volumes:
- /local/path:/app
And run it via
docker-compose run sencha [<options>] | 2 | 0.054054 | 1 | 1 |
3fa19f711754933d363ea4b2356eff4ba8a974b1 | app/models/question.rb | app/models/question.rb | class Question < ActiveRecord::Base
belongs_to :user
has_many :answers
validates :title, presence: true
validates :body, presence: true
has_many :votes, as: :article
has_many :comments, as: :article
end
| class Question < ActiveRecord::Base
belongs_to :user
has_many :answers
has_many :votes, as: :article
has_many :comments, as: :article
validates :title, presence: true
validates :body, presence: true
end
| Resolve line order merge conflict. | Resolve line order merge conflict.
| Ruby | mit | barreyro/stack-overflow-clone,barreyro/stack-overflow-clone,barreyro/stack-overflow-clone | ruby | ## Code Before:
class Question < ActiveRecord::Base
belongs_to :user
has_many :answers
validates :title, presence: true
validates :body, presence: true
has_many :votes, as: :article
has_many :comments, as: :article
end
## Instruction:
Resolve line order merge conflict.
## Code After:
class Question < ActiveRecord::Base
belongs_to :user
has_many :answers
has_many :votes, as: :article
has_many :comments, as: :article
validates :title, presence: true
validates :body, presence: true
end
| class Question < ActiveRecord::Base
belongs_to :user
has_many :answers
+ has_many :votes, as: :article
+ has_many :comments, as: :article
validates :title, presence: true
validates :body, presence: true
- has_many :votes, as: :article
- has_many :comments, as: :article
end | 4 | 0.5 | 2 | 2 |
45b71ea93db90ccb4b2b42947a73ea7a50bb91dd | grouprise/features/files/views.py | grouprise/features/files/views.py | import grouprise.features
from . import forms
class Create(grouprise.features.content.views.Create):
template_name = 'files/create.html'
form_class = forms.Create
| import grouprise.features.content.views
from . import forms
class Create(grouprise.features.content.views.Create):
template_name = 'files/create.html'
form_class = forms.Create
| Use full import in files view | Use full import in files view
Previously it seemed to work only by accident (the importer imported the
package before).
| Python | agpl-3.0 | stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten | python | ## Code Before:
import grouprise.features
from . import forms
class Create(grouprise.features.content.views.Create):
template_name = 'files/create.html'
form_class = forms.Create
## Instruction:
Use full import in files view
Previously it seemed to work only by accident (the importer imported the
package before).
## Code After:
import grouprise.features.content.views
from . import forms
class Create(grouprise.features.content.views.Create):
template_name = 'files/create.html'
form_class = forms.Create
| - import grouprise.features
+ import grouprise.features.content.views
? ++++++++++++++
from . import forms
class Create(grouprise.features.content.views.Create):
template_name = 'files/create.html'
form_class = forms.Create | 2 | 0.25 | 1 | 1 |
f3cf637ca71c2bf65a56f9a1ab81407e94732786 | hello/hello.asd | hello/hello.asd | ;;;; -*- Mode: Lisp; -*-
(defsystem "hello"
:description "Example Bazel Hello World application"
:class program-system
:entry-point "hello:main"
:depends-on (:alexandria)
:components ((:file "hello")))
(defsystem "hello/chello"
:description "Example Bazel Hello World application, using C"
:class program-system
:entry-point "chello:main"
:defsystem-depends-on (:cffi-toolchain)
:depends-on (:cffi)
:serial t
:components
((:c-file "chello_lib")
(:file "chello")))
| ;;;; -*- Mode: Lisp; -*-
(defsystem "hello"
:description "Example Bazel Hello World application"
:class program-system
:entry-point "hello:main"
:depends-on (:alexandria)
:components ((:file "hello")))
(defsystem "hello/chello"
:description "Example Bazel Hello World application, using C"
:class program-system
:entry-point "chello:main"
:defsystem-depends-on (:cffi-toolchain)
:depends-on (:cffi-toolchain)
:serial t
:components
((:c-file "chello_lib")
(:file "chello")))
| Make cffi-toolchain a runtime dependency, too. | Make cffi-toolchain a runtime dependency, too.
This resolves a load-time dependency on ASDF and
allows chello to be built as a statically linked executable with ECL.
| Common Lisp | mit | qitab/bazelisp,qitab/bazelisp,qitab/bazelisp | common-lisp | ## Code Before:
;;;; -*- Mode: Lisp; -*-
(defsystem "hello"
:description "Example Bazel Hello World application"
:class program-system
:entry-point "hello:main"
:depends-on (:alexandria)
:components ((:file "hello")))
(defsystem "hello/chello"
:description "Example Bazel Hello World application, using C"
:class program-system
:entry-point "chello:main"
:defsystem-depends-on (:cffi-toolchain)
:depends-on (:cffi)
:serial t
:components
((:c-file "chello_lib")
(:file "chello")))
## Instruction:
Make cffi-toolchain a runtime dependency, too.
This resolves a load-time dependency on ASDF and
allows chello to be built as a statically linked executable with ECL.
## Code After:
;;;; -*- Mode: Lisp; -*-
(defsystem "hello"
:description "Example Bazel Hello World application"
:class program-system
:entry-point "hello:main"
:depends-on (:alexandria)
:components ((:file "hello")))
(defsystem "hello/chello"
:description "Example Bazel Hello World application, using C"
:class program-system
:entry-point "chello:main"
:defsystem-depends-on (:cffi-toolchain)
:depends-on (:cffi-toolchain)
:serial t
:components
((:c-file "chello_lib")
(:file "chello")))
| ;;;; -*- Mode: Lisp; -*-
(defsystem "hello"
:description "Example Bazel Hello World application"
:class program-system
:entry-point "hello:main"
:depends-on (:alexandria)
:components ((:file "hello")))
(defsystem "hello/chello"
:description "Example Bazel Hello World application, using C"
:class program-system
:entry-point "chello:main"
:defsystem-depends-on (:cffi-toolchain)
- :depends-on (:cffi)
+ :depends-on (:cffi-toolchain)
? ++++++++++
:serial t
:components
((:c-file "chello_lib")
(:file "chello"))) | 2 | 0.105263 | 1 | 1 |
12e2cdc94c33d7a5988f41e8f8120c40cd6f2ec6 | RetroXUtils/src/retrobox/utils/MountPoint.java | RetroXUtils/src/retrobox/utils/MountPoint.java | package retrobox.utils;
import java.io.File;
import xtvapps.core.Utils;
public class MountPoint {
File dir;
String description;
String filesystem = "unknown";
public MountPoint(String path) {
this.dir = new File(path);
}
public MountPoint(File dir) {
this.dir = dir;
}
public MountPoint() {
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isValid() {
return dir!=null;
}
public long getFreeSpace() {
return dir==null?0:dir.getFreeSpace();
}
public long getTotalSpace() {
return dir==null?0:dir.getTotalSpace();
}
public File getDir() {
return dir;
}
public String getFilesystem() {
return filesystem;
}
public void setFilesystem(String filesystem) {
this.filesystem = filesystem;
}
public String getFriendlyFreeSpace() {
return Utils.size2humanDetailed(getFreeSpace()) + " free of " + Utils.size2humanDetailed(getTotalSpace());
}
@Override
public String toString() {
return String.format("path:%s, desc:%s", dir!=null?dir.getAbsolutePath():"null", description);
}
}
| package retrobox.utils;
import java.io.File;
import xtvapps.core.Utils;
public class MountPoint {
File dir;
String description;
String filesystem = "unknown";
boolean isWritable = false;
public MountPoint(String path) {
this.dir = new File(path);
}
public MountPoint(File dir) {
this.dir = dir;
}
public MountPoint() {
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isValid() {
return dir!=null;
}
public long getFreeSpace() {
return dir==null?0:dir.getFreeSpace();
}
public long getTotalSpace() {
return dir==null?0:dir.getTotalSpace();
}
public File getDir() {
return dir;
}
public String getFilesystem() {
return filesystem;
}
public void setFilesystem(String filesystem) {
this.filesystem = filesystem;
}
public String getFriendlyFreeSpace() {
return Utils.size2humanDetailed(getFreeSpace()) + " free of " + Utils.size2humanDetailed(getTotalSpace());
}
public boolean isWritable() {
return isWritable;
}
public void setWritable(boolean isWritable) {
this.isWritable = isWritable;
}
@Override
public String toString() {
return String.format("path:%s, desc:%s", dir!=null?dir.getAbsolutePath():"null", description);
}
}
| Allow setting a flag for writable / non writable folders | Allow setting a flag for writable / non writable folders | Java | lgpl-2.1 | fcatrin/retroxlibs | java | ## Code Before:
package retrobox.utils;
import java.io.File;
import xtvapps.core.Utils;
public class MountPoint {
File dir;
String description;
String filesystem = "unknown";
public MountPoint(String path) {
this.dir = new File(path);
}
public MountPoint(File dir) {
this.dir = dir;
}
public MountPoint() {
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isValid() {
return dir!=null;
}
public long getFreeSpace() {
return dir==null?0:dir.getFreeSpace();
}
public long getTotalSpace() {
return dir==null?0:dir.getTotalSpace();
}
public File getDir() {
return dir;
}
public String getFilesystem() {
return filesystem;
}
public void setFilesystem(String filesystem) {
this.filesystem = filesystem;
}
public String getFriendlyFreeSpace() {
return Utils.size2humanDetailed(getFreeSpace()) + " free of " + Utils.size2humanDetailed(getTotalSpace());
}
@Override
public String toString() {
return String.format("path:%s, desc:%s", dir!=null?dir.getAbsolutePath():"null", description);
}
}
## Instruction:
Allow setting a flag for writable / non writable folders
## Code After:
package retrobox.utils;
import java.io.File;
import xtvapps.core.Utils;
public class MountPoint {
File dir;
String description;
String filesystem = "unknown";
boolean isWritable = false;
public MountPoint(String path) {
this.dir = new File(path);
}
public MountPoint(File dir) {
this.dir = dir;
}
public MountPoint() {
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isValid() {
return dir!=null;
}
public long getFreeSpace() {
return dir==null?0:dir.getFreeSpace();
}
public long getTotalSpace() {
return dir==null?0:dir.getTotalSpace();
}
public File getDir() {
return dir;
}
public String getFilesystem() {
return filesystem;
}
public void setFilesystem(String filesystem) {
this.filesystem = filesystem;
}
public String getFriendlyFreeSpace() {
return Utils.size2humanDetailed(getFreeSpace()) + " free of " + Utils.size2humanDetailed(getTotalSpace());
}
public boolean isWritable() {
return isWritable;
}
public void setWritable(boolean isWritable) {
this.isWritable = isWritable;
}
@Override
public String toString() {
return String.format("path:%s, desc:%s", dir!=null?dir.getAbsolutePath():"null", description);
}
}
| package retrobox.utils;
import java.io.File;
import xtvapps.core.Utils;
public class MountPoint {
File dir;
String description;
String filesystem = "unknown";
+ boolean isWritable = false;
public MountPoint(String path) {
this.dir = new File(path);
}
public MountPoint(File dir) {
this.dir = dir;
}
public MountPoint() {
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public boolean isValid() {
return dir!=null;
}
public long getFreeSpace() {
return dir==null?0:dir.getFreeSpace();
}
public long getTotalSpace() {
return dir==null?0:dir.getTotalSpace();
}
public File getDir() {
return dir;
}
public String getFilesystem() {
return filesystem;
}
public void setFilesystem(String filesystem) {
this.filesystem = filesystem;
}
public String getFriendlyFreeSpace() {
return Utils.size2humanDetailed(getFreeSpace()) + " free of " + Utils.size2humanDetailed(getTotalSpace());
}
+
+ public boolean isWritable() {
+ return isWritable;
+ }
+
+ public void setWritable(boolean isWritable) {
+ this.isWritable = isWritable;
+ }
+
@Override
public String toString() {
return String.format("path:%s, desc:%s", dir!=null?dir.getAbsolutePath():"null", description);
}
} | 10 | 0.16129 | 10 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.