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
50e84e6af2a4021a0303b6e777e05d77a24de299
.travis.yml
.travis.yml
language: go go: - 1.7 - 1.8 - 1.9 - tip env: - GOARCH=amd64 sudo: required dist: trusty before_install: - sudo apt-get update -qq - sudo apt-get install -qq -y gtk+3.0 libgtk-3-dev - sudo apt-get install -qq -y xvfb - "export DISPLAY=:99.0" - sudo /usr/bin/Xvfb $DISPLAY 2>1 > /dev/null & - "export GTK_VERSION=$(pkg-config --modversion gtk+-3.0 | tr . _| cut -d '_' -f 1-2)" - "export Glib_VERSION=$(pkg-config --modversion glib-2.0)" - "export Cairo_VERSION=$(pkg-config --modversion cairo)" - "export Pango_VERSION=$(pkg-config --modversion pango)" - echo "GTK version ${GTK_VERSION} (Glib ${Glib_VERSION}, Cairo ${Cairo_VERSION}, Pango ${Pango_VERSION})" install: - go get -t -tags "gtk_${GTK_VERSION}" ./... script: - go test -tags "gtk_${GTK_VERSION}" ./...
language: go go: - 1.7 - 1.8 - 1.9 - tip env: - GOARCH=amd64 sudo: required dist: trusty before_install: - sudo apt-get update -qq - sudo apt-get install -qq -y gtk+3.0 libgtk-3-dev - sudo apt-get install -qq -y xvfb - "export DISPLAY=:99.0" - sudo /usr/bin/Xvfb $DISPLAY 2>1 > /dev/null & - "export GTK_VERSION=$(pkg-config --modversion gtk+-3.0 | tr . _| cut -d '_' -f 1-2)" - "export Glib_VERSION=$(pkg-config --modversion glib-2.0)" - "export Cairo_VERSION=$(pkg-config --modversion cairo)" - "export Pango_VERSION=$(pkg-config --modversion pango)" - echo "GTK version ${GTK_VERSION} (Glib ${Glib_VERSION}, Cairo ${Cairo_VERSION}, Pango ${Pango_VERSION})" # hack for building on forks -> move to original repo name: - RepoName=`basename $PWD`; SrcDir=`dirname $PWD`; DestDir="`dirname $SrcDir`/gotk3" - if [[ "$SrcDir" != "$DestDir" ]]; then mv "$SrcDir" "$DestDir"; cd ../../gotk3/$RepoName; export TRAVIS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/$RepoName; fi install: - go get -t -tags "gtk_${GTK_VERSION}" ./... script: - go test -tags "gtk_${GTK_VERSION}" ./...
Add hack to move the repo to original (gotk3) repo name
Add hack to move the repo to original (gotk3) repo name
YAML
isc
gotk3/gotk3,gotk3/gotk3
yaml
## Code Before: language: go go: - 1.7 - 1.8 - 1.9 - tip env: - GOARCH=amd64 sudo: required dist: trusty before_install: - sudo apt-get update -qq - sudo apt-get install -qq -y gtk+3.0 libgtk-3-dev - sudo apt-get install -qq -y xvfb - "export DISPLAY=:99.0" - sudo /usr/bin/Xvfb $DISPLAY 2>1 > /dev/null & - "export GTK_VERSION=$(pkg-config --modversion gtk+-3.0 | tr . _| cut -d '_' -f 1-2)" - "export Glib_VERSION=$(pkg-config --modversion glib-2.0)" - "export Cairo_VERSION=$(pkg-config --modversion cairo)" - "export Pango_VERSION=$(pkg-config --modversion pango)" - echo "GTK version ${GTK_VERSION} (Glib ${Glib_VERSION}, Cairo ${Cairo_VERSION}, Pango ${Pango_VERSION})" install: - go get -t -tags "gtk_${GTK_VERSION}" ./... script: - go test -tags "gtk_${GTK_VERSION}" ./... ## Instruction: Add hack to move the repo to original (gotk3) repo name ## Code After: language: go go: - 1.7 - 1.8 - 1.9 - tip env: - GOARCH=amd64 sudo: required dist: trusty before_install: - sudo apt-get update -qq - sudo apt-get install -qq -y gtk+3.0 libgtk-3-dev - sudo apt-get install -qq -y xvfb - "export DISPLAY=:99.0" - sudo /usr/bin/Xvfb $DISPLAY 2>1 > /dev/null & - "export GTK_VERSION=$(pkg-config --modversion gtk+-3.0 | tr . _| cut -d '_' -f 1-2)" - "export Glib_VERSION=$(pkg-config --modversion glib-2.0)" - "export Cairo_VERSION=$(pkg-config --modversion cairo)" - "export Pango_VERSION=$(pkg-config --modversion pango)" - echo "GTK version ${GTK_VERSION} (Glib ${Glib_VERSION}, Cairo ${Cairo_VERSION}, Pango ${Pango_VERSION})" # hack for building on forks -> move to original repo name: - RepoName=`basename $PWD`; SrcDir=`dirname $PWD`; DestDir="`dirname $SrcDir`/gotk3" - if [[ "$SrcDir" != "$DestDir" ]]; then mv "$SrcDir" "$DestDir"; cd ../../gotk3/$RepoName; export TRAVIS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/$RepoName; fi install: - go get -t -tags "gtk_${GTK_VERSION}" ./... script: - go test -tags "gtk_${GTK_VERSION}" ./...
language: go go: - 1.7 - 1.8 - 1.9 - tip env: - GOARCH=amd64 sudo: required dist: trusty before_install: - sudo apt-get update -qq - sudo apt-get install -qq -y gtk+3.0 libgtk-3-dev - sudo apt-get install -qq -y xvfb - "export DISPLAY=:99.0" - sudo /usr/bin/Xvfb $DISPLAY 2>1 > /dev/null & - "export GTK_VERSION=$(pkg-config --modversion gtk+-3.0 | tr . _| cut -d '_' -f 1-2)" - "export Glib_VERSION=$(pkg-config --modversion glib-2.0)" - "export Cairo_VERSION=$(pkg-config --modversion cairo)" - "export Pango_VERSION=$(pkg-config --modversion pango)" - echo "GTK version ${GTK_VERSION} (Glib ${Glib_VERSION}, Cairo ${Cairo_VERSION}, Pango ${Pango_VERSION})" + # hack for building on forks -> move to original repo name: + - RepoName=`basename $PWD`; SrcDir=`dirname $PWD`; DestDir="`dirname $SrcDir`/gotk3" + - if [[ "$SrcDir" != "$DestDir" ]]; then mv "$SrcDir" "$DestDir"; cd ../../gotk3/$RepoName; export TRAVIS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/$RepoName; fi install: - go get -t -tags "gtk_${GTK_VERSION}" ./... script: - go test -tags "gtk_${GTK_VERSION}" ./...
3
0.096774
3
0
e94f93d44e1019784cd45a0ee8cbc75ceb648bf1
README.md
README.md
An electron-based application which will run `git reset --hard` on a specified directory every X minutes. ## Wha-? I don't even... Why would anyone ever want to do this? Adding this constraint to your development flow may help you think in smaller units and make atomic commits. Instead of thinking about "losing work," consider it a way to experiment with code until you get something really good. What you've learned is more important than specific lines of code, and sometimes you can write better code faster after the reset. Running `git reset --hard` every X minutes is sometimes used during Global Day of Code Retreat exercises. Give it a try with a code kata!
An electron-based application which will run `git reset --hard` on a specified directory every X minutes. ## Wha-? I don't even... Why would anyone ever want to do this? Adding this constraint to your development flow may help you think in smaller units and make atomic commits. Instead of thinking about "losing work," consider it a way to experiment with code until you get something really good. What you've learned is more important than specific lines of code, and sometimes you can write better code faster after the reset. Running `git reset --hard` every X minutes is sometimes used during Global Day of Code Retreat exercises. Give it a try with a code kata! ## License This code is provided under the under the [MIT license](LICENSE)
Add license info to readme
Add license info to readme
Markdown
mit
allan-stewart/git-bomb,allan-stewart/git-bomb
markdown
## Code Before: An electron-based application which will run `git reset --hard` on a specified directory every X minutes. ## Wha-? I don't even... Why would anyone ever want to do this? Adding this constraint to your development flow may help you think in smaller units and make atomic commits. Instead of thinking about "losing work," consider it a way to experiment with code until you get something really good. What you've learned is more important than specific lines of code, and sometimes you can write better code faster after the reset. Running `git reset --hard` every X minutes is sometimes used during Global Day of Code Retreat exercises. Give it a try with a code kata! ## Instruction: Add license info to readme ## Code After: An electron-based application which will run `git reset --hard` on a specified directory every X minutes. ## Wha-? I don't even... Why would anyone ever want to do this? Adding this constraint to your development flow may help you think in smaller units and make atomic commits. Instead of thinking about "losing work," consider it a way to experiment with code until you get something really good. What you've learned is more important than specific lines of code, and sometimes you can write better code faster after the reset. Running `git reset --hard` every X minutes is sometimes used during Global Day of Code Retreat exercises. Give it a try with a code kata! ## License This code is provided under the under the [MIT license](LICENSE)
An electron-based application which will run `git reset --hard` on a specified directory every X minutes. ## Wha-? I don't even... Why would anyone ever want to do this? Adding this constraint to your development flow may help you think in smaller units and make atomic commits. Instead of thinking about "losing work," consider it a way to experiment with code until you get something really good. What you've learned is more important than specific lines of code, and sometimes you can write better code faster after the reset. Running `git reset --hard` every X minutes is sometimes used during Global Day of Code Retreat exercises. Give it a try with a code kata! + + ## License + + This code is provided under the under the [MIT license](LICENSE)
4
0.235294
4
0
ace2ba09ac424a601ff743e5b3c307fff67d9bf2
.travis.yml
.travis.yml
language: php php: - 5.5 - 5.4 - 5.3 script: phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml php vendor/bin/phpcpd --exclude vendor . echo "---------------------------------------------------" echo "----------------GLOBAL LOC-------------------------" echo "---------------------------------------------------" php vendor/bin/phploc . --exclude vendor echo "---------------------------------------------------" echo "----------------LIB LOC----------------------------" echo "---------------------------------------------------" php vendor/bin/phploc lib/. --exclude vendor mkdir -p tests/build/dependences echo "---------------------------------------------------" echo "-------Generating some code metrics----------------" echo "---------------------------------------------------" vendor/bin/pdepend --summary-xml=tests/build/logs/dependence-summary.xml --jdepend-chart=tests/build/dependences/jdepend.svg --overview-pyramid=tests/build/dependences/pyramid.svg lib/. echo "---------------------------------------------------" echo "-------- -------Check code-------------------------" echo "---------------------------------------------------" vendor/bin/phpcs --standard=tests/ZendModStandard lib/Saml2 demo1 demo2 demo-old endpoints tests/src after_script: export TRAVIS=https://travis-ci.org/onelogin/php-saml echo $TRAVIS echo $TRAVIS_JOB_ID php vendor/bin/coveralls --config .coveralls.yml -v
language: php php: - 5.5 - 5.4 - 5.3 script: - phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml - php vendor/bin/phpcpd --exclude vendor . - echo "---------------------------------------------------" - echo "----------------GLOBAL LOC-------------------------" - echo "---------------------------------------------------" - php vendor/bin/phploc . --exclude vendor - echo "---------------------------------------------------" - echo "----------------LIB LOC----------------------------" - echo "---------------------------------------------------" - php vendor/bin/phploc lib/. --exclude vendor - mkdir -p tests/build/dependences - echo "---------------------------------------------------" - echo "-------Generating some code metrics----------------" - echo "---------------------------------------------------" - vendor/bin/pdepend --summary-xml=tests/build/logs/dependence-summary.xml --jdepend-chart=tests/build/dependences/jdepend.svg --overview-pyramid=tests/build/dependences/pyramid.svg lib/. - echo "---------------------------------------------------" - echo "-------- -------Check code-------------------------" - echo "---------------------------------------------------" - vendor/bin/phpcs --standard=tests/ZendModStandard lib/Saml2 demo1 demo2 demo-old endpoints tests/src after_script: - export TRAVIS=https://travis-ci.org/onelogin/php-saml - echo $TRAVIS - echo $TRAVIS_JOB_ID - php vendor/bin/coveralls --config .coveralls.yml -v
Fix Travis CI setting file
Fix Travis CI setting file
YAML
mit
ucfcdl/php-saml,sproogen/php-saml,Ricky-rick/php-saml,stayallive/php-saml,samlev/php-saml,mzbac/php-saml,onelogin/php-saml,dialogik/php-saml,davidjnelson/php-saml
yaml
## Code Before: language: php php: - 5.5 - 5.4 - 5.3 script: phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml php vendor/bin/phpcpd --exclude vendor . echo "---------------------------------------------------" echo "----------------GLOBAL LOC-------------------------" echo "---------------------------------------------------" php vendor/bin/phploc . --exclude vendor echo "---------------------------------------------------" echo "----------------LIB LOC----------------------------" echo "---------------------------------------------------" php vendor/bin/phploc lib/. --exclude vendor mkdir -p tests/build/dependences echo "---------------------------------------------------" echo "-------Generating some code metrics----------------" echo "---------------------------------------------------" vendor/bin/pdepend --summary-xml=tests/build/logs/dependence-summary.xml --jdepend-chart=tests/build/dependences/jdepend.svg --overview-pyramid=tests/build/dependences/pyramid.svg lib/. echo "---------------------------------------------------" echo "-------- -------Check code-------------------------" echo "---------------------------------------------------" vendor/bin/phpcs --standard=tests/ZendModStandard lib/Saml2 demo1 demo2 demo-old endpoints tests/src after_script: export TRAVIS=https://travis-ci.org/onelogin/php-saml echo $TRAVIS echo $TRAVIS_JOB_ID php vendor/bin/coveralls --config .coveralls.yml -v ## Instruction: Fix Travis CI setting file ## Code After: language: php php: - 5.5 - 5.4 - 5.3 script: - phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml - php vendor/bin/phpcpd --exclude vendor . - echo "---------------------------------------------------" - echo "----------------GLOBAL LOC-------------------------" - echo "---------------------------------------------------" - php vendor/bin/phploc . --exclude vendor - echo "---------------------------------------------------" - echo "----------------LIB LOC----------------------------" - echo "---------------------------------------------------" - php vendor/bin/phploc lib/. --exclude vendor - mkdir -p tests/build/dependences - echo "---------------------------------------------------" - echo "-------Generating some code metrics----------------" - echo "---------------------------------------------------" - vendor/bin/pdepend --summary-xml=tests/build/logs/dependence-summary.xml --jdepend-chart=tests/build/dependences/jdepend.svg --overview-pyramid=tests/build/dependences/pyramid.svg lib/. - echo "---------------------------------------------------" - echo "-------- -------Check code-------------------------" - echo "---------------------------------------------------" - vendor/bin/phpcs --standard=tests/ZendModStandard lib/Saml2 demo1 demo2 demo-old endpoints tests/src after_script: - export TRAVIS=https://travis-ci.org/onelogin/php-saml - echo $TRAVIS - echo $TRAVIS_JOB_ID - php vendor/bin/coveralls --config .coveralls.yml -v
language: php php: - 5.5 - 5.4 - 5.3 script: - phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml ? ^ + - phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml ? ^ - php vendor/bin/phpcpd --exclude vendor . ? ^ + - php vendor/bin/phpcpd --exclude vendor . ? ^ - echo "---------------------------------------------------" ? ^ + - echo "---------------------------------------------------" ? ^ - echo "----------------GLOBAL LOC-------------------------" ? ^ + - echo "----------------GLOBAL LOC-------------------------" ? ^ - echo "---------------------------------------------------" ? ^ + - echo "---------------------------------------------------" ? ^ - php vendor/bin/phploc . --exclude vendor ? ^ + - php vendor/bin/phploc . --exclude vendor ? ^ - echo "---------------------------------------------------" ? ^ + - echo "---------------------------------------------------" ? ^ - echo "----------------LIB LOC----------------------------" ? ^ + - echo "----------------LIB LOC----------------------------" ? ^ - echo "---------------------------------------------------" ? ^ + - echo "---------------------------------------------------" ? ^ - php vendor/bin/phploc lib/. --exclude vendor ? ^ + - php vendor/bin/phploc lib/. --exclude vendor ? ^ - mkdir -p tests/build/dependences ? ^ + - mkdir -p tests/build/dependences ? ^ - echo "---------------------------------------------------" ? ^ + - echo "---------------------------------------------------" ? ^ - echo "-------Generating some code metrics----------------" ? ^ + - echo "-------Generating some code metrics----------------" ? ^ - echo "---------------------------------------------------" ? ^ + - echo "---------------------------------------------------" ? ^ - vendor/bin/pdepend --summary-xml=tests/build/logs/dependence-summary.xml --jdepend-chart=tests/build/dependences/jdepend.svg --overview-pyramid=tests/build/dependences/pyramid.svg lib/. ? ^ + - vendor/bin/pdepend --summary-xml=tests/build/logs/dependence-summary.xml --jdepend-chart=tests/build/dependences/jdepend.svg --overview-pyramid=tests/build/dependences/pyramid.svg lib/. ? ^ - echo "---------------------------------------------------" ? ^ + - echo "---------------------------------------------------" ? ^ - echo "-------- -------Check code-------------------------" ? ^ + - echo "-------- -------Check code-------------------------" ? ^ - echo "---------------------------------------------------" ? ^ + - echo "---------------------------------------------------" ? ^ - vendor/bin/phpcs --standard=tests/ZendModStandard lib/Saml2 demo1 demo2 demo-old endpoints tests/src ? ^ ---- + - vendor/bin/phpcs --standard=tests/ZendModStandard lib/Saml2 demo1 demo2 demo-old endpoints tests/src ? ^ - after_script: ? ---- + after_script: - export TRAVIS=https://travis-ci.org/onelogin/php-saml ? ^ + - export TRAVIS=https://travis-ci.org/onelogin/php-saml ? ^ - echo $TRAVIS ? ^ + - echo $TRAVIS ? ^ - echo $TRAVIS_JOB_ID ? ^ + - echo $TRAVIS_JOB_ID ? ^ - php vendor/bin/coveralls --config .coveralls.yml -v ? ^ + - php vendor/bin/coveralls --config .coveralls.yml -v ? ^ - -
50
1.428571
24
26
4406b3f4c8af47cf08d4a1a8b507b43cede18f46
.github/workflows/build_and_test.yml
.github/workflows/build_and_test.yml
on: [push] name: Build and test jobs: build_and_test: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: haskell/actions/setup@v2 with: enable-stack: true stack-version: 'latest' - run: stack build
on: [push] name: Build and test jobs: build_and_test: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: haskell/actions/setup@v2 with: enable-stack: true stack-version: 'latest' - run: stack build - run: stack test - run: ./parse_all_footprints
Add testing to github action workflow
Add testing to github action workflow
YAML
mit
kasbah/haskell-kicad-data,monostable/haskell-kicad-data,monostable/haskell-kicad-data
yaml
## Code Before: on: [push] name: Build and test jobs: build_and_test: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: haskell/actions/setup@v2 with: enable-stack: true stack-version: 'latest' - run: stack build ## Instruction: Add testing to github action workflow ## Code After: on: [push] name: Build and test jobs: build_and_test: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: haskell/actions/setup@v2 with: enable-stack: true stack-version: 'latest' - run: stack build - run: stack test - run: ./parse_all_footprints
on: [push] name: Build and test jobs: build_and_test: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: haskell/actions/setup@v2 with: enable-stack: true stack-version: 'latest' - run: stack build + - run: stack test + - run: ./parse_all_footprints
2
0.166667
2
0
224b00f113cb71272dbdb683ea5abf1b9c855b02
config.yml
config.yml
--- required_approvals: default: 1 -@master: 2 sileht/pastamaker: 1 gnocchixyz/gnocchi-docker: 1 gnocchixyz/tools-tester: 1 gnocchixyz/tools-tester@master: 1 gnocchixyz/grafana-gnocchi-datasource: 1 branch_protection_enforce_admins: default: true sileht/pastamaker: false gnocchixyz/grafana-gnocchi-datasource: false
--- required_approvals: default: 1 -@master: 2 sileht/pastamaker: 1 gnocchixyz/gnocchi-docker: 1 gnocchixyz/collectd-gnocchi: 1 gnocchixyz/tools-tester: 1 gnocchixyz/tools-tester@master: 1 gnocchixyz/grafana-gnocchi-datasource: 1 branch_protection_enforce_admins: default: true sileht/pastamaker: false gnocchixyz/grafana-gnocchi-datasource: false
Use one review for collectd-gnocchi
Use one review for collectd-gnocchi
YAML
apache-2.0
sileht/pastamaker,sileht/pastamaker,sileht/pastamaker
yaml
## Code Before: --- required_approvals: default: 1 -@master: 2 sileht/pastamaker: 1 gnocchixyz/gnocchi-docker: 1 gnocchixyz/tools-tester: 1 gnocchixyz/tools-tester@master: 1 gnocchixyz/grafana-gnocchi-datasource: 1 branch_protection_enforce_admins: default: true sileht/pastamaker: false gnocchixyz/grafana-gnocchi-datasource: false ## Instruction: Use one review for collectd-gnocchi ## Code After: --- required_approvals: default: 1 -@master: 2 sileht/pastamaker: 1 gnocchixyz/gnocchi-docker: 1 gnocchixyz/collectd-gnocchi: 1 gnocchixyz/tools-tester: 1 gnocchixyz/tools-tester@master: 1 gnocchixyz/grafana-gnocchi-datasource: 1 branch_protection_enforce_admins: default: true sileht/pastamaker: false gnocchixyz/grafana-gnocchi-datasource: false
--- required_approvals: default: 1 -@master: 2 sileht/pastamaker: 1 gnocchixyz/gnocchi-docker: 1 + gnocchixyz/collectd-gnocchi: 1 gnocchixyz/tools-tester: 1 gnocchixyz/tools-tester@master: 1 gnocchixyz/grafana-gnocchi-datasource: 1 branch_protection_enforce_admins: default: true sileht/pastamaker: false gnocchixyz/grafana-gnocchi-datasource: false
1
0.071429
1
0
fd9b688d1e416b53fb0a20b322d485f39c744d86
Resources/helpers/LoginHelper.js
Resources/helpers/LoginHelper.js
var LoginHelper = { loggedIn : function() { var cookie = Ti.App.Properties.getString('auth_cookie'); if (!cookie) return false; return true; }, logout : function() { var createConfirmDialog = function() { var confirmDialog = Ti.UI.createAlertDialog({ title : "Logout", cancel : 1, buttonNames : ['Confirm', 'Cancel'], message : "This will clear your surveys.\n Are you sure?" }); return confirmDialog; } var confirmDialog = createConfirmDialog(); confirmDialog.addEventListener('click', function(e) { if (e.index === e.source.cancel) { Ti.API.info('The logout was cancelled'); } else { Ti.App.Properties.setString('auth_cookie', null); var DatabaseHelper = require("helpers/DatabaseHelper"); DatabaseHelper.clearDownloadedData(); Ti.App.fireEvent('settings.refreshSurveys'); } }); confirmDialog.show(); } } module.exports = LoginHelper;
var LoginHelper = { loggedIn : function() { var cookie = Ti.App.Properties.getString('auth_cookie'); var cookieCreatedAt = Ti.App.Properties.getString('auth_cookie_created_at'); if (!cookie) return false; if(new Date() - new Date(cookieCreatedAt) > 3600000) { //Expire the cookie after 1 hour. alert("Your session has expired. You need to login again to fetch or sync any data."); LoginHelper.expireSession(); return false; } return true; }, logout : function(clearDB) { var createConfirmDialog = function() { var confirmDialog = Ti.UI.createAlertDialog({ title : "Logout", cancel : 1, buttonNames : ['Confirm', 'Cancel'], message : "This will clear your surveys.\n Are you sure?" }); return confirmDialog; } var confirmDialog = createConfirmDialog(); confirmDialog.addEventListener('click', function(e) { if (e.index === e.source.cancel) { Ti.API.info('The logout was cancelled'); } else { LoginHelper.expireSession(); var DatabaseHelper = require("helpers/DatabaseHelper"); DatabaseHelper.clearDownloadedData(); Ti.App.fireEvent('settings.refreshSurveys'); } }); confirmDialog.show(); }, expireSession : function() { Ti.App.Properties.setString('auth_cookie', null); Ti.App.Properties.setString('auth_cookie_created_at', null); } } module.exports = LoginHelper;
Expire the session (cookie) in one hour after login.
Expire the session (cookie) in one hour after login.
JavaScript
mit
nilenso/ashoka-survey-mobile,nilenso/ashoka-survey-mobile
javascript
## Code Before: var LoginHelper = { loggedIn : function() { var cookie = Ti.App.Properties.getString('auth_cookie'); if (!cookie) return false; return true; }, logout : function() { var createConfirmDialog = function() { var confirmDialog = Ti.UI.createAlertDialog({ title : "Logout", cancel : 1, buttonNames : ['Confirm', 'Cancel'], message : "This will clear your surveys.\n Are you sure?" }); return confirmDialog; } var confirmDialog = createConfirmDialog(); confirmDialog.addEventListener('click', function(e) { if (e.index === e.source.cancel) { Ti.API.info('The logout was cancelled'); } else { Ti.App.Properties.setString('auth_cookie', null); var DatabaseHelper = require("helpers/DatabaseHelper"); DatabaseHelper.clearDownloadedData(); Ti.App.fireEvent('settings.refreshSurveys'); } }); confirmDialog.show(); } } module.exports = LoginHelper; ## Instruction: Expire the session (cookie) in one hour after login. ## Code After: var LoginHelper = { loggedIn : function() { var cookie = Ti.App.Properties.getString('auth_cookie'); var cookieCreatedAt = Ti.App.Properties.getString('auth_cookie_created_at'); if (!cookie) return false; if(new Date() - new Date(cookieCreatedAt) > 3600000) { //Expire the cookie after 1 hour. alert("Your session has expired. You need to login again to fetch or sync any data."); LoginHelper.expireSession(); return false; } return true; }, logout : function(clearDB) { var createConfirmDialog = function() { var confirmDialog = Ti.UI.createAlertDialog({ title : "Logout", cancel : 1, buttonNames : ['Confirm', 'Cancel'], message : "This will clear your surveys.\n Are you sure?" }); return confirmDialog; } var confirmDialog = createConfirmDialog(); confirmDialog.addEventListener('click', function(e) { if (e.index === e.source.cancel) { Ti.API.info('The logout was cancelled'); } else { LoginHelper.expireSession(); var DatabaseHelper = require("helpers/DatabaseHelper"); DatabaseHelper.clearDownloadedData(); Ti.App.fireEvent('settings.refreshSurveys'); } }); confirmDialog.show(); }, expireSession : function() { Ti.App.Properties.setString('auth_cookie', null); Ti.App.Properties.setString('auth_cookie_created_at', null); } } module.exports = LoginHelper;
var LoginHelper = { loggedIn : function() { var cookie = Ti.App.Properties.getString('auth_cookie'); + var cookieCreatedAt = Ti.App.Properties.getString('auth_cookie_created_at'); + if (!cookie) return false; + + if(new Date() - new Date(cookieCreatedAt) > 3600000) { //Expire the cookie after 1 hour. + alert("Your session has expired. You need to login again to fetch or sync any data."); + LoginHelper.expireSession(); + return false; + } + return true; }, - logout : function() { + logout : function(clearDB) { ? +++++++ var createConfirmDialog = function() { var confirmDialog = Ti.UI.createAlertDialog({ title : "Logout", cancel : 1, buttonNames : ['Confirm', 'Cancel'], message : "This will clear your surveys.\n Are you sure?" }); return confirmDialog; } var confirmDialog = createConfirmDialog(); confirmDialog.addEventListener('click', function(e) { if (e.index === e.source.cancel) { Ti.API.info('The logout was cancelled'); } else { - Ti.App.Properties.setString('auth_cookie', null); + LoginHelper.expireSession(); var DatabaseHelper = require("helpers/DatabaseHelper"); DatabaseHelper.clearDownloadedData(); Ti.App.fireEvent('settings.refreshSurveys'); } }); confirmDialog.show(); + }, + + expireSession : function() { + Ti.App.Properties.setString('auth_cookie', null); + Ti.App.Properties.setString('auth_cookie_created_at', null); } + } module.exports = LoginHelper;
19
0.527778
17
2
6cdd42d1dff9daf22efbb34b5241d8f1f17b1faf
README.md
README.md
A discord bot that tells you the best clothing items to pick in the game Love Nikki. ## Usage Assuming you're in the Love Nikki discord server: ![!yoko](https://i.imgur.com/1yE3rlY.png) ## Requirements and running Python 3.4 and up required, dependencies include * asyncio * discord.py Just clone and execute: ``` git clone https://github.com/janezdu/yokobot.git cd yokobot python3 basicbot.py ``` ## Upcoming * Print a variable number of items in each category * Detailed accessory categories * Scoring fine tuning * A stage guide
A discord bot that tells you the best clothing items to pick in the game Love Nikki. ## Usage Assuming you're in the Love Nikki discord server: ![!yoko](https://i.imgur.com/1yE3rlY.png) ## Requirements and running Python 3.4 and up required, dependencies include * asyncio * discord.py Just clone and execute: ``` git clone https://github.com/janezdu/yokobot.git cd yokobot python3 basicbot.py ``` ## Contribute Check out [issues](https://github.com/janezdu/yokobot/issues) to see what's going on. Also feel free to contact me on discord at @cyphra#6416.
Move info to issues and projects, add contact info
Move info to issues and projects, add contact info
Markdown
mit
janezdu/yokobot
markdown
## Code Before: A discord bot that tells you the best clothing items to pick in the game Love Nikki. ## Usage Assuming you're in the Love Nikki discord server: ![!yoko](https://i.imgur.com/1yE3rlY.png) ## Requirements and running Python 3.4 and up required, dependencies include * asyncio * discord.py Just clone and execute: ``` git clone https://github.com/janezdu/yokobot.git cd yokobot python3 basicbot.py ``` ## Upcoming * Print a variable number of items in each category * Detailed accessory categories * Scoring fine tuning * A stage guide ## Instruction: Move info to issues and projects, add contact info ## Code After: A discord bot that tells you the best clothing items to pick in the game Love Nikki. ## Usage Assuming you're in the Love Nikki discord server: ![!yoko](https://i.imgur.com/1yE3rlY.png) ## Requirements and running Python 3.4 and up required, dependencies include * asyncio * discord.py Just clone and execute: ``` git clone https://github.com/janezdu/yokobot.git cd yokobot python3 basicbot.py ``` ## Contribute Check out [issues](https://github.com/janezdu/yokobot/issues) to see what's going on. Also feel free to contact me on discord at @cyphra#6416.
A discord bot that tells you the best clothing items to pick in the game Love Nikki. ## Usage Assuming you're in the Love Nikki discord server: ![!yoko](https://i.imgur.com/1yE3rlY.png) ## Requirements and running Python 3.4 and up required, dependencies include * asyncio * discord.py Just clone and execute: ``` git clone https://github.com/janezdu/yokobot.git cd yokobot python3 basicbot.py ``` + ## Contribute + Check out [issues](https://github.com/janezdu/yokobot/issues) to see what's going on. Also feel free to contact me on discord at @cyphra#6416. - ## Upcoming - * Print a variable number of items in each category - * Detailed accessory categories - * Scoring fine tuning - * A stage guide
7
0.28
2
5
1107fc26cf9baa235d62813ea0006687d4710280
src/engine/file_loader.py
src/engine/file_loader.py
import os import json from lib import contract data_dir = os.path.join(os.environ['PORTER'], 'data') @contract.accepts(str) @contract.returns(list) def read_and_parse_json(data_type): sub_dir = os.path.join(data_dir, data_type) def full_path(file_name): return os.path.join(sub_dir, file_name) def only_json(file_name): return file_name.endswith('.json') def load_json(json_file_name): with open(json_file_name) as json_file: return json.load(json_file) return map(load_json, filter(only_json, map(full_path, os.listdir(sub_dir))))
import os import json from lib import contract data_dir = os.path.join(os.environ['PORTER'], 'data') @contract.accepts(str) @contract.returns(list) def read_and_parse_json(data_type): sub_dir = os.path.join(data_dir, data_type) def full_path(file_name): return os.path.join(sub_dir, file_name) def only_json(file_name): return file_name.endswith('.json') def load_json(json_file_name): with open(json_file_name) as json_file: return json.load(json_file) return map(load_json, filter(only_json, map(full_path, os.listdir(sub_dir)))) @contract.accepts(str) @contract.returns(dict) def load_enum(struct_name): enum_ = {} list_ = read_and_parse_json(struct_name)[0] for enumeration, enum_type in enumerate(list_): enum_[str(enum_type)] = enumeration return enum_ @contract.accepts(str) @contract.returns(dict) def load_struct(struct_name): def create_struct_map(struct_map, struct_): struct_map[str(struct_['name'])] = struct_ return struct_map return reduce(create_struct_map, read_and_parse_json(struct_name), {})
Add load_enum and load_struct functions
Add load_enum and load_struct functions Load enumeration list json Load full struct into dictionary
Python
mit
Tactique/game_engine,Tactique/game_engine
python
## Code Before: import os import json from lib import contract data_dir = os.path.join(os.environ['PORTER'], 'data') @contract.accepts(str) @contract.returns(list) def read_and_parse_json(data_type): sub_dir = os.path.join(data_dir, data_type) def full_path(file_name): return os.path.join(sub_dir, file_name) def only_json(file_name): return file_name.endswith('.json') def load_json(json_file_name): with open(json_file_name) as json_file: return json.load(json_file) return map(load_json, filter(only_json, map(full_path, os.listdir(sub_dir)))) ## Instruction: Add load_enum and load_struct functions Load enumeration list json Load full struct into dictionary ## Code After: import os import json from lib import contract data_dir = os.path.join(os.environ['PORTER'], 'data') @contract.accepts(str) @contract.returns(list) def read_and_parse_json(data_type): sub_dir = os.path.join(data_dir, data_type) def full_path(file_name): return os.path.join(sub_dir, file_name) def only_json(file_name): return file_name.endswith('.json') def load_json(json_file_name): with open(json_file_name) as json_file: return json.load(json_file) return map(load_json, filter(only_json, map(full_path, os.listdir(sub_dir)))) @contract.accepts(str) @contract.returns(dict) def load_enum(struct_name): enum_ = {} list_ = read_and_parse_json(struct_name)[0] for enumeration, enum_type in enumerate(list_): enum_[str(enum_type)] = enumeration return enum_ @contract.accepts(str) @contract.returns(dict) def load_struct(struct_name): def create_struct_map(struct_map, struct_): struct_map[str(struct_['name'])] = struct_ return struct_map return reduce(create_struct_map, read_and_parse_json(struct_name), {})
import os import json from lib import contract data_dir = os.path.join(os.environ['PORTER'], 'data') @contract.accepts(str) @contract.returns(list) def read_and_parse_json(data_type): sub_dir = os.path.join(data_dir, data_type) def full_path(file_name): return os.path.join(sub_dir, file_name) def only_json(file_name): return file_name.endswith('.json') def load_json(json_file_name): with open(json_file_name) as json_file: return json.load(json_file) return map(load_json, filter(only_json, map(full_path, os.listdir(sub_dir)))) + + + @contract.accepts(str) + @contract.returns(dict) + def load_enum(struct_name): + enum_ = {} + list_ = read_and_parse_json(struct_name)[0] + for enumeration, enum_type in enumerate(list_): + enum_[str(enum_type)] = enumeration + return enum_ + + + @contract.accepts(str) + @contract.returns(dict) + def load_struct(struct_name): + def create_struct_map(struct_map, struct_): + struct_map[str(struct_['name'])] = struct_ + return struct_map + + return reduce(create_struct_map, read_and_parse_json(struct_name), {})
20
0.833333
20
0
ee531491a8affe19a6a0476e62dc141707564006
Firmware/AnalogAccel.cpp
Firmware/AnalogAccel.cpp
volatile Axis currentAxis = X; ISR(ANALOG_COMP_vect) //To be executed once analog compare is completed { //Do stuff... } AnalogAccel::AnalogAccel() { } AnalogAccel::~AnalogAccel() { } volatile Axis& AnalogAccel::currentAxis_ = currentAxis;
volatile Axis currentAxis = X; ISR(ANALOG_COMP_vect) //To be executed once analog compare is completed { //Do stuff... } AnalogAccel::AnalogAccel() { //Prescaler of 64 (12MHz / 64 == 187.5 kHz), //recommended value is 50-200kHz. Also: Enable interrupt, //enable auto-triggering, start conversion and turn the ADC on. ADCSRA |= _BV(ADPS1) | _BV(ADPS2) | _BV(ADIE) | _BV(ADATE) \ | _BV(ADSC) | _BV(ADEN); //Free-running mode: takes measurements as long as the ADC is enabled ADCSRB = 0; //Disable digital input buffers for those pins (saves power) DIDR0 |= _BV(ADC0D) | _BV(ADC1D) | _BV(ADC2D); } AnalogAccel::~AnalogAccel() { ADCSRA &= ~_BV(ADEN); //Disable the ADC (also disables the interrupt) } volatile Axis& AnalogAccel::currentAxis_ = currentAxis;
Set ADC control registers in constructor
Set ADC control registers in constructor
C++
bsd-3-clause
Icosanol/ModelRocketAHRS
c++
## Code Before: volatile Axis currentAxis = X; ISR(ANALOG_COMP_vect) //To be executed once analog compare is completed { //Do stuff... } AnalogAccel::AnalogAccel() { } AnalogAccel::~AnalogAccel() { } volatile Axis& AnalogAccel::currentAxis_ = currentAxis; ## Instruction: Set ADC control registers in constructor ## Code After: volatile Axis currentAxis = X; ISR(ANALOG_COMP_vect) //To be executed once analog compare is completed { //Do stuff... } AnalogAccel::AnalogAccel() { //Prescaler of 64 (12MHz / 64 == 187.5 kHz), //recommended value is 50-200kHz. Also: Enable interrupt, //enable auto-triggering, start conversion and turn the ADC on. ADCSRA |= _BV(ADPS1) | _BV(ADPS2) | _BV(ADIE) | _BV(ADATE) \ | _BV(ADSC) | _BV(ADEN); //Free-running mode: takes measurements as long as the ADC is enabled ADCSRB = 0; //Disable digital input buffers for those pins (saves power) DIDR0 |= _BV(ADC0D) | _BV(ADC1D) | _BV(ADC2D); } AnalogAccel::~AnalogAccel() { ADCSRA &= ~_BV(ADEN); //Disable the ADC (also disables the interrupt) } volatile Axis& AnalogAccel::currentAxis_ = currentAxis;
volatile Axis currentAxis = X; ISR(ANALOG_COMP_vect) //To be executed once analog compare is completed { //Do stuff... } AnalogAccel::AnalogAccel() { + //Prescaler of 64 (12MHz / 64 == 187.5 kHz), + //recommended value is 50-200kHz. Also: Enable interrupt, + //enable auto-triggering, start conversion and turn the ADC on. + ADCSRA |= _BV(ADPS1) | _BV(ADPS2) | _BV(ADIE) | _BV(ADATE) \ + | _BV(ADSC) | _BV(ADEN); + + //Free-running mode: takes measurements as long as the ADC is enabled + ADCSRB = 0; + + //Disable digital input buffers for those pins (saves power) + DIDR0 |= _BV(ADC0D) | _BV(ADC1D) | _BV(ADC2D); } AnalogAccel::~AnalogAccel() { + ADCSRA &= ~_BV(ADEN); //Disable the ADC (also disables the interrupt) } volatile Axis& AnalogAccel::currentAxis_ = currentAxis;
12
0.705882
12
0
6c088f7892e0f7c676e38a4d2758a5fad434a327
test_rails_versions.sh
test_rails_versions.sh
set -e for RAILS_VERSION in "3.2.0" "4.0.0" "4.1.0" "5.0.0" do bundle update bundle exec rspec spec done
set -e for RAILS_VERSION in "3.2.0" "4.0.0" "4.1.0" "4.2.0" "5.0.0" do export RAILS_VERSION echo "Rails $RAILS_VERSION" bundle update bundle exec rspec spec done unset RAILS_VERSION
Fix Rails versions test script
Fix Rails versions test script
Shell
mit
magnusvk/counter_culture,magnusvk/counter_culture
shell
## Code Before: set -e for RAILS_VERSION in "3.2.0" "4.0.0" "4.1.0" "5.0.0" do bundle update bundle exec rspec spec done ## Instruction: Fix Rails versions test script ## Code After: set -e for RAILS_VERSION in "3.2.0" "4.0.0" "4.1.0" "4.2.0" "5.0.0" do export RAILS_VERSION echo "Rails $RAILS_VERSION" bundle update bundle exec rspec spec done unset RAILS_VERSION
set -e - for RAILS_VERSION in "3.2.0" "4.0.0" "4.1.0" "5.0.0" + for RAILS_VERSION in "3.2.0" "4.0.0" "4.1.0" "4.2.0" "5.0.0" ? ++++++++ do + export RAILS_VERSION + echo "Rails $RAILS_VERSION" bundle update bundle exec rspec spec done + + unset RAILS_VERSION
6
0.75
5
1
54aa1bbcc1e4f4dc42edfc511ab492c01d2a89df
lib/metacrunch/job/dsl.rb
lib/metacrunch/job/dsl.rb
module Metacrunch class Job::Dsl require_relative "dsl/helper" require_relative "dsl/bundler_support" require_relative "dsl/option_support" def initialize(job) @_job = job end def source(source) @_job.add_source(source) end def destination(destination) @_job.add_destination(destination) end def pre_process(callable = nil, &block) @_job.add_pre_process(callable, &block) end def post_process(callable = nil, &block) @_job.add_post_process(callable, &block) end def transformation(callable = nil, &block) @_job.add_transformation(callable, &block) end def dependencies(&gemfile) BundlerSupport.new(install: @_job.install_dependencies, &gemfile) exit(0) if @_job.install_dependencies end def options(&block) if block_given? @_options = OptionSupport.new.register_options(@_job.args, &block) else @_options ||= {} end end def helper @_helper ||= Helper.new end end end
module Metacrunch class Job::Dsl require_relative "dsl/helper" require_relative "dsl/bundler_support" require_relative "dsl/option_support" def initialize(job) @_job = job end def source(source) @_job.add_source(source) end def destination(destination) @_job.add_destination(destination) end def pre_process(callable = nil, &block) @_job.add_pre_process(callable, &block) end def post_process(callable = nil, &block) @_job.add_post_process(callable, &block) end def transformation(callable = nil, &block) @_job.add_transformation(callable, &block) end def dependencies(&gemfile) raise ArgumentError, "Block needed" unless block_given? BundlerSupport.new(install: @_job.install_dependencies, &gemfile) exit(0) if @_job.install_dependencies end def options(&block) if block_given? @_options = OptionSupport.new.register_options(@_job.args, &block) else @_options ||= {} end end def helper @_helper ||= Helper.new end end end
Raise ArgumentError if block is missing.
Raise ArgumentError if block is missing.
Ruby
mit
ubpb/metacrunch
ruby
## Code Before: module Metacrunch class Job::Dsl require_relative "dsl/helper" require_relative "dsl/bundler_support" require_relative "dsl/option_support" def initialize(job) @_job = job end def source(source) @_job.add_source(source) end def destination(destination) @_job.add_destination(destination) end def pre_process(callable = nil, &block) @_job.add_pre_process(callable, &block) end def post_process(callable = nil, &block) @_job.add_post_process(callable, &block) end def transformation(callable = nil, &block) @_job.add_transformation(callable, &block) end def dependencies(&gemfile) BundlerSupport.new(install: @_job.install_dependencies, &gemfile) exit(0) if @_job.install_dependencies end def options(&block) if block_given? @_options = OptionSupport.new.register_options(@_job.args, &block) else @_options ||= {} end end def helper @_helper ||= Helper.new end end end ## Instruction: Raise ArgumentError if block is missing. ## Code After: module Metacrunch class Job::Dsl require_relative "dsl/helper" require_relative "dsl/bundler_support" require_relative "dsl/option_support" def initialize(job) @_job = job end def source(source) @_job.add_source(source) end def destination(destination) @_job.add_destination(destination) end def pre_process(callable = nil, &block) @_job.add_pre_process(callable, &block) end def post_process(callable = nil, &block) @_job.add_post_process(callable, &block) end def transformation(callable = nil, &block) @_job.add_transformation(callable, &block) end def dependencies(&gemfile) raise ArgumentError, "Block needed" unless block_given? BundlerSupport.new(install: @_job.install_dependencies, &gemfile) exit(0) if @_job.install_dependencies end def options(&block) if block_given? @_options = OptionSupport.new.register_options(@_job.args, &block) else @_options ||= {} end end def helper @_helper ||= Helper.new end end end
module Metacrunch class Job::Dsl require_relative "dsl/helper" require_relative "dsl/bundler_support" require_relative "dsl/option_support" def initialize(job) @_job = job end def source(source) @_job.add_source(source) end def destination(destination) @_job.add_destination(destination) end def pre_process(callable = nil, &block) @_job.add_pre_process(callable, &block) end def post_process(callable = nil, &block) @_job.add_post_process(callable, &block) end def transformation(callable = nil, &block) @_job.add_transformation(callable, &block) end def dependencies(&gemfile) + raise ArgumentError, "Block needed" unless block_given? BundlerSupport.new(install: @_job.install_dependencies, &gemfile) exit(0) if @_job.install_dependencies end def options(&block) if block_given? @_options = OptionSupport.new.register_options(@_job.args, &block) else @_options ||= {} end end def helper @_helper ||= Helper.new end end end
1
0.020408
1
0
986a7b377a7116974da942f94874ab7784320c62
src/com/redhat/ceylon/compiler/model/Type.java
src/com/redhat/ceylon/compiler/model/Type.java
package com.redhat.ceylon.compiler.model; import java.util.ArrayList; import java.util.List; public class Type extends Model { List<Type> typeArguments = new ArrayList<Type>(); GenericType genericType; public GenericType getGenericType() { return genericType; } public void setGenericType(GenericType type) { this.genericType = type; } public List<Type> getTypeArguments() { return typeArguments; } @Override public String toString() { return "Type[" + getProducedTypeName() + "]"; } public String getProducedTypeName() { String producedTypeName = genericType.getName(); if (!typeArguments.isEmpty()) { producedTypeName+="<"; for (Type t: typeArguments) { producedTypeName+=t.getProducedTypeName(); } producedTypeName+=">"; } return producedTypeName; } }
package com.redhat.ceylon.compiler.model; import com.redhat.ceylon.compiler.tree.Tree; import java.util.ArrayList; import java.util.List; public class Type extends Model { List<Type> typeArguments = new ArrayList<Type>(); GenericType genericType; public GenericType getGenericType() { return genericType; } public void setGenericType(GenericType type) { this.genericType = type; } public List<Type> getTypeArguments() { return typeArguments; } @Override public String toString() { return "Type[" + getProducedTypeName() + "]"; } public String getProducedTypeName() { if (genericType == null) { //unknown type return null; } String producedTypeName = genericType.getName(); if (!typeArguments.isEmpty()) { producedTypeName+="<"; for (Type t: typeArguments) { producedTypeName+=t.getProducedTypeName(); } producedTypeName+=">"; } return producedTypeName; } }
Make sure tree is properly displayed on missing types
Make sure tree is properly displayed on missing types
Java
apache-2.0
jvasileff/ceylon-spec,jvasileff/ceylon-spec,ceylon/ceylon-spec,jvasileff/ceylon-spec,ceylon/ceylon-spec,ceylon/ceylon-spec,lucaswerkmeister/ceylon-spec
java
## Code Before: package com.redhat.ceylon.compiler.model; import java.util.ArrayList; import java.util.List; public class Type extends Model { List<Type> typeArguments = new ArrayList<Type>(); GenericType genericType; public GenericType getGenericType() { return genericType; } public void setGenericType(GenericType type) { this.genericType = type; } public List<Type> getTypeArguments() { return typeArguments; } @Override public String toString() { return "Type[" + getProducedTypeName() + "]"; } public String getProducedTypeName() { String producedTypeName = genericType.getName(); if (!typeArguments.isEmpty()) { producedTypeName+="<"; for (Type t: typeArguments) { producedTypeName+=t.getProducedTypeName(); } producedTypeName+=">"; } return producedTypeName; } } ## Instruction: Make sure tree is properly displayed on missing types ## Code After: package com.redhat.ceylon.compiler.model; import com.redhat.ceylon.compiler.tree.Tree; import java.util.ArrayList; import java.util.List; public class Type extends Model { List<Type> typeArguments = new ArrayList<Type>(); GenericType genericType; public GenericType getGenericType() { return genericType; } public void setGenericType(GenericType type) { this.genericType = type; } public List<Type> getTypeArguments() { return typeArguments; } @Override public String toString() { return "Type[" + getProducedTypeName() + "]"; } public String getProducedTypeName() { if (genericType == null) { //unknown type return null; } String producedTypeName = genericType.getName(); if (!typeArguments.isEmpty()) { producedTypeName+="<"; for (Type t: typeArguments) { producedTypeName+=t.getProducedTypeName(); } producedTypeName+=">"; } return producedTypeName; } }
package com.redhat.ceylon.compiler.model; + + import com.redhat.ceylon.compiler.tree.Tree; import java.util.ArrayList; import java.util.List; public class Type extends Model { List<Type> typeArguments = new ArrayList<Type>(); GenericType genericType; public GenericType getGenericType() { return genericType; } public void setGenericType(GenericType type) { this.genericType = type; } public List<Type> getTypeArguments() { return typeArguments; } @Override public String toString() { return "Type[" + getProducedTypeName() + "]"; } public String getProducedTypeName() { + if (genericType == null) { + //unknown type + return null; + } String producedTypeName = genericType.getName(); if (!typeArguments.isEmpty()) { producedTypeName+="<"; for (Type t: typeArguments) { producedTypeName+=t.getProducedTypeName(); } producedTypeName+=">"; } return producedTypeName; } }
6
0.15
6
0
3fa2afe6ad84c1d0ac79cdb667d7876b66b19f3f
pom.xml
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.basex</groupId> <artifactId>basex-tests</artifactId> <version>6.6.3-SNAPSHOT</version> <repositories> <repository> <id>basex</id> <name>BaseX Maven Repository</name> <url>http://files.basex.org/maven</url> </repository> <repository> <id>central</id> <name>Central Maven Repository</name> <url>http://repo2.maven.org/maven2/</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.basex</groupId> <artifactId>basex</artifactId> <version>6.6.3-SNAPSHOT</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <type>jar</type> <scope>test</scope> </dependency> </dependencies> </project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.basex</groupId> <artifactId>basex-tests</artifactId> <version>6.7</version> <repositories> <repository> <id>basex</id> <name>BaseX Maven Repository</name> <url>http://files.basex.org/maven</url> </repository> <repository> <id>central</id> <name>Central Maven Repository</name> <url>http://repo2.maven.org/maven2/</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.basex</groupId> <artifactId>basex</artifactId> <version>6.7</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <type>jar</type> <scope>test</scope> </dependency> </dependencies> </project>
Switch to Version 6.7-RC1, cleanups
[MOD] Switch to Version 6.7-RC1, cleanups
XML
bsd-3-clause
joansmith/basex,dimitarp/basex,deshmnnit04/basex,vincentml/basex,JensErat/basex,ksclarke/basex,dimitarp/basex,dimitarp/basex,dimitarp/basex,deshmnnit04/basex,vincentml/basex,JensErat/basex,joansmith/basex,deshmnnit04/basex,BaseXdb/basex,dimitarp/basex,drmacro/basex,BaseXdb/basex,deshmnnit04/basex,dimitarp/basex,joansmith/basex,deshmnnit04/basex,BaseXdb/basex,joansmith/basex,BaseXdb/basex,vincentml/basex,deshmnnit04/basex,dimitarp/basex,ksclarke/basex,joansmith/basex,BaseXdb/basex,deshmnnit04/basex,vincentml/basex,BaseXdb/basex,drmacro/basex,dimitarp/basex,ksclarke/basex,BaseXdb/basex,vincentml/basex,drmacro/basex,joansmith/basex,drmacro/basex,drmacro/basex,dimitarp/basex,drmacro/basex,vincentml/basex,drmacro/basex,drmacro/basex,dimitarp/basex,JensErat/basex,joansmith/basex,deshmnnit04/basex,JensErat/basex,JensErat/basex,ksclarke/basex,joansmith/basex,JensErat/basex,JensErat/basex,JensErat/basex,ksclarke/basex,vincentml/basex,ksclarke/basex,ksclarke/basex,BaseXdb/basex,drmacro/basex,BaseXdb/basex,vincentml/basex,JensErat/basex,dimitarp/basex,JensErat/basex,ksclarke/basex,joansmith/basex,deshmnnit04/basex,ksclarke/basex,joansmith/basex,vincentml/basex,JensErat/basex,dimitarp/basex,ksclarke/basex,drmacro/basex,ksclarke/basex,joansmith/basex,joansmith/basex,deshmnnit04/basex,BaseXdb/basex,vincentml/basex,deshmnnit04/basex,drmacro/basex,drmacro/basex,BaseXdb/basex,BaseXdb/basex,vincentml/basex,deshmnnit04/basex,ksclarke/basex,JensErat/basex,vincentml/basex
xml
## Code Before: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.basex</groupId> <artifactId>basex-tests</artifactId> <version>6.6.3-SNAPSHOT</version> <repositories> <repository> <id>basex</id> <name>BaseX Maven Repository</name> <url>http://files.basex.org/maven</url> </repository> <repository> <id>central</id> <name>Central Maven Repository</name> <url>http://repo2.maven.org/maven2/</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.basex</groupId> <artifactId>basex</artifactId> <version>6.6.3-SNAPSHOT</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <type>jar</type> <scope>test</scope> </dependency> </dependencies> </project> ## Instruction: [MOD] Switch to Version 6.7-RC1, cleanups ## Code After: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.basex</groupId> <artifactId>basex-tests</artifactId> <version>6.7</version> <repositories> <repository> <id>basex</id> <name>BaseX Maven Repository</name> <url>http://files.basex.org/maven</url> </repository> <repository> <id>central</id> <name>Central Maven Repository</name> <url>http://repo2.maven.org/maven2/</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.basex</groupId> <artifactId>basex</artifactId> <version>6.7</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <type>jar</type> <scope>test</scope> </dependency> </dependencies> </project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.basex</groupId> <artifactId>basex-tests</artifactId> - <version>6.6.3-SNAPSHOT</version> ? ^^^^^^^^^^^^ + <version>6.7</version> ? ^ <repositories> <repository> <id>basex</id> <name>BaseX Maven Repository</name> <url>http://files.basex.org/maven</url> </repository> <repository> <id>central</id> <name>Central Maven Repository</name> <url>http://repo2.maven.org/maven2/</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.basex</groupId> <artifactId>basex</artifactId> - <version>6.6.3-SNAPSHOT</version> ? ^^^^^^^^^^^^ + <version>6.7</version> ? ^ <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <type>jar</type> <scope>test</scope> </dependency> </dependencies> </project>
4
0.117647
2
2
2b6628591403ebbf9c887de2e0ddc1771f5ccb74
core_dev/cron/cleanup_activations.php
core_dev/cron/cleanup_activations.php
<?php /** * Cleans up old entries in tblActivation */ define('MAX_LIFETIME', 30); //delete entries older than 30 days require_once('/home/ml/dev/pc/config.php'); //FIXME: no hardcoded path $q = 'DELETE FROM tblActivation WHERE timeCreated <= DATE_SUB(NOW(),INTERVAL '.MAX_LIFETIME.' DAY)'; $db->delete($q); ?>
<?php /** * Cleans up old entries in tblActivation */ define('MAX_LIFETIME', 30); //delete entries older than 30 days require_once('find_config.php'); $q = 'DELETE FROM tblActivation WHERE timeCreated <= DATE_SUB(NOW(),INTERVAL '.MAX_LIFETIME.' DAY)'; $db->delete($q); ?>
Fix the other script in the cron dir
Fix the other script in the cron dir
PHP
mit
martinlindhe/core_dev,martinlindhe/core_dev
php
## Code Before: <?php /** * Cleans up old entries in tblActivation */ define('MAX_LIFETIME', 30); //delete entries older than 30 days require_once('/home/ml/dev/pc/config.php'); //FIXME: no hardcoded path $q = 'DELETE FROM tblActivation WHERE timeCreated <= DATE_SUB(NOW(),INTERVAL '.MAX_LIFETIME.' DAY)'; $db->delete($q); ?> ## Instruction: Fix the other script in the cron dir ## Code After: <?php /** * Cleans up old entries in tblActivation */ define('MAX_LIFETIME', 30); //delete entries older than 30 days require_once('find_config.php'); $q = 'DELETE FROM tblActivation WHERE timeCreated <= DATE_SUB(NOW(),INTERVAL '.MAX_LIFETIME.' DAY)'; $db->delete($q); ?>
<?php /** * Cleans up old entries in tblActivation */ define('MAX_LIFETIME', 30); //delete entries older than 30 days - require_once('/home/ml/dev/pc/config.php'); //FIXME: no hardcoded path + require_once('find_config.php'); $q = 'DELETE FROM tblActivation WHERE timeCreated <= DATE_SUB(NOW(),INTERVAL '.MAX_LIFETIME.' DAY)'; $db->delete($q); ?>
2
0.153846
1
1
b117a8a57921df883c7d0f157e97a9c6d091d63e
Packages/settings/setup-theme.el
Packages/settings/setup-theme.el
(use-package spacemacs-theme :defer t :init (setq default-frame-alist (quote ((fullscreen . maximized)))) (load-theme 'spacemacs-dark t) ) (use-package spaceline :defer t :init (setq powerline-default-separator 'arrow-fade) ) (use-package spaceline-config :demand t :ensure spaceline :config (spaceline-define-segment line-column "The current line and column numbers." "l:%l c:%2c") (spaceline-helm-mode 1) (spaceline-spacemacs-theme) ) (provide 'setup-theme)
(use-package spacemacs-theme :defer t :init (setq default-frame-alist (quote ((fullscreen . maximized)))) (load-theme 'spacemacs-dark t) ) (use-package spaceline :defer t :init (setq powerline-default-separator 'slant) (setq ns-use-srgb-colorspace nil) (setq powerline-height 15) ) (use-package spaceline-config :demand t :ensure spaceline :config (spaceline-define-segment line-column "The current line and column numbers." "l:%l c:%2c") (spaceline-helm-mode 1) (spaceline-spacemacs-theme) ) (provide 'setup-theme)
Disable srgb colorspace and set powerline-height to 15
Disable srgb colorspace and set powerline-height to 15
Emacs Lisp
mit
hsienchiaolee/aquamacs
emacs-lisp
## Code Before: (use-package spacemacs-theme :defer t :init (setq default-frame-alist (quote ((fullscreen . maximized)))) (load-theme 'spacemacs-dark t) ) (use-package spaceline :defer t :init (setq powerline-default-separator 'arrow-fade) ) (use-package spaceline-config :demand t :ensure spaceline :config (spaceline-define-segment line-column "The current line and column numbers." "l:%l c:%2c") (spaceline-helm-mode 1) (spaceline-spacemacs-theme) ) (provide 'setup-theme) ## Instruction: Disable srgb colorspace and set powerline-height to 15 ## Code After: (use-package spacemacs-theme :defer t :init (setq default-frame-alist (quote ((fullscreen . maximized)))) (load-theme 'spacemacs-dark t) ) (use-package spaceline :defer t :init (setq powerline-default-separator 'slant) (setq ns-use-srgb-colorspace nil) (setq powerline-height 15) ) (use-package spaceline-config :demand t :ensure spaceline :config (spaceline-define-segment line-column "The current line and column numbers." "l:%l c:%2c") (spaceline-helm-mode 1) (spaceline-spacemacs-theme) ) (provide 'setup-theme)
(use-package spacemacs-theme :defer t :init (setq default-frame-alist (quote ((fullscreen . maximized)))) (load-theme 'spacemacs-dark t) ) (use-package spaceline :defer t :init - (setq powerline-default-separator 'arrow-fade) ? ^^^^^^^^^ + (setq powerline-default-separator 'slant) ? ++ ^^ + (setq ns-use-srgb-colorspace nil) + (setq powerline-height 15) ) (use-package spaceline-config :demand t :ensure spaceline :config (spaceline-define-segment line-column "The current line and column numbers." "l:%l c:%2c") (spaceline-helm-mode 1) (spaceline-spacemacs-theme) ) (provide 'setup-theme)
4
0.16
3
1
b864e5cf1e4c014691198e04b7f1c24b62de481c
project/analyze-data/src/analyze_data/tf_idf/inverse_document_frequency.clj
project/analyze-data/src/analyze_data/tf_idf/inverse_document_frequency.clj
(ns analyze-data.tf-idf.inverse-document-frequency) (defn document-frequency "Return a map from term to number of documents it appears in." [tf-corpus] (let [count-term (fn [m term] (assoc m term (inc (get m term 0)))) term-keys (mapcat keys tf-corpus)] (reduce count-term {} term-keys))) (defn calc-inverse-document-frequency "Calculate inverse document frequency. num-documents: the total number of documents num-documents-with-term: the number of documents containing the term we are calculating for" [num-documents num-documents-with-term] (Math/log (/ num-documents num-documents-with-term))) (defn inverse-document-frequency "Given tf-corpus: a sequence of term-frequency maps where each one represents a single document Return a map from term to its inverse document frequency (as defined at https://en.wikipedia.org/wiki/Tf–idf#Inverse_document_frequency_2)." [tf-corpus] (let [num-documents (count tf-corpus) document-frequencies (document-frequency tf-corpus) assoc-idf (fn [m term num-documents-with-term] (assoc m term (calc-inverse-document-frequency num-documents num-documents-with-term)))] (reduce-kv assoc-idf {} document-frequencies)))
(ns analyze-data.tf-idf.inverse-document-frequency) (defn document-frequency "Return a map from term to number of documents it appears in." [term-frequency-corpus] (let [count-term (fn [m term] (assoc m term (inc (get m term 0)))) term-keys (mapcat keys term-frequency-corpus)] (reduce count-term {} term-keys))) (defn calc-inverse-document-frequency "Calculate inverse document frequency. num-documents: the total number of documents num-documents-with-term: the number of documents containing the term we are calculating for" [num-documents num-documents-with-term] (Math/log (/ num-documents num-documents-with-term))) (defn inverse-document-frequency "Given term-frequency-corpus: a sequence of term-frequency maps where each one represents a single document Return a map from term to its inverse document frequency (as defined at https://en.wikipedia.org/wiki/Tf–idf#Inverse_document_frequency_2)." [term-frequency-corpus] (let [num-documents (count term-frequency-corpus) document-frequencies (document-frequency term-frequency-corpus) assoc-idf (fn [m term num-documents-with-term] (assoc m term (calc-inverse-document-frequency num-documents num-documents-with-term)))] (reduce-kv assoc-idf {} document-frequencies)))
Rename tf-corpus variable to term-frequency-corpus.
Rename tf-corpus variable to term-frequency-corpus.
Clojure
mit
dylanfprice/stanfordml,dylanfprice/stanfordml
clojure
## Code Before: (ns analyze-data.tf-idf.inverse-document-frequency) (defn document-frequency "Return a map from term to number of documents it appears in." [tf-corpus] (let [count-term (fn [m term] (assoc m term (inc (get m term 0)))) term-keys (mapcat keys tf-corpus)] (reduce count-term {} term-keys))) (defn calc-inverse-document-frequency "Calculate inverse document frequency. num-documents: the total number of documents num-documents-with-term: the number of documents containing the term we are calculating for" [num-documents num-documents-with-term] (Math/log (/ num-documents num-documents-with-term))) (defn inverse-document-frequency "Given tf-corpus: a sequence of term-frequency maps where each one represents a single document Return a map from term to its inverse document frequency (as defined at https://en.wikipedia.org/wiki/Tf–idf#Inverse_document_frequency_2)." [tf-corpus] (let [num-documents (count tf-corpus) document-frequencies (document-frequency tf-corpus) assoc-idf (fn [m term num-documents-with-term] (assoc m term (calc-inverse-document-frequency num-documents num-documents-with-term)))] (reduce-kv assoc-idf {} document-frequencies))) ## Instruction: Rename tf-corpus variable to term-frequency-corpus. ## Code After: (ns analyze-data.tf-idf.inverse-document-frequency) (defn document-frequency "Return a map from term to number of documents it appears in." [term-frequency-corpus] (let [count-term (fn [m term] (assoc m term (inc (get m term 0)))) term-keys (mapcat keys term-frequency-corpus)] (reduce count-term {} term-keys))) (defn calc-inverse-document-frequency "Calculate inverse document frequency. num-documents: the total number of documents num-documents-with-term: the number of documents containing the term we are calculating for" [num-documents num-documents-with-term] (Math/log (/ num-documents num-documents-with-term))) (defn inverse-document-frequency "Given term-frequency-corpus: a sequence of term-frequency maps where each one represents a single document Return a map from term to its inverse document frequency (as defined at https://en.wikipedia.org/wiki/Tf–idf#Inverse_document_frequency_2)." [term-frequency-corpus] (let [num-documents (count term-frequency-corpus) document-frequencies (document-frequency term-frequency-corpus) assoc-idf (fn [m term num-documents-with-term] (assoc m term (calc-inverse-document-frequency num-documents num-documents-with-term)))] (reduce-kv assoc-idf {} document-frequencies)))
(ns analyze-data.tf-idf.inverse-document-frequency) (defn document-frequency "Return a map from term to number of documents it appears in." - [tf-corpus] + [term-frequency-corpus] (let [count-term (fn [m term] (assoc m term (inc (get m term 0)))) - term-keys (mapcat keys tf-corpus)] + term-keys (mapcat keys term-frequency-corpus)] ? ++++ ++++++++ (reduce count-term {} term-keys))) (defn calc-inverse-document-frequency "Calculate inverse document frequency. num-documents: the total number of documents num-documents-with-term: the number of documents containing the term we are calculating for" [num-documents num-documents-with-term] (Math/log (/ num-documents num-documents-with-term))) (defn inverse-document-frequency "Given - tf-corpus: a sequence of term-frequency maps where each one represents a ? ------------- + term-frequency-corpus: a sequence of term-frequency maps where each one ? ++++ ++++++++ - single document + represents a single document Return a map from term to its inverse document frequency (as defined at https://en.wikipedia.org/wiki/Tf–idf#Inverse_document_frequency_2)." - [tf-corpus] + [term-frequency-corpus] - (let [num-documents (count tf-corpus) + (let [num-documents (count term-frequency-corpus) ? ++++ ++++++++ - document-frequencies (document-frequency tf-corpus) + document-frequencies (document-frequency term-frequency-corpus) ? ++++ ++++++++ assoc-idf (fn [m term num-documents-with-term] (assoc m term (calc-inverse-document-frequency num-documents num-documents-with-term)))] (reduce-kv assoc-idf {} document-frequencies)))
14
0.4
7
7
4a0bacc23e5f1f424d97a2581b0dde5d21720b46
gwt-example/src/main/java/org/realityforge/arez/gwt/examples/NetworkStatus.java
gwt-example/src/main/java/org/realityforge/arez/gwt/examples/NetworkStatus.java
package org.realityforge.arez.gwt.examples; import elemental2.dom.DomGlobal; import org.realityforge.arez.annotations.Action; import org.realityforge.arez.annotations.Container; import org.realityforge.arez.annotations.Observable; @Container( singleton = true ) public class NetworkStatus { private boolean _onLine; @Observable public boolean isOnLine() { return _onLine; } public void setOnLine( final boolean onLine ) { _onLine = onLine; } @Action public void updateOnlineStatus() { setOnLine( DomGlobal.navigator.onLine ); } }
package org.realityforge.arez.gwt.examples; import elemental2.dom.DomGlobal; import org.realityforge.arez.annotations.Action; import org.realityforge.arez.annotations.Computed; import org.realityforge.arez.annotations.Container; import org.realityforge.arez.annotations.Observable; @Container( singleton = true ) public class NetworkStatus { private boolean _rawOnLine; @Computed public boolean isOnLine() { return isRawOnLine(); } @Observable boolean isRawOnLine() { return _rawOnLine; } void setRawOnLine( final boolean rawOnLine ) { _rawOnLine = rawOnLine; } @Action public void updateOnlineStatus() { setRawOnLine( DomGlobal.navigator.onLine ); } }
Use computed value for OnLine flag
Use computed value for OnLine flag
Java
apache-2.0
realityforge/arez,realityforge/arez,realityforge/arez
java
## Code Before: package org.realityforge.arez.gwt.examples; import elemental2.dom.DomGlobal; import org.realityforge.arez.annotations.Action; import org.realityforge.arez.annotations.Container; import org.realityforge.arez.annotations.Observable; @Container( singleton = true ) public class NetworkStatus { private boolean _onLine; @Observable public boolean isOnLine() { return _onLine; } public void setOnLine( final boolean onLine ) { _onLine = onLine; } @Action public void updateOnlineStatus() { setOnLine( DomGlobal.navigator.onLine ); } } ## Instruction: Use computed value for OnLine flag ## Code After: package org.realityforge.arez.gwt.examples; import elemental2.dom.DomGlobal; import org.realityforge.arez.annotations.Action; import org.realityforge.arez.annotations.Computed; import org.realityforge.arez.annotations.Container; import org.realityforge.arez.annotations.Observable; @Container( singleton = true ) public class NetworkStatus { private boolean _rawOnLine; @Computed public boolean isOnLine() { return isRawOnLine(); } @Observable boolean isRawOnLine() { return _rawOnLine; } void setRawOnLine( final boolean rawOnLine ) { _rawOnLine = rawOnLine; } @Action public void updateOnlineStatus() { setRawOnLine( DomGlobal.navigator.onLine ); } }
package org.realityforge.arez.gwt.examples; import elemental2.dom.DomGlobal; import org.realityforge.arez.annotations.Action; + import org.realityforge.arez.annotations.Computed; import org.realityforge.arez.annotations.Container; import org.realityforge.arez.annotations.Observable; @Container( singleton = true ) public class NetworkStatus { - private boolean _onLine; ? ^ + private boolean _rawOnLine; ? ^^^^ + + @Computed + public boolean isOnLine() + { + return isRawOnLine(); + } @Observable - public boolean isOnLine() ? ------- + boolean isRawOnLine() ? +++ { - return _onLine; ? ^ + return _rawOnLine; ? ^^^^ } - public void setOnLine( final boolean onLine ) ? ------- ^ + void setRawOnLine( final boolean rawOnLine ) ? +++ ^^^^ { - _onLine = onLine; ? ^ ^ + _rawOnLine = rawOnLine; ? ^^^^ ^^^^ } @Action public void updateOnlineStatus() { - setOnLine( DomGlobal.navigator.onLine ); + setRawOnLine( DomGlobal.navigator.onLine ); ? +++ } }
19
0.655172
13
6
76d66b089410f321aba4ba4c2cf00b2905cd51cb
Cargo.toml
Cargo.toml
[package] name = "rotor-http" description = """ The mio-based http server (+with http client and websockets planned) """ license = "MIT" readme = "README.rst" keywords = ["mio", "http", "websocket", "rotor"] homepage = "http://github.com/tailhook/rotor-http" version = "0.2.2" authors = ["paul@colomiets.name"] [dependencies] hyper = "0.6.13" httparse = "^0.1" netbuf = "0.2.0" log = "*" time = "*" mio = "0.4.3" rotor = "0.2" [dev-dependencies] libc = "*" [lib] name = "rotor_http"
[package] name = "rotor-http" description = """ The mio-based http server (+with http client and websockets planned) """ license = "MIT" readme = "README.rst" keywords = ["mio", "http", "websocket", "rotor"] homepage = "http://github.com/tailhook/rotor-http" version = "0.2.2" authors = ["paul@colomiets.name"] [dependencies] hyper = "0.6.13" httparse = "1.0.0" netbuf = "0.2.0" log = "*" time = "*" mio = "0.4.3" rotor = { git = "https://github.com/tailhook/rotor.git" } [dev-dependencies] libc = "*" [lib] name = "rotor_http"
Update httparse and rotor to unbreak this project
Update httparse and rotor to unbreak this project
TOML
mit
tailhook/rotor-http
toml
## Code Before: [package] name = "rotor-http" description = """ The mio-based http server (+with http client and websockets planned) """ license = "MIT" readme = "README.rst" keywords = ["mio", "http", "websocket", "rotor"] homepage = "http://github.com/tailhook/rotor-http" version = "0.2.2" authors = ["paul@colomiets.name"] [dependencies] hyper = "0.6.13" httparse = "^0.1" netbuf = "0.2.0" log = "*" time = "*" mio = "0.4.3" rotor = "0.2" [dev-dependencies] libc = "*" [lib] name = "rotor_http" ## Instruction: Update httparse and rotor to unbreak this project ## Code After: [package] name = "rotor-http" description = """ The mio-based http server (+with http client and websockets planned) """ license = "MIT" readme = "README.rst" keywords = ["mio", "http", "websocket", "rotor"] homepage = "http://github.com/tailhook/rotor-http" version = "0.2.2" authors = ["paul@colomiets.name"] [dependencies] hyper = "0.6.13" httparse = "1.0.0" netbuf = "0.2.0" log = "*" time = "*" mio = "0.4.3" rotor = { git = "https://github.com/tailhook/rotor.git" } [dev-dependencies] libc = "*" [lib] name = "rotor_http"
[package] name = "rotor-http" description = """ The mio-based http server (+with http client and websockets planned) """ license = "MIT" readme = "README.rst" keywords = ["mio", "http", "websocket", "rotor"] homepage = "http://github.com/tailhook/rotor-http" version = "0.2.2" authors = ["paul@colomiets.name"] [dependencies] hyper = "0.6.13" - httparse = "^0.1" ? ^ ^ + httparse = "1.0.0" ? ^^ ^ netbuf = "0.2.0" log = "*" time = "*" mio = "0.4.3" - rotor = "0.2" + rotor = { git = "https://github.com/tailhook/rotor.git" } [dev-dependencies] libc = "*" [lib] name = "rotor_http"
4
0.153846
2
2
688118c4b015dd6772693c36ebaeb5ce8cd1990b
input/text.go
input/text.go
package input import ( "github.com/antonienko/goandroid/device" "strings" ) // TextInput struct represents a text input subsystem for associated device. type TextInput struct { dev device.Device // Associated device } // NewTextInput method returns a new TextInput struct which is associated with // given device. func NewTextInput(dev device.Device) TextInput { return TextInput{dev: dev} } // EnterText method enters text on selected input area. Input area must be // selected previously. Functionality of this method is very limited and // does not support any unicode aharacters or any special characters. func (ti TextInput) EnterText(text string) { formatted := strings.Replace(text, " ", "%s", -1) ti.dev.Shell("input", "text", formatted) }
package input import ( "github.com/antonienko/goandroid/device" "strings" ) // TextInput struct represents a text input subsystem for associated device. type TextInput struct { dev device.Device // Associated device } // NewTextInput method returns a new TextInput struct which is associated with // given device. func NewTextInput(dev device.Device) TextInput { return TextInput{dev: dev} } // EnterText method enters text on selected input area. Input area must be // selected previously. Functionality of this method is very limited and // does not support any unicode aharacters or any special characters. func (ti TextInput) EnterText(text string) error { formatted := strings.Replace(text, " ", "%s", -1) _, err := ti.dev.Shell("input", "text", formatted) return err }
Return error on the EnterText action
Return error on the EnterText action
Go
mit
antonienko/goandroid
go
## Code Before: package input import ( "github.com/antonienko/goandroid/device" "strings" ) // TextInput struct represents a text input subsystem for associated device. type TextInput struct { dev device.Device // Associated device } // NewTextInput method returns a new TextInput struct which is associated with // given device. func NewTextInput(dev device.Device) TextInput { return TextInput{dev: dev} } // EnterText method enters text on selected input area. Input area must be // selected previously. Functionality of this method is very limited and // does not support any unicode aharacters or any special characters. func (ti TextInput) EnterText(text string) { formatted := strings.Replace(text, " ", "%s", -1) ti.dev.Shell("input", "text", formatted) } ## Instruction: Return error on the EnterText action ## Code After: package input import ( "github.com/antonienko/goandroid/device" "strings" ) // TextInput struct represents a text input subsystem for associated device. type TextInput struct { dev device.Device // Associated device } // NewTextInput method returns a new TextInput struct which is associated with // given device. func NewTextInput(dev device.Device) TextInput { return TextInput{dev: dev} } // EnterText method enters text on selected input area. Input area must be // selected previously. Functionality of this method is very limited and // does not support any unicode aharacters or any special characters. func (ti TextInput) EnterText(text string) error { formatted := strings.Replace(text, " ", "%s", -1) _, err := ti.dev.Shell("input", "text", formatted) return err }
package input import ( "github.com/antonienko/goandroid/device" "strings" ) // TextInput struct represents a text input subsystem for associated device. type TextInput struct { dev device.Device // Associated device } // NewTextInput method returns a new TextInput struct which is associated with // given device. func NewTextInput(dev device.Device) TextInput { return TextInput{dev: dev} } // EnterText method enters text on selected input area. Input area must be // selected previously. Functionality of this method is very limited and // does not support any unicode aharacters or any special characters. - func (ti TextInput) EnterText(text string) { + func (ti TextInput) EnterText(text string) error { ? ++++++ formatted := strings.Replace(text, " ", "%s", -1) - ti.dev.Shell("input", "text", formatted) + _, err := ti.dev.Shell("input", "text", formatted) ? ++++++++++ + return err }
5
0.2
3
2
8ad1f0e28456f67cbaa4381063795b1c263550a3
test/Transforms/InstCombine/load-select.ll
test/Transforms/InstCombine/load-select.ll
; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32" @a = constant [2 x i32] [i32 3, i32 6] ; <[2 x i32]*> [#uses=2] define arm_apcscc i32 @b(i32 %y) nounwind readonly { ; CHECK: @b ; CHECK-NOT: load ; CHECK: ret i32 entry: %0 = icmp eq i32 %y, 0 ; <i1> [#uses=1] %storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1] %1 = load i32* %storemerge, align 4 ; <i32> [#uses=1] ret i32 %1 }
; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32" @a = constant [2 x i32] [i32 3, i32 6] ; <[2 x i32]*> [#uses=2] define i32 @b(i32 %y) nounwind readonly { ; CHECK: @b ; CHECK-NOT: load ; CHECK: ret i32 entry: %0 = icmp eq i32 %y, 0 ; <i1> [#uses=1] %storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1] %1 = load i32* %storemerge, align 4 ; <i32> [#uses=1] ret i32 %1 }
Remove ARM-specific calling convention from this test. Target data is needed for this test, but otherwise, there's nothing ARM-specific about it and no need to specify the calling convention.
Remove ARM-specific calling convention from this test. Target data is needed for this test, but otherwise, there's nothing ARM-specific about it and no need to specify the calling convention. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@94862 91177308-0d34-0410-b5e6-96231b3b80d8
LLVM
bsd-2-clause
dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap
llvm
## Code Before: ; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32" @a = constant [2 x i32] [i32 3, i32 6] ; <[2 x i32]*> [#uses=2] define arm_apcscc i32 @b(i32 %y) nounwind readonly { ; CHECK: @b ; CHECK-NOT: load ; CHECK: ret i32 entry: %0 = icmp eq i32 %y, 0 ; <i1> [#uses=1] %storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1] %1 = load i32* %storemerge, align 4 ; <i32> [#uses=1] ret i32 %1 } ## Instruction: Remove ARM-specific calling convention from this test. Target data is needed for this test, but otherwise, there's nothing ARM-specific about it and no need to specify the calling convention. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@94862 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: ; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32" @a = constant [2 x i32] [i32 3, i32 6] ; <[2 x i32]*> [#uses=2] define i32 @b(i32 %y) nounwind readonly { ; CHECK: @b ; CHECK-NOT: load ; CHECK: ret i32 entry: %0 = icmp eq i32 %y, 0 ; <i1> [#uses=1] %storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1] %1 = load i32* %storemerge, align 4 ; <i32> [#uses=1] ret i32 %1 }
; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32" @a = constant [2 x i32] [i32 3, i32 6] ; <[2 x i32]*> [#uses=2] - define arm_apcscc i32 @b(i32 %y) nounwind readonly { ? ----------- + define i32 @b(i32 %y) nounwind readonly { ; CHECK: @b ; CHECK-NOT: load ; CHECK: ret i32 entry: %0 = icmp eq i32 %y, 0 ; <i1> [#uses=1] %storemerge = select i1 %0, i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 1), i32* getelementptr inbounds ([2 x i32]* @a, i32 0, i32 0) ; <i32*> [#uses=1] %1 = load i32* %storemerge, align 4 ; <i32> [#uses=1] ret i32 %1 }
2
0.125
1
1
db4078b3db30ab7634de87b228ec81cd42e5d372
thinc/linear/avgtron.pxd
thinc/linear/avgtron.pxd
from cymem.cymem cimport Pool from preshed.maps cimport PreshMap from .features cimport ConjunctionExtracter from ..typedefs cimport weight_t, feat_t, class_t from ..structs cimport FeatureC from ..structs cimport ExampleC cdef class AveragedPerceptron: cdef readonly Pool mem cdef readonly PreshMap weights cdef readonly PreshMap averages cdef readonly PreshMap lasso_ledger cdef ConjunctionExtracter extracter cdef public int time cdef public weight_t learn_rate cdef public weight_t l1_penalty cdef public weight_t momentum cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil cdef int updateC(self, const ExampleC* eg) except -1 cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1
from cymem.cymem cimport Pool from preshed.maps cimport PreshMap from .features cimport ConjunctionExtracter from ..typedefs cimport weight_t, feat_t, class_t from ..structs cimport FeatureC from ..structs cimport ExampleC cdef class AveragedPerceptron: cdef readonly Pool mem cdef readonly PreshMap weights cdef readonly PreshMap averages cdef readonly PreshMap lasso_ledger cdef ConjunctionExtracter extracter cdef public int time cdef readonly int nr_out cdef public weight_t learn_rate cdef public weight_t l1_penalty cdef public weight_t momentum cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil cdef int updateC(self, const ExampleC* eg) except -1 cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1
Add nr_out attribute to AveragedPerceptron
Add nr_out attribute to AveragedPerceptron
Cython
mit
explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc
cython
## Code Before: from cymem.cymem cimport Pool from preshed.maps cimport PreshMap from .features cimport ConjunctionExtracter from ..typedefs cimport weight_t, feat_t, class_t from ..structs cimport FeatureC from ..structs cimport ExampleC cdef class AveragedPerceptron: cdef readonly Pool mem cdef readonly PreshMap weights cdef readonly PreshMap averages cdef readonly PreshMap lasso_ledger cdef ConjunctionExtracter extracter cdef public int time cdef public weight_t learn_rate cdef public weight_t l1_penalty cdef public weight_t momentum cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil cdef int updateC(self, const ExampleC* eg) except -1 cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1 ## Instruction: Add nr_out attribute to AveragedPerceptron ## Code After: from cymem.cymem cimport Pool from preshed.maps cimport PreshMap from .features cimport ConjunctionExtracter from ..typedefs cimport weight_t, feat_t, class_t from ..structs cimport FeatureC from ..structs cimport ExampleC cdef class AveragedPerceptron: cdef readonly Pool mem cdef readonly PreshMap weights cdef readonly PreshMap averages cdef readonly PreshMap lasso_ledger cdef ConjunctionExtracter extracter cdef public int time cdef readonly int nr_out cdef public weight_t learn_rate cdef public weight_t l1_penalty cdef public weight_t momentum cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil cdef int updateC(self, const ExampleC* eg) except -1 cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1
from cymem.cymem cimport Pool from preshed.maps cimport PreshMap from .features cimport ConjunctionExtracter from ..typedefs cimport weight_t, feat_t, class_t from ..structs cimport FeatureC from ..structs cimport ExampleC cdef class AveragedPerceptron: cdef readonly Pool mem cdef readonly PreshMap weights cdef readonly PreshMap averages cdef readonly PreshMap lasso_ledger cdef ConjunctionExtracter extracter cdef public int time + cdef readonly int nr_out cdef public weight_t learn_rate cdef public weight_t l1_penalty cdef public weight_t momentum cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil cdef int updateC(self, const ExampleC* eg) except -1 cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1
1
0.043478
1
0
c6d82a80783fb76944f291f41177e9851e122a7f
uberfire-showcase/uberfire-webapp/src/main/resources/org/uberfire/UberfireShowcase.gwt.xml
uberfire-showcase/uberfire-webapp/src/main/resources/org/uberfire/UberfireShowcase.gwt.xml
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd"> <module> <inherits name="org.jboss.errai.enterprise.CDI"/> <inherits name="org.uberfire.UberfireJS"/> <inherits name="org.uberfire.security.UberfireSecurityClient"/> <inherits name="org.uberfire.UberfireWorkbench"/> <inherits name="org.uberfire.UberfireWidgetsCore"/> <inherits name="org.uberfire.UberfireBackend"/> <inherits name="org.uberfire.UberfireMarkdownWidget"/> <!-- Specify the application specific style sheet. --> <stylesheet src='css/uberfire-showcase.css'/> <!-- Specify the paths for translatable code --> <source path='client'/> <source path='shared'/> </module>
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd"> <module> <inherits name="org.jboss.errai.enterprise.CDI"/> <inherits name="org.uberfire.UberfireJS"/> <inherits name="org.uberfire.security.UberfireSecurityClient"/> <inherits name="org.uberfire.UberfireWorkbench"/> <inherits name="org.uberfire.UberfireWidgetsCore"/> <inherits name="org.uberfire.UberfireBackend"/> <inherits name="org.uberfire.UberfireMarkdownWidget"/> <!-- Specify the application specific style sheet. --> <stylesheet src='css/uberfire-showcase.css'/> <!-- Specify the paths for translatable code --> <source path='client'/> <source path='shared'/> <!-- i18n --> <extend-property name="locale" values="es_ES"/> <extend-property name="locale" values="fr_FR"/> <extend-property name="locale" values="ja_JP"/> <extend-property name="locale" values="pt_BR"/> <extend-property name="locale" values="zh_CN"/> </module>
Include i18n in full profile; to catch i18n errors early.
Include i18n in full profile; to catch i18n errors early.
XML
apache-2.0
Rikkola/uberfire,paulovmr/uberfire,karreiro/uberfire,karreiro/uberfire,uberfire/uberfire,Rikkola/uberfire,cristianonicolai/uberfire,wmedvede/uberfire,wmedvede/uberfire,wmedvede/uberfire,mbiarnes/uberfire,mbiarnes/uberfire,dgutierr/uberfire,psiroky/uberfire,Salaboy/uberfire,qmx/uberfire,kiereleaseuser/uberfire,dgutierr/uberfire,mbarkley/uberfire,porcelli-forks/uberfire,baldimir/uberfire,cristianonicolai/uberfire,paulovmr/uberfire,kiereleaseuser/uberfire,qmx/uberfire,porcelli-forks/uberfire,qmx/uberfire,uberfire/uberfire,baldimir/uberfire,Rikkola/uberfire,mbarkley/uberfire,dgutierr/uberfire,mbarkley/uberfire,ederign/uberfire,Rikkola/uberfire,karreiro/uberfire,kiereleaseuser/uberfire,uberfire/uberfire,dgutierr/uberfire,psiroky/uberfire,mbiarnes/uberfire,porcelli-forks/uberfire,cristianonicolai/uberfire,mbiarnes/uberfire,paulovmr/uberfire,ederign/uberfire,porcelli-forks/uberfire,Salaboy/uberfire,Salaboy/uberfire,karreiro/uberfire,mbarkley/uberfire,paulovmr/uberfire,baldimir/uberfire,uberfire/uberfire,psiroky/uberfire,ederign/uberfire,Salaboy/uberfire,wmedvede/uberfire,cristianonicolai/uberfire,qmx/uberfire,paulovmr/uberfire,psiroky/uberfire,kiereleaseuser/uberfire,ederign/uberfire,baldimir/uberfire
xml
## Code Before: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd"> <module> <inherits name="org.jboss.errai.enterprise.CDI"/> <inherits name="org.uberfire.UberfireJS"/> <inherits name="org.uberfire.security.UberfireSecurityClient"/> <inherits name="org.uberfire.UberfireWorkbench"/> <inherits name="org.uberfire.UberfireWidgetsCore"/> <inherits name="org.uberfire.UberfireBackend"/> <inherits name="org.uberfire.UberfireMarkdownWidget"/> <!-- Specify the application specific style sheet. --> <stylesheet src='css/uberfire-showcase.css'/> <!-- Specify the paths for translatable code --> <source path='client'/> <source path='shared'/> </module> ## Instruction: Include i18n in full profile; to catch i18n errors early. ## Code After: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd"> <module> <inherits name="org.jboss.errai.enterprise.CDI"/> <inherits name="org.uberfire.UberfireJS"/> <inherits name="org.uberfire.security.UberfireSecurityClient"/> <inherits name="org.uberfire.UberfireWorkbench"/> <inherits name="org.uberfire.UberfireWidgetsCore"/> <inherits name="org.uberfire.UberfireBackend"/> <inherits name="org.uberfire.UberfireMarkdownWidget"/> <!-- Specify the application specific style sheet. --> <stylesheet src='css/uberfire-showcase.css'/> <!-- Specify the paths for translatable code --> <source path='client'/> <source path='shared'/> <!-- i18n --> <extend-property name="locale" values="es_ES"/> <extend-property name="locale" values="fr_FR"/> <extend-property name="locale" values="ja_JP"/> <extend-property name="locale" values="pt_BR"/> <extend-property name="locale" values="zh_CN"/> </module>
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd"> <module> <inherits name="org.jboss.errai.enterprise.CDI"/> <inherits name="org.uberfire.UberfireJS"/> <inherits name="org.uberfire.security.UberfireSecurityClient"/> <inherits name="org.uberfire.UberfireWorkbench"/> <inherits name="org.uberfire.UberfireWidgetsCore"/> <inherits name="org.uberfire.UberfireBackend"/> <inherits name="org.uberfire.UberfireMarkdownWidget"/> <!-- Specify the application specific style sheet. --> <stylesheet src='css/uberfire-showcase.css'/> <!-- Specify the paths for translatable code --> <source path='client'/> <source path='shared'/> + <!-- i18n --> + <extend-property name="locale" values="es_ES"/> + <extend-property name="locale" values="fr_FR"/> + <extend-property name="locale" values="ja_JP"/> + <extend-property name="locale" values="pt_BR"/> + <extend-property name="locale" values="zh_CN"/> + </module>
7
0.291667
7
0
1f3dc9aee3a73582c75ac14ef079f2cf970537e6
service_config.py
service_config.py
import os # The secret key used by Flask to encrypt session keys SECRET_KEY = os.urandom(24) # The URI of the database #SQLALCHEMY_DATABASE_URI = "mysql://pegasus:secret@127.0.0.1:3306/pegasus_service" SQLALCHEMY_DATABASE_URI = 'sqlite:///%s/.pegasus/workflow.db' % os.getenv('HOME')
import os # The secret key used by Flask to encrypt session keys SECRET_KEY = os.urandom(24) # The URI of the database #SQLALCHEMY_DATABASE_URI = "mysql://pegasus:secret@127.0.0.1:3306/pegasus_service" SQLALCHEMY_DATABASE_URI = 'sqlite:///%s/.pegasus/workflow.db' % os.getenv('HOME') # Set to True to log SQL queries #SQLALCHEMY_ECHO = False # Set to change the SQLAlchemy connection pool size #SQLALCHEMY_POOL_SIZE = 5 # Set to change the connection timeout (in seconds) #SQLALCHEMY_POOL_TIMEOUT = 10 # Set to change how long connections remain before being recycled (in seconds) # Default is 2 hours for MySQL #SQLALCHEMY_POOL_RECYCLE = 2 * 60 * 60
Update configuration options for Flask-SQLAlchemy
Update configuration options for Flask-SQLAlchemy
Python
apache-2.0
pegasus-isi/pegasus-service,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus-service,pegasus-isi/pegasus,pegasus-isi/pegasus,pegasus-isi/pegasus-service,pegasus-isi/pegasus
python
## Code Before: import os # The secret key used by Flask to encrypt session keys SECRET_KEY = os.urandom(24) # The URI of the database #SQLALCHEMY_DATABASE_URI = "mysql://pegasus:secret@127.0.0.1:3306/pegasus_service" SQLALCHEMY_DATABASE_URI = 'sqlite:///%s/.pegasus/workflow.db' % os.getenv('HOME') ## Instruction: Update configuration options for Flask-SQLAlchemy ## Code After: import os # The secret key used by Flask to encrypt session keys SECRET_KEY = os.urandom(24) # The URI of the database #SQLALCHEMY_DATABASE_URI = "mysql://pegasus:secret@127.0.0.1:3306/pegasus_service" SQLALCHEMY_DATABASE_URI = 'sqlite:///%s/.pegasus/workflow.db' % os.getenv('HOME') # Set to True to log SQL queries #SQLALCHEMY_ECHO = False # Set to change the SQLAlchemy connection pool size #SQLALCHEMY_POOL_SIZE = 5 # Set to change the connection timeout (in seconds) #SQLALCHEMY_POOL_TIMEOUT = 10 # Set to change how long connections remain before being recycled (in seconds) # Default is 2 hours for MySQL #SQLALCHEMY_POOL_RECYCLE = 2 * 60 * 60
import os # The secret key used by Flask to encrypt session keys SECRET_KEY = os.urandom(24) # The URI of the database #SQLALCHEMY_DATABASE_URI = "mysql://pegasus:secret@127.0.0.1:3306/pegasus_service" SQLALCHEMY_DATABASE_URI = 'sqlite:///%s/.pegasus/workflow.db' % os.getenv('HOME') + # Set to True to log SQL queries + #SQLALCHEMY_ECHO = False + # Set to change the SQLAlchemy connection pool size + #SQLALCHEMY_POOL_SIZE = 5 + + # Set to change the connection timeout (in seconds) + #SQLALCHEMY_POOL_TIMEOUT = 10 + + # Set to change how long connections remain before being recycled (in seconds) + # Default is 2 hours for MySQL + #SQLALCHEMY_POOL_RECYCLE = 2 * 60 * 60 +
12
1.2
12
0
428d0cc8cfc51bbf06bd851ddc1892e83dee9322
README.md
README.md
Fast stars in SDSS #To do: - [x] Run test with LSR velocity of 220km/s instead of 240km/s - [x] Run test with 250km/s cut instead of 200km/s - [x] Re-run models with default settings (powerlaw, flattened powerlaw, TF with Gibbons prior) - [ ] Write Introduction - [ ] Write Conclusions - [ ] Process changes from other authors
Fast stars in SDSS #To do: - [x] Run test with LSR velocity of 220km/s instead of 240km/s - [x] Run test with 250km/s cut instead of 200km/s - [x] Re-run models with default settings (powerlaw, flattened powerlaw, TF with Gibbons prior) - [ ] Write Introduction - [ ] Write Conclusions - [ ] Process changes from other authors - [ ] Add bit to conclusion about accretion history being encoded in k (we are doing this) - [ ] Add bit to justify the transformation of vesc(r) - > M(r), cite Piffl
Add a couple of extra things to put in the article
Add a couple of extra things to put in the article
Markdown
mit
anguswilliams91/OnTheRun
markdown
## Code Before: Fast stars in SDSS #To do: - [x] Run test with LSR velocity of 220km/s instead of 240km/s - [x] Run test with 250km/s cut instead of 200km/s - [x] Re-run models with default settings (powerlaw, flattened powerlaw, TF with Gibbons prior) - [ ] Write Introduction - [ ] Write Conclusions - [ ] Process changes from other authors ## Instruction: Add a couple of extra things to put in the article ## Code After: Fast stars in SDSS #To do: - [x] Run test with LSR velocity of 220km/s instead of 240km/s - [x] Run test with 250km/s cut instead of 200km/s - [x] Re-run models with default settings (powerlaw, flattened powerlaw, TF with Gibbons prior) - [ ] Write Introduction - [ ] Write Conclusions - [ ] Process changes from other authors - [ ] Add bit to conclusion about accretion history being encoded in k (we are doing this) - [ ] Add bit to justify the transformation of vesc(r) - > M(r), cite Piffl
Fast stars in SDSS #To do: - [x] Run test with LSR velocity of 220km/s instead of 240km/s - [x] Run test with 250km/s cut instead of 200km/s - [x] Re-run models with default settings (powerlaw, flattened powerlaw, TF with Gibbons prior) - [ ] Write Introduction - [ ] Write Conclusions - [ ] Process changes from other authors + - [ ] Add bit to conclusion about accretion history being encoded in k (we are doing this) + - [ ] Add bit to justify the transformation of vesc(r) - > M(r), cite Piffl
2
0.2
2
0
b8c014535aeb57606fe3d69f5f5809bd987a7f45
src/Logic/Api.php
src/Logic/Api.php
<?php namespace Gt\WebEngine\Logic; abstract class Api extends AbstractLogic { protected $object; /** @noinspection PhpMissingParentConstructorInspection */ public function __construct($object) { $this->object = $object; call_user_func_array( "parent::__construct", func_get_args() ); } }
<?php namespace Gt\WebEngine\Logic; use Gt\WebEngine\Refactor\ObjectDocument; abstract class Api extends AbstractLogic { /** @var ObjectDocument */ protected $document; /** @noinspection PhpMissingParentConstructorInspection */ public function __construct($object) { $this->document = $object; call_user_func_array( "parent::__construct", func_get_args() ); } }
Introduce ObjectDocument for serving API requests
Introduce ObjectDocument for serving API requests
PHP
mit
phpgt/webengine
php
## Code Before: <?php namespace Gt\WebEngine\Logic; abstract class Api extends AbstractLogic { protected $object; /** @noinspection PhpMissingParentConstructorInspection */ public function __construct($object) { $this->object = $object; call_user_func_array( "parent::__construct", func_get_args() ); } } ## Instruction: Introduce ObjectDocument for serving API requests ## Code After: <?php namespace Gt\WebEngine\Logic; use Gt\WebEngine\Refactor\ObjectDocument; abstract class Api extends AbstractLogic { /** @var ObjectDocument */ protected $document; /** @noinspection PhpMissingParentConstructorInspection */ public function __construct($object) { $this->document = $object; call_user_func_array( "parent::__construct", func_get_args() ); } }
<?php namespace Gt\WebEngine\Logic; + use Gt\WebEngine\Refactor\ObjectDocument; + abstract class Api extends AbstractLogic { + /** @var ObjectDocument */ - protected $object; ? ^^ ^ + protected $document; ? + ^^^ ^ /** @noinspection PhpMissingParentConstructorInspection */ public function __construct($object) { - $this->object = $object; ? ^^ ^ + $this->document = $object; ? + ^^^ ^ + call_user_func_array( "parent::__construct", func_get_args() ); } }
8
0.533333
6
2
52ec6e59fb34f50759d187edaecd77c7349d5b5f
org.ektorp/src/main/java/org/ektorp/http/IdleConnectionMonitor.java
org.ektorp/src/main/java/org/ektorp/http/IdleConnectionMonitor.java
package org.ektorp.http; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.apache.http.conn.*; public class IdleConnectionMonitor { private final static long DEFAULT_IDLE_CHECK_INTERVAL = 30; private final static ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1, new ThreadFactory() { private final AtomicInteger threadCount = new AtomicInteger(0); public Thread newThread(Runnable r) { Thread t = new Thread(r); t.setDaemon(true); t.setName(String.format("ektorp-idle-connection-monitor-thread-%s", threadCount.incrementAndGet())); return t; } }); public static void monitor(ClientConnectionManager cm) { executorService.scheduleWithFixedDelay(new CleanupTask(cm), DEFAULT_IDLE_CHECK_INTERVAL, DEFAULT_IDLE_CHECK_INTERVAL, TimeUnit.SECONDS); } private static class CleanupTask implements Runnable { final ClientConnectionManager cm; CleanupTask(ClientConnectionManager cm) { this.cm = cm; } public void run() { cm.closeExpiredConnections(); } } }
package org.ektorp.http; import java.lang.ref.WeakReference; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.apache.http.conn.*; public class IdleConnectionMonitor { private final static long DEFAULT_IDLE_CHECK_INTERVAL = 30; private final static ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1, new ThreadFactory() { private final AtomicInteger threadCount = new AtomicInteger(0); public Thread newThread(Runnable r) { Thread t = new Thread(r); t.setDaemon(true); t.setName(String.format("ektorp-idle-connection-monitor-thread-%s", threadCount.incrementAndGet())); return t; } }); public static void monitor(ClientConnectionManager cm) { CleanupTask cleanupTask = new CleanupTask(cm); ScheduledFuture<?> cleanupFuture = executorService.scheduleWithFixedDelay(cleanupTask, DEFAULT_IDLE_CHECK_INTERVAL, DEFAULT_IDLE_CHECK_INTERVAL, TimeUnit.SECONDS); cleanupTask.setFuture(cleanupFuture); } private static class CleanupTask implements Runnable { private final WeakReference<ClientConnectionManager> cm; private ScheduledFuture<?> thisFuture; CleanupTask(ClientConnectionManager cm) { this.cm = new WeakReference<ClientConnectionManager>(cm); } public void setFuture(ScheduledFuture<?> future) { thisFuture = future; } public void run() { if (cm.get() != null) { cm.get().closeExpiredConnections(); } else if (thisFuture != null) { thisFuture.cancel(false); } } } }
Fix memory leak in cleanup task
Fix memory leak in cleanup task
Java
apache-2.0
helun/Ektorp,YannRobert/Ektorp,taktik/Ektorp,maoueh/Ektorp,helun/Ektorp,maoueh/Ektorp,couchbaselabs/Ektorp,couchbaselabs/Ektorp,Arcticwolf/Ektorp,taktik/Ektorp,YannRobert/Ektorp,Arcticwolf/Ektorp
java
## Code Before: package org.ektorp.http; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.apache.http.conn.*; public class IdleConnectionMonitor { private final static long DEFAULT_IDLE_CHECK_INTERVAL = 30; private final static ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1, new ThreadFactory() { private final AtomicInteger threadCount = new AtomicInteger(0); public Thread newThread(Runnable r) { Thread t = new Thread(r); t.setDaemon(true); t.setName(String.format("ektorp-idle-connection-monitor-thread-%s", threadCount.incrementAndGet())); return t; } }); public static void monitor(ClientConnectionManager cm) { executorService.scheduleWithFixedDelay(new CleanupTask(cm), DEFAULT_IDLE_CHECK_INTERVAL, DEFAULT_IDLE_CHECK_INTERVAL, TimeUnit.SECONDS); } private static class CleanupTask implements Runnable { final ClientConnectionManager cm; CleanupTask(ClientConnectionManager cm) { this.cm = cm; } public void run() { cm.closeExpiredConnections(); } } } ## Instruction: Fix memory leak in cleanup task ## Code After: package org.ektorp.http; import java.lang.ref.WeakReference; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.apache.http.conn.*; public class IdleConnectionMonitor { private final static long DEFAULT_IDLE_CHECK_INTERVAL = 30; private final static ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1, new ThreadFactory() { private final AtomicInteger threadCount = new AtomicInteger(0); public Thread newThread(Runnable r) { Thread t = new Thread(r); t.setDaemon(true); t.setName(String.format("ektorp-idle-connection-monitor-thread-%s", threadCount.incrementAndGet())); return t; } }); public static void monitor(ClientConnectionManager cm) { CleanupTask cleanupTask = new CleanupTask(cm); ScheduledFuture<?> cleanupFuture = executorService.scheduleWithFixedDelay(cleanupTask, DEFAULT_IDLE_CHECK_INTERVAL, DEFAULT_IDLE_CHECK_INTERVAL, TimeUnit.SECONDS); cleanupTask.setFuture(cleanupFuture); } private static class CleanupTask implements Runnable { private final WeakReference<ClientConnectionManager> cm; private ScheduledFuture<?> thisFuture; CleanupTask(ClientConnectionManager cm) { this.cm = new WeakReference<ClientConnectionManager>(cm); } public void setFuture(ScheduledFuture<?> future) { thisFuture = future; } public void run() { if (cm.get() != null) { cm.get().closeExpiredConnections(); } else if (thisFuture != null) { thisFuture.cancel(false); } } } }
package org.ektorp.http; + import java.lang.ref.WeakReference; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.apache.http.conn.*; public class IdleConnectionMonitor { private final static long DEFAULT_IDLE_CHECK_INTERVAL = 30; private final static ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1, new ThreadFactory() { private final AtomicInteger threadCount = new AtomicInteger(0); public Thread newThread(Runnable r) { Thread t = new Thread(r); t.setDaemon(true); t.setName(String.format("ektorp-idle-connection-monitor-thread-%s", threadCount.incrementAndGet())); return t; } }); - public static void monitor(ClientConnectionManager cm) { ? ^ + public static void monitor(ClientConnectionManager cm) { ? ^^^^ - executorService.scheduleWithFixedDelay(new CleanupTask(cm), DEFAULT_IDLE_CHECK_INTERVAL, DEFAULT_IDLE_CHECK_INTERVAL, TimeUnit.SECONDS); - } + CleanupTask cleanupTask = new CleanupTask(cm); + ScheduledFuture<?> cleanupFuture = executorService.scheduleWithFixedDelay(cleanupTask, DEFAULT_IDLE_CHECK_INTERVAL, + DEFAULT_IDLE_CHECK_INTERVAL, TimeUnit.SECONDS); + cleanupTask.setFuture(cleanupFuture); + } private static class CleanupTask implements Runnable { - final ClientConnectionManager cm; - + private final WeakReference<ClientConnectionManager> cm; + private ScheduledFuture<?> thisFuture; + - CleanupTask(ClientConnectionManager cm) { ? ^^ + CleanupTask(ClientConnectionManager cm) { ? ^^^^^^^^ - this.cm = cm; - } - + this.cm = new WeakReference<ClientConnectionManager>(cm); + } + + public void setFuture(ScheduledFuture<?> future) { + thisFuture = future; + } + - public void run() { ? ^^ + public void run() { ? ^^^^^^^^ - cm.closeExpiredConnections(); - } + if (cm.get() != null) { + cm.get().closeExpiredConnections(); + } else if (thisFuture != null) { + thisFuture.cancel(false); + } + } } }
37
0.880952
25
12
3329631b2e394863fe69b3ddc8cfd18c980a9cc3
app/views/calendar/_calendar_head.html.erb
app/views/calendar/_calendar_head.html.erb
<% content_for :title, @calendar.title %> <% content_for :head do %> <meta name="description" content="<%= @calendar.description %>"> <link rel="alternate" type="application/json" href="<%= calendar_path(@calendar, :format => :json) %>" /> <% @calendar.divisions.each do |division| %> <link rel="alternate" type="application/json" href="<%= division_path(@calendar, division, :format => :json) %>" /> <link rel="alternate" type="text/calendar" href="<%= division_path(@calendar, division, :format => :ics) %>" /> <% end %> <% end %>
<% content_for :title, @calendar.title %> <% content_for :head do %> <meta name="description" content="<%= @calendar.description %>"> <link rel="alternate" type="application/json" href="<%= calendar_path(@calendar, :format => :json) %>" /> <% @calendar.divisions.each do |division| %> <link rel="alternate" type="application/json" href="<%= division_path(@calendar, division, :format => :json) %>" /> <link rel="alternate" type="text/calendar" href="<%= division_path(@calendar, division, :format => :ics) %>" /> <% end %> <%= render 'govuk_publishing_components/components/machine_readable_metadata', schema: :article, content_item: @content_item %> <% end %>
Add schema.org data via the new component
Add schema.org data via the new component This uses the new component built in https://github.com/alphagov/govuk_publishing_components/pull/318. https://trello.com/c/RLQI1IUV
HTML+ERB
mit
alphagov/calendars,alphagov/calendars,alphagov/calendars,alphagov/calendars
html+erb
## Code Before: <% content_for :title, @calendar.title %> <% content_for :head do %> <meta name="description" content="<%= @calendar.description %>"> <link rel="alternate" type="application/json" href="<%= calendar_path(@calendar, :format => :json) %>" /> <% @calendar.divisions.each do |division| %> <link rel="alternate" type="application/json" href="<%= division_path(@calendar, division, :format => :json) %>" /> <link rel="alternate" type="text/calendar" href="<%= division_path(@calendar, division, :format => :ics) %>" /> <% end %> <% end %> ## Instruction: Add schema.org data via the new component This uses the new component built in https://github.com/alphagov/govuk_publishing_components/pull/318. https://trello.com/c/RLQI1IUV ## Code After: <% content_for :title, @calendar.title %> <% content_for :head do %> <meta name="description" content="<%= @calendar.description %>"> <link rel="alternate" type="application/json" href="<%= calendar_path(@calendar, :format => :json) %>" /> <% @calendar.divisions.each do |division| %> <link rel="alternate" type="application/json" href="<%= division_path(@calendar, division, :format => :json) %>" /> <link rel="alternate" type="text/calendar" href="<%= division_path(@calendar, division, :format => :ics) %>" /> <% end %> <%= render 'govuk_publishing_components/components/machine_readable_metadata', schema: :article, content_item: @content_item %> <% end %>
<% content_for :title, @calendar.title %> <% content_for :head do %> <meta name="description" content="<%= @calendar.description %>"> <link rel="alternate" type="application/json" href="<%= calendar_path(@calendar, :format => :json) %>" /> <% @calendar.divisions.each do |division| %> <link rel="alternate" type="application/json" href="<%= division_path(@calendar, division, :format => :json) %>" /> <link rel="alternate" type="text/calendar" href="<%= division_path(@calendar, division, :format => :ics) %>" /> <% end %> + + <%= render 'govuk_publishing_components/components/machine_readable_metadata', + schema: :article, + content_item: @content_item %> <% end %>
4
0.4
4
0
6e002fffecae10823cec9a577439702169faeb78
data/templates/block_paragraph.html.slim
data/templates/block_paragraph.html.slim
- if title? section.paragraph h6 =title p id=id class=role =content - else p id=id class=role =content
- if title? section.paragraph id=id h6 =title p class=role =content - else p id=id class=role =content
Move id to <section> on paragraph with title
Move id to <section> on paragraph with title
Slim
mit
jirutka/asciidoctor-html5,jirutka/asciidoctor-html5
slim
## Code Before: - if title? section.paragraph h6 =title p id=id class=role =content - else p id=id class=role =content ## Instruction: Move id to <section> on paragraph with title ## Code After: - if title? section.paragraph id=id h6 =title p class=role =content - else p id=id class=role =content
- if title? - section.paragraph + section.paragraph id=id ? ++++++ h6 =title - p id=id class=role =content ? ------ + p class=role =content - else p id=id class=role =content
4
0.666667
2
2
32d351481e9fb8877eaafb9b81ea21a4f44bf316
index.js
index.js
/* eslint-env node */ 'use strict'; var { requireUp } = require('./requireUp'); var { DEFAULT_EXTENSIONS } = require('./constants'); var rules = requireUp('eslint-local-rules', DEFAULT_EXTENSIONS, __dirname); if (!rules) { throw new Error( 'eslint-plugin-local-rules: ' + 'Cannot find "eslint-local-rules{' + ['.js'].concat(exts.filter(Boolean)) + '} ' + 'or eslint-local-rules/index.js (checked all ancestors of "' + __dirname + '").' ); } module.exports = { rules: rules, };
/* eslint-env node */ 'use strict'; var { requireUp } = require('./requireUp'); var { DEFAULT_EXTENSIONS } = require('./constants'); var rules = requireUp('eslint-local-rules', DEFAULT_EXTENSIONS, __dirname); if (!rules) { throw new Error( 'eslint-plugin-local-rules: ' + 'Cannot find "eslint-local-rules{' + ['.js'].concat(DEFAULT_EXTENSIONS.filter(Boolean)) + '} ' + 'or eslint-local-rules/index.js (checked all ancestors of "' + __dirname + '").' ); } module.exports = { rules: rules, };
Fix "undefined var exts when eslint-local-rules.js not found"
Fix "undefined var exts when eslint-local-rules.js not found" Fixes #14
JavaScript
mit
cletusw/eslint-plugin-local-rules
javascript
## Code Before: /* eslint-env node */ 'use strict'; var { requireUp } = require('./requireUp'); var { DEFAULT_EXTENSIONS } = require('./constants'); var rules = requireUp('eslint-local-rules', DEFAULT_EXTENSIONS, __dirname); if (!rules) { throw new Error( 'eslint-plugin-local-rules: ' + 'Cannot find "eslint-local-rules{' + ['.js'].concat(exts.filter(Boolean)) + '} ' + 'or eslint-local-rules/index.js (checked all ancestors of "' + __dirname + '").' ); } module.exports = { rules: rules, }; ## Instruction: Fix "undefined var exts when eslint-local-rules.js not found" Fixes #14 ## Code After: /* eslint-env node */ 'use strict'; var { requireUp } = require('./requireUp'); var { DEFAULT_EXTENSIONS } = require('./constants'); var rules = requireUp('eslint-local-rules', DEFAULT_EXTENSIONS, __dirname); if (!rules) { throw new Error( 'eslint-plugin-local-rules: ' + 'Cannot find "eslint-local-rules{' + ['.js'].concat(DEFAULT_EXTENSIONS.filter(Boolean)) + '} ' + 'or eslint-local-rules/index.js (checked all ancestors of "' + __dirname + '").' ); } module.exports = { rules: rules, };
/* eslint-env node */ 'use strict'; var { requireUp } = require('./requireUp'); var { DEFAULT_EXTENSIONS } = require('./constants'); var rules = requireUp('eslint-local-rules', DEFAULT_EXTENSIONS, __dirname); if (!rules) { throw new Error( 'eslint-plugin-local-rules: ' + 'Cannot find "eslint-local-rules{' + - ['.js'].concat(exts.filter(Boolean)) + ? ^^^^ + ['.js'].concat(DEFAULT_EXTENSIONS.filter(Boolean)) + ? ^^^^^^^^^^^^^^^^^^ '} ' + 'or eslint-local-rules/index.js (checked all ancestors of "' + __dirname + '").' ); } module.exports = { rules: rules, };
2
0.086957
1
1
3c6ce44c7b0434d9000dae25a2af8326714b6bc4
lineprofile/ln_likes.pxd
lineprofile/ln_likes.pxd
"A bunch of improper (not normalized) prior distributions" from libc.math cimport log, fabs cdef inline double ln_normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return -0.5 * tmp - log(stddev) cdef inline double ln_laplace(double value, double mean, double stddev): return -1.0 * fabs(value - mean) / stddev - log(stddev) cdef inline double ln_log(double value): return -1.0 * log(value) cdef inline double ln_gamma(double value, double k, double theta): return (k - 1.0) * log(value) - value / theta cdef inline double ln_beta(double value, double p, double q): return (p - 1.0) * log(value) + (q - 1.0) * log(1 - value)
"A bunch of improper (not normalized) prior distributions" from libc.math cimport log, fabs, sqrt, exp, M_PI cdef inline double ln_normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return -0.5 * tmp - log(stddev) cdef inline double ln_laplace(double value, double mean, double stddev): return -1.0 * fabs(value - mean) / stddev - log(stddev) cdef inline double ln_log(double value): return -1.0 * log(value) cdef inline double ln_gamma(double value, double k, double theta): return (k - 1.0) * log(value) - value / theta cdef inline double ln_beta(double value, double p, double q): return (p - 1.0) * log(value) + (q - 1.0) * log(1 - value) cdef inline double normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return exp(-0.5 * tmp) / sqrt(2. * M_PI) / stddev
Add non-logarithmic normal for mixture model
Add non-logarithmic normal for mixture model
Cython
mit
lfloeer/hiprofile
cython
## Code Before: "A bunch of improper (not normalized) prior distributions" from libc.math cimport log, fabs cdef inline double ln_normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return -0.5 * tmp - log(stddev) cdef inline double ln_laplace(double value, double mean, double stddev): return -1.0 * fabs(value - mean) / stddev - log(stddev) cdef inline double ln_log(double value): return -1.0 * log(value) cdef inline double ln_gamma(double value, double k, double theta): return (k - 1.0) * log(value) - value / theta cdef inline double ln_beta(double value, double p, double q): return (p - 1.0) * log(value) + (q - 1.0) * log(1 - value) ## Instruction: Add non-logarithmic normal for mixture model ## Code After: "A bunch of improper (not normalized) prior distributions" from libc.math cimport log, fabs, sqrt, exp, M_PI cdef inline double ln_normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return -0.5 * tmp - log(stddev) cdef inline double ln_laplace(double value, double mean, double stddev): return -1.0 * fabs(value - mean) / stddev - log(stddev) cdef inline double ln_log(double value): return -1.0 * log(value) cdef inline double ln_gamma(double value, double k, double theta): return (k - 1.0) * log(value) - value / theta cdef inline double ln_beta(double value, double p, double q): return (p - 1.0) * log(value) + (q - 1.0) * log(1 - value) cdef inline double normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return exp(-0.5 * tmp) / sqrt(2. * M_PI) / stddev
"A bunch of improper (not normalized) prior distributions" - from libc.math cimport log, fabs + from libc.math cimport log, fabs, sqrt, exp, M_PI ? +++++++++++++++++ cdef inline double ln_normal(double value, double mean, double stddev): cdef double tmp = (value - mean) / stddev tmp *= tmp return -0.5 * tmp - log(stddev) cdef inline double ln_laplace(double value, double mean, double stddev): return -1.0 * fabs(value - mean) / stddev - log(stddev) cdef inline double ln_log(double value): return -1.0 * log(value) cdef inline double ln_gamma(double value, double k, double theta): return (k - 1.0) * log(value) - value / theta cdef inline double ln_beta(double value, double p, double q): return (p - 1.0) * log(value) + (q - 1.0) * log(1 - value) + + cdef inline double normal(double value, double mean, double stddev): + cdef double tmp = (value - mean) / stddev + tmp *= tmp + return exp(-0.5 * tmp) / sqrt(2. * M_PI) / stddev
7
0.368421
6
1
b32c48ee0519f7469077ed9878bbc1d550660d78
changelog/5585.breaking.rst
changelog/5585.breaking.rst
As per our policy, the following features have been deprecated in the 5.X series and are now removed: * The ``funcargnames`` read-only property of ``FixtureRequest``, ``Metafunc``, and ``Function`` classes. Use ``fixturenames`` attribute. * ``@pytest.fixture`` no longer supports positional arguments, pass all arguments by keyword instead. * Direct construction of ``Node`` subclasses now raise an error, use ``from_parent`` instead. * The default value for ``junit_family`` has changed to ``xunit2``. If you require the old format, add ``junit_family=xunit1`` to your configuration file. * The ``TerminalReporter`` no longer has a ``writer`` attribute. Plugin authors may use the public functions of the ``TerminalReporter`` instead of accessing the ``TerminalWriter`` object directly.
As per our policy, the following features have been deprecated in the 5.X series and are now removed: * The ``funcargnames`` read-only property of ``FixtureRequest``, ``Metafunc``, and ``Function`` classes. Use ``fixturenames`` attribute. * ``@pytest.fixture`` no longer supports positional arguments, pass all arguments by keyword instead. * Direct construction of ``Node`` subclasses now raise an error, use ``from_parent`` instead. * The default value for ``junit_family`` has changed to ``xunit2``. If you require the old format, add ``junit_family=xunit1`` to your configuration file. * The ``TerminalReporter`` no longer has a ``writer`` attribute. Plugin authors may use the public functions of the ``TerminalReporter`` instead of accessing the ``TerminalWriter`` object directly. For more information consult `Deprecations and Removals <https://docs.pytest.org/en/stable/deprecations.html>`__ in the docs.
Add bottom changelog deprecation notice
Add bottom changelog deprecation notice
reStructuredText
mit
markshao/pytest,pytest-dev/pytest,The-Compiler/pytest,nicoddemus/pytest,Akasurde/pytest,RonnyPfannschmidt/pytest,nicoddemus/pytest,The-Compiler/pytest
restructuredtext
## Code Before: As per our policy, the following features have been deprecated in the 5.X series and are now removed: * The ``funcargnames`` read-only property of ``FixtureRequest``, ``Metafunc``, and ``Function`` classes. Use ``fixturenames`` attribute. * ``@pytest.fixture`` no longer supports positional arguments, pass all arguments by keyword instead. * Direct construction of ``Node`` subclasses now raise an error, use ``from_parent`` instead. * The default value for ``junit_family`` has changed to ``xunit2``. If you require the old format, add ``junit_family=xunit1`` to your configuration file. * The ``TerminalReporter`` no longer has a ``writer`` attribute. Plugin authors may use the public functions of the ``TerminalReporter`` instead of accessing the ``TerminalWriter`` object directly. ## Instruction: Add bottom changelog deprecation notice ## Code After: As per our policy, the following features have been deprecated in the 5.X series and are now removed: * The ``funcargnames`` read-only property of ``FixtureRequest``, ``Metafunc``, and ``Function`` classes. Use ``fixturenames`` attribute. * ``@pytest.fixture`` no longer supports positional arguments, pass all arguments by keyword instead. * Direct construction of ``Node`` subclasses now raise an error, use ``from_parent`` instead. * The default value for ``junit_family`` has changed to ``xunit2``. If you require the old format, add ``junit_family=xunit1`` to your configuration file. * The ``TerminalReporter`` no longer has a ``writer`` attribute. Plugin authors may use the public functions of the ``TerminalReporter`` instead of accessing the ``TerminalWriter`` object directly. For more information consult `Deprecations and Removals <https://docs.pytest.org/en/stable/deprecations.html>`__ in the docs.
As per our policy, the following features have been deprecated in the 5.X series and are now removed: * The ``funcargnames`` read-only property of ``FixtureRequest``, ``Metafunc``, and ``Function`` classes. Use ``fixturenames`` attribute. * ``@pytest.fixture`` no longer supports positional arguments, pass all arguments by keyword instead. * Direct construction of ``Node`` subclasses now raise an error, use ``from_parent`` instead. * The default value for ``junit_family`` has changed to ``xunit2``. If you require the old format, add ``junit_family=xunit1`` to your configuration file. * The ``TerminalReporter`` no longer has a ``writer`` attribute. Plugin authors may use the public functions of the ``TerminalReporter`` instead of accessing the ``TerminalWriter`` object directly. + + + For more information consult + `Deprecations and Removals <https://docs.pytest.org/en/stable/deprecations.html>`__ in the docs.
4
0.333333
4
0
e32b6f7017e14983fdf9acd1ef74bb5522c99772
lib/hyperclient.rb
lib/hyperclient.rb
module Hyperclient end require 'hyperclient/entry_point' require "hyperclient/version"
module Hyperclient def self.new(url) Hyperclient::EntryPoint.new(url) end end require 'hyperclient/entry_point' require "hyperclient/version"
Add convinience method to build entry points
Add convinience method to build entry points
Ruby
mit
jufemaiz/hyperclient,codegram/hyperclient,alabeduarte/hyperclient,dblock/hyperclient
ruby
## Code Before: module Hyperclient end require 'hyperclient/entry_point' require "hyperclient/version" ## Instruction: Add convinience method to build entry points ## Code After: module Hyperclient def self.new(url) Hyperclient::EntryPoint.new(url) end end require 'hyperclient/entry_point' require "hyperclient/version"
module Hyperclient + def self.new(url) + Hyperclient::EntryPoint.new(url) + end end require 'hyperclient/entry_point' require "hyperclient/version"
3
0.6
3
0
4b154130f3fd9ad2665685c5d5294c0f7940b3c8
scripts/cachefilesd.sh
scripts/cachefilesd.sh
sudo apt-get install -y cachefilesd sudo sed -i -e 's/#RUN=yes/RUN=yes/g' /etc/default/cachefilesd cat <<EOF | sudo tee /etc/cachefilesd.conf > /dev/null dir /var/cache/fscache #dir /raid tag dgx1cache brun 25% bcull 15% bstop 5% frun 10% fcull 7% fstop 3% EOF sudo modprobe cachefiles sudo service cachefilesd start
sudo apt-get install -y cachefilesd sudo sed -i -e 's/#RUN=yes/RUN=yes/g' /etc/default/cachefilesd : ${FSCACHE_DIR:=/var/cache/fscache} cat <<EOF | sudo tee /etc/cachefilesd.conf > /dev/null dir $FSCACHE_DIR tag dgx1cache brun 25% bcull 15% bstop 5% frun 10% fcull 7% fstop 3% EOF sudo modprobe cachefiles sudo service cachefilesd start
Allow for the fscache directory to be set via env var
Allow for the fscache directory to be set via env var
Shell
apache-2.0
dhague/maas-k8s
shell
## Code Before: sudo apt-get install -y cachefilesd sudo sed -i -e 's/#RUN=yes/RUN=yes/g' /etc/default/cachefilesd cat <<EOF | sudo tee /etc/cachefilesd.conf > /dev/null dir /var/cache/fscache #dir /raid tag dgx1cache brun 25% bcull 15% bstop 5% frun 10% fcull 7% fstop 3% EOF sudo modprobe cachefiles sudo service cachefilesd start ## Instruction: Allow for the fscache directory to be set via env var ## Code After: sudo apt-get install -y cachefilesd sudo sed -i -e 's/#RUN=yes/RUN=yes/g' /etc/default/cachefilesd : ${FSCACHE_DIR:=/var/cache/fscache} cat <<EOF | sudo tee /etc/cachefilesd.conf > /dev/null dir $FSCACHE_DIR tag dgx1cache brun 25% bcull 15% bstop 5% frun 10% fcull 7% fstop 3% EOF sudo modprobe cachefiles sudo service cachefilesd start
sudo apt-get install -y cachefilesd sudo sed -i -e 's/#RUN=yes/RUN=yes/g' /etc/default/cachefilesd + : ${FSCACHE_DIR:=/var/cache/fscache} cat <<EOF | sudo tee /etc/cachefilesd.conf > /dev/null + dir $FSCACHE_DIR - dir /var/cache/fscache - #dir /raid tag dgx1cache brun 25% bcull 15% bstop 5% frun 10% fcull 7% fstop 3% EOF sudo modprobe cachefiles sudo service cachefilesd start
4
0.25
2
2
5d3fe703e04ebd4e7667aa1959861fd57bbeb7a9
CMakeLists.txt
CMakeLists.txt
cmake_minimum_required(VERSION 2.6) project(INDEXEDCORPUS) if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) include_directories(${INDEXEDCORPUS_SOURCE_DIR}) find_package(Qt4 COMPONENTS QtCore REQUIRED) INCLUDE(${QT_USE_FILE}) find_package(ZLIB REQUIRED) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) endif() add_library(corpus STATIC src/ActCorpusReader/ActCorpusReader.cpp src/DzIstreamBuf/DzIstreamBuf.cpp src/IndexedCorpusReader/IndexedCorpusReader.cpp src/IndexedCorpusWriter/IndexedCorpusWriter.cpp src/util/textfile/textfile.cpp src/util/base64.cpp src/DzOstream/DzOstream.cpp src/DzOstreamBuf/DzOstreamBuf.cpp src/IndexNamePair/IndexNamePair.cpp src/DzIstream/DzIstream.cpp )
cmake_minimum_required(VERSION 2.6) project(INDEXEDCORPUS) if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) include_directories(${INDEXEDCORPUS_SOURCE_DIR}) find_package(Qt4 COMPONENTS QtCore REQUIRED) INCLUDE(${QT_USE_FILE}) find_package(ZLIB REQUIRED) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) endif() add_library(corpus SHARED src/ActCorpusReader/ActCorpusReader.cpp src/DzIstreamBuf/DzIstreamBuf.cpp src/IndexedCorpusReader/IndexedCorpusReader.cpp src/IndexedCorpusWriter/IndexedCorpusWriter.cpp src/util/textfile/textfile.cpp src/util/base64.cpp src/DzOstream/DzOstream.cpp src/DzOstreamBuf/DzOstreamBuf.cpp src/IndexNamePair/IndexNamePair.cpp src/DzIstream/DzIstream.cpp ) target_link_libraries(corpus ${QT_LIBRARIES}) target_link_libraries(corpus ${ZLIB_LIBRARIES})
Build indexedcorpus as a shared library.
Build indexedcorpus as a shared library.
Text
lgpl-2.1
evdmade01/alpinocorpus,evdmade01/alpinocorpus,rug-compling/alpinocorpus,rug-compling/alpinocorpus,rug-compling/alpinocorpus
text
## Code Before: cmake_minimum_required(VERSION 2.6) project(INDEXEDCORPUS) if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) include_directories(${INDEXEDCORPUS_SOURCE_DIR}) find_package(Qt4 COMPONENTS QtCore REQUIRED) INCLUDE(${QT_USE_FILE}) find_package(ZLIB REQUIRED) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) endif() add_library(corpus STATIC src/ActCorpusReader/ActCorpusReader.cpp src/DzIstreamBuf/DzIstreamBuf.cpp src/IndexedCorpusReader/IndexedCorpusReader.cpp src/IndexedCorpusWriter/IndexedCorpusWriter.cpp src/util/textfile/textfile.cpp src/util/base64.cpp src/DzOstream/DzOstream.cpp src/DzOstreamBuf/DzOstreamBuf.cpp src/IndexNamePair/IndexNamePair.cpp src/DzIstream/DzIstream.cpp ) ## Instruction: Build indexedcorpus as a shared library. ## Code After: cmake_minimum_required(VERSION 2.6) project(INDEXEDCORPUS) if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) include_directories(${INDEXEDCORPUS_SOURCE_DIR}) find_package(Qt4 COMPONENTS QtCore REQUIRED) INCLUDE(${QT_USE_FILE}) find_package(ZLIB REQUIRED) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) endif() add_library(corpus SHARED src/ActCorpusReader/ActCorpusReader.cpp src/DzIstreamBuf/DzIstreamBuf.cpp src/IndexedCorpusReader/IndexedCorpusReader.cpp src/IndexedCorpusWriter/IndexedCorpusWriter.cpp src/util/textfile/textfile.cpp src/util/base64.cpp src/DzOstream/DzOstream.cpp src/DzOstreamBuf/DzOstreamBuf.cpp src/IndexNamePair/IndexNamePair.cpp src/DzIstream/DzIstream.cpp ) target_link_libraries(corpus ${QT_LIBRARIES}) target_link_libraries(corpus ${ZLIB_LIBRARIES})
cmake_minimum_required(VERSION 2.6) project(INDEXEDCORPUS) if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) include_directories(${INDEXEDCORPUS_SOURCE_DIR}) find_package(Qt4 COMPONENTS QtCore REQUIRED) INCLUDE(${QT_USE_FILE}) find_package(ZLIB REQUIRED) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) endif() - add_library(corpus STATIC ? ^ ^^^ + add_library(corpus SHARED ? ^ ^^^ src/ActCorpusReader/ActCorpusReader.cpp src/DzIstreamBuf/DzIstreamBuf.cpp src/IndexedCorpusReader/IndexedCorpusReader.cpp src/IndexedCorpusWriter/IndexedCorpusWriter.cpp src/util/textfile/textfile.cpp src/util/base64.cpp src/DzOstream/DzOstream.cpp src/DzOstreamBuf/DzOstreamBuf.cpp src/IndexNamePair/IndexNamePair.cpp src/DzIstream/DzIstream.cpp ) + target_link_libraries(corpus ${QT_LIBRARIES}) + target_link_libraries(corpus ${ZLIB_LIBRARIES})
4
0.133333
3
1
2dfceba6f44e65b0d9d7953f8beb41aaf0b65159
examples/login/package.json
examples/login/package.json
{ "name": "passport-gamewallet-examples-login", "version": "0.0.0", "dependencies": { "express": ">= 0.0.0", "ejs": ">= 0.0.0", "passport": ">= 0.0.0", "passport-gamewallet": "git+ssh://git@github.com/DriveAgency/passport-gamewallet.git#v0.1.0" } }
{ "name": "passport-gamewallet-examples-login", "version": "0.0.0", "dependencies": { "express": ">= 0.0.0", "ejs": ">= 0.0.0", "passport": ">= 0.0.0", "passport-gamewallet": "git+https://git@github.com/DriveAgency/passport-gamewallet.git" } }
Fix path to gamewallet dependency
Fix path to gamewallet dependency
JSON
mit
DriveAgency/passport-gamewallet
json
## Code Before: { "name": "passport-gamewallet-examples-login", "version": "0.0.0", "dependencies": { "express": ">= 0.0.0", "ejs": ">= 0.0.0", "passport": ">= 0.0.0", "passport-gamewallet": "git+ssh://git@github.com/DriveAgency/passport-gamewallet.git#v0.1.0" } } ## Instruction: Fix path to gamewallet dependency ## Code After: { "name": "passport-gamewallet-examples-login", "version": "0.0.0", "dependencies": { "express": ">= 0.0.0", "ejs": ">= 0.0.0", "passport": ">= 0.0.0", "passport-gamewallet": "git+https://git@github.com/DriveAgency/passport-gamewallet.git" } }
{ "name": "passport-gamewallet-examples-login", "version": "0.0.0", "dependencies": { "express": ">= 0.0.0", "ejs": ">= 0.0.0", "passport": ">= 0.0.0", - "passport-gamewallet": "git+ssh://git@github.com/DriveAgency/passport-gamewallet.git#v0.1.0" ? -- ------- + "passport-gamewallet": "git+https://git@github.com/DriveAgency/passport-gamewallet.git" ? ++++ } }
2
0.2
1
1
2d6309dd0f34da6ce350e3a007e0541085228456
README.md
README.md
XKCD Password Generator ======================= A password generation library based on thexkpasswd.pm perl module for the Rust programming library.
XKCD Password Generator ======================= [![Build Status](https://travis-ci.org/darayus/XKCDPass.svg?branch=master)](https://travis-ci.org/darayus/XKCDPass) A password generation library based on thexkpasswd.pm perl module for the Rust programming library.
Add the travis badge to the readme
Add the travis badge to the readme
Markdown
mit
darayus/XKCDPass
markdown
## Code Before: XKCD Password Generator ======================= A password generation library based on thexkpasswd.pm perl module for the Rust programming library. ## Instruction: Add the travis badge to the readme ## Code After: XKCD Password Generator ======================= [![Build Status](https://travis-ci.org/darayus/XKCDPass.svg?branch=master)](https://travis-ci.org/darayus/XKCDPass) A password generation library based on thexkpasswd.pm perl module for the Rust programming library.
XKCD Password Generator ======================= + [![Build Status](https://travis-ci.org/darayus/XKCDPass.svg?branch=master)](https://travis-ci.org/darayus/XKCDPass) + A password generation library based on thexkpasswd.pm perl module for the Rust programming library.
2
0.5
2
0
5923100418c244fead56a5c6bf0fda90b7ce2292
minio-azure-gateway/azuredeploy.parameters.json
minio-azure-gateway/azuredeploy.parameters.json
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "virtualNetworkAddressPrefix": { "value": [ "10.0.0.0/16" ] }, "virtualNetworkSubnetAddressPrefix": { "value": "10.0.0.0/16" }, "agentPoolVmSku": { "value": "Standard_D16s_v3" }, "maxpods": { "value": 20 }, "nodecount": { "value": 4 }, "mincount": { "value": 4 }, "maxcount": { "value": 10 }, "linuxSSHKey": { "value": "GEN-SSH-PUB-KEY" } } }
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "virtualNetworkAddressPrefix": { "value": [ "10.0.0.0/16" ] }, "virtualNetworkSubnetAddressPrefix": { "value": "10.0.0.0/16" }, "agentPoolVmSku": { "value": "Standard_D16s_v3" }, "maxpods": { "value": 20 }, "nodecount": { "value": 4 }, "mincount": { "value": 4 }, "maxcount": { "value": 10 }, "linuxSSHKey": { "value": "GEN-SSH-PUB-KEY" }, "adminUsername": { "value": "clusterAdmin" } } }
Add default value of adminUsername
Add default value of adminUsername
JSON
mit
MCKLMT/azure-quickstart-templates,johndowns/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,Azure/azure-quickstart-templates,nzthiago/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,nzthiago/azure-quickstart-templates,jmservera/azure-quickstart-templates,slapointe/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,slapointe/azure-quickstart-templates,jmservera/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,Azure/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,jmservera/azure-quickstart-templates,neudesic/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,slapointe/azure-quickstart-templates,johndowns/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,neudesic/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,slapointe/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,Azure/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,neudesic/azure-quickstart-templates,johndowns/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,johndowns/azure-quickstart-templates,johndowns/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,Azure/azure-quickstart-templates,jmservera/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,Azure/azure-quickstart-templates,slapointe/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,neudesic/azure-quickstart-templates,nzthiago/azure-quickstart-templates,neudesic/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,neudesic/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,Azure/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,jmservera/azure-quickstart-templates,jmservera/azure-quickstart-templates,slapointe/azure-quickstart-templates,nzthiago/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,johndowns/azure-quickstart-templates,nzthiago/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,nzthiago/azure-quickstart-templates
json
## Code Before: { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "virtualNetworkAddressPrefix": { "value": [ "10.0.0.0/16" ] }, "virtualNetworkSubnetAddressPrefix": { "value": "10.0.0.0/16" }, "agentPoolVmSku": { "value": "Standard_D16s_v3" }, "maxpods": { "value": 20 }, "nodecount": { "value": 4 }, "mincount": { "value": 4 }, "maxcount": { "value": 10 }, "linuxSSHKey": { "value": "GEN-SSH-PUB-KEY" } } } ## Instruction: Add default value of adminUsername ## Code After: { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "virtualNetworkAddressPrefix": { "value": [ "10.0.0.0/16" ] }, "virtualNetworkSubnetAddressPrefix": { "value": "10.0.0.0/16" }, "agentPoolVmSku": { "value": "Standard_D16s_v3" }, "maxpods": { "value": 20 }, "nodecount": { "value": 4 }, "mincount": { "value": 4 }, "maxcount": { "value": 10 }, "linuxSSHKey": { "value": "GEN-SSH-PUB-KEY" }, "adminUsername": { "value": "clusterAdmin" } } }
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "virtualNetworkAddressPrefix": { "value": [ "10.0.0.0/16" ] }, "virtualNetworkSubnetAddressPrefix": { "value": "10.0.0.0/16" }, "agentPoolVmSku": { "value": "Standard_D16s_v3" }, "maxpods": { "value": 20 }, "nodecount": { "value": 4 }, "mincount": { "value": 4 }, "maxcount": { "value": 10 }, "linuxSSHKey": { "value": "GEN-SSH-PUB-KEY" + }, + "adminUsername": { + "value": "clusterAdmin" } } }
3
0.1
3
0
9439963aa921c51307f6332d471c0eecf3774cff
webserver/templates/base.html
webserver/templates/base.html
{% load static %} {% get_static_prefix as STATIC_PREFIX %} <html> <head> <title>Attempt</title> <link href="{{ STATIC_PREFIX }}css/sitewide.css" rel="stylesheet" type="text/css"> <script> var STATIC_PREFIX = "{{ STATIC_PREFIX }}"; </script> <script src="{{ STATIC_PREFIX }}js/lib/underscore.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/contracts.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/jquery-2.0.3.min.js" type="text/javascript"></script> {% block gameheaders %}{% endblock %} </head> <body> {% if user.is_authenticated %} <a href="/account/logout/">Logout</a> {% endif %} <div id="content"> {% block content %}{% endblock %} </div> </body> </html>
{% load static %} {% get_static_prefix as STATIC_PREFIX %} <html> <head> <title>Attempt</title> <link href="{{ STATIC_PREFIX }}css/sitewide.css" rel="stylesheet" type="text/css"> <script> var STATIC_PREFIX = "{{ STATIC_PREFIX }}"; </script> <script src="{{ STATIC_PREFIX }}js/lib/underscore.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/contracts.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/jquery-2.0.3.min.js" type="text/javascript"></script> {% block gameheaders %}{% endblock %} </head> <body> {% if user.is_authenticated %} <span>Logged in as <b>{{ username }}</b></span> <br/> <a href="/account/logout/">Logout</a> {% endif %} <div id="content"> {% block content %}{% endblock %} </div> </body> </html>
Add line showing what user is logged in
Add line showing what user is logged in
HTML
mit
quintenpalmer/attempt,quintenpalmer/attempt,quintenpalmer/attempt,quintenpalmer/attempt
html
## Code Before: {% load static %} {% get_static_prefix as STATIC_PREFIX %} <html> <head> <title>Attempt</title> <link href="{{ STATIC_PREFIX }}css/sitewide.css" rel="stylesheet" type="text/css"> <script> var STATIC_PREFIX = "{{ STATIC_PREFIX }}"; </script> <script src="{{ STATIC_PREFIX }}js/lib/underscore.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/contracts.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/jquery-2.0.3.min.js" type="text/javascript"></script> {% block gameheaders %}{% endblock %} </head> <body> {% if user.is_authenticated %} <a href="/account/logout/">Logout</a> {% endif %} <div id="content"> {% block content %}{% endblock %} </div> </body> </html> ## Instruction: Add line showing what user is logged in ## Code After: {% load static %} {% get_static_prefix as STATIC_PREFIX %} <html> <head> <title>Attempt</title> <link href="{{ STATIC_PREFIX }}css/sitewide.css" rel="stylesheet" type="text/css"> <script> var STATIC_PREFIX = "{{ STATIC_PREFIX }}"; </script> <script src="{{ STATIC_PREFIX }}js/lib/underscore.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/contracts.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/jquery-2.0.3.min.js" type="text/javascript"></script> {% block gameheaders %}{% endblock %} </head> <body> {% if user.is_authenticated %} <span>Logged in as <b>{{ username }}</b></span> <br/> <a href="/account/logout/">Logout</a> {% endif %} <div id="content"> {% block content %}{% endblock %} </div> </body> </html>
{% load static %} {% get_static_prefix as STATIC_PREFIX %} <html> <head> <title>Attempt</title> <link href="{{ STATIC_PREFIX }}css/sitewide.css" rel="stylesheet" type="text/css"> <script> var STATIC_PREFIX = "{{ STATIC_PREFIX }}"; </script> <script src="{{ STATIC_PREFIX }}js/lib/underscore.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/contracts.js" type="text/javascript"></script> <script src="{{ STATIC_PREFIX }}js/lib/jquery-2.0.3.min.js" type="text/javascript"></script> {% block gameheaders %}{% endblock %} </head> <body> {% if user.is_authenticated %} + <span>Logged in as <b>{{ username }}</b></span> + <br/> <a href="/account/logout/">Logout</a> {% endif %} <div id="content"> {% block content %}{% endblock %} </div> </body> </html>
2
0.086957
2
0
b766cb9b4ec7f6c8e86f3d6c098c47d06065c2fe
src/twitch-ext.js
src/twitch-ext.js
import Client from './state-client'; // Wrapper around global Twitch extension object. class Ext { static onAuthorized(cb) { if (window.Twitch) { window.Twitch.ext.onAuthorized(cb); } else { Client.fetchTestAuth(this.testAppID, this.testChannelID) .then((auth) => { cb(auth); }) .catch(() => { cb(); }); } } static onContext(cb) { if (window.Twitch) { window.Twitch.ext.onContext(cb); } } } export default Ext;
import Client from './state-client'; // Wrapper around global Twitch extension object. class Ext { static fetchTestAuth(cb) { Client.fetchTestAuth(this.testAppID, this.testChannelID) .then((auth) => { cb(auth); }) .catch(() => { cb(); }); } static onAuthorized(cb) { if (window.Twitch) { window.Twitch.ext.onAuthorized(cb); } else { Ext.fetchTestAuth(cb); setInterval(Ext.fetchTestAuth, 1000 * 60 * 25, cb); } } static onContext(cb) { if (window.Twitch) { window.Twitch.ext.onContext(cb); } } } export default Ext;
Refresh the test token every 25 minutes
Refresh the test token every 25 minutes
JavaScript
isc
muxy/extensions-js,muxy/extensions-js,muxy/extensions-js
javascript
## Code Before: import Client from './state-client'; // Wrapper around global Twitch extension object. class Ext { static onAuthorized(cb) { if (window.Twitch) { window.Twitch.ext.onAuthorized(cb); } else { Client.fetchTestAuth(this.testAppID, this.testChannelID) .then((auth) => { cb(auth); }) .catch(() => { cb(); }); } } static onContext(cb) { if (window.Twitch) { window.Twitch.ext.onContext(cb); } } } export default Ext; ## Instruction: Refresh the test token every 25 minutes ## Code After: import Client from './state-client'; // Wrapper around global Twitch extension object. class Ext { static fetchTestAuth(cb) { Client.fetchTestAuth(this.testAppID, this.testChannelID) .then((auth) => { cb(auth); }) .catch(() => { cb(); }); } static onAuthorized(cb) { if (window.Twitch) { window.Twitch.ext.onAuthorized(cb); } else { Ext.fetchTestAuth(cb); setInterval(Ext.fetchTestAuth, 1000 * 60 * 25, cb); } } static onContext(cb) { if (window.Twitch) { window.Twitch.ext.onContext(cb); } } } export default Ext;
import Client from './state-client'; // Wrapper around global Twitch extension object. class Ext { + static fetchTestAuth(cb) { + Client.fetchTestAuth(this.testAppID, this.testChannelID) + .then((auth) => { + cb(auth); + }) + .catch(() => { + cb(); + }); + } + static onAuthorized(cb) { if (window.Twitch) { window.Twitch.ext.onAuthorized(cb); } else { + Ext.fetchTestAuth(cb); + setInterval(Ext.fetchTestAuth, 1000 * 60 * 25, cb); - Client.fetchTestAuth(this.testAppID, this.testChannelID) - .then((auth) => { - cb(auth); - }) - .catch(() => { - cb(); - }); } } static onContext(cb) { if (window.Twitch) { window.Twitch.ext.onContext(cb); } } } export default Ext;
19
0.730769
12
7
9e30a64a4ed9513f820b69d3e6095e82938d56bb
travis/run.sh
travis/run.sh
cd spec/dummy export BUNDLE_GEMFILE=$PWD/Gemfile bundle exec cucumber bundle exec rspec
cd spec/dummy export BUNDLE_GEMFILE=$PWD/Gemfile bundle exec cucumber EXIT_1=$? bundle exec rspec EXIT_2=$? if [[ $EXIT_1 != 0 || $EXIT_2 != 0]]; then exit 1 fi
Exit code handling for travis
Exit code handling for travis
Shell
mit
javimey/capybara-ng,ldodds/capybara-ng,kikonen/capybara-ng,kikonen/capybara-ng,ldodds/capybara-ng,javimey/capybara-ng,ldodds/capybara-ng,kikonen/capybara-ng,ldodds/capybara-ng,javimey/capybara-ng,kikonen/capybara-ng,javimey/capybara-ng
shell
## Code Before: cd spec/dummy export BUNDLE_GEMFILE=$PWD/Gemfile bundle exec cucumber bundle exec rspec ## Instruction: Exit code handling for travis ## Code After: cd spec/dummy export BUNDLE_GEMFILE=$PWD/Gemfile bundle exec cucumber EXIT_1=$? bundle exec rspec EXIT_2=$? if [[ $EXIT_1 != 0 || $EXIT_2 != 0]]; then exit 1 fi
cd spec/dummy export BUNDLE_GEMFILE=$PWD/Gemfile bundle exec cucumber + EXIT_1=$? + bundle exec rspec + EXIT_2=$? + + if [[ $EXIT_1 != 0 || $EXIT_2 != 0]]; then + exit 1 + fi
7
1.4
7
0
6f633ec582fc063e583057fe18676b35be5b6d89
stories/setup.stories.js
stories/setup.stories.js
/** * External dependencies */ import { storiesOf } from '@storybook/react'; /** * Internal dependencies */ import Setup from '../assets/js/components/setup'; storiesOf( 'Setup', module ) .add( 'Step one', () => { global._googlesitekitLegacyData.setup.isSiteKitConnected = false; global._googlesitekitLegacyData.setup.isAuthenticated = false; global._googlesitekitLegacyData.setup.isVerified = false; global._googlesitekitLegacyData.setup.hasSearchConsoleProperty = false; global._googlesitekitLegacyData.permissions.canSetup = true; return ( <Setup /> ); } );
/** * External dependencies */ import { storiesOf } from '@storybook/react'; /** * Internal dependencies */ import Setup from '../assets/js/components/setup'; import { STORE_NAME as CORE_USER } from '../assets/js/googlesitekit/datastore/user/constants'; import { WithTestRegistry } from '../tests/js/utils'; storiesOf( 'Setup', module ) .add( 'Step one', () => { global._googlesitekitLegacyData.setup.isSiteKitConnected = false; global._googlesitekitLegacyData.setup.isAuthenticated = false; global._googlesitekitLegacyData.setup.isVerified = false; global._googlesitekitLegacyData.setup.hasSearchConsoleProperty = false; global._googlesitekitLegacyData.permissions.canSetup = true; const setupRegistry = ( { dispatch } ) => { dispatch( CORE_USER ).receiveGetAuthentication( { authenticated: false, requiredScopes: [], grantedScopes: [], } ); }; return ( <WithTestRegistry callback={ setupRegistry }> <Setup /> </WithTestRegistry> ); } );
Update Storybook for legacy setup accordingly after migrating Header component.
Update Storybook for legacy setup accordingly after migrating Header component.
JavaScript
apache-2.0
google/site-kit-wp,google/site-kit-wp,google/site-kit-wp,google/site-kit-wp
javascript
## Code Before: /** * External dependencies */ import { storiesOf } from '@storybook/react'; /** * Internal dependencies */ import Setup from '../assets/js/components/setup'; storiesOf( 'Setup', module ) .add( 'Step one', () => { global._googlesitekitLegacyData.setup.isSiteKitConnected = false; global._googlesitekitLegacyData.setup.isAuthenticated = false; global._googlesitekitLegacyData.setup.isVerified = false; global._googlesitekitLegacyData.setup.hasSearchConsoleProperty = false; global._googlesitekitLegacyData.permissions.canSetup = true; return ( <Setup /> ); } ); ## Instruction: Update Storybook for legacy setup accordingly after migrating Header component. ## Code After: /** * External dependencies */ import { storiesOf } from '@storybook/react'; /** * Internal dependencies */ import Setup from '../assets/js/components/setup'; import { STORE_NAME as CORE_USER } from '../assets/js/googlesitekit/datastore/user/constants'; import { WithTestRegistry } from '../tests/js/utils'; storiesOf( 'Setup', module ) .add( 'Step one', () => { global._googlesitekitLegacyData.setup.isSiteKitConnected = false; global._googlesitekitLegacyData.setup.isAuthenticated = false; global._googlesitekitLegacyData.setup.isVerified = false; global._googlesitekitLegacyData.setup.hasSearchConsoleProperty = false; global._googlesitekitLegacyData.permissions.canSetup = true; const setupRegistry = ( { dispatch } ) => { dispatch( CORE_USER ).receiveGetAuthentication( { authenticated: false, requiredScopes: [], grantedScopes: [], } ); }; return ( <WithTestRegistry callback={ setupRegistry }> <Setup /> </WithTestRegistry> ); } );
/** * External dependencies */ import { storiesOf } from '@storybook/react'; /** * Internal dependencies */ import Setup from '../assets/js/components/setup'; + import { STORE_NAME as CORE_USER } from '../assets/js/googlesitekit/datastore/user/constants'; + import { WithTestRegistry } from '../tests/js/utils'; storiesOf( 'Setup', module ) .add( 'Step one', () => { global._googlesitekitLegacyData.setup.isSiteKitConnected = false; global._googlesitekitLegacyData.setup.isAuthenticated = false; global._googlesitekitLegacyData.setup.isVerified = false; global._googlesitekitLegacyData.setup.hasSearchConsoleProperty = false; global._googlesitekitLegacyData.permissions.canSetup = true; - return ( <Setup /> ); + + const setupRegistry = ( { dispatch } ) => { + dispatch( CORE_USER ).receiveGetAuthentication( { + authenticated: false, + requiredScopes: [], + grantedScopes: [], + } ); + }; + + return ( + <WithTestRegistry callback={ setupRegistry }> + <Setup /> + </WithTestRegistry> + ); } );
17
0.894737
16
1
c8c9bc1bf66f43c9221e6d974a19f5574e1fb0cf
test/lat_lng_test.rb
test/lat_lng_test.rb
require 'test_helper' describe MapPrint::LatLng do let(:lat_lng) { MapPrint::LatLng.new(-29.980172, -52.959305) } it 'assigns latitude' do lat_lng.lat.must_equal -29.980172 end it 'assigns longitude' do lat_lng.lng.must_equal -52.959305 end describe '#get_slippy_map_tile_number' do let(:slippy_map_tile_number) { lat_lng.get_slippy_map_tile_number(8) } it 'returns x number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns y number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns x offset' do slippy_map_tile_number[:offset][:x].must_equal 0.3400497777777787 end it 'returns y offset' do slippy_map_tile_number[:offset][:y].must_equal 0.36446621522523515 end end end
require 'test_helper' describe MapPrint::LatLng do let(:lat_lng) { MapPrint::LatLng.new(-29.980172, -52.959305) } it 'assigns latitude' do lat_lng.lat.must_equal -29.980172 end it 'assigns longitude' do lat_lng.lng.must_equal -52.959305 end describe '#get_slippy_map_tile_number' do let(:slippy_map_tile_number) { lat_lng.get_slippy_map_tile_number(8) } it 'returns x number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns y number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns x offset' do slippy_map_tile_number[:offset][:x].round(12).must_equal 0.340049777778 end it 'returns y offset' do slippy_map_tile_number[:offset][:y].round(12).must_equal 0.364466215225 end end end
Make lat_lng test machine precision safe
Make lat_lng test machine precision safe
Ruby
mit
afast/map_print,afast/map_print
ruby
## Code Before: require 'test_helper' describe MapPrint::LatLng do let(:lat_lng) { MapPrint::LatLng.new(-29.980172, -52.959305) } it 'assigns latitude' do lat_lng.lat.must_equal -29.980172 end it 'assigns longitude' do lat_lng.lng.must_equal -52.959305 end describe '#get_slippy_map_tile_number' do let(:slippy_map_tile_number) { lat_lng.get_slippy_map_tile_number(8) } it 'returns x number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns y number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns x offset' do slippy_map_tile_number[:offset][:x].must_equal 0.3400497777777787 end it 'returns y offset' do slippy_map_tile_number[:offset][:y].must_equal 0.36446621522523515 end end end ## Instruction: Make lat_lng test machine precision safe ## Code After: require 'test_helper' describe MapPrint::LatLng do let(:lat_lng) { MapPrint::LatLng.new(-29.980172, -52.959305) } it 'assigns latitude' do lat_lng.lat.must_equal -29.980172 end it 'assigns longitude' do lat_lng.lng.must_equal -52.959305 end describe '#get_slippy_map_tile_number' do let(:slippy_map_tile_number) { lat_lng.get_slippy_map_tile_number(8) } it 'returns x number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns y number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns x offset' do slippy_map_tile_number[:offset][:x].round(12).must_equal 0.340049777778 end it 'returns y offset' do slippy_map_tile_number[:offset][:y].round(12).must_equal 0.364466215225 end end end
require 'test_helper' describe MapPrint::LatLng do let(:lat_lng) { MapPrint::LatLng.new(-29.980172, -52.959305) } it 'assigns latitude' do lat_lng.lat.must_equal -29.980172 end it 'assigns longitude' do lat_lng.lng.must_equal -52.959305 end describe '#get_slippy_map_tile_number' do let(:slippy_map_tile_number) { lat_lng.get_slippy_map_tile_number(8) } it 'returns x number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns y number' do slippy_map_tile_number[:x].must_equal 90 end it 'returns x offset' do - slippy_map_tile_number[:offset][:x].must_equal 0.3400497777777787 ? --- - + slippy_map_tile_number[:offset][:x].round(12).must_equal 0.340049777778 ? ++++++++++ end it 'returns y offset' do - slippy_map_tile_number[:offset][:y].must_equal 0.36446621522523515 ? ----- + slippy_map_tile_number[:offset][:y].round(12).must_equal 0.364466215225 ? ++++++++++ end end end
4
0.121212
2
2
1011d1707d6ab5211e062345bec46754bca24937
README.md
README.md
Bayeslite is a BQL database built on SQLite3. BQL is an extension to SQL that supports queries about the probable implications of data. ## Dependencies Bayeslite is written in Python 2.7, using the sqlite3 module with SQLite3 >=3.7.17, and does not itself depend on any external software beyond that. Bayeslite is most useful in conjunction with [Crosscat](https://github.com/mit-probabilistic-computing-project/crosscat), which provides a general-purpose metamodel. Running the automatic tests requires [pytest](http://pytest.org/) and Crosscat. Building the documentation requires [Sphinx](http://sphinx-doc.org/). ## Test To check that everything is working (requires pytest and Crosscat): ``` $ ./check.sh ``` ## Install To install system-wide, or into the current virtual environment: ``` $ python setup.py build $ python setup.py install ``` ## Use Import the `bayeslite` module. See the documentation for details on the Python API. ## Run To enter the interactive bayeslite shell, storing data in `foo.bdb`: ``` $ bayeslite foo.bdb ``` ## Documentation To build the documentation (requires sphinx): ``` $ make doc ``` The result will be placed in `build/doc`, with one subdirectory per output format. To build only one output format, e.g. HTML because you don't want to install TeX: ``` $ make html ```
Bayeslite is a BQL database built on SQLite3. BQL is an extension to SQL that supports queries about the probable implications of data. ## Dependencies Bayeslite is written in Python 2.7, using the sqlite3 module with SQLite3 >=3.7.17. Bayeslite is most useful in conjunction with [Crosscat](https://github.com/mit-probabilistic-computing-project/crosscat), which provides a general-purpose metamodel. Running the automatic tests requires [pytest](http://pytest.org/) and Crosscat. Building the documentation requires [Sphinx](http://sphinx-doc.org/). ## Test To check that everything is working (requires pytest and Crosscat): ``` $ ./check.sh ``` ## Install To install system-wide, or into the current virtual environment: ``` $ python setup.py build $ python setup.py install ``` ## Use Import the `bayeslite` module. See the documentation for details on the Python API. ## Run To enter the interactive bayeslite shell, storing data in `foo.bdb`: ``` $ bayeslite foo.bdb ``` ## Documentation To build the documentation (requires sphinx): ``` $ make doc ``` The result will be placed in `build/doc`, with one subdirectory per output format. To build only one output format, e.g. HTML because you don't want to install TeX: ``` $ make html ```
Stop claiming we don't depend on external software.
Stop claiming we don't depend on external software.
Markdown
apache-2.0
probcomp/bayeslite,probcomp/bayeslite
markdown
## Code Before: Bayeslite is a BQL database built on SQLite3. BQL is an extension to SQL that supports queries about the probable implications of data. ## Dependencies Bayeslite is written in Python 2.7, using the sqlite3 module with SQLite3 >=3.7.17, and does not itself depend on any external software beyond that. Bayeslite is most useful in conjunction with [Crosscat](https://github.com/mit-probabilistic-computing-project/crosscat), which provides a general-purpose metamodel. Running the automatic tests requires [pytest](http://pytest.org/) and Crosscat. Building the documentation requires [Sphinx](http://sphinx-doc.org/). ## Test To check that everything is working (requires pytest and Crosscat): ``` $ ./check.sh ``` ## Install To install system-wide, or into the current virtual environment: ``` $ python setup.py build $ python setup.py install ``` ## Use Import the `bayeslite` module. See the documentation for details on the Python API. ## Run To enter the interactive bayeslite shell, storing data in `foo.bdb`: ``` $ bayeslite foo.bdb ``` ## Documentation To build the documentation (requires sphinx): ``` $ make doc ``` The result will be placed in `build/doc`, with one subdirectory per output format. To build only one output format, e.g. HTML because you don't want to install TeX: ``` $ make html ``` ## Instruction: Stop claiming we don't depend on external software. ## Code After: Bayeslite is a BQL database built on SQLite3. BQL is an extension to SQL that supports queries about the probable implications of data. ## Dependencies Bayeslite is written in Python 2.7, using the sqlite3 module with SQLite3 >=3.7.17. Bayeslite is most useful in conjunction with [Crosscat](https://github.com/mit-probabilistic-computing-project/crosscat), which provides a general-purpose metamodel. Running the automatic tests requires [pytest](http://pytest.org/) and Crosscat. Building the documentation requires [Sphinx](http://sphinx-doc.org/). ## Test To check that everything is working (requires pytest and Crosscat): ``` $ ./check.sh ``` ## Install To install system-wide, or into the current virtual environment: ``` $ python setup.py build $ python setup.py install ``` ## Use Import the `bayeslite` module. See the documentation for details on the Python API. ## Run To enter the interactive bayeslite shell, storing data in `foo.bdb`: ``` $ bayeslite foo.bdb ``` ## Documentation To build the documentation (requires sphinx): ``` $ make doc ``` The result will be placed in `build/doc`, with one subdirectory per output format. To build only one output format, e.g. HTML because you don't want to install TeX: ``` $ make html ```
Bayeslite is a BQL database built on SQLite3. BQL is an extension to SQL that supports queries about the probable implications of data. ## Dependencies Bayeslite is written in Python 2.7, using the sqlite3 module with + SQLite3 >=3.7.17. - SQLite3 >=3.7.17, and does not itself depend on any external software - beyond that. Bayeslite is most useful in conjunction with [Crosscat](https://github.com/mit-probabilistic-computing-project/crosscat), which provides a general-purpose metamodel. Running the automatic tests requires [pytest](http://pytest.org/) and Crosscat. Building the documentation requires [Sphinx](http://sphinx-doc.org/). ## Test To check that everything is working (requires pytest and Crosscat): ``` $ ./check.sh ``` ## Install To install system-wide, or into the current virtual environment: ``` $ python setup.py build $ python setup.py install ``` ## Use Import the `bayeslite` module. See the documentation for details on the Python API. ## Run To enter the interactive bayeslite shell, storing data in `foo.bdb`: ``` $ bayeslite foo.bdb ``` ## Documentation To build the documentation (requires sphinx): ``` $ make doc ``` The result will be placed in `build/doc`, with one subdirectory per output format. To build only one output format, e.g. HTML because you don't want to install TeX: ``` $ make html ```
3
0.045455
1
2
41a8fa653709587e6e619a6ad005155547b68812
dist/extension.js
dist/extension.js
const vscode = require('vscode'); const THEME_CONFIGURATION_ID = 'markdown-preview-github-styles'; const THEME_CONFIGURATION_KEY = 'colorTheme'; const THEME_CONFIGURATION_VALUES = { 'auto': true, 'system': true, 'light': true, 'dark': true } const THEME_CONFIGURATION_AUTO = 'auto'; function getColorTheme() { const settings = vscode.workspace.getConfiguration(THEME_CONFIGURATION_ID, null); return validThemeConfigurationValue(settings.get(THEME_CONFIGURATION_KEY)) } function validThemeConfigurationValue(theme) { return !THEME_CONFIGURATION_VALUES[theme] ? THEME_CONFIGURATION_AUTO : theme; } exports.activate = function() { return { extendMarkdownIt(md) { return md.use(plugin); } }; } function plugin(md) { const render = md.renderer.render; md.renderer.render = function() { return `<div class="markdown-body markdown-${getColorTheme()}">\n${render.apply(md.renderer, arguments)}\n</div>`; }; return md; }
// @ts-check const vscode = require('vscode'); const THEME_CONFIGURATION_ID = 'markdown-preview-github-styles'; const THEME_CONFIGURATION_KEY = 'colorTheme'; const THEME_CONFIGURATION_VALUES = { 'auto': true, 'system': true, 'light': true, 'dark': true } const THEME_CONFIGURATION_AUTO = 'auto'; function getColorTheme() { const settings = vscode.workspace.getConfiguration(THEME_CONFIGURATION_ID, null); return validThemeConfigurationValue(settings.get(THEME_CONFIGURATION_KEY)) } function validThemeConfigurationValue(theme) { return !THEME_CONFIGURATION_VALUES[theme] ? THEME_CONFIGURATION_AUTO : theme; } exports.activate = function(/** @type {vscode.ExtensionContext} */ctx) { ctx.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => { if (e.affectsConfiguration(THEME_CONFIGURATION_ID)) { vscode.commands.executeCommand('markdown.preview.refresh'); } })); return { extendMarkdownIt(md) { return md.use(plugin); } }; } function plugin(md) { const render = md.renderer.render; md.renderer.render = function() { return `<div class="markdown-body markdown-${getColorTheme()}">\n${render.apply(md.renderer, arguments)}\n</div>`; }; return md; }
Update preview on setting change
Update preview on setting change
JavaScript
mit
mjbvz/vscode-github-markdown-preview-style
javascript
## Code Before: const vscode = require('vscode'); const THEME_CONFIGURATION_ID = 'markdown-preview-github-styles'; const THEME_CONFIGURATION_KEY = 'colorTheme'; const THEME_CONFIGURATION_VALUES = { 'auto': true, 'system': true, 'light': true, 'dark': true } const THEME_CONFIGURATION_AUTO = 'auto'; function getColorTheme() { const settings = vscode.workspace.getConfiguration(THEME_CONFIGURATION_ID, null); return validThemeConfigurationValue(settings.get(THEME_CONFIGURATION_KEY)) } function validThemeConfigurationValue(theme) { return !THEME_CONFIGURATION_VALUES[theme] ? THEME_CONFIGURATION_AUTO : theme; } exports.activate = function() { return { extendMarkdownIt(md) { return md.use(plugin); } }; } function plugin(md) { const render = md.renderer.render; md.renderer.render = function() { return `<div class="markdown-body markdown-${getColorTheme()}">\n${render.apply(md.renderer, arguments)}\n</div>`; }; return md; } ## Instruction: Update preview on setting change ## Code After: // @ts-check const vscode = require('vscode'); const THEME_CONFIGURATION_ID = 'markdown-preview-github-styles'; const THEME_CONFIGURATION_KEY = 'colorTheme'; const THEME_CONFIGURATION_VALUES = { 'auto': true, 'system': true, 'light': true, 'dark': true } const THEME_CONFIGURATION_AUTO = 'auto'; function getColorTheme() { const settings = vscode.workspace.getConfiguration(THEME_CONFIGURATION_ID, null); return validThemeConfigurationValue(settings.get(THEME_CONFIGURATION_KEY)) } function validThemeConfigurationValue(theme) { return !THEME_CONFIGURATION_VALUES[theme] ? THEME_CONFIGURATION_AUTO : theme; } exports.activate = function(/** @type {vscode.ExtensionContext} */ctx) { ctx.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => { if (e.affectsConfiguration(THEME_CONFIGURATION_ID)) { vscode.commands.executeCommand('markdown.preview.refresh'); } })); return { extendMarkdownIt(md) { return md.use(plugin); } }; } function plugin(md) { const render = md.renderer.render; md.renderer.render = function() { return `<div class="markdown-body markdown-${getColorTheme()}">\n${render.apply(md.renderer, arguments)}\n</div>`; }; return md; }
+ // @ts-check + const vscode = require('vscode'); const THEME_CONFIGURATION_ID = 'markdown-preview-github-styles'; const THEME_CONFIGURATION_KEY = 'colorTheme'; const THEME_CONFIGURATION_VALUES = { 'auto': true, 'system': true, 'light': true, 'dark': true } const THEME_CONFIGURATION_AUTO = 'auto'; function getColorTheme() { const settings = vscode.workspace.getConfiguration(THEME_CONFIGURATION_ID, null); return validThemeConfigurationValue(settings.get(THEME_CONFIGURATION_KEY)) } function validThemeConfigurationValue(theme) { return !THEME_CONFIGURATION_VALUES[theme] ? THEME_CONFIGURATION_AUTO : theme; } - exports.activate = function() { + exports.activate = function(/** @type {vscode.ExtensionContext} */ctx) { + ctx.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(THEME_CONFIGURATION_ID)) { + vscode.commands.executeCommand('markdown.preview.refresh'); + } + })); + return { extendMarkdownIt(md) { return md.use(plugin); } }; } function plugin(md) { const render = md.renderer.render; md.renderer.render = function() { return `<div class="markdown-body markdown-${getColorTheme()}">\n${render.apply(md.renderer, arguments)}\n</div>`; }; return md; }
10
0.25641
9
1
8e5303bb1f6188e3f929b9e6b47795aaee2838c0
src/components/search_results/SearchResults.js
src/components/search_results/SearchResults.js
import React from 'react' import ImdbResultsContainer from './ImdbResultsContainer' const SearchResults = ({searchResults}) => { if (searchResults.searchMovies.error) { return ( <h2>{searchResults.searchMovies.error.data}</h2> ) } else { return ( <div className="row"> <div className="col-lg-12"> {/* { partial } */} <div className="row"> <div className="bs-callout bs-callout-warning"> <h4>From MMDB</h4> </div> {/* <table> <tbody> {searchResults.searchMovies.localMovies.map(movie => { if (movie.name) { return ( <tr key={movie._id.$oid}> <td>{movie.name}</td> <td>{movie.year}</td> </tr> ) } return '' })} </tbody> </table> */} </div> {/* <ImdbResultsContainer movies={ searchResults.searchMovies.imdbMovies }/> */} <ImdbResultsContainer/> {/* <div className="card" style={{width: '20rem'}}> <img className="card-img-top" src="..." alt="Card cap" /> <div className="card-block"> <h4 className="card-title">Card title</h4> <p className="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <a href="#" className="btn btn-primary">Go somewhere</a> </div> </div> */} </div> </div> ) } } export default SearchResults;
import React from 'react' import ImdbResultsContainer from './ImdbResultsContainer' const SearchResults = ({searchResults}) => { if (searchResults.searchMovies.error) { return ( <h2>{searchResults.searchMovies.error.data}</h2> ) } else { return ( <div> <div className="bs-callout bs-callout-warning"> <h4>From MMDB</h4> </div> <ImdbResultsContainer/> </div> ) } } export default SearchResults;
Remove unused comments, fix component width
Remove unused comments, fix component width
JavaScript
mit
landrysoules/mmdb_front_react,landrysoules/mmdb_front_react
javascript
## Code Before: import React from 'react' import ImdbResultsContainer from './ImdbResultsContainer' const SearchResults = ({searchResults}) => { if (searchResults.searchMovies.error) { return ( <h2>{searchResults.searchMovies.error.data}</h2> ) } else { return ( <div className="row"> <div className="col-lg-12"> {/* { partial } */} <div className="row"> <div className="bs-callout bs-callout-warning"> <h4>From MMDB</h4> </div> {/* <table> <tbody> {searchResults.searchMovies.localMovies.map(movie => { if (movie.name) { return ( <tr key={movie._id.$oid}> <td>{movie.name}</td> <td>{movie.year}</td> </tr> ) } return '' })} </tbody> </table> */} </div> {/* <ImdbResultsContainer movies={ searchResults.searchMovies.imdbMovies }/> */} <ImdbResultsContainer/> {/* <div className="card" style={{width: '20rem'}}> <img className="card-img-top" src="..." alt="Card cap" /> <div className="card-block"> <h4 className="card-title">Card title</h4> <p className="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <a href="#" className="btn btn-primary">Go somewhere</a> </div> </div> */} </div> </div> ) } } export default SearchResults; ## Instruction: Remove unused comments, fix component width ## Code After: import React from 'react' import ImdbResultsContainer from './ImdbResultsContainer' const SearchResults = ({searchResults}) => { if (searchResults.searchMovies.error) { return ( <h2>{searchResults.searchMovies.error.data}</h2> ) } else { return ( <div> <div className="bs-callout bs-callout-warning"> <h4>From MMDB</h4> </div> <ImdbResultsContainer/> </div> ) } } export default SearchResults;
import React from 'react' import ImdbResultsContainer from './ImdbResultsContainer' const SearchResults = ({searchResults}) => { if (searchResults.searchMovies.error) { return ( <h2>{searchResults.searchMovies.error.data}</h2> ) } else { return ( + <div> - <div className="row"> - <div className="col-lg-12"> - {/* { partial } */} - <div className="row"> <div className="bs-callout bs-callout-warning"> <h4>From MMDB</h4> </div> - {/* <table> - <tbody> - {searchResults.searchMovies.localMovies.map(movie => { - if (movie.name) { - return ( - <tr key={movie._id.$oid}> - <td>{movie.name}</td> - <td>{movie.year}</td> - </tr> - ) - } - return '' - })} - </tbody> - </table> */} - </div> - {/* <ImdbResultsContainer movies={ searchResults.searchMovies.imdbMovies }/> */} <ImdbResultsContainer/> - {/* <div className="card" style={{width: '20rem'}}> - <img className="card-img-top" src="..." alt="Card cap" /> - <div className="card-block"> - <h4 className="card-title">Card title</h4> - <p className="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> - <a href="#" className="btn btn-primary">Go somewhere</a> - </div> - </div> */} - </div> </div> ) } } export default SearchResults;
31
0.607843
1
30
562ceedfefdc0e2b9335488cf537ddc3bd8c897d
.github/workflows/python-package.yml
.github/workflows/python-package.yml
name: Python package on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: [2.7,3.5,3.6,3.7, 3.8,3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | sudo apt-get update -qq sudo apt-get install -qq swig python-dev libxml2-dev libxmlsec1-dev make install-req make install-test - name: Test run: | make pytest make pycodestyle make flake8
name: Python package on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: [2.7,3.5,3.6,3.7, 3.8,3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - uses: actions/cache@v2 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} restore-keys: | ${{ runner.os }}-pip- - name: Install dependencies run: | sudo apt-get update -qq sudo apt-get install -qq swig python-dev libxml2-dev libxmlsec1-dev make install-req make install-test - name: Test run: | make pytest make pycodestyle make flake8
Add Pip cache to CI
Add Pip cache to CI
YAML
mit
onelogin/python3-saml,onelogin/python3-saml
yaml
## Code Before: name: Python package on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: [2.7,3.5,3.6,3.7, 3.8,3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | sudo apt-get update -qq sudo apt-get install -qq swig python-dev libxml2-dev libxmlsec1-dev make install-req make install-test - name: Test run: | make pytest make pycodestyle make flake8 ## Instruction: Add Pip cache to CI ## Code After: name: Python package on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: [2.7,3.5,3.6,3.7, 3.8,3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - uses: actions/cache@v2 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} restore-keys: | ${{ runner.os }}-pip- - name: Install dependencies run: | sudo apt-get update -qq sudo apt-get install -qq swig python-dev libxml2-dev libxmlsec1-dev make install-req make install-test - name: Test run: | make pytest make pycodestyle make flake8
name: Python package on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: [2.7,3.5,3.6,3.7, 3.8,3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ runner.os }}-pip- - name: Install dependencies run: | sudo apt-get update -qq sudo apt-get install -qq swig python-dev libxml2-dev libxmlsec1-dev make install-req make install-test - - name: Test run: | make pytest make pycodestyle make flake8
8
0.242424
6
2
015425e589870e8c751e9024bbd6f9b66bce9734
addon/mixins/sl-input-based.js
addon/mixins/sl-input-based.js
import Ember from 'ember'; /** * @module mixins * @class sl-input-based */ export default Ember.Mixin.create({ /** * Class name bindings for the component * * @property {Array} classNameBindings */ classNameBindings: [ 'disabled', 'optional', 'readonly', 'required' ], /** * Whether the input-based component should be disabled * * The internal input element should be passed this attribute as a property. * * @property {boolean} disabled * @default false */ disabled: false, /** * Whether the input-based component should be displayed as optional * * @property {boolean} optional * @default false */ optional: false, /** * Whether the input-based component is readonly or not * * The internal input element should be passed this attribute as a property. * * @property {boolean} readonly * @default false */ readonly: false, /** * Whether the input-based component is required * * @property {boolean} required * @default false */ required: false });
import Ember from 'ember'; /** * @module mixins * @class sl-input-based */ export default Ember.Mixin.create({ // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- // Attributes /** * Class name bindings for the component * * @property {Ember.Array} classNameBindings */ classNameBindings: [ 'disabled', 'optional', 'readonly', 'required' ], // ------------------------------------------------------------------------- // Actions // ------------------------------------------------------------------------- // Events // ------------------------------------------------------------------------- // Properties /** * Whether the input-based component should be disabled * * The internal input element should be passed this attribute as a property. * * @property {boolean} disabled * @default false */ disabled: false, /** * Whether the input-based component should be displayed as optional * * @property {boolean} optional * @default false */ optional: false, /** * Whether the input-based component is readonly or not * * The internal input element should be passed this attribute as a property. * * @property {boolean} readonly * @default false */ readonly: false, /** * Whether the input-based component is required * * @property {boolean} required * @default false */ required: false // ------------------------------------------------------------------------- // Observers // ------------------------------------------------------------------------- // Methods });
Refactor to follow coding guidelines
Refactor to follow coding guidelines
JavaScript
mit
Suven/sl-ember-components,softlayer/sl-ember-components,azizpunjani/sl-ember-components,erangeles/sl-ember-components,juwara0/sl-ember-components,erangeles/sl-ember-components,SpikedKira/sl-ember-components,azizpunjani/sl-ember-components,notmessenger/sl-ember-components,alxyuu/sl-ember-components,notmessenger/sl-ember-components,theoshu/sl-ember-components,softlayer/sl-ember-components,Suven/sl-ember-components,alxyuu/sl-ember-components,theoshu/sl-ember-components,jonathandavidson/sl-ember-components,SpikedKira/sl-ember-components,juwara0/sl-ember-components
javascript
## Code Before: import Ember from 'ember'; /** * @module mixins * @class sl-input-based */ export default Ember.Mixin.create({ /** * Class name bindings for the component * * @property {Array} classNameBindings */ classNameBindings: [ 'disabled', 'optional', 'readonly', 'required' ], /** * Whether the input-based component should be disabled * * The internal input element should be passed this attribute as a property. * * @property {boolean} disabled * @default false */ disabled: false, /** * Whether the input-based component should be displayed as optional * * @property {boolean} optional * @default false */ optional: false, /** * Whether the input-based component is readonly or not * * The internal input element should be passed this attribute as a property. * * @property {boolean} readonly * @default false */ readonly: false, /** * Whether the input-based component is required * * @property {boolean} required * @default false */ required: false }); ## Instruction: Refactor to follow coding guidelines ## Code After: import Ember from 'ember'; /** * @module mixins * @class sl-input-based */ export default Ember.Mixin.create({ // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- // Attributes /** * Class name bindings for the component * * @property {Ember.Array} classNameBindings */ classNameBindings: [ 'disabled', 'optional', 'readonly', 'required' ], // ------------------------------------------------------------------------- // Actions // ------------------------------------------------------------------------- // Events // ------------------------------------------------------------------------- // Properties /** * Whether the input-based component should be disabled * * The internal input element should be passed this attribute as a property. * * @property {boolean} disabled * @default false */ disabled: false, /** * Whether the input-based component should be displayed as optional * * @property {boolean} optional * @default false */ optional: false, /** * Whether the input-based component is readonly or not * * The internal input element should be passed this attribute as a property. * * @property {boolean} readonly * @default false */ readonly: false, /** * Whether the input-based component is required * * @property {boolean} required * @default false */ required: false // ------------------------------------------------------------------------- // Observers // ------------------------------------------------------------------------- // Methods });
import Ember from 'ember'; /** * @module mixins - * @class sl-input-based + * @class sl-input-based ? + */ export default Ember.Mixin.create({ + + // ------------------------------------------------------------------------- + // Dependencies + + // ------------------------------------------------------------------------- + // Attributes /** * Class name bindings for the component * - * @property {Array} classNameBindings + * @property {Ember.Array} classNameBindings ? ++++++ */ classNameBindings: [ 'disabled', 'optional', 'readonly', 'required' ], + + // ------------------------------------------------------------------------- + // Actions + + // ------------------------------------------------------------------------- + // Events + + // ------------------------------------------------------------------------- + // Properties /** * Whether the input-based component should be disabled * * The internal input element should be passed this attribute as a property. * * @property {boolean} disabled - * @default false + * @default false ? + */ disabled: false, /** * Whether the input-based component should be displayed as optional * * @property {boolean} optional - * @default false + * @default false ? + */ optional: false, /** * Whether the input-based component is readonly or not * * The internal input element should be passed this attribute as a property. * * @property {boolean} readonly - * @default false + * @default false ? + */ readonly: false, /** * Whether the input-based component is required * * @property {boolean} required - * @default false + * @default false ? + */ required: false + // ------------------------------------------------------------------------- + // Observers + + // ------------------------------------------------------------------------- + // Methods + });
33
0.634615
27
6
90213ab017ec2ec9a7fdbf01e628800c80548264
src/Oro/Bundle/UIBundle/Resources/public/blank/scss/components/vertical-container.scss
src/Oro/Bundle/UIBundle/Resources/public/blank/scss/components/vertical-container.scss
.vertical-container { display: flex; justify-content: center; align-items: center; height: 100%; &__content { width: 100%; } }
.vertical-container { height: 100%; text-align: center; font-size: 0; &::before, &__content { display: inline-block; } &::before { height: 100%; vertical-align: middle; content: ''; } &__content { width: 100%; font-size: $base-font-size; text-align: left; vertical-align: middle; } }
Fix mobile / tablet version for 5 pages - fix vertical container styles
BB-5290: Fix mobile / tablet version for 5 pages - fix vertical container styles
SCSS
mit
orocrm/platform,orocrm/platform,Djamy/platform,Djamy/platform,geoffroycochard/platform,geoffroycochard/platform,geoffroycochard/platform,orocrm/platform,Djamy/platform
scss
## Code Before: .vertical-container { display: flex; justify-content: center; align-items: center; height: 100%; &__content { width: 100%; } } ## Instruction: BB-5290: Fix mobile / tablet version for 5 pages - fix vertical container styles ## Code After: .vertical-container { height: 100%; text-align: center; font-size: 0; &::before, &__content { display: inline-block; } &::before { height: 100%; vertical-align: middle; content: ''; } &__content { width: 100%; font-size: $base-font-size; text-align: left; vertical-align: middle; } }
.vertical-container { - display: flex; - justify-content: center; - align-items: center; height: 100%; + + text-align: center; + font-size: 0; + + &::before, + &__content { + display: inline-block; + } + + &::before { + height: 100%; + + vertical-align: middle; + + content: ''; + } &__content { width: 100%; + + font-size: $base-font-size; + text-align: left; + + vertical-align: middle; } }
24
2.4
21
3
b328d6d95f5642afba8b6ee80b3351a3bf71a0af
better-stacks.js
better-stacks.js
try { require('source-map-support-2/register') } catch (_) {} // Async stacks. try { require('trace') } catch (_) {} // Removes node_modules and internal modules. try { var sep = require('path').sep var path = __dirname + sep + 'node_modules' + sep require('stack-chain').filter.attach(function (_, frames) { var filtered = frames.filter(function (frame) { var name = frame && frame.getFileName() return ( // has a filename name && // contains a separator (no internal modules) name.indexOf(sep) !== -1 && // does not start with the current path followed by node_modules. name.lastIndexOf(path, 0) !== 0 ) }) // depd (used amongst other by express requires at least 3 frames // in the stack. return filtered.length > 2 ? filtered : frames }) } catch (_) {}
Error.stackTraceLimit = 100 try { require('source-map-support-2/register') } catch (_) {} // Async stacks. try { require('trace') } catch (_) {} // Removes node_modules and internal modules. try { var sep = require('path').sep var path = __dirname + sep + 'node_modules' + sep require('stack-chain').filter.attach(function (_, frames) { var filtered = frames.filter(function (frame) { var name = frame && frame.getFileName() return ( // has a filename name && // contains a separator (no internal modules) name.indexOf(sep) !== -1 && // does not start with the current path followed by node_modules. name.lastIndexOf(path, 0) !== 0 ) }) // depd (used amongst other by express requires at least 3 frames // in the stack. return filtered.length > 2 ? filtered : frames }) } catch (_) {}
Augment stack traces limit to 100.
Augment stack traces limit to 100.
JavaScript
agpl-3.0
vatesfr/xo-web,lmcro/xo-web,vatesfr/xo-web,lmcro/xo-web,lmcro/xo-web
javascript
## Code Before: try { require('source-map-support-2/register') } catch (_) {} // Async stacks. try { require('trace') } catch (_) {} // Removes node_modules and internal modules. try { var sep = require('path').sep var path = __dirname + sep + 'node_modules' + sep require('stack-chain').filter.attach(function (_, frames) { var filtered = frames.filter(function (frame) { var name = frame && frame.getFileName() return ( // has a filename name && // contains a separator (no internal modules) name.indexOf(sep) !== -1 && // does not start with the current path followed by node_modules. name.lastIndexOf(path, 0) !== 0 ) }) // depd (used amongst other by express requires at least 3 frames // in the stack. return filtered.length > 2 ? filtered : frames }) } catch (_) {} ## Instruction: Augment stack traces limit to 100. ## Code After: Error.stackTraceLimit = 100 try { require('source-map-support-2/register') } catch (_) {} // Async stacks. try { require('trace') } catch (_) {} // Removes node_modules and internal modules. try { var sep = require('path').sep var path = __dirname + sep + 'node_modules' + sep require('stack-chain').filter.attach(function (_, frames) { var filtered = frames.filter(function (frame) { var name = frame && frame.getFileName() return ( // has a filename name && // contains a separator (no internal modules) name.indexOf(sep) !== -1 && // does not start with the current path followed by node_modules. name.lastIndexOf(path, 0) !== 0 ) }) // depd (used amongst other by express requires at least 3 frames // in the stack. return filtered.length > 2 ? filtered : frames }) } catch (_) {}
+ Error.stackTraceLimit = 100 + try { require('source-map-support-2/register') } catch (_) {} // Async stacks. try { require('trace') } catch (_) {} // Removes node_modules and internal modules. try { var sep = require('path').sep var path = __dirname + sep + 'node_modules' + sep require('stack-chain').filter.attach(function (_, frames) { var filtered = frames.filter(function (frame) { var name = frame && frame.getFileName() return ( // has a filename name && // contains a separator (no internal modules) name.indexOf(sep) !== -1 && // does not start with the current path followed by node_modules. name.lastIndexOf(path, 0) !== 0 ) }) // depd (used amongst other by express requires at least 3 frames // in the stack. return filtered.length > 2 ? filtered : frames }) } catch (_) {}
2
0.060606
2
0
6443e572719e74ce7479fa20c4c4e51eb6832da3
PhantomJS/runner.js
PhantomJS/runner.js
var HTMLCS_RUNNER = new function() { this.run = function(standard) { var self = this; // At the moment, it passes the whole DOM document. HTMLCS.process(standard, document, function() { var messages = HTMLCS.getMessages(); var length = messages.length; for (var i = 0; i < length; i++) { self.output(messages[i]); } console.log('done'); }); }; this.output = function(msg) { // Simple output for now. console.log(msg.type + '|' + msg.code + '|' + msg.msg); }; };
var HTMLCS_RUNNER = new function() { this.run = function(standard) { var self = this; // At the moment, it passes the whole DOM document. HTMLCS.process(standard, document, function() { var messages = HTMLCS.getMessages(); var length = messages.length; for (var i = 0; i < length; i++) { self.output(messages[i]); } console.log('done'); }); }; this.output = function(msg) { // Simple output for now. var typeName = 'UNKNOWN'; switch (msg.type) { case HTMLCS.ERROR: typeName = 'ERROR'; break; case HTMLCS.WARNING: typeName = 'WARNING'; break; case HTMLCS.NOTICE: typeName = 'NOTICE'; break; }//end switch console.log(typeName + '|' + msg.code + '|' + msg.msg); }; };
Replace level 1,2,3 with ERROR, WARNING, NOTICE.
Replace level 1,2,3 with ERROR, WARNING, NOTICE.
JavaScript
bsd-3-clause
squizlabs/HTML_CodeSniffer,squizlabs/HTML_CodeSniffer,squizlabs/HTML_CodeSniffer,telesma/HTML_CodeSniffer,adelevie/HTML_CodeSniffer,ironikart/HTML_CodeSniffer,daam/HTML_CodeSniffer,daam/HTML_CodeSniffer,adelevie/HTML_CodeSniffer,ironikart/HTML_CodeSniffer,ironikart/HTML_CodeSniffer,telesma/HTML_CodeSniffer,telesma/HTML_CodeSniffer,lwright-sq/HTML_CodeSniffer,lwright-sq/HTML_CodeSniffer,daam/HTML_CodeSniffer,adelevie/HTML_CodeSniffer,lwright-sq/HTML_CodeSniffer
javascript
## Code Before: var HTMLCS_RUNNER = new function() { this.run = function(standard) { var self = this; // At the moment, it passes the whole DOM document. HTMLCS.process(standard, document, function() { var messages = HTMLCS.getMessages(); var length = messages.length; for (var i = 0; i < length; i++) { self.output(messages[i]); } console.log('done'); }); }; this.output = function(msg) { // Simple output for now. console.log(msg.type + '|' + msg.code + '|' + msg.msg); }; }; ## Instruction: Replace level 1,2,3 with ERROR, WARNING, NOTICE. ## Code After: var HTMLCS_RUNNER = new function() { this.run = function(standard) { var self = this; // At the moment, it passes the whole DOM document. HTMLCS.process(standard, document, function() { var messages = HTMLCS.getMessages(); var length = messages.length; for (var i = 0; i < length; i++) { self.output(messages[i]); } console.log('done'); }); }; this.output = function(msg) { // Simple output for now. var typeName = 'UNKNOWN'; switch (msg.type) { case HTMLCS.ERROR: typeName = 'ERROR'; break; case HTMLCS.WARNING: typeName = 'WARNING'; break; case HTMLCS.NOTICE: typeName = 'NOTICE'; break; }//end switch console.log(typeName + '|' + msg.code + '|' + msg.msg); }; };
var HTMLCS_RUNNER = new function() { this.run = function(standard) { var self = this; // At the moment, it passes the whole DOM document. HTMLCS.process(standard, document, function() { var messages = HTMLCS.getMessages(); var length = messages.length; for (var i = 0; i < length; i++) { self.output(messages[i]); } console.log('done'); }); }; this.output = function(msg) { // Simple output for now. + var typeName = 'UNKNOWN'; + switch (msg.type) { + case HTMLCS.ERROR: + typeName = 'ERROR'; + break; + + case HTMLCS.WARNING: + typeName = 'WARNING'; + break; + + case HTMLCS.NOTICE: + typeName = 'NOTICE'; + break; + }//end switch + - console.log(msg.type + '|' + msg.code + '|' + msg.msg); ? ---- + console.log(typeName + '|' + msg.code + '|' + msg.msg); ? ++++ }; };
17
0.772727
16
1
20de9e04059337e59faf3aaa801c4f90527973e6
test/powershell/Select-XML.Tests.ps1
test/powershell/Select-XML.Tests.ps1
Describe "Select-XML DRT Unit Tests" -Tags DRT{ $tmpDirectory = $TestDrive $testfilename = "testfile.xml" $testfile = Join-Path -Path $tmpDirectory -ChildPath $testfilename It "Select-XML should work"{ $xmlContent = @" <?xml version ="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="CHILDREN"> <title lang="english">Harry Potter</title> <price>30.00</price> </book> <book category="WEB"> <title lang="english">Learning XML</title> <price>25.00</price> </book> </bookstore> "@ $xmlContent >$testfile try { $results=Select-XML -Path $testfile -XPath "/bookstore/book/title" $results.Count | Should Be 2 $results[0].Node."#text" | Should Be "Harry Potter" $results[1].Node."#text" | Should Be "Learning XML" } finally { rm $testfile } } }
Describe "Select-XML DRT Unit Tests" -Tags DRT{ BeforeAll { $testfile = Join-Path -Path $TestDrive -ChildPath "testfile.xml" $xmlContent = @" <?xml version ="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="CHILDREN"> <title lang="english">Harry Potter</title> <price>30.00</price> </book> <book category="WEB"> <title lang="english">Learning XML</title> <price>25.00</price> </book> </bookstore> "@ $xmlContent >$testfile } AfterAll { rm $testfile } It "Select-XML should work"{ $results = Select-XML -Path $testfile -XPath "/bookstore/book/title" $results.Count | Should Be 2 $results[0].Node."#text" | Should Be "Harry Potter" $results[1].Node."#text" | Should Be "Learning XML" } }
Update fix based on comments for Select-XML Pester Test
Update fix based on comments for Select-XML Pester Test
PowerShell
mit
bmanikm/PowerShell,JamesWTruher/PowerShell-1,kmosher/PowerShell,kmosher/PowerShell,bingbing8/PowerShell,bingbing8/PowerShell,bingbing8/PowerShell,JamesWTruher/PowerShell-1,bingbing8/PowerShell,bmanikm/PowerShell,kmosher/PowerShell,kmosher/PowerShell,KarolKaczmarek/PowerShell,daxian-dbw/PowerShell,jsoref/PowerShell,bmanikm/PowerShell,TravisEz13/PowerShell,jsoref/PowerShell,KarolKaczmarek/PowerShell,KarolKaczmarek/PowerShell,PaulHigin/PowerShell,TravisEz13/PowerShell,kmosher/PowerShell,daxian-dbw/PowerShell,KarolKaczmarek/PowerShell,JamesWTruher/PowerShell-1,jsoref/PowerShell,bmanikm/PowerShell,JamesWTruher/PowerShell-1,jsoref/PowerShell,PaulHigin/PowerShell,PaulHigin/PowerShell,daxian-dbw/PowerShell,daxian-dbw/PowerShell,TravisEz13/PowerShell,PaulHigin/PowerShell,bingbing8/PowerShell,TravisEz13/PowerShell,bmanikm/PowerShell,jsoref/PowerShell,KarolKaczmarek/PowerShell
powershell
## Code Before: Describe "Select-XML DRT Unit Tests" -Tags DRT{ $tmpDirectory = $TestDrive $testfilename = "testfile.xml" $testfile = Join-Path -Path $tmpDirectory -ChildPath $testfilename It "Select-XML should work"{ $xmlContent = @" <?xml version ="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="CHILDREN"> <title lang="english">Harry Potter</title> <price>30.00</price> </book> <book category="WEB"> <title lang="english">Learning XML</title> <price>25.00</price> </book> </bookstore> "@ $xmlContent >$testfile try { $results=Select-XML -Path $testfile -XPath "/bookstore/book/title" $results.Count | Should Be 2 $results[0].Node."#text" | Should Be "Harry Potter" $results[1].Node."#text" | Should Be "Learning XML" } finally { rm $testfile } } } ## Instruction: Update fix based on comments for Select-XML Pester Test ## Code After: Describe "Select-XML DRT Unit Tests" -Tags DRT{ BeforeAll { $testfile = Join-Path -Path $TestDrive -ChildPath "testfile.xml" $xmlContent = @" <?xml version ="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="CHILDREN"> <title lang="english">Harry Potter</title> <price>30.00</price> </book> <book category="WEB"> <title lang="english">Learning XML</title> <price>25.00</price> </book> </bookstore> "@ $xmlContent >$testfile } AfterAll { rm $testfile } It "Select-XML should work"{ $results = Select-XML -Path $testfile -XPath "/bookstore/book/title" $results.Count | Should Be 2 $results[0].Node."#text" | Should Be "Harry Potter" $results[1].Node."#text" | Should Be "Learning XML" } }
Describe "Select-XML DRT Unit Tests" -Tags DRT{ - $tmpDirectory = $TestDrive - $testfilename = "testfile.xml" - $testfile = Join-Path -Path $tmpDirectory -ChildPath $testfilename - It "Select-XML should work"{ + BeforeAll { + $testfile = Join-Path -Path $TestDrive -ChildPath "testfile.xml" $xmlContent = @" <?xml version ="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="CHILDREN"> <title lang="english">Harry Potter</title> <price>30.00</price> </book> <book category="WEB"> <title lang="english">Learning XML</title> <price>25.00</price> </book> </bookstore> "@ $xmlContent >$testfile - try - { + } + AfterAll { + rm $testfile + } + + It "Select-XML should work"{ - $results=Select-XML -Path $testfile -XPath "/bookstore/book/title" ? - + $results = Select-XML -Path $testfile -XPath "/bookstore/book/title" ? + + - $results.Count | Should Be 2 ? - + $results.Count | Should Be 2 - $results[0].Node."#text" | Should Be "Harry Potter" ? - + $results[0].Node."#text" | Should Be "Harry Potter" - $results[1].Node."#text" | Should Be "Learning XML" ? - + $results[1].Node."#text" | Should Be "Learning XML" - } - finally - { - rm $testfile - } } }
27
0.794118
12
15
a53eebe976b87b94ddf9d528a457033511c796c9
src/app/components/docedit/tabs/docedit-conflicts-tab.scss
src/app/components/docedit/tabs/docedit-conflicts-tab.scss
docedit-conflicts-tab { #conflict-resolver { height: calc(100vh - 161px); overflow-x: hidden; overflow-y: auto; h3 { user-select: none; } .conflict-resolver-field { padding: 10px 5px; user-select: none; } .radio-button-field { padding-bottom: 5px; padding-left: 20px; } .winning-side { color: #1b9519; } .losing-side { color: #e00000; } #solve-conflict-button { margin-top: 20px; margin-bottom: 10px; } .row { margin: inherit; } } loading-icon { position: absolute; top: 70px; left: -15px; width: 100%; } }
docedit-conflicts-tab { #conflict-resolver { height: calc(100vh - 161px); overflow-x: hidden; overflow-y: auto; h3 { user-select: none; } .conflict-resolver-field { padding: 10px 5px; user-select: none; } .radio-button-field { padding-left: 20px; } .winning-side { color: #1b9519; } .losing-side { color: #e00000; } #solve-conflict-button { margin-top: 20px; margin-bottom: 10px; } .row { margin: inherit; } } loading-icon { position: absolute; top: 70px; left: -15px; width: 100%; } }
Adjust radio button position in conflicts resolver
Adjust radio button position in conflicts resolver
SCSS
apache-2.0
codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client
scss
## Code Before: docedit-conflicts-tab { #conflict-resolver { height: calc(100vh - 161px); overflow-x: hidden; overflow-y: auto; h3 { user-select: none; } .conflict-resolver-field { padding: 10px 5px; user-select: none; } .radio-button-field { padding-bottom: 5px; padding-left: 20px; } .winning-side { color: #1b9519; } .losing-side { color: #e00000; } #solve-conflict-button { margin-top: 20px; margin-bottom: 10px; } .row { margin: inherit; } } loading-icon { position: absolute; top: 70px; left: -15px; width: 100%; } } ## Instruction: Adjust radio button position in conflicts resolver ## Code After: docedit-conflicts-tab { #conflict-resolver { height: calc(100vh - 161px); overflow-x: hidden; overflow-y: auto; h3 { user-select: none; } .conflict-resolver-field { padding: 10px 5px; user-select: none; } .radio-button-field { padding-left: 20px; } .winning-side { color: #1b9519; } .losing-side { color: #e00000; } #solve-conflict-button { margin-top: 20px; margin-bottom: 10px; } .row { margin: inherit; } } loading-icon { position: absolute; top: 70px; left: -15px; width: 100%; } }
docedit-conflicts-tab { #conflict-resolver { height: calc(100vh - 161px); overflow-x: hidden; overflow-y: auto; h3 { user-select: none; } .conflict-resolver-field { padding: 10px 5px; user-select: none; } .radio-button-field { - padding-bottom: 5px; padding-left: 20px; } .winning-side { color: #1b9519; } .losing-side { color: #e00000; } #solve-conflict-button { margin-top: 20px; margin-bottom: 10px; } .row { margin: inherit; } } loading-icon { position: absolute; top: 70px; left: -15px; width: 100%; } }
1
0.022222
0
1
755c0c6c0a115ec42b4b76bde64df19e43bd6939
src/connect/socket.js
src/connect/socket.js
import queryString from 'query-string' import events from '../core/events' import * as constants from '../constants' import { actions } from '../store/actions' import ReconnectingWebSocket from 'reconnectingwebsocket' const { setDocumentCaptured, setToken, setAuthenticated } = actions export default class Socket { connect(jwt) { const query = queryString.stringify({ jwt: jwt }) const url = `${constants.DEV_SOCKET_URL}?${query}` const socket = new ReconnectingWebSocket(url) socket.onopen = () => { this.socket = socket this.onMessage() setToken(jwt) setAuthenticated(true) } } handleData(data) { events.emit('onMessage', data) if (data.is_document) { setDocumentCaptured(true) } } onMessage() { this.socket.onmessage = (e) => { const data = JSON.parse(e.data) this.handleData(data) } } sendMessage(message) { this.socket.send(message) } }
import queryString from 'query-string' import events from '../core/events' import * as constants from '../constants' import { actions } from '../store/actions' import ReconnectingWebSocket from 'reconnectingwebsocket' const { setDocumentCaptured, setToken, setAuthenticated } = actions export default class Socket { connect(jwt) { const query = queryString.stringify({ jwt: jwt }) const url = `${constants.DEV_SOCKET_URL}?${query}` const socket = new ReconnectingWebSocket(url) socket.onopen = () => { this.socket = socket this.onMessage() setToken(jwt) setAuthenticated(true) } } onMessage() { this.socket.onmessage = (e) => { const data = JSON.parse(e.data) events.emit('onMessage', data) } } sendMessage(message) { this.socket.send(message) } }
Move message handling out of core
Move message handling out of core
JavaScript
mit
onfido/onfido-sdk-core
javascript
## Code Before: import queryString from 'query-string' import events from '../core/events' import * as constants from '../constants' import { actions } from '../store/actions' import ReconnectingWebSocket from 'reconnectingwebsocket' const { setDocumentCaptured, setToken, setAuthenticated } = actions export default class Socket { connect(jwt) { const query = queryString.stringify({ jwt: jwt }) const url = `${constants.DEV_SOCKET_URL}?${query}` const socket = new ReconnectingWebSocket(url) socket.onopen = () => { this.socket = socket this.onMessage() setToken(jwt) setAuthenticated(true) } } handleData(data) { events.emit('onMessage', data) if (data.is_document) { setDocumentCaptured(true) } } onMessage() { this.socket.onmessage = (e) => { const data = JSON.parse(e.data) this.handleData(data) } } sendMessage(message) { this.socket.send(message) } } ## Instruction: Move message handling out of core ## Code After: import queryString from 'query-string' import events from '../core/events' import * as constants from '../constants' import { actions } from '../store/actions' import ReconnectingWebSocket from 'reconnectingwebsocket' const { setDocumentCaptured, setToken, setAuthenticated } = actions export default class Socket { connect(jwt) { const query = queryString.stringify({ jwt: jwt }) const url = `${constants.DEV_SOCKET_URL}?${query}` const socket = new ReconnectingWebSocket(url) socket.onopen = () => { this.socket = socket this.onMessage() setToken(jwt) setAuthenticated(true) } } onMessage() { this.socket.onmessage = (e) => { const data = JSON.parse(e.data) events.emit('onMessage', data) } } sendMessage(message) { this.socket.send(message) } }
import queryString from 'query-string' import events from '../core/events' import * as constants from '../constants' import { actions } from '../store/actions' import ReconnectingWebSocket from 'reconnectingwebsocket' const { setDocumentCaptured, setToken, setAuthenticated } = actions export default class Socket { connect(jwt) { const query = queryString.stringify({ jwt: jwt }) const url = `${constants.DEV_SOCKET_URL}?${query}` const socket = new ReconnectingWebSocket(url) socket.onopen = () => { this.socket = socket this.onMessage() setToken(jwt) setAuthenticated(true) } } - handleData(data) { - events.emit('onMessage', data) - if (data.is_document) { - setDocumentCaptured(true) - } - } - onMessage() { this.socket.onmessage = (e) => { const data = JSON.parse(e.data) - this.handleData(data) + events.emit('onMessage', data) } } sendMessage(message) { this.socket.send(message) } }
9
0.2
1
8
d8c25fc0884f28b71267cf6071b0b71217870272
src/views/layouts/includes/f-item-content.html
src/views/layouts/includes/f-item-content.html
{{#if data.help}} <div class="f-item-notes"> <strong>Help</strong> {{t data.help}} </div> {{/if}} <div class="f-item-preview"> <div class="codeExample"> <div class="exampleOutput"> <strong>Example</strong> {{{material @key @root}}} <button type="button" class="show-code" data-toggle="collapse" data-target="#{{data.codeblock}}" aria-expanded="true">&lt;/&gt;</button> </div> <div class="f-item-code f-item-hidden"> <div class="codeBlock collapse" id="{{data.codeblock}}"> <strong>Code</strong> <pre><code class="language-markup">{{material @key @root}}</code></pre> </div> </div> </div> </div> {{#if data.javascript}} <div class="f-item-javascript"> <div class="codeBlock jsExample"> <strong>Javascript</strong> <pre><code class="language-javascript">{{data.javascript}}</code></pre> </div> </div> {{/if}}
{{#if data.help}} <div class="f-item-notes"> <strong>Help</strong> {{t data.help}} </div> {{/if}} <div class="f-item-preview"> <div class="codeExample"> <div class="exampleOutput"> <strong>Example</strong> {{{material @key @root}}} <button type="button" class="show-code" data-toggle="collapse" data-target="#code-{{@key}}" aria-expanded="true">&lt;/&gt;</button> </div> <div class="f-item-code f-item-hidden"> <div class="codeBlock collapse" id="code-{{@key}}"> <strong>Code</strong> <pre><code class="language-markup">{{material @key @root}}</code></pre> </div> </div> </div> </div> {{#if data.javascript}} <div class="f-item-javascript"> <div class="codeBlock jsExample"> <strong>Javascript</strong> <pre><code class="language-javascript">{{data.javascript}}</code></pre> </div> </div> {{/if}}
Refactor data attributes for toggle animation
Refactor data attributes for toggle animation
HTML
mit
ComperioAG/styleguide_geologieportal,swiss/styleguide,ComperioAG/styleguide_geologieportal,ComperioAG/styleguide_mont-terri,swiss/styleguide,ComperioAG/styleguide_mont-terri
html
## Code Before: {{#if data.help}} <div class="f-item-notes"> <strong>Help</strong> {{t data.help}} </div> {{/if}} <div class="f-item-preview"> <div class="codeExample"> <div class="exampleOutput"> <strong>Example</strong> {{{material @key @root}}} <button type="button" class="show-code" data-toggle="collapse" data-target="#{{data.codeblock}}" aria-expanded="true">&lt;/&gt;</button> </div> <div class="f-item-code f-item-hidden"> <div class="codeBlock collapse" id="{{data.codeblock}}"> <strong>Code</strong> <pre><code class="language-markup">{{material @key @root}}</code></pre> </div> </div> </div> </div> {{#if data.javascript}} <div class="f-item-javascript"> <div class="codeBlock jsExample"> <strong>Javascript</strong> <pre><code class="language-javascript">{{data.javascript}}</code></pre> </div> </div> {{/if}} ## Instruction: Refactor data attributes for toggle animation ## Code After: {{#if data.help}} <div class="f-item-notes"> <strong>Help</strong> {{t data.help}} </div> {{/if}} <div class="f-item-preview"> <div class="codeExample"> <div class="exampleOutput"> <strong>Example</strong> {{{material @key @root}}} <button type="button" class="show-code" data-toggle="collapse" data-target="#code-{{@key}}" aria-expanded="true">&lt;/&gt;</button> </div> <div class="f-item-code f-item-hidden"> <div class="codeBlock collapse" id="code-{{@key}}"> <strong>Code</strong> <pre><code class="language-markup">{{material @key @root}}</code></pre> </div> </div> </div> </div> {{#if data.javascript}} <div class="f-item-javascript"> <div class="codeBlock jsExample"> <strong>Javascript</strong> <pre><code class="language-javascript">{{data.javascript}}</code></pre> </div> </div> {{/if}}
{{#if data.help}} <div class="f-item-notes"> <strong>Help</strong> {{t data.help}} </div> {{/if}} <div class="f-item-preview"> <div class="codeExample"> <div class="exampleOutput"> <strong>Example</strong> {{{material @key @root}}} - <button type="button" class="show-code" data-toggle="collapse" data-target="#{{data.codeblock}}" aria-expanded="true">&lt;/&gt;</button> ? ------- ^^^^ + <button type="button" class="show-code" data-toggle="collapse" data-target="#code-{{@key}}" aria-expanded="true">&lt;/&gt;</button> ? ^^^^ ++ </div> <div class="f-item-code f-item-hidden"> - <div class="codeBlock collapse" id="{{data.codeblock}}"> ? ------- ^^^^ + <div class="codeBlock collapse" id="code-{{@key}}"> ? ^^^^ ++ <strong>Code</strong> <pre><code class="language-markup">{{material @key @root}}</code></pre> </div> </div> </div> </div> {{#if data.javascript}} <div class="f-item-javascript"> <div class="codeBlock jsExample"> <strong>Javascript</strong> <pre><code class="language-javascript">{{data.javascript}}</code></pre> </div> </div> {{/if}}
4
0.121212
2
2
3626edc1cdbc4c5e5926067e7b04e7ee7be64bae
integration-test/src/main/resources/testsuites/clustertestset.yaml
integration-test/src/main/resources/testsuites/clustertestset.yaml
name: Cluster_tests parallel: instances listeners: - com.sequenceiq.it.cloudbreak.newway.priority.PriorityMethodInterceptor parameters: cleanUp: false tests: - name: cluster_test parameters: providers: openstack,gcp,azure,aws classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory
name: Cluster_tests parallel: instances listeners: - com.sequenceiq.it.cloudbreak.newway.priority.PriorityMethodInterceptor parameters: cleanUp: false tests: - name: cluster_os_test parameters: provider: openstack openstackCredentialName: autotesting-clusters-os classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory - name: cluster_aws_test parameters: provider: aws awsCredentialName: autotesting-clusters-aws classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory - name: cluster_azure_test parameters: provider: azure azureCredentialName: autotesting-clusters-azure classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory - name: cluster_gcp_test parameters: provider: gcp gcpCredentialName: autotesting-clusters-gcp classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory
Introduce custom credential names for Cluster tests
Introduce custom credential names for Cluster tests
YAML
apache-2.0
hortonworks/cloudbreak,hortonworks/cloudbreak,hortonworks/cloudbreak,hortonworks/cloudbreak,hortonworks/cloudbreak,hortonworks/cloudbreak
yaml
## Code Before: name: Cluster_tests parallel: instances listeners: - com.sequenceiq.it.cloudbreak.newway.priority.PriorityMethodInterceptor parameters: cleanUp: false tests: - name: cluster_test parameters: providers: openstack,gcp,azure,aws classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory ## Instruction: Introduce custom credential names for Cluster tests ## Code After: name: Cluster_tests parallel: instances listeners: - com.sequenceiq.it.cloudbreak.newway.priority.PriorityMethodInterceptor parameters: cleanUp: false tests: - name: cluster_os_test parameters: provider: openstack openstackCredentialName: autotesting-clusters-os classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory - name: cluster_aws_test parameters: provider: aws awsCredentialName: autotesting-clusters-aws classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory - name: cluster_azure_test parameters: provider: azure azureCredentialName: autotesting-clusters-azure classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory - name: cluster_gcp_test parameters: provider: gcp gcpCredentialName: autotesting-clusters-gcp classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory
name: Cluster_tests parallel: instances listeners: - com.sequenceiq.it.cloudbreak.newway.priority.PriorityMethodInterceptor parameters: cleanUp: false tests: - - name: cluster_test + - name: cluster_os_test ? +++ parameters: - providers: openstack,gcp,azure,aws ? - -------------- + provider: openstack + openstackCredentialName: autotesting-clusters-os classes: - com.sequenceiq.it.cloudbreak.ClusterTestFactory + - name: cluster_aws_test + parameters: + provider: aws + awsCredentialName: autotesting-clusters-aws + classes: + - com.sequenceiq.it.cloudbreak.ClusterTestFactory + - name: cluster_azure_test + parameters: + provider: azure + azureCredentialName: autotesting-clusters-azure + classes: + - com.sequenceiq.it.cloudbreak.ClusterTestFactory + - name: cluster_gcp_test + parameters: + provider: gcp + gcpCredentialName: autotesting-clusters-gcp + classes: + - com.sequenceiq.it.cloudbreak.ClusterTestFactory
23
1.769231
21
2
99917d94ede28f14027cfb2b828cf2e6375b325f
app/views/situations/show.html.erb
app/views/situations/show.html.erb
<% if notice %> <p data-alert class="alert-box success radius"><%= notice %></p> <% end %> <div class="row text-center"> <h1><%= @situation.title %></h1> <p> <%= @situation.sit_rep %> </p> </div> <div class="row text-center"> <% unless @situation.ending %> <a href="./<%= @choice_1 %>" class="button" id="choice1"> <%= @choice_1_label %> </a> <a href="./<%= @choice_2 %>" class="button" id="choice2"> <%= @choice_2_label %> </a> <% end %> <% if @situation.ending %> <a href="/situations/1" class="button" id="startover"> Start Over </a> <% end %> </div> <div class="row text-center"> <%= link_to 'Edit', edit_situation_path(@situation) %> | <%= link_to 'Situation List', situations_path %> </div>
<div class="row text-center"> <h1><%= @situation.title %></h1> <p> <%= @situation.sit_rep %> </p> </div> <div class="row text-center"> <% unless @situation.ending %> <a href="./<%= @choice_1 %>" class="button" id="choice1"> <%= @choice_1_label %> </a> <a href="./<%= @choice_2 %>" class="button" id="choice2"> <%= @choice_2_label %> </a> <% end %> <% if @situation.ending %> <a href="/situations/1" class="button" id="startover"> Start Over </a> <% end %> </div> <div class="row text-center"> <%= link_to 'Edit', edit_situation_path(@situation) %> | <%= link_to 'Situation List', situations_path %> </div>
Remove duplicate notice (moved to application layout).
Remove duplicate notice (moved to application layout).
HTML+ERB
mit
Peradventure/app,Peradventure/app,Peradventure/app
html+erb
## Code Before: <% if notice %> <p data-alert class="alert-box success radius"><%= notice %></p> <% end %> <div class="row text-center"> <h1><%= @situation.title %></h1> <p> <%= @situation.sit_rep %> </p> </div> <div class="row text-center"> <% unless @situation.ending %> <a href="./<%= @choice_1 %>" class="button" id="choice1"> <%= @choice_1_label %> </a> <a href="./<%= @choice_2 %>" class="button" id="choice2"> <%= @choice_2_label %> </a> <% end %> <% if @situation.ending %> <a href="/situations/1" class="button" id="startover"> Start Over </a> <% end %> </div> <div class="row text-center"> <%= link_to 'Edit', edit_situation_path(@situation) %> | <%= link_to 'Situation List', situations_path %> </div> ## Instruction: Remove duplicate notice (moved to application layout). ## Code After: <div class="row text-center"> <h1><%= @situation.title %></h1> <p> <%= @situation.sit_rep %> </p> </div> <div class="row text-center"> <% unless @situation.ending %> <a href="./<%= @choice_1 %>" class="button" id="choice1"> <%= @choice_1_label %> </a> <a href="./<%= @choice_2 %>" class="button" id="choice2"> <%= @choice_2_label %> </a> <% end %> <% if @situation.ending %> <a href="/situations/1" class="button" id="startover"> Start Over </a> <% end %> </div> <div class="row text-center"> <%= link_to 'Edit', edit_situation_path(@situation) %> | <%= link_to 'Situation List', situations_path %> </div>
- <% if notice %> - <p data-alert class="alert-box success radius"><%= notice %></p> - <% end %> - <div class="row text-center"> <h1><%= @situation.title %></h1> <p> <%= @situation.sit_rep %> </p> </div> <div class="row text-center"> <% unless @situation.ending %> <a href="./<%= @choice_1 %>" class="button" id="choice1"> <%= @choice_1_label %> </a> <a href="./<%= @choice_2 %>" class="button" id="choice2"> <%= @choice_2_label %> </a> <% end %> <% if @situation.ending %> <a href="/situations/1" class="button" id="startover"> Start Over </a> <% end %> </div> <div class="row text-center"> <%= link_to 'Edit', edit_situation_path(@situation) %> | <%= link_to 'Situation List', situations_path %> </div>
4
0.114286
0
4
ac87ce6e6055531f6e33a8def6014be7ad53f44b
test/notSupported.js
test/notSupported.js
/*global describe, it */ /*exported should */ /*jshint -W030 */ var should = require('should'), supertest = require('supertest'), app = require('../app'); describe('notSupported', function() { it('should not support anything', function(done) { supertest(app). get('/api/v1/'). expect(500, function(err, res) { should.equal(res.body.request_type, 'atomic'); should.equal(res.body.response_code, 500); res.body.resource_status.should.be.length(1); should.equal(res.body.resource_status[0].resource, '*'); should.equal(res.body.resource_status[0].response_code, '500'); res.body.resource_status[0].errors.should.be.length(1); should.equal( res.body.resource_status[0].errors[0].code, 'NOT_SUPPORTED'); done(); }); }); });
/*global describe, it */ /*exported should */ /*jshint -W030 */ var should = require('should'), supertest = require('supertest'), app = require('../app'); describe('notSupported', function() { it('should not support any resources', function(done) { supertest(app). get('/api/v1/questions'). expect(500, function(err, res) { should.equal(res.body.request_type, 'atomic'); should.equal(res.body.response_code, 500); res.body.resource_status.should.be.length(1); should.equal(res.body.resource_status[0].resource, '*'); should.equal(res.body.resource_status[0].response_code, '500'); res.body.resource_status[0].errors.should.be.length(1); should.equal( res.body.resource_status[0].errors[0].code, 'NOT_SUPPORTED'); done(); }); }); it('should 404 non-api requests', function(done) { supertest(app). get('/allTheThings'). expect(404, done); }); });
Test AEP and non-API 404s
Test AEP and non-API 404s Signed-off-by: shaisachs <47bd79f9420edf5d0991d1e2710179d4e040d480@ngpvan.com>
JavaScript
apache-2.0
joshco/osdi-service,NGPVAN/osdi-service
javascript
## Code Before: /*global describe, it */ /*exported should */ /*jshint -W030 */ var should = require('should'), supertest = require('supertest'), app = require('../app'); describe('notSupported', function() { it('should not support anything', function(done) { supertest(app). get('/api/v1/'). expect(500, function(err, res) { should.equal(res.body.request_type, 'atomic'); should.equal(res.body.response_code, 500); res.body.resource_status.should.be.length(1); should.equal(res.body.resource_status[0].resource, '*'); should.equal(res.body.resource_status[0].response_code, '500'); res.body.resource_status[0].errors.should.be.length(1); should.equal( res.body.resource_status[0].errors[0].code, 'NOT_SUPPORTED'); done(); }); }); }); ## Instruction: Test AEP and non-API 404s Signed-off-by: shaisachs <47bd79f9420edf5d0991d1e2710179d4e040d480@ngpvan.com> ## Code After: /*global describe, it */ /*exported should */ /*jshint -W030 */ var should = require('should'), supertest = require('supertest'), app = require('../app'); describe('notSupported', function() { it('should not support any resources', function(done) { supertest(app). get('/api/v1/questions'). expect(500, function(err, res) { should.equal(res.body.request_type, 'atomic'); should.equal(res.body.response_code, 500); res.body.resource_status.should.be.length(1); should.equal(res.body.resource_status[0].resource, '*'); should.equal(res.body.resource_status[0].response_code, '500'); res.body.resource_status[0].errors.should.be.length(1); should.equal( res.body.resource_status[0].errors[0].code, 'NOT_SUPPORTED'); done(); }); }); it('should 404 non-api requests', function(done) { supertest(app). get('/allTheThings'). expect(404, done); }); });
/*global describe, it */ /*exported should */ /*jshint -W030 */ var should = require('should'), supertest = require('supertest'), app = require('../app'); describe('notSupported', function() { - it('should not support anything', function(done) { ? ^^^^^ + it('should not support any resources', function(done) { ? ^^^^^^^^^^ supertest(app). - get('/api/v1/'). + get('/api/v1/questions'). ? +++++++++ expect(500, function(err, res) { should.equal(res.body.request_type, 'atomic'); should.equal(res.body.response_code, 500); res.body.resource_status.should.be.length(1); should.equal(res.body.resource_status[0].resource, '*'); should.equal(res.body.resource_status[0].response_code, '500'); res.body.resource_status[0].errors.should.be.length(1); should.equal( res.body.resource_status[0].errors[0].code, 'NOT_SUPPORTED'); done(); }); }); + it('should 404 non-api requests', function(done) { + supertest(app). + get('/allTheThings'). + expect(404, done); + }); + });
10
0.357143
8
2
609e0b76680156584bb1e06aa10a5425c55f8c01
wagtail/utils/widgets.py
wagtail/utils/widgets.py
from django.forms.widgets import Widget from django.utils.safestring import mark_safe class WidgetWithScript(Widget): def render(self, name, value, attrs=None): widget = super(WidgetWithScript, self).render(name, value, attrs) final_attrs = self.build_attrs(attrs, name=name) id_ = final_attrs.get('id', None) if 'id_' is None: return widget js = self.render_js_init(id_, name, value) out = '{0}<script>{1}</script>'.format(widget, js) return mark_safe(out) def render_js_init(self, id_, name, value): return ''
from __future__ import absolute_import, unicode_literals from django.forms.widgets import Widget from django.utils.safestring import mark_safe class WidgetWithScript(Widget): def render(self, name, value, attrs=None): widget = super(WidgetWithScript, self).render(name, value, attrs) final_attrs = self.build_attrs(attrs, name=name) id_ = final_attrs.get('id', None) if 'id_' is None: return widget js = self.render_js_init(id_, name, value) out = '{0}<script>{1}</script>'.format(widget, js) return mark_safe(out) def render_js_init(self, id_, name, value): return ''
Fix unicode error caused by ascii format string
Fix unicode error caused by ascii format string
Python
bsd-3-clause
JoshBarr/wagtail,zerolab/wagtail,benjaoming/wagtail,takeshineshiro/wagtail,jordij/wagtail,iho/wagtail,chrxr/wagtail,iansprice/wagtail,mayapurmedia/wagtail,janusnic/wagtail,jordij/wagtail,kurtw/wagtail,jordij/wagtail,Klaudit/wagtail,jnns/wagtail,bjesus/wagtail,JoshBarr/wagtail,mikedingjan/wagtail,darith27/wagtail,takeflight/wagtail,Toshakins/wagtail,davecranwell/wagtail,stevenewey/wagtail,rv816/wagtail,JoshBarr/wagtail,gasman/wagtail,tangentlabs/wagtail,KimGlazebrook/wagtail-experiment,stevenewey/wagtail,mayapurmedia/wagtail,nealtodd/wagtail,rv816/wagtail,marctc/wagtail,FlipperPA/wagtail,thenewguy/wagtail,rsalmaso/wagtail,kurtw/wagtail,nutztherookie/wagtail,thenewguy/wagtail,gasman/wagtail,marctc/wagtail,chrxr/wagtail,nilnvoid/wagtail,FlipperPA/wagtail,Pennebaker/wagtail,bjesus/wagtail,hanpama/wagtail,nimasmi/wagtail,quru/wagtail,kurtrwall/wagtail,davecranwell/wagtail,inonit/wagtail,kurtrwall/wagtail,taedori81/wagtail,marctc/wagtail,janusnic/wagtail,mephizzle/wagtail,darith27/wagtail,mjec/wagtail,WQuanfeng/wagtail,jorge-marques/wagtail,mephizzle/wagtail,Pennebaker/wagtail,nimasmi/wagtail,torchbox/wagtail,torchbox/wagtail,nrsimha/wagtail,jorge-marques/wagtail,wagtail/wagtail,rjsproxy/wagtail,kaedroho/wagtail,rsalmaso/wagtail,nutztherookie/wagtail,nutztherookie/wagtail,kaedroho/wagtail,mixxorz/wagtail,mayapurmedia/wagtail,wagtail/wagtail,jordij/wagtail,timorieber/wagtail,jorge-marques/wagtail,iansprice/wagtail,zerolab/wagtail,bjesus/wagtail,jorge-marques/wagtail,mikedingjan/wagtail,iho/wagtail,serzans/wagtail,mikedingjan/wagtail,torchbox/wagtail,benjaoming/wagtail,mixxorz/wagtail,iansprice/wagtail,Pennebaker/wagtail,takeflight/wagtail,mikedingjan/wagtail,chimeno/wagtail,taedori81/wagtail,nimasmi/wagtail,iansprice/wagtail,stevenewey/wagtail,takeshineshiro/wagtail,Toshakins/wagtail,Pennebaker/wagtail,jnns/wagtail,marctc/wagtail,nrsimha/wagtail,hamsterbacke23/wagtail,dresiu/wagtail,takeflight/wagtail,m-sanders/wagtail,wagtail/wagtail,inonit/wagtail,mephizzle/wagtail,inonit/wagtail,jnns/wagtail,Tivix/wagtail,mixxorz/wagtail,dresiu/wagtail,gogobook/wagtail,Klaudit/wagtail,KimGlazebrook/wagtail-experiment,gasman/wagtail,tangentlabs/wagtail,jnns/wagtail,nilnvoid/wagtail,KimGlazebrook/wagtail-experiment,FlipperPA/wagtail,gogobook/wagtail,nutztherookie/wagtail,mjec/wagtail,chimeno/wagtail,mjec/wagtail,hanpama/wagtail,mjec/wagtail,KimGlazebrook/wagtail-experiment,chimeno/wagtail,kurtrwall/wagtail,kurtrwall/wagtail,kaedroho/wagtail,serzans/wagtail,mixxorz/wagtail,rsalmaso/wagtail,rv816/wagtail,m-sanders/wagtail,darith27/wagtail,hanpama/wagtail,takeflight/wagtail,mixxorz/wagtail,kurtw/wagtail,tangentlabs/wagtail,chimeno/wagtail,taedori81/wagtail,Toshakins/wagtail,wagtail/wagtail,rjsproxy/wagtail,gasman/wagtail,thenewguy/wagtail,thenewguy/wagtail,kurtw/wagtail,timorieber/wagtail,taedori81/wagtail,tangentlabs/wagtail,davecranwell/wagtail,quru/wagtail,hamsterbacke23/wagtail,nilnvoid/wagtail,zerolab/wagtail,stevenewey/wagtail,WQuanfeng/wagtail,nealtodd/wagtail,serzans/wagtail,nrsimha/wagtail,gogobook/wagtail,benjaoming/wagtail,gogobook/wagtail,Toshakins/wagtail,serzans/wagtail,bjesus/wagtail,takeshineshiro/wagtail,taedori81/wagtail,chrxr/wagtail,zerolab/wagtail,inonit/wagtail,JoshBarr/wagtail,quru/wagtail,jorge-marques/wagtail,darith27/wagtail,WQuanfeng/wagtail,quru/wagtail,dresiu/wagtail,chrxr/wagtail,hamsterbacke23/wagtail,janusnic/wagtail,mayapurmedia/wagtail,Klaudit/wagtail,FlipperPA/wagtail,mephizzle/wagtail,gasman/wagtail,Tivix/wagtail,kaedroho/wagtail,rv816/wagtail,nilnvoid/wagtail,Klaudit/wagtail,davecranwell/wagtail,hanpama/wagtail,iho/wagtail,timorieber/wagtail,benjaoming/wagtail,rsalmaso/wagtail,nimasmi/wagtail,hamsterbacke23/wagtail,zerolab/wagtail,kaedroho/wagtail,rjsproxy/wagtail,nealtodd/wagtail,takeshineshiro/wagtail,thenewguy/wagtail,torchbox/wagtail,iho/wagtail,WQuanfeng/wagtail,janusnic/wagtail,Tivix/wagtail,dresiu/wagtail,rjsproxy/wagtail,m-sanders/wagtail,timorieber/wagtail,m-sanders/wagtail,rsalmaso/wagtail,nrsimha/wagtail,nealtodd/wagtail,dresiu/wagtail,Tivix/wagtail,wagtail/wagtail,chimeno/wagtail
python
## Code Before: from django.forms.widgets import Widget from django.utils.safestring import mark_safe class WidgetWithScript(Widget): def render(self, name, value, attrs=None): widget = super(WidgetWithScript, self).render(name, value, attrs) final_attrs = self.build_attrs(attrs, name=name) id_ = final_attrs.get('id', None) if 'id_' is None: return widget js = self.render_js_init(id_, name, value) out = '{0}<script>{1}</script>'.format(widget, js) return mark_safe(out) def render_js_init(self, id_, name, value): return '' ## Instruction: Fix unicode error caused by ascii format string ## Code After: from __future__ import absolute_import, unicode_literals from django.forms.widgets import Widget from django.utils.safestring import mark_safe class WidgetWithScript(Widget): def render(self, name, value, attrs=None): widget = super(WidgetWithScript, self).render(name, value, attrs) final_attrs = self.build_attrs(attrs, name=name) id_ = final_attrs.get('id', None) if 'id_' is None: return widget js = self.render_js_init(id_, name, value) out = '{0}<script>{1}</script>'.format(widget, js) return mark_safe(out) def render_js_init(self, id_, name, value): return ''
+ from __future__ import absolute_import, unicode_literals + from django.forms.widgets import Widget from django.utils.safestring import mark_safe class WidgetWithScript(Widget): def render(self, name, value, attrs=None): widget = super(WidgetWithScript, self).render(name, value, attrs) final_attrs = self.build_attrs(attrs, name=name) id_ = final_attrs.get('id', None) if 'id_' is None: return widget js = self.render_js_init(id_, name, value) out = '{0}<script>{1}</script>'.format(widget, js) return mark_safe(out) def render_js_init(self, id_, name, value): return ''
2
0.105263
2
0
351f53053496d65761b26c17619073debe97456c
lib/stacks/virtual_name_service.rb
lib/stacks/virtual_name_service.rb
module Stacks::VirtualNameService def self.extended(object) object.configure() end def configure() @ports = [53] end def realserver_prod_fqdns self.realservers.map { |server| server.prod_fqdn }.sort end def realserver_mgmt_fqdns self.realservers.map { |server| server.mgmt_fqdn }.sort end def to_loadbalancer_config prod_realservers = {'blue' => realserver_prod_fqdns} mgmt_realservers = {'blue' => realserver_mgmt_fqdns} { self.vip_fqdn(:prod) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => prod_realservers }, self.vip_fqdn(:mgmt) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => mgmt_realservers } } end end
module Stacks::VirtualNameService def self.extended(object) object.configure() end def configure() @ports = [53] add_vip_network :mgmt end def realserver_prod_fqdns self.realservers.map { |server| server.prod_fqdn }.sort end def realserver_mgmt_fqdns self.realservers.map { |server| server.mgmt_fqdn }.sort end def to_loadbalancer_config prod_realservers = {'blue' => realserver_prod_fqdns} mgmt_realservers = {'blue' => realserver_mgmt_fqdns} { self.vip_fqdn(:prod) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => prod_realservers }, self.vip_fqdn(:mgmt) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => mgmt_realservers } } end end
Make nemeservers create vips on the mgmt network
Make nemeservers create vips on the mgmt network
Ruby
mit
tim-group/stackbuilder,tim-group/stackbuilder
ruby
## Code Before: module Stacks::VirtualNameService def self.extended(object) object.configure() end def configure() @ports = [53] end def realserver_prod_fqdns self.realservers.map { |server| server.prod_fqdn }.sort end def realserver_mgmt_fqdns self.realservers.map { |server| server.mgmt_fqdn }.sort end def to_loadbalancer_config prod_realservers = {'blue' => realserver_prod_fqdns} mgmt_realservers = {'blue' => realserver_mgmt_fqdns} { self.vip_fqdn(:prod) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => prod_realservers }, self.vip_fqdn(:mgmt) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => mgmt_realservers } } end end ## Instruction: Make nemeservers create vips on the mgmt network ## Code After: module Stacks::VirtualNameService def self.extended(object) object.configure() end def configure() @ports = [53] add_vip_network :mgmt end def realserver_prod_fqdns self.realservers.map { |server| server.prod_fqdn }.sort end def realserver_mgmt_fqdns self.realservers.map { |server| server.mgmt_fqdn }.sort end def to_loadbalancer_config prod_realservers = {'blue' => realserver_prod_fqdns} mgmt_realservers = {'blue' => realserver_mgmt_fqdns} { self.vip_fqdn(:prod) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => prod_realservers }, self.vip_fqdn(:mgmt) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => mgmt_realservers } } end end
module Stacks::VirtualNameService def self.extended(object) object.configure() end def configure() @ports = [53] + add_vip_network :mgmt end def realserver_prod_fqdns self.realservers.map { |server| server.prod_fqdn }.sort end def realserver_mgmt_fqdns self.realservers.map { |server| server.mgmt_fqdn }.sort end def to_loadbalancer_config prod_realservers = {'blue' => realserver_prod_fqdns} mgmt_realservers = {'blue' => realserver_mgmt_fqdns} { self.vip_fqdn(:prod) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => prod_realservers }, self.vip_fqdn(:mgmt) => { 'type' => 'dns', 'ports' => @ports, 'realservers' => mgmt_realservers } } end end
1
0.028571
1
0
7742c95f227ebe39d4d91f6098e21bf559e33f3b
files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb
files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb
cd <%= node['gitlab']['gitlab-rails']['dir'] %>/working exec 2>&1 exec chpst -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /usr/bin/env BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitlab-rails/Gemfile HOME="<%= node['gitlab']['user']['home'] %>" /opt/gitlab/embedded/bin/bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e <%= node['gitlab']['gitlab-rails']['environment'] %> -r /opt/gitlab/embedded/service/gitlab-rails
cd <%= node['gitlab']['gitlab-rails']['dir'] %>/working exec 2>&1 exec chpst -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /usr/bin/env BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitlab-rails/Gemfile HOME="<%= node['gitlab']['user']['home'] %>" /opt/gitlab/embedded/bin/bundle exec sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e <%= node['gitlab']['gitlab-rails']['environment'] %> -r /opt/gitlab/embedded/service/gitlab-rails
Use the new sidekiq queue syntax
Use the new sidekiq queue syntax
HTML+ERB
apache-2.0
aleksandrs-ledovskis/omnibus-gitlab,aleksandrs-ledovskis/omnibus-gitlab,copystudy/omnibus-gitlab,felixbuenemann/omnibus-gitlab,gitlabhq/omnibus-gitlab,copystudy/omnibus-gitlab,gitlabhq/omnibus-gitlab,gitlabhq/omnibus-gitlab,copystudy/omnibus-gitlab,felixbuenemann/omnibus-gitlab,aleksandrs-ledovskis/omnibus-gitlab,felixbuenemann/omnibus-gitlab,gitlabhq/omnibus-gitlab
html+erb
## Code Before: cd <%= node['gitlab']['gitlab-rails']['dir'] %>/working exec 2>&1 exec chpst -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /usr/bin/env BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitlab-rails/Gemfile HOME="<%= node['gitlab']['user']['home'] %>" /opt/gitlab/embedded/bin/bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e <%= node['gitlab']['gitlab-rails']['environment'] %> -r /opt/gitlab/embedded/service/gitlab-rails ## Instruction: Use the new sidekiq queue syntax ## Code After: cd <%= node['gitlab']['gitlab-rails']['dir'] %>/working exec 2>&1 exec chpst -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /usr/bin/env BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitlab-rails/Gemfile HOME="<%= node['gitlab']['user']['home'] %>" /opt/gitlab/embedded/bin/bundle exec sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e <%= node['gitlab']['gitlab-rails']['environment'] %> -r /opt/gitlab/embedded/service/gitlab-rails
cd <%= node['gitlab']['gitlab-rails']['dir'] %>/working exec 2>&1 - exec chpst -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /usr/bin/env BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitlab-rails/Gemfile HOME="<%= node['gitlab']['user']['home'] %>" /opt/gitlab/embedded/bin/bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e <%= node['gitlab']['gitlab-rails']['environment'] %> -r /opt/gitlab/embedded/service/gitlab-rails ? ^^^^^^^^ ^ ^ ^^^^^^^^ + exec chpst -P -U <%= node['gitlab']['user']['username'] %> -u <%= node['gitlab']['user']['username'] %> /usr/bin/env BUNDLE_GEMFILE=/opt/gitlab/embedded/service/gitlab-rails/Gemfile HOME="<%= node['gitlab']['user']['home'] %>" /opt/gitlab/embedded/bin/bundle exec sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e <%= node['gitlab']['gitlab-rails']['environment'] %> -r /opt/gitlab/embedded/service/gitlab-rails ? ^^^^^^^^^^^^^^ ^^^^ ^^^^ ^^^^^^^^^^^^^^
2
0.4
1
1
0dbf13e09d7da1eba60969f7d7b69b6289c0789a
metadata/org.mattvchandler.progressbars.yml
metadata/org.mattvchandler.progressbars.yml
Categories: - Time License: MIT SourceCode: https://github.com/mattvchandler/progressbars IssueTracker: https://github.com/mattvchandler/progressbars/issues Changelog: https://github.com/mattvchandler/ProgressBars/releases AutoName: Progress Bars RepoType: git Repo: https://github.com/mattvchandler/progressbars Builds: - versionName: 2.0.2 versionCode: 190020002 commit: v2.0.2 subdir: app gradle: - yes - versionName: 2.0.3 versionCode: 190020003 commit: v2.0.3 subdir: app gradle: - yes AutoUpdateMode: Version v%v UpdateCheckMode: Tags CurrentVersion: 2.0.3 CurrentVersionCode: 190020003
Categories: - Time License: MIT SourceCode: https://github.com/mattvchandler/progressbars IssueTracker: https://github.com/mattvchandler/progressbars/issues Changelog: https://github.com/mattvchandler/ProgressBars/releases AutoName: Progress Bars RepoType: git Repo: https://github.com/mattvchandler/progressbars Builds: - versionName: 2.0.2 versionCode: 190020002 commit: v2.0.2 subdir: app gradle: - yes - versionName: 2.0.3 versionCode: 190020003 commit: v2.0.3 subdir: app gradle: - yes - versionName: 2.0.4 versionCode: 190020004 commit: v2.0.4 subdir: app gradle: - yes AutoUpdateMode: Version v%v UpdateCheckMode: Tags CurrentVersion: 2.0.4 CurrentVersionCode: 190020004
Update Progress Bars to 2.0.4 (190020004)
Update Progress Bars to 2.0.4 (190020004)
YAML
agpl-3.0
f-droid/fdroiddata,f-droid/fdroiddata
yaml
## Code Before: Categories: - Time License: MIT SourceCode: https://github.com/mattvchandler/progressbars IssueTracker: https://github.com/mattvchandler/progressbars/issues Changelog: https://github.com/mattvchandler/ProgressBars/releases AutoName: Progress Bars RepoType: git Repo: https://github.com/mattvchandler/progressbars Builds: - versionName: 2.0.2 versionCode: 190020002 commit: v2.0.2 subdir: app gradle: - yes - versionName: 2.0.3 versionCode: 190020003 commit: v2.0.3 subdir: app gradle: - yes AutoUpdateMode: Version v%v UpdateCheckMode: Tags CurrentVersion: 2.0.3 CurrentVersionCode: 190020003 ## Instruction: Update Progress Bars to 2.0.4 (190020004) ## Code After: Categories: - Time License: MIT SourceCode: https://github.com/mattvchandler/progressbars IssueTracker: https://github.com/mattvchandler/progressbars/issues Changelog: https://github.com/mattvchandler/ProgressBars/releases AutoName: Progress Bars RepoType: git Repo: https://github.com/mattvchandler/progressbars Builds: - versionName: 2.0.2 versionCode: 190020002 commit: v2.0.2 subdir: app gradle: - yes - versionName: 2.0.3 versionCode: 190020003 commit: v2.0.3 subdir: app gradle: - yes - versionName: 2.0.4 versionCode: 190020004 commit: v2.0.4 subdir: app gradle: - yes AutoUpdateMode: Version v%v UpdateCheckMode: Tags CurrentVersion: 2.0.4 CurrentVersionCode: 190020004
Categories: - Time License: MIT SourceCode: https://github.com/mattvchandler/progressbars IssueTracker: https://github.com/mattvchandler/progressbars/issues Changelog: https://github.com/mattvchandler/ProgressBars/releases AutoName: Progress Bars RepoType: git Repo: https://github.com/mattvchandler/progressbars Builds: - versionName: 2.0.2 versionCode: 190020002 commit: v2.0.2 subdir: app gradle: - yes - versionName: 2.0.3 versionCode: 190020003 commit: v2.0.3 subdir: app gradle: - yes + - versionName: 2.0.4 + versionCode: 190020004 + commit: v2.0.4 + subdir: app + gradle: + - yes + AutoUpdateMode: Version v%v UpdateCheckMode: Tags - CurrentVersion: 2.0.3 ? ^ + CurrentVersion: 2.0.4 ? ^ - CurrentVersionCode: 190020003 ? ^ + CurrentVersionCode: 190020004 ? ^
11
0.354839
9
2
6503450cdd1ebfb9e2fa874de6676bbf7531c5b1
src/me/dreamteam/tardis/Game.java
src/me/dreamteam/tardis/Game.java
package me.dreamteam.tardis; import java.awt.Canvas; import java.awt.image.BufferStrategy; /** Main Class */ public class Game extends Canvas { /** * Begin the game parameters that will allow us to define certain elements. */ private BufferStrategy strategy; // This provides hardware acceleration private boolean isRunning = true; // Is the game running or not? }
package me.dreamteam.tardis; import java.awt.Canvas; import java.awt.Dimension; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.image.BufferStrategy; import javax.swing.JFrame; import javax.swing.JPanel; /** Main Class */ public class Game extends Canvas { /** * Begin the game parameters that will allow us to define certain elements. */ private BufferStrategy strategy; // This provides hardware acceleration private boolean isRunning = true; // Is the game running or not? private String gameName = "Codename TARDIS "; private String build = "Alpha "; private String version = "0.1"; // Version set up so that we can see where we are at public Game() { // create a frame to contain our game JFrame container = new JFrame(gameName + "- " + build + version); // get hold the content of the frame and set up the resolution of the game JPanel panel = (JPanel) container.getContentPane(); panel.setPreferredSize(new Dimension(500,650)); // Katie feel free to change this to the dimensions as given in the photoshop document panel.setLayout(null); // setup our canvas size and put it into the content of the frame setBounds(0,0,500,650); panel.add(this); // Tell AWT not to bother repainting our canvas since we're // going to do that our self in accelerated mode setIgnoreRepaint(true); // finally make the window visible container.pack(); container.setResizable(false); container.setVisible(true); // add a listener to respond to the user closing the window. If they // do we'd like to exit the game container.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } /** * Garbage collection and looping */ private void startGame() { } public void gameLoop() { long lastLoopTime = System.currentTimeMillis(); while (isRunning) { long delta = System.currentTimeMillis() - lastLoopTime; lastLoopTime = System.currentTimeMillis(); } } /** * Game Start */ public static void main(String argv[]) { Game g =new Game(); // Start the main game loop g.gameLoop(); } }
Build the canvas, add more params, game loop, main!!!
Build the canvas, add more params, game loop, main!!!
Java
mit
The-Dream-Team/Tardis,The-Dream-Team/Tardis
java
## Code Before: package me.dreamteam.tardis; import java.awt.Canvas; import java.awt.image.BufferStrategy; /** Main Class */ public class Game extends Canvas { /** * Begin the game parameters that will allow us to define certain elements. */ private BufferStrategy strategy; // This provides hardware acceleration private boolean isRunning = true; // Is the game running or not? } ## Instruction: Build the canvas, add more params, game loop, main!!! ## Code After: package me.dreamteam.tardis; import java.awt.Canvas; import java.awt.Dimension; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.image.BufferStrategy; import javax.swing.JFrame; import javax.swing.JPanel; /** Main Class */ public class Game extends Canvas { /** * Begin the game parameters that will allow us to define certain elements. */ private BufferStrategy strategy; // This provides hardware acceleration private boolean isRunning = true; // Is the game running or not? private String gameName = "Codename TARDIS "; private String build = "Alpha "; private String version = "0.1"; // Version set up so that we can see where we are at public Game() { // create a frame to contain our game JFrame container = new JFrame(gameName + "- " + build + version); // get hold the content of the frame and set up the resolution of the game JPanel panel = (JPanel) container.getContentPane(); panel.setPreferredSize(new Dimension(500,650)); // Katie feel free to change this to the dimensions as given in the photoshop document panel.setLayout(null); // setup our canvas size and put it into the content of the frame setBounds(0,0,500,650); panel.add(this); // Tell AWT not to bother repainting our canvas since we're // going to do that our self in accelerated mode setIgnoreRepaint(true); // finally make the window visible container.pack(); container.setResizable(false); container.setVisible(true); // add a listener to respond to the user closing the window. If they // do we'd like to exit the game container.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } /** * Garbage collection and looping */ private void startGame() { } public void gameLoop() { long lastLoopTime = System.currentTimeMillis(); while (isRunning) { long delta = System.currentTimeMillis() - lastLoopTime; lastLoopTime = System.currentTimeMillis(); } } /** * Game Start */ public static void main(String argv[]) { Game g =new Game(); // Start the main game loop g.gameLoop(); } }
package me.dreamteam.tardis; import java.awt.Canvas; + import java.awt.Dimension; + import java.awt.event.WindowAdapter; + import java.awt.event.WindowEvent; import java.awt.image.BufferStrategy; + + import javax.swing.JFrame; + import javax.swing.JPanel; /** Main Class */ public class Game extends Canvas { /** * Begin the game parameters that will allow us to define certain elements. */ private BufferStrategy strategy; // This provides hardware acceleration private boolean isRunning = true; // Is the game running or not? + private String gameName = "Codename TARDIS "; + private String build = "Alpha "; + private String version = "0.1"; + // Version set up so that we can see where we are at + + + public Game() { + // create a frame to contain our game + JFrame container = new JFrame(gameName + "- " + build + version); + + // get hold the content of the frame and set up the resolution of the game + JPanel panel = (JPanel) container.getContentPane(); + panel.setPreferredSize(new Dimension(500,650)); + // Katie feel free to change this to the dimensions as given in the photoshop document + panel.setLayout(null); + + // setup our canvas size and put it into the content of the frame + setBounds(0,0,500,650); + panel.add(this); + + // Tell AWT not to bother repainting our canvas since we're + // going to do that our self in accelerated mode + setIgnoreRepaint(true); + + // finally make the window visible + container.pack(); + container.setResizable(false); + container.setVisible(true); + + // add a listener to respond to the user closing the window. If they + // do we'd like to exit the game + container.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + } + + /** + * Garbage collection and looping + */ + private void startGame() { + + } + + + public void gameLoop() { + long lastLoopTime = System.currentTimeMillis(); + + while (isRunning) { + long delta = System.currentTimeMillis() - lastLoopTime; + lastLoopTime = System.currentTimeMillis(); + + } + } + + /** + * Game Start + */ + public static void main(String argv[]) { + Game g =new Game(); + + // Start the main game loop + g.gameLoop(); + } + }
72
3.272727
72
0
6efacc72a63af7c8dd35c7e5dd77fe1a823c075d
src/main.rs
src/main.rs
fn main() { println!("CRTP") }
// ================================================================================================ type SSRC = u32; type RtpTimestamp = u32; type NtpTimestamp = u64; #[deriving(Clone)] struct SenderInfo { ntp_ts : NtpTimestamp, rtp_ts : RtpTimestamp, pckt_count : u32, byte_count : u32 } #[deriving(Clone)] struct ReportBlock { ssrc : SSRC, fract_lost : u8, cumul_lost : u32, ext_seq : u32, jitter : u32, lsr : u32, dlsr : u32 } #[deriving(Clone)] struct SdesItem { item_type : u8, item_text : String } #[deriving(Clone)] struct SdesChunk { ssrc : SSRC, items : Vec<SdesItem> } #[deriving(Clone)] enum PacketRTCP { PacketSR(SSRC, Vec<ReportBlock>, SenderInfo), PacketRR(SSRC, Vec<ReportBlock>), PacketSDES(Vec<SdesChunk>), PacketBye(Vec<SSRC>, String), } #[deriving(Clone)] enum Packet { PacketRTP, PacketCompoundRTCP(Vec<PacketRTCP>) } // ================================================================================================ fn main() { println!("CRTP") } // ================================================================================================ // vim: set ts=2 sw=2 tw=0 et ai:
Add structs to represent RTCP packets (SR, RR, SDES, BYE)
Add structs to represent RTCP packets (SR, RR, SDES, BYE)
Rust
bsd-2-clause
csperkins/crtp
rust
## Code Before: fn main() { println!("CRTP") } ## Instruction: Add structs to represent RTCP packets (SR, RR, SDES, BYE) ## Code After: // ================================================================================================ type SSRC = u32; type RtpTimestamp = u32; type NtpTimestamp = u64; #[deriving(Clone)] struct SenderInfo { ntp_ts : NtpTimestamp, rtp_ts : RtpTimestamp, pckt_count : u32, byte_count : u32 } #[deriving(Clone)] struct ReportBlock { ssrc : SSRC, fract_lost : u8, cumul_lost : u32, ext_seq : u32, jitter : u32, lsr : u32, dlsr : u32 } #[deriving(Clone)] struct SdesItem { item_type : u8, item_text : String } #[deriving(Clone)] struct SdesChunk { ssrc : SSRC, items : Vec<SdesItem> } #[deriving(Clone)] enum PacketRTCP { PacketSR(SSRC, Vec<ReportBlock>, SenderInfo), PacketRR(SSRC, Vec<ReportBlock>), PacketSDES(Vec<SdesChunk>), PacketBye(Vec<SSRC>, String), } #[deriving(Clone)] enum Packet { PacketRTP, PacketCompoundRTCP(Vec<PacketRTCP>) } // ================================================================================================ fn main() { println!("CRTP") } // ================================================================================================ // vim: set ts=2 sw=2 tw=0 et ai:
+ // ================================================================================================ + + type SSRC = u32; + type RtpTimestamp = u32; + type NtpTimestamp = u64; + + #[deriving(Clone)] + struct SenderInfo { + ntp_ts : NtpTimestamp, + rtp_ts : RtpTimestamp, + pckt_count : u32, + byte_count : u32 + } + + #[deriving(Clone)] + struct ReportBlock { + ssrc : SSRC, + fract_lost : u8, + cumul_lost : u32, + ext_seq : u32, + jitter : u32, + lsr : u32, + dlsr : u32 + } + + #[deriving(Clone)] + struct SdesItem { + item_type : u8, + item_text : String + } + + #[deriving(Clone)] + struct SdesChunk { + ssrc : SSRC, + items : Vec<SdesItem> + } + + #[deriving(Clone)] + enum PacketRTCP { + PacketSR(SSRC, Vec<ReportBlock>, SenderInfo), + PacketRR(SSRC, Vec<ReportBlock>), + PacketSDES(Vec<SdesChunk>), + PacketBye(Vec<SSRC>, String), + } + + #[deriving(Clone)] + enum Packet { + PacketRTP, + PacketCompoundRTCP(Vec<PacketRTCP>) + } + + // ================================================================================================ fn main() { println!("CRTP") } + // ================================================================================================ + // vim: set ts=2 sw=2 tw=0 et ai:
54
10.8
54
0
30c59942108a8a78bd666190d9ab61c27ddf95f8
source/_download.markdown
source/_download.markdown
Just include the plugin file, [Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.js) stylesheet, [SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.css) and keep reading:
Just include the plugin file, [Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.js) stylesheet, [SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.css) and keep reading:
Fix links to static files
Fix links to static files
Markdown
mit
camerond/windoze,camerond/windoze,camerond/windoze
markdown
## Code Before: Just include the plugin file, [Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.js) stylesheet, [SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.css) and keep reading: ## Instruction: Fix links to static files ## Code After: Just include the plugin file, [Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.js) stylesheet, [SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.css) and keep reading:
Just include the plugin file, - [Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.js) ? ^^^^^^ ------ + [Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.js) ? ^^^^^ stylesheet, - [SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.css) ? ^^ ^^^ ------ + [SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.css) ? ^ ^^^ and keep reading:
4
0.4
2
2
2d15ff38abb68335daa8bb2b94aaeff91ed829a2
photoshell/__main__.py
photoshell/__main__.py
import os import sys import yaml from photoshell import ui config_path = os.path.join(os.environ['HOME'], '.photoshell.yaml') with open(config_path, 'r') as config_file: config = yaml.load(config_file) print('Libray path is {0}'.format(config['library'])) # Open photo viewer ui.render(config['library'])
import os import sys import yaml from photoshell import ui config_path = os.path.join(os.environ['HOME'], '.photoshell.yaml') config = dict( { 'library': os.path.join(os.environ['HOME'], 'Pictures/Photoshell') } ) if os.path.isfile(config_path): with open(config_path, 'r') as config_file: config = yaml.load(config_file) else: with open(config_path, 'w+') as config_file: yaml.dump(config, config_file, default_flow_style=False) print('Libray path is {0}'.format(config['library'])) # Open photo viewer ui.render(config['library'])
Create default config if one doesn't exist
Create default config if one doesn't exist Fixes #20
Python
mit
photoshell/photoshell,SamWhited/photoshell,campaul/photoshell
python
## Code Before: import os import sys import yaml from photoshell import ui config_path = os.path.join(os.environ['HOME'], '.photoshell.yaml') with open(config_path, 'r') as config_file: config = yaml.load(config_file) print('Libray path is {0}'.format(config['library'])) # Open photo viewer ui.render(config['library']) ## Instruction: Create default config if one doesn't exist Fixes #20 ## Code After: import os import sys import yaml from photoshell import ui config_path = os.path.join(os.environ['HOME'], '.photoshell.yaml') config = dict( { 'library': os.path.join(os.environ['HOME'], 'Pictures/Photoshell') } ) if os.path.isfile(config_path): with open(config_path, 'r') as config_file: config = yaml.load(config_file) else: with open(config_path, 'w+') as config_file: yaml.dump(config, config_file, default_flow_style=False) print('Libray path is {0}'.format(config['library'])) # Open photo viewer ui.render(config['library'])
import os import sys import yaml from photoshell import ui - config_path = os.path.join(os.environ['HOME'], '.photoshell.yaml') + config = dict( + { + 'library': os.path.join(os.environ['HOME'], 'Pictures/Photoshell') + } + ) + if os.path.isfile(config_path): - with open(config_path, 'r') as config_file: + with open(config_path, 'r') as config_file: ? ++++ - config = yaml.load(config_file) + config = yaml.load(config_file) ? ++++ + else: + with open(config_path, 'w+') as config_file: + yaml.dump(config, config_file, default_flow_style=False) print('Libray path is {0}'.format(config['library'])) # Open photo viewer ui.render(config['library'])
14
0.823529
11
3
a1c8456f35bf75e6f6e58735ab613536d66541dd
README.md
README.md
Sanitize-Rails - sanitize .. on Rails. [![Build Status](https://travis-ci.org/vjt/sanitize-rails.png?branch=4-mark-cleaned-strings-as-html-safe)](https://travis-ci.org/vjt/sanitize-rails) ====================================== Installation ------------ Gemfile: gem 'sanitize-rails', :require => 'sanitize/rails' Configuration ------------- config/initializers/sanitizer.rb: Sanitize::Rails.configure( :elements => [ ... ], :attribiutes => { ... }, ... ) There's an example in the `example/` directory. Usage ----- app/models/foo.rb: sanitizes :field sanitizes :some_other_field, :on => :create sanitizes :yet_another_field, :on => :save ActionView `sanitize` helper is overriden to use the Sanitize gem - transparently. Testing ------- Only Test::Unit for now - please write matchers and send a pull request :-) test/test\_helper: Sanitize::Rails::TestHelpers.setup(self, :invalid => 'some <a>string', :valid => 'some <a>string</a>' ) your test: assert_sanitizes(Model, :field, :some_other_field) Compatibility ------------- Tested with Rails 3.0 ~ 4.0 under Ruby 1.9 and 2.0. License ------- MIT Have fun!
Sanitize-Rails - sanitize .. on Rails. [![Build Status](https://travis-ci.org/vjt/sanitize-rails.png)](https://travis-ci.org/vjt/sanitize-rails) ====================================== Installation ------------ Gemfile: gem 'sanitize-rails', :require => 'sanitize/rails' Configuration ------------- config/initializers/sanitizer.rb: Sanitize::Rails.configure( :elements => [ ... ], :attribiutes => { ... }, ... ) There's an example in the `example/` directory. Usage ----- app/models/foo.rb: sanitizes :field sanitizes :some_other_field, :on => :create sanitizes :yet_another_field, :on => :save ActionView `sanitize` helper is overriden to use the Sanitize gem - transparently. Testing ------- Only Test::Unit for now - please write matchers and send a pull request :-) test/test\_helper: Sanitize::Rails::TestHelpers.setup(self, :invalid => 'some <a>string', :valid => 'some <a>string</a>' ) your test: assert_sanitizes(Model, :field, :some_other_field) Compatibility ------------- Tested with Rails 3.0 ~ 4.0 under Ruby 1.9 and 2.0. License ------- MIT Have fun!
Fix a derp; build status badge should be for master, not a dev branch!
Fix a derp; build status badge should be for master, not a dev branch!
Markdown
mit
vjt/sanitize-rails
markdown
## Code Before: Sanitize-Rails - sanitize .. on Rails. [![Build Status](https://travis-ci.org/vjt/sanitize-rails.png?branch=4-mark-cleaned-strings-as-html-safe)](https://travis-ci.org/vjt/sanitize-rails) ====================================== Installation ------------ Gemfile: gem 'sanitize-rails', :require => 'sanitize/rails' Configuration ------------- config/initializers/sanitizer.rb: Sanitize::Rails.configure( :elements => [ ... ], :attribiutes => { ... }, ... ) There's an example in the `example/` directory. Usage ----- app/models/foo.rb: sanitizes :field sanitizes :some_other_field, :on => :create sanitizes :yet_another_field, :on => :save ActionView `sanitize` helper is overriden to use the Sanitize gem - transparently. Testing ------- Only Test::Unit for now - please write matchers and send a pull request :-) test/test\_helper: Sanitize::Rails::TestHelpers.setup(self, :invalid => 'some <a>string', :valid => 'some <a>string</a>' ) your test: assert_sanitizes(Model, :field, :some_other_field) Compatibility ------------- Tested with Rails 3.0 ~ 4.0 under Ruby 1.9 and 2.0. License ------- MIT Have fun! ## Instruction: Fix a derp; build status badge should be for master, not a dev branch! ## Code After: Sanitize-Rails - sanitize .. on Rails. [![Build Status](https://travis-ci.org/vjt/sanitize-rails.png)](https://travis-ci.org/vjt/sanitize-rails) ====================================== Installation ------------ Gemfile: gem 'sanitize-rails', :require => 'sanitize/rails' Configuration ------------- config/initializers/sanitizer.rb: Sanitize::Rails.configure( :elements => [ ... ], :attribiutes => { ... }, ... ) There's an example in the `example/` directory. Usage ----- app/models/foo.rb: sanitizes :field sanitizes :some_other_field, :on => :create sanitizes :yet_another_field, :on => :save ActionView `sanitize` helper is overriden to use the Sanitize gem - transparently. Testing ------- Only Test::Unit for now - please write matchers and send a pull request :-) test/test\_helper: Sanitize::Rails::TestHelpers.setup(self, :invalid => 'some <a>string', :valid => 'some <a>string</a>' ) your test: assert_sanitizes(Model, :field, :some_other_field) Compatibility ------------- Tested with Rails 3.0 ~ 4.0 under Ruby 1.9 and 2.0. License ------- MIT Have fun!
- Sanitize-Rails - sanitize .. on Rails. [![Build Status](https://travis-ci.org/vjt/sanitize-rails.png?branch=4-mark-cleaned-strings-as-html-safe)](https://travis-ci.org/vjt/sanitize-rails) ? ------------------------------------------- + Sanitize-Rails - sanitize .. on Rails. [![Build Status](https://travis-ci.org/vjt/sanitize-rails.png)](https://travis-ci.org/vjt/sanitize-rails) ====================================== Installation ------------ Gemfile: gem 'sanitize-rails', :require => 'sanitize/rails' Configuration ------------- config/initializers/sanitizer.rb: Sanitize::Rails.configure( :elements => [ ... ], :attribiutes => { ... }, ... ) There's an example in the `example/` directory. Usage ----- app/models/foo.rb: sanitizes :field sanitizes :some_other_field, :on => :create sanitizes :yet_another_field, :on => :save ActionView `sanitize` helper is overriden to use the Sanitize gem - transparently. Testing ------- Only Test::Unit for now - please write matchers and send a pull request :-) test/test\_helper: Sanitize::Rails::TestHelpers.setup(self, :invalid => 'some <a>string', :valid => 'some <a>string</a>' ) your test: assert_sanitizes(Model, :field, :some_other_field) Compatibility ------------- Tested with Rails 3.0 ~ 4.0 under Ruby 1.9 and 2.0. License ------- MIT Have fun!
2
0.03125
1
1
d6ae82e5b8e04f6bea71a77cfb2ab3cf2a6ad2f0
app/controllers/api/v1/lessons_tokens_controller.rb
app/controllers/api/v1/lessons_tokens_controller.rb
class Api::V1::LessonsTokensController < Api::ApiController skip_before_action :verify_authenticity_token def create token = LessonsTokenCreator .new(current_user, lessons_token_params[:classroom_activity_id]) .create render json: { token: token } end private def lessons_token_params params.require(:lessons_token).permit(:classroom_activity_id) end end
class Api::V1::LessonsTokensController < Api::ApiController skip_before_action :verify_authenticity_token def create token = LessonsTokenCreator .new(current_user, params[:classroom_activity_id]) .create render json: { token: token } end end
Edit param input for lessons token controller
Edit param input for lessons token controller
Ruby
agpl-3.0
empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core
ruby
## Code Before: class Api::V1::LessonsTokensController < Api::ApiController skip_before_action :verify_authenticity_token def create token = LessonsTokenCreator .new(current_user, lessons_token_params[:classroom_activity_id]) .create render json: { token: token } end private def lessons_token_params params.require(:lessons_token).permit(:classroom_activity_id) end end ## Instruction: Edit param input for lessons token controller ## Code After: class Api::V1::LessonsTokensController < Api::ApiController skip_before_action :verify_authenticity_token def create token = LessonsTokenCreator .new(current_user, params[:classroom_activity_id]) .create render json: { token: token } end end
class Api::V1::LessonsTokensController < Api::ApiController skip_before_action :verify_authenticity_token def create token = LessonsTokenCreator - .new(current_user, lessons_token_params[:classroom_activity_id]) ? -------------- + .new(current_user, params[:classroom_activity_id]) .create render json: { token: token } end - - private - - def lessons_token_params - params.require(:lessons_token).permit(:classroom_activity_id) - end end
8
0.5
1
7
c7d2e917df5e0c2182e351b5157271b6e62a06cd
app/soc/modules/gsoc/models/timeline.py
app/soc/modules/gsoc/models/timeline.py
from google.appengine.ext import db from django.utils.translation import ugettext import soc.models.timeline class GSoCTimeline(soc.models.timeline.Timeline): """GSoC Timeline model extends the basic Program Timeline model. """ application_review_deadline = db.DateTimeProperty( verbose_name=ugettext('Application Review Deadline')) student_application_matched_deadline = db.DateTimeProperty( verbose_name=ugettext('Student Application Matched Deadline')) accepted_students_announced_deadline = db.DateTimeProperty( verbose_name=ugettext('Accepted Students Announced Deadline'))
from google.appengine.ext import db from django.utils.translation import ugettext import soc.models.timeline class GSoCTimeline(soc.models.timeline.Timeline): """GSoC Timeline model extends the basic Program Timeline model. """ application_review_deadline = db.DateTimeProperty( verbose_name=ugettext('Organizations Review Student Applications Deadline')) student_application_matched_deadline = db.DateTimeProperty( verbose_name=ugettext('Students Matched to Mentors Deadline')) accepted_students_announced_deadline = db.DateTimeProperty( verbose_name=ugettext('Accepted Students Announced Deadline'))
Change verbage on program profile info.
Change verbage on program profile info. Fixes issue 1601.
Python
apache-2.0
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
python
## Code Before: from google.appengine.ext import db from django.utils.translation import ugettext import soc.models.timeline class GSoCTimeline(soc.models.timeline.Timeline): """GSoC Timeline model extends the basic Program Timeline model. """ application_review_deadline = db.DateTimeProperty( verbose_name=ugettext('Application Review Deadline')) student_application_matched_deadline = db.DateTimeProperty( verbose_name=ugettext('Student Application Matched Deadline')) accepted_students_announced_deadline = db.DateTimeProperty( verbose_name=ugettext('Accepted Students Announced Deadline')) ## Instruction: Change verbage on program profile info. Fixes issue 1601. ## Code After: from google.appengine.ext import db from django.utils.translation import ugettext import soc.models.timeline class GSoCTimeline(soc.models.timeline.Timeline): """GSoC Timeline model extends the basic Program Timeline model. """ application_review_deadline = db.DateTimeProperty( verbose_name=ugettext('Organizations Review Student Applications Deadline')) student_application_matched_deadline = db.DateTimeProperty( verbose_name=ugettext('Students Matched to Mentors Deadline')) accepted_students_announced_deadline = db.DateTimeProperty( verbose_name=ugettext('Accepted Students Announced Deadline'))
from google.appengine.ext import db from django.utils.translation import ugettext import soc.models.timeline class GSoCTimeline(soc.models.timeline.Timeline): """GSoC Timeline model extends the basic Program Timeline model. """ application_review_deadline = db.DateTimeProperty( - verbose_name=ugettext('Application Review Deadline')) + verbose_name=ugettext('Organizations Review Student Applications Deadline')) student_application_matched_deadline = db.DateTimeProperty( - verbose_name=ugettext('Student Application Matched Deadline')) ? ^^^^^^^^^^^^ + verbose_name=ugettext('Students Matched to Mentors Deadline')) ? ^ +++++++++++ accepted_students_announced_deadline = db.DateTimeProperty( verbose_name=ugettext('Accepted Students Announced Deadline'))
4
0.190476
2
2
c344d2538030f97f17cb17b86ae32ef578e42474
CHANGELOG.md
CHANGELOG.md
All Notable changes to `Datatable` will be documented in this file ## 0.2.0 - 2015-12-14 ### Added * [Datatable 1.10 Support] [#14](https://github.com/OpenSkill/Datatable/issues/14) - Added support for the current version of datatables and made it default ## 0.1.2 - 2015-12-13 ### Fixed * [CollectionProvider] [#12](https://github.com/OpenSkill/Datatable/issues/12) - `CollectionProvider` now accepts a custom order function ## 0.1.1 - 2015-12-12 ### Fixed * [CollectionProvider] [#10](https://github.com/OpenSkill/Datatable/issues/10) - Global searches will now respect individual column settings ## 0.1.0 - 2015-12-12 First development version ### Added * [CollectionProvider] Added the abillity to work with collections * [Datatables 1.9 Support] Added support for the legacy version of datatables.
All Notable changes to `Datatable` will be documented in this file ## 0.2.1 - 2016-01-18 ### Fixed * Support Symphony 3.0 [#17](https://github.com/OpenSkill/Datatable/issues/17) - OpenSkill does not work with symfony/http-foundation ~3.0 ## 0.2.0 - 2015-12-14 ### Added * [Datatable 1.10 Support] [#14](https://github.com/OpenSkill/Datatable/issues/14) - Added support for the current version of datatables and made it default ## 0.1.2 - 2015-12-13 ### Fixed * [CollectionProvider] [#12](https://github.com/OpenSkill/Datatable/issues/12) - `CollectionProvider` now accepts a custom order function ## 0.1.1 - 2015-12-12 ### Fixed * [CollectionProvider] [#10](https://github.com/OpenSkill/Datatable/issues/10) - Global searches will now respect individual column settings ## 0.1.0 - 2015-12-12 First development version ### Added * [CollectionProvider] Added the abillity to work with collections * [Datatables 1.9 Support] Added support for the legacy version of datatables.
Update changelog, ready for 0.2.1 tag.
Update changelog, ready for 0.2.1 tag.
Markdown
mit
OpenSkill/Datatable,OpenSkill/Datatable
markdown
## Code Before: All Notable changes to `Datatable` will be documented in this file ## 0.2.0 - 2015-12-14 ### Added * [Datatable 1.10 Support] [#14](https://github.com/OpenSkill/Datatable/issues/14) - Added support for the current version of datatables and made it default ## 0.1.2 - 2015-12-13 ### Fixed * [CollectionProvider] [#12](https://github.com/OpenSkill/Datatable/issues/12) - `CollectionProvider` now accepts a custom order function ## 0.1.1 - 2015-12-12 ### Fixed * [CollectionProvider] [#10](https://github.com/OpenSkill/Datatable/issues/10) - Global searches will now respect individual column settings ## 0.1.0 - 2015-12-12 First development version ### Added * [CollectionProvider] Added the abillity to work with collections * [Datatables 1.9 Support] Added support for the legacy version of datatables. ## Instruction: Update changelog, ready for 0.2.1 tag. ## Code After: All Notable changes to `Datatable` will be documented in this file ## 0.2.1 - 2016-01-18 ### Fixed * Support Symphony 3.0 [#17](https://github.com/OpenSkill/Datatable/issues/17) - OpenSkill does not work with symfony/http-foundation ~3.0 ## 0.2.0 - 2015-12-14 ### Added * [Datatable 1.10 Support] [#14](https://github.com/OpenSkill/Datatable/issues/14) - Added support for the current version of datatables and made it default ## 0.1.2 - 2015-12-13 ### Fixed * [CollectionProvider] [#12](https://github.com/OpenSkill/Datatable/issues/12) - `CollectionProvider` now accepts a custom order function ## 0.1.1 - 2015-12-12 ### Fixed * [CollectionProvider] [#10](https://github.com/OpenSkill/Datatable/issues/10) - Global searches will now respect individual column settings ## 0.1.0 - 2015-12-12 First development version ### Added * [CollectionProvider] Added the abillity to work with collections * [Datatables 1.9 Support] Added support for the legacy version of datatables.
All Notable changes to `Datatable` will be documented in this file + + ## 0.2.1 - 2016-01-18 + ### Fixed + * Support Symphony 3.0 [#17](https://github.com/OpenSkill/Datatable/issues/17) - OpenSkill does not work with symfony/http-foundation ~3.0 ## 0.2.0 - 2015-12-14 ### Added * [Datatable 1.10 Support] [#14](https://github.com/OpenSkill/Datatable/issues/14) - Added support for the current version of datatables and made it default ## 0.1.2 - 2015-12-13 ### Fixed * [CollectionProvider] [#12](https://github.com/OpenSkill/Datatable/issues/12) - `CollectionProvider` now accepts a custom order function ## 0.1.1 - 2015-12-12 ### Fixed * [CollectionProvider] [#10](https://github.com/OpenSkill/Datatable/issues/10) - Global searches will now respect individual column settings ## 0.1.0 - 2015-12-12 First development version ### Added * [CollectionProvider] Added the abillity to work with collections * [Datatables 1.9 Support] Added support for the legacy version of datatables.
4
0.181818
4
0
73bc0183f1bcda752f6fda84aeb9aa50287f3399
tests/server.test.js
tests/server.test.js
const chai = require('chai') const chaiHttp = require('chai-http') const server = require('../server') chai.use(chaiHttp) chai.should() describe('Black box tests', () => { it('GET /index should return status code 200', (done) => { chai.request(server) .get('/') .end((err, res) => { res.should.have.status(200) done() }) }) it('GET an invalid url should return status code 404', (done) => { chai.request(server) .get('/an-invalid-url') .end((err, res) => { res.should.have.status(404) done() }) }) })
const chai = require('chai') const expect = chai.expect const chaiHttp = require('chai-http') const server = require('../server') chai.use(chaiHttp) describe('Black box tests', () => { it('GET /index should return status code 200', (done) => { chai.request(server) .get('/') .end((err, res) => { expect(res.status).to.eq(200) done() }) }) it('GET an invalid url should return status code 404', (done) => { chai.request(server) .get('/an-invalid-url') .end((err, res) => { expect(res.status).to.eq(404) done() }) }) })
Use the chai expect syntax
Use the chai expect syntax
JavaScript
mit
digitalnatives/graphiql-server,digitalnatives/graphiql-server
javascript
## Code Before: const chai = require('chai') const chaiHttp = require('chai-http') const server = require('../server') chai.use(chaiHttp) chai.should() describe('Black box tests', () => { it('GET /index should return status code 200', (done) => { chai.request(server) .get('/') .end((err, res) => { res.should.have.status(200) done() }) }) it('GET an invalid url should return status code 404', (done) => { chai.request(server) .get('/an-invalid-url') .end((err, res) => { res.should.have.status(404) done() }) }) }) ## Instruction: Use the chai expect syntax ## Code After: const chai = require('chai') const expect = chai.expect const chaiHttp = require('chai-http') const server = require('../server') chai.use(chaiHttp) describe('Black box tests', () => { it('GET /index should return status code 200', (done) => { chai.request(server) .get('/') .end((err, res) => { expect(res.status).to.eq(200) done() }) }) it('GET an invalid url should return status code 404', (done) => { chai.request(server) .get('/an-invalid-url') .end((err, res) => { expect(res.status).to.eq(404) done() }) }) })
const chai = require('chai') + const expect = chai.expect const chaiHttp = require('chai-http') const server = require('../server') chai.use(chaiHttp) - chai.should() describe('Black box tests', () => { it('GET /index should return status code 200', (done) => { chai.request(server) .get('/') .end((err, res) => { - res.should.have.status(200) + expect(res.status).to.eq(200) done() }) }) it('GET an invalid url should return status code 404', (done) => { chai.request(server) .get('/an-invalid-url') .end((err, res) => { - res.should.have.status(404) + expect(res.status).to.eq(404) done() }) }) })
6
0.230769
3
3
bbaaaf8b87af682a1ef843ebc51169d92ee0d5d4
.travis.yml
.travis.yml
language: generic dist: trusty sudo: false notifications: email: on_success: never on_failure: change script: - curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh - npm run flow after_success: - curl -s https://raw.githubusercontent.com/lgeiger/prettier-greenkeeper/master/travis.sh | sh env: matrix: - ATOM_CHANNEL=stable - ATOM_CHANNEL=beta
language: generic dist: trusty sudo: false notifications: email: on_success: never on_failure: change script: - curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh - npm run flow after_success: - curl -s https://raw.githubusercontent.com/lgeiger/prettier-greenkeeper/master/travis.sh | sh env: matrix: - ATOM_CHANNEL=stable - ATOM_CHANNEL=beta addons: apt: sources: - ubuntu-toolchain-r-test packages: - g++-6
Fix Travis for Atom 1.19 beta
Fix Travis for Atom 1.19 beta
YAML
mit
nteract/hydrogen,rgbkrk/hydrogen,xanecs/hydrogen,nteract/hydrogen
yaml
## Code Before: language: generic dist: trusty sudo: false notifications: email: on_success: never on_failure: change script: - curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh - npm run flow after_success: - curl -s https://raw.githubusercontent.com/lgeiger/prettier-greenkeeper/master/travis.sh | sh env: matrix: - ATOM_CHANNEL=stable - ATOM_CHANNEL=beta ## Instruction: Fix Travis for Atom 1.19 beta ## Code After: language: generic dist: trusty sudo: false notifications: email: on_success: never on_failure: change script: - curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh - npm run flow after_success: - curl -s https://raw.githubusercontent.com/lgeiger/prettier-greenkeeper/master/travis.sh | sh env: matrix: - ATOM_CHANNEL=stable - ATOM_CHANNEL=beta addons: apt: sources: - ubuntu-toolchain-r-test packages: - g++-6
language: generic dist: trusty sudo: false notifications: email: on_success: never on_failure: change script: - curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh - npm run flow after_success: - curl -s https://raw.githubusercontent.com/lgeiger/prettier-greenkeeper/master/travis.sh | sh env: matrix: - ATOM_CHANNEL=stable - ATOM_CHANNEL=beta + + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6
7
0.368421
7
0
cb1d0ff96546ded5d5ccc778d0112a9e96274e42
guestbook/frontend-controller.json
guestbook/frontend-controller.json
{ "id": "frontendController", "kind": "ReplicationController", "apiVersion": "v1beta1", "desiredState": { "replicas": 3, "replicaSelector": {"name": "frontend"}, "podTemplate": { "desiredState": { "manifest": { "version": "v1beta1", "id": "frontendController", "containers": [{ "name": "php-redis", "image": "brendanburns/php-redis", "ports": [{"containerPort": 80, "hostPort": 8000}] }] } }, "labels": {"name": "frontend"} }}, "labels": {"name": "frontend"} }
{ "id": "frontendController", "kind": "ReplicationController", "apiVersion": "v1beta1", "desiredState": { "replicas": 3, "replicaSelector": {"name": "frontend"}, "podTemplate": { "desiredState": { "manifest": { "version": "v1beta1", "id": "frontendController", "containers": [{ "name": "php-redis", "image": "brendanburns/php-redis", "memory": 10000000, "ports": [{"containerPort": 80, "hostPort": 8000}] }] } }, "labels": {"name": "frontend"} }}, "labels": {"name": "frontend"} }
Add a resource fit scheduler predicate. Set sensible defaults.
Add a resource fit scheduler predicate. Set sensible defaults.
JSON
apache-2.0
kubernetes/examples,kubernetes/examples,kubernetes/examples,kubernetes/examples,kubernetes/examples,kubernetes/examples,kubernetes/examples,kubernetes/examples
json
## Code Before: { "id": "frontendController", "kind": "ReplicationController", "apiVersion": "v1beta1", "desiredState": { "replicas": 3, "replicaSelector": {"name": "frontend"}, "podTemplate": { "desiredState": { "manifest": { "version": "v1beta1", "id": "frontendController", "containers": [{ "name": "php-redis", "image": "brendanburns/php-redis", "ports": [{"containerPort": 80, "hostPort": 8000}] }] } }, "labels": {"name": "frontend"} }}, "labels": {"name": "frontend"} } ## Instruction: Add a resource fit scheduler predicate. Set sensible defaults. ## Code After: { "id": "frontendController", "kind": "ReplicationController", "apiVersion": "v1beta1", "desiredState": { "replicas": 3, "replicaSelector": {"name": "frontend"}, "podTemplate": { "desiredState": { "manifest": { "version": "v1beta1", "id": "frontendController", "containers": [{ "name": "php-redis", "image": "brendanburns/php-redis", "memory": 10000000, "ports": [{"containerPort": 80, "hostPort": 8000}] }] } }, "labels": {"name": "frontend"} }}, "labels": {"name": "frontend"} }
{ "id": "frontendController", "kind": "ReplicationController", "apiVersion": "v1beta1", "desiredState": { "replicas": 3, "replicaSelector": {"name": "frontend"}, "podTemplate": { "desiredState": { "manifest": { "version": "v1beta1", "id": "frontendController", "containers": [{ "name": "php-redis", "image": "brendanburns/php-redis", + "memory": 10000000, "ports": [{"containerPort": 80, "hostPort": 8000}] }] } }, "labels": {"name": "frontend"} }}, "labels": {"name": "frontend"} }
1
0.043478
1
0
8b98d68881f023dd8474b03b28b38adcf5d3c2cf
app/views/sessions/new.html.erb
app/views/sessions/new.html.erb
<h2>Login:</h2> <%= form_tag sessions_path do |f| %> <div> Username: <%= text_field_tag :name %> </div> <div> Email: <%= email_field_tag :email %> </div> <div> Password: <%= password_field_tag :password %> </div> <%= submit_tag 'Log In'%> <% end %>
<h2>Login:</h2> <%= form_tag sessions_path do |f| %> <div> Username: <%= text_field_tag :name %> </div> <div> Email: <%= email_field_tag :email %> </div> <div> Password: <%= password_field_tag :password %> </div> <%= submit_tag 'Log In'%> <% end %> <h2>New User Signup:</h2> <%= form_for User.new do |f| %> <div> <%= f.label :name %> <%= f.text_field :name %> </div> <div> <%= f.label :email %> <%= f.text_field :email %> </div> <div> <%= f.label :password %> <%= f.password_field :password %> </div> <%= f.submit 'Create Account'%> <% end %>
Include new user signup in login page
Include new user signup in login page
HTML+ERB
mit
zlschatz/Mountain-Chat-Rails-App,zlschatz/Mountain-Chat-Rails-App,zlschatz/Mountain-Chat-Rails-App
html+erb
## Code Before: <h2>Login:</h2> <%= form_tag sessions_path do |f| %> <div> Username: <%= text_field_tag :name %> </div> <div> Email: <%= email_field_tag :email %> </div> <div> Password: <%= password_field_tag :password %> </div> <%= submit_tag 'Log In'%> <% end %> ## Instruction: Include new user signup in login page ## Code After: <h2>Login:</h2> <%= form_tag sessions_path do |f| %> <div> Username: <%= text_field_tag :name %> </div> <div> Email: <%= email_field_tag :email %> </div> <div> Password: <%= password_field_tag :password %> </div> <%= submit_tag 'Log In'%> <% end %> <h2>New User Signup:</h2> <%= form_for User.new do |f| %> <div> <%= f.label :name %> <%= f.text_field :name %> </div> <div> <%= f.label :email %> <%= f.text_field :email %> </div> <div> <%= f.label :password %> <%= f.password_field :password %> </div> <%= f.submit 'Create Account'%> <% end %>
<h2>Login:</h2> <%= form_tag sessions_path do |f| %> <div> Username: <%= text_field_tag :name %> </div> <div> Email: <%= email_field_tag :email %> </div> <div> Password: <%= password_field_tag :password %> </div> <%= submit_tag 'Log In'%> <% end %> + + <h2>New User Signup:</h2> + <%= form_for User.new do |f| %> + + <div> + <%= f.label :name %> + <%= f.text_field :name %> + </div> + + <div> + <%= f.label :email %> + <%= f.text_field :email %> + </div> + + <div> + <%= f.label :password %> + <%= f.password_field :password %> + </div> + + <%= f.submit 'Create Account'%> + + <% end %>
22
1.222222
22
0
4fff90f93e0e2621a4f7844305811224b273e7a5
app/helpers/admin/organisation_helper.rb
app/helpers/admin/organisation_helper.rb
module Admin::OrganisationHelper def organisation_role_ordering_fields(outer_form, organisation_roles) outer_form.fields_for :organisation_roles, organisation_roles do |organisation_role_form| label_text = "#{organisation_role_form.object.role.name}, #{organisation_role_form.object.role.current_person_name}" content_tag(:div, organisation_role_form.text_field(:ordering, label_text: label_text, class: "ordering"), class: "well" ) end end end
module Admin::OrganisationHelper def organisation_role_ordering_fields(outer_form, organisation_roles) outer_form.fields_for :organisation_roles, organisation_roles do |organisation_role_form| label_text = "#{organisation_role_form.object.role.name}<br/><strong>#{organisation_role_form.object.role.current_person_name}</strong>".html_safe content_tag(:div, organisation_role_form.text_field(:ordering, label_text: label_text, class: "ordering"), class: "well" ) end end end
Make the role/person clearer when sorting.
Make the role/person clearer when sorting.
Ruby
mit
hotvulcan/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,ggoral/whitehall,robinwhittleton/whitehall,askl56/whitehall,robinwhittleton/whitehall,alphagov/whitehall,ggoral/whitehall,askl56/whitehall,alphagov/whitehall,YOTOV-LIMITED/whitehall,askl56/whitehall,YOTOV-LIMITED/whitehall,ggoral/whitehall,robinwhittleton/whitehall,alphagov/whitehall,robinwhittleton/whitehall,ggoral/whitehall,askl56/whitehall,hotvulcan/whitehall,alphagov/whitehall,YOTOV-LIMITED/whitehall,hotvulcan/whitehall
ruby
## Code Before: module Admin::OrganisationHelper def organisation_role_ordering_fields(outer_form, organisation_roles) outer_form.fields_for :organisation_roles, organisation_roles do |organisation_role_form| label_text = "#{organisation_role_form.object.role.name}, #{organisation_role_form.object.role.current_person_name}" content_tag(:div, organisation_role_form.text_field(:ordering, label_text: label_text, class: "ordering"), class: "well" ) end end end ## Instruction: Make the role/person clearer when sorting. ## Code After: module Admin::OrganisationHelper def organisation_role_ordering_fields(outer_form, organisation_roles) outer_form.fields_for :organisation_roles, organisation_roles do |organisation_role_form| label_text = "#{organisation_role_form.object.role.name}<br/><strong>#{organisation_role_form.object.role.current_person_name}</strong>".html_safe content_tag(:div, organisation_role_form.text_field(:ordering, label_text: label_text, class: "ordering"), class: "well" ) end end end
module Admin::OrganisationHelper def organisation_role_ordering_fields(outer_form, organisation_roles) outer_form.fields_for :organisation_roles, organisation_roles do |organisation_role_form| - label_text = "#{organisation_role_form.object.role.name}, #{organisation_role_form.object.role.current_person_name}" ? ^^ + label_text = "#{organisation_role_form.object.role.name}<br/><strong>#{organisation_role_form.object.role.current_person_name}</strong>".html_safe ? ^^^^^^^^^^^^^ +++++++++ ++++++++++ content_tag(:div, organisation_role_form.text_field(:ordering, label_text: label_text, class: "ordering"), class: "well" ) end end end
2
0.181818
1
1
342df8f8edbd9081770be4aa18da05f86f925855
TEST3/test3.rb
TEST3/test3.rb
def process(document) result = [] file = document columns = [] File.readlines(file).each do |line| records = line.split(' ') year = records[6] p year end end process("T08 (1).1")
require 'date' def process(document) result = [] file = document columns = [] File.readlines(file).each do |line| records = line.split(' ') year = records[6] columns << year end p columns end process("T08 (1).1") class Record # Looking at the people.csv file, # what attributes should a Person object have? attr_reader :table_number, :sub_table, :record_number, :day_of_week, :day_of_month, :month, :year, :total_deaths, :wounded def initialize(args = {}) @table_number = args[:table_number] @sub_table = args[:sub_table] @record_number = args[:record_number] @day_of_week = args[:day_of_week] @day_of_month = args[:day_of_month] @month = args[:month] @year = args[:year] @total_deaths = args[:total_deaths] @wounded = args[:wounded] end end
Create Record class with file columns as attributes
Create Record class with file columns as attributes
Ruby
mit
Tooconfident/TicketFrontier-Test
ruby
## Code Before: def process(document) result = [] file = document columns = [] File.readlines(file).each do |line| records = line.split(' ') year = records[6] p year end end process("T08 (1).1") ## Instruction: Create Record class with file columns as attributes ## Code After: require 'date' def process(document) result = [] file = document columns = [] File.readlines(file).each do |line| records = line.split(' ') year = records[6] columns << year end p columns end process("T08 (1).1") class Record # Looking at the people.csv file, # what attributes should a Person object have? attr_reader :table_number, :sub_table, :record_number, :day_of_week, :day_of_month, :month, :year, :total_deaths, :wounded def initialize(args = {}) @table_number = args[:table_number] @sub_table = args[:sub_table] @record_number = args[:record_number] @day_of_week = args[:day_of_week] @day_of_month = args[:day_of_month] @month = args[:month] @year = args[:year] @total_deaths = args[:total_deaths] @wounded = args[:wounded] end end
+ require 'date' + def process(document) result = [] file = document columns = [] File.readlines(file).each do |line| records = line.split(' ') year = records[6] - p year + columns << year end - + p columns end process("T08 (1).1") + + class Record + # Looking at the people.csv file, + # what attributes should a Person object have? + attr_reader :table_number, :sub_table, :record_number, :day_of_week, :day_of_month, :month, :year, :total_deaths, :wounded + + def initialize(args = {}) + @table_number = args[:table_number] + @sub_table = args[:sub_table] + @record_number = args[:record_number] + @day_of_week = args[:day_of_week] + @day_of_month = args[:day_of_month] + @month = args[:month] + @year = args[:year] + @total_deaths = args[:total_deaths] + @wounded = args[:wounded] + end + end
24
1.846154
22
2
2223ad453b7f2ee80ad23f1afbd9a02495342c15
app.rb
app.rb
require 'bundler' Bundler.require get '/' do 'OMG' end post '/' do if params[:payload] payload = JSON.parse(params[:payload]) # Only trigger message when a new PR is opened if payload['action'] == 'opened' hipchat_msg = format_text_for_pr_message(payload['pull_request']) send_to_dev_underground(hipchat_msg) end end end def format_text_for_pr_message(pr) "PR: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" end def send_to_dev_underground(msg) client = HipChat::Client.new(ENV['HIPCHAT_API']) client['Engineering'].send('Github', msg) end
require 'bundler' Bundler.require get '/' do 'OMG' end post '/' do if params[:payload] payload = JSON.parse(params[:payload]) # Only trigger message when a new PR is opened if payload['action'] == 'opened' msg = message_for_new_pr(payload['pull_request']) send_to_dev_underground(msg) elsif payload['action'] == 'closed' && payload['merged'] msg = message_for_pr_merge(payload['pull_request']) send_to_operations_talk(msg) end end end def message_for_new_pr(pr) "PR: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" end def message_for_pr_merge(pr) "MERGED: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" end def send_to_dev_underground(msg) client = HipChat::Client.new(ENV['HIPCHAT_API']) client['Engineering'].send('Github', msg) end def send_to_operations_talk(msg) client['Operations talk'].send('Github', msg, color: "green") end def hipchat_client HipChat::Client.new(ENV['HIPCHAT_API']) end
Send merged PRs to Operations Talk
Send merged PRs to Operations Talk
Ruby
mit
brandonhilkert/pipeline_pr
ruby
## Code Before: require 'bundler' Bundler.require get '/' do 'OMG' end post '/' do if params[:payload] payload = JSON.parse(params[:payload]) # Only trigger message when a new PR is opened if payload['action'] == 'opened' hipchat_msg = format_text_for_pr_message(payload['pull_request']) send_to_dev_underground(hipchat_msg) end end end def format_text_for_pr_message(pr) "PR: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" end def send_to_dev_underground(msg) client = HipChat::Client.new(ENV['HIPCHAT_API']) client['Engineering'].send('Github', msg) end ## Instruction: Send merged PRs to Operations Talk ## Code After: require 'bundler' Bundler.require get '/' do 'OMG' end post '/' do if params[:payload] payload = JSON.parse(params[:payload]) # Only trigger message when a new PR is opened if payload['action'] == 'opened' msg = message_for_new_pr(payload['pull_request']) send_to_dev_underground(msg) elsif payload['action'] == 'closed' && payload['merged'] msg = message_for_pr_merge(payload['pull_request']) send_to_operations_talk(msg) end end end def message_for_new_pr(pr) "PR: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" end def message_for_pr_merge(pr) "MERGED: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" end def send_to_dev_underground(msg) client = HipChat::Client.new(ENV['HIPCHAT_API']) client['Engineering'].send('Github', msg) end def send_to_operations_talk(msg) client['Operations talk'].send('Github', msg, color: "green") end def hipchat_client HipChat::Client.new(ENV['HIPCHAT_API']) end
require 'bundler' Bundler.require get '/' do 'OMG' end post '/' do if params[:payload] payload = JSON.parse(params[:payload]) # Only trigger message when a new PR is opened if payload['action'] == 'opened' + msg = message_for_new_pr(payload['pull_request']) - - hipchat_msg = format_text_for_pr_message(payload['pull_request']) - send_to_dev_underground(hipchat_msg) ? -------- + send_to_dev_underground(msg) + elsif payload['action'] == 'closed' && payload['merged'] + msg = message_for_pr_merge(payload['pull_request']) + send_to_operations_talk(msg) end end end - def format_text_for_pr_message(pr) + def message_for_new_pr(pr) "PR: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" + end + + def message_for_pr_merge(pr) + "MERGED: #{pr['head']['repo']['name']}/#{pr['number']} - <a href='#{pr['html_url']}' >#{pr['title']}</a> (#{pr['user']['login']})" end def send_to_dev_underground(msg) client = HipChat::Client.new(ENV['HIPCHAT_API']) client['Engineering'].send('Github', msg) end + + def send_to_operations_talk(msg) + client['Operations talk'].send('Github', msg, color: "green") + end + + def hipchat_client + HipChat::Client.new(ENV['HIPCHAT_API']) + end +
23
0.821429
19
4
9e1b1ebe39d597997771a78a60abe64f1ac9ef84
File/Name/Util/FileNameUtil.sh
File/Name/Util/FileNameUtil.sh
include Base/Util/BaseUtil.sh include String/Util/StringUtil.sh FileNameUtil(){ getPath(){ path=${1} if [[ $(BaseUtil getOS) =~ NT ]]; then _drive=${path:1:1} drive=${_drive^} headlessPath=${path/\/[a-z]/} echo ${drive}:${headlessPath} else echo ${path} fi } $@ }
include OS/Validator/OSValidator.sh include String/Util/StringUtil.sh FileNameUtil(){ getPath(){ path=${1} if [[ $(OSValidator isWindows) ]]; then _drive=${path:1:1} drive=${_drive^} headlessPath=${path/\/[a-z]/} echo ${drive}:${headlessPath} else echo ${path} fi } $@ }
Use validator to check filepath format
Use validator to check filepath format
Shell
mit
anthony-chu/build-tool
shell
## Code Before: include Base/Util/BaseUtil.sh include String/Util/StringUtil.sh FileNameUtil(){ getPath(){ path=${1} if [[ $(BaseUtil getOS) =~ NT ]]; then _drive=${path:1:1} drive=${_drive^} headlessPath=${path/\/[a-z]/} echo ${drive}:${headlessPath} else echo ${path} fi } $@ } ## Instruction: Use validator to check filepath format ## Code After: include OS/Validator/OSValidator.sh include String/Util/StringUtil.sh FileNameUtil(){ getPath(){ path=${1} if [[ $(OSValidator isWindows) ]]; then _drive=${path:1:1} drive=${_drive^} headlessPath=${path/\/[a-z]/} echo ${drive}:${headlessPath} else echo ${path} fi } $@ }
- include Base/Util/BaseUtil.sh + include OS/Validator/OSValidator.sh include String/Util/StringUtil.sh FileNameUtil(){ getPath(){ path=${1} - if [[ $(BaseUtil getOS) =~ NT ]]; then + if [[ $(OSValidator isWindows) ]]; then _drive=${path:1:1} drive=${_drive^} headlessPath=${path/\/[a-z]/} echo ${drive}:${headlessPath} else echo ${path} fi } $@ }
4
0.2
2
2
7c19642fe111b98d276c0ea8de99e56c4f089033
src/main/java/cms/qermit/prototype/PrototypeApplication.java
src/main/java/cms/qermit/prototype/PrototypeApplication.java
package cms.qermit.prototype; import cms.qermit.prototype.mongo.TokenRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class PrototypeApplication { @Autowired private TokenRepository tokenRepository; public static void main(String[] args) throws Exception { SpringApplication.run(PrototypeApplication.class, args); } }
package cms.qermit.prototype; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class PrototypeApplication { public static void main(String[] args) throws Exception { SpringApplication.run(PrototypeApplication.class, args); } }
Remove unused dependency in application class
Remove unused dependency in application class
Java
apache-2.0
qermit-cms/prototype-a
java
## Code Before: package cms.qermit.prototype; import cms.qermit.prototype.mongo.TokenRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class PrototypeApplication { @Autowired private TokenRepository tokenRepository; public static void main(String[] args) throws Exception { SpringApplication.run(PrototypeApplication.class, args); } } ## Instruction: Remove unused dependency in application class ## Code After: package cms.qermit.prototype; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class PrototypeApplication { public static void main(String[] args) throws Exception { SpringApplication.run(PrototypeApplication.class, args); } }
package cms.qermit.prototype; - import cms.qermit.prototype.mongo.TokenRepository; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class PrototypeApplication { + - - @Autowired - private TokenRepository tokenRepository; - public static void main(String[] args) throws Exception { SpringApplication.run(PrototypeApplication.class, args); } }
7
0.388889
1
6
71992fbaf93f0aa50e6244a571ea723aa8476382
packages/hs/hslua-module-text.yaml
packages/hs/hslua-module-text.yaml
homepage: https://github.com/hslua/hslua-text-module changelog-type: markdown hash: a81cee216643fe4a59133fba3288c96997ec2ee91ffb1cdd94ae6c2bc45e5369 test-bench-deps: base: -any text: -any hslua-module-text: -any tasty-hunit: -any tasty: -any hslua: -any maintainer: albert+hslua@zeitkraut.de synopsis: Lua module for text changelog: ! '# Revision history for hslua-module-text ## 0.1 -- 2017-11-15 * First version. Released on an unsuspecting world. ' basic-deps: base: ! '>=4.8 && <4.11' text: ! '>=1 && <1.3' hslua: ! '>=0.9 && <0.10' all-versions: - '0.1' author: Albert Krewinkel latest: '0.1' description-type: haddock description: UTF-8 aware subset of Lua's `string` module. license-name: MIT
homepage: https://github.com/hslua/hslua-module-test changelog-type: markdown hash: 53fdb4bb0868fabef7a8dfb4ab08c554f7dffd980196c282afc0f32a4937fbf7 test-bench-deps: base: -any text: -any hslua-module-text: -any tasty-hunit: -any tasty: -any hslua: -any maintainer: albert+hslua@zeitkraut.de synopsis: Lua module for text changelog: ! '# Revision history for hslua-module-text ## 0.1.1 -- 2017-11-16 * Lift restriction on base to allow GHC 7.8. ## 0.1 -- 2017-11-15 * First version. Released on an unsuspecting world. ' basic-deps: base: ! '>=4.7 && <4.11' text: ! '>=1 && <1.3' hslua: ! '>=0.9 && <0.10' all-versions: - '0.1' - '0.1.1' author: Albert Krewinkel latest: '0.1.1' description-type: haddock description: UTF-8 aware subset of Lua's `string` module. license-name: MIT
Update from Hackage at 2017-11-16T21:37:49Z
Update from Hackage at 2017-11-16T21:37:49Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/hslua/hslua-text-module changelog-type: markdown hash: a81cee216643fe4a59133fba3288c96997ec2ee91ffb1cdd94ae6c2bc45e5369 test-bench-deps: base: -any text: -any hslua-module-text: -any tasty-hunit: -any tasty: -any hslua: -any maintainer: albert+hslua@zeitkraut.de synopsis: Lua module for text changelog: ! '# Revision history for hslua-module-text ## 0.1 -- 2017-11-15 * First version. Released on an unsuspecting world. ' basic-deps: base: ! '>=4.8 && <4.11' text: ! '>=1 && <1.3' hslua: ! '>=0.9 && <0.10' all-versions: - '0.1' author: Albert Krewinkel latest: '0.1' description-type: haddock description: UTF-8 aware subset of Lua's `string` module. license-name: MIT ## Instruction: Update from Hackage at 2017-11-16T21:37:49Z ## Code After: homepage: https://github.com/hslua/hslua-module-test changelog-type: markdown hash: 53fdb4bb0868fabef7a8dfb4ab08c554f7dffd980196c282afc0f32a4937fbf7 test-bench-deps: base: -any text: -any hslua-module-text: -any tasty-hunit: -any tasty: -any hslua: -any maintainer: albert+hslua@zeitkraut.de synopsis: Lua module for text changelog: ! '# Revision history for hslua-module-text ## 0.1.1 -- 2017-11-16 * Lift restriction on base to allow GHC 7.8. ## 0.1 -- 2017-11-15 * First version. Released on an unsuspecting world. ' basic-deps: base: ! '>=4.7 && <4.11' text: ! '>=1 && <1.3' hslua: ! '>=0.9 && <0.10' all-versions: - '0.1' - '0.1.1' author: Albert Krewinkel latest: '0.1.1' description-type: haddock description: UTF-8 aware subset of Lua's `string` module. license-name: MIT
- homepage: https://github.com/hslua/hslua-text-module ? ----- + homepage: https://github.com/hslua/hslua-module-test ? +++++ changelog-type: markdown - hash: a81cee216643fe4a59133fba3288c96997ec2ee91ffb1cdd94ae6c2bc45e5369 + hash: 53fdb4bb0868fabef7a8dfb4ab08c554f7dffd980196c282afc0f32a4937fbf7 test-bench-deps: base: -any text: -any hslua-module-text: -any tasty-hunit: -any tasty: -any hslua: -any maintainer: albert+hslua@zeitkraut.de synopsis: Lua module for text changelog: ! '# Revision history for hslua-module-text + ## 0.1.1 -- 2017-11-16 + + + * Lift restriction on base to allow GHC 7.8. + + + ## 0.1 -- 2017-11-15 * First version. Released on an unsuspecting world. ' basic-deps: - base: ! '>=4.8 && <4.11' ? ^ + base: ! '>=4.7 && <4.11' ? ^ text: ! '>=1 && <1.3' hslua: ! '>=0.9 && <0.10' all-versions: - '0.1' + - '0.1.1' author: Albert Krewinkel - latest: '0.1' + latest: '0.1.1' ? ++ description-type: haddock description: UTF-8 aware subset of Lua's `string` module. license-name: MIT
16
0.5
12
4
c176213c87b1e63da4e79f10b95c5b34a5ec3fce
OpenIPSL/NonElectrical/Logical/LV_GATE.mo
OpenIPSL/NonElectrical/Logical/LV_GATE.mo
within OpenIPSL.NonElectrical.Logical; block LV_GATE "Passes through the lower value of the two inputs" extends Modelica.Blocks.Math.Min; equation connect(y, y) annotation (Line(points={{110,0},{110,0}}, color={0,0,127})); annotation (Icon(graphics={Polygon( points={{-100,100},{40,100},{100,0},{40,-100},{-100,-100},{-100,100}}, lineColor={28,108,200}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( extent={{-100,40},{60,-40}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.None, textString="LV GATE")})); end LV_GATE;
within OpenIPSL.NonElectrical.Logical; block LV_GATE "Passes through the lower value of the two inputs" extends Modelica.Blocks.Math.Min; annotation (Icon(graphics={Polygon( points={{-100,100},{40,100},{100,0},{40,-100},{-100,-100},{-100,100}}, lineColor={28,108,200}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( extent={{-100,40},{60,-40}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.None, textString="LV GATE")})); end LV_GATE;
Remove dummy erroneous self connection.
Remove dummy erroneous self connection.
Modelica
bsd-3-clause
SmarTS-Lab/OpenIPSL,SmarTS-Lab/OpenIPSL,OpenIPSL/OpenIPSL
modelica
## Code Before: within OpenIPSL.NonElectrical.Logical; block LV_GATE "Passes through the lower value of the two inputs" extends Modelica.Blocks.Math.Min; equation connect(y, y) annotation (Line(points={{110,0},{110,0}}, color={0,0,127})); annotation (Icon(graphics={Polygon( points={{-100,100},{40,100},{100,0},{40,-100},{-100,-100},{-100,100}}, lineColor={28,108,200}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( extent={{-100,40},{60,-40}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.None, textString="LV GATE")})); end LV_GATE; ## Instruction: Remove dummy erroneous self connection. ## Code After: within OpenIPSL.NonElectrical.Logical; block LV_GATE "Passes through the lower value of the two inputs" extends Modelica.Blocks.Math.Min; annotation (Icon(graphics={Polygon( points={{-100,100},{40,100},{100,0},{40,-100},{-100,-100},{-100,100}}, lineColor={28,108,200}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( extent={{-100,40},{60,-40}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.None, textString="LV GATE")})); end LV_GATE;
within OpenIPSL.NonElectrical.Logical; block LV_GATE "Passes through the lower value of the two inputs" extends Modelica.Blocks.Math.Min; - equation - connect(y, y) annotation (Line(points={{110,0},{110,0}}, color={0,0,127})); annotation (Icon(graphics={Polygon( points={{-100,100},{40,100},{100,0},{40,-100},{-100,-100},{-100,100}}, lineColor={28,108,200}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( extent={{-100,40},{60,-40}}, lineColor={0,0,255}, fillColor={255,255,255}, fillPattern=FillPattern.None, textString="LV GATE")})); end LV_GATE;
2
0.117647
0
2
40cd4f7703c414e559b73de8cdc105d0bd29edfe
pi-setup.sh
pi-setup.sh
sudo apt-get install \ chromium-browser \ ttf-mscorefonts-installer \ git \ vim \ build-essential \ openssl \ libssl-dev \ bluetooth \ bluez-utils \ blueman # install node version manager (nvm) curl https://raw.githubusercontent.com/creationix/nvm/v0.17.1/install.sh | bash nvm install v0.10.32
sudo apt-get install \ chromium-browser \ ttf-mscorefonts-installer \ git \ vim \ build-essential \ openssl \ libssl-dev \ bluetooth \ bluez-utils \ blueman # install node version manager (nvm) curl https://raw.githubusercontent.com/creationix/nvm/v0.17.1/install.sh | bash # 0.10.28 is the last version with a prebuilt arm-pi binary for node nvm install v0.10.28
Use node 0.10.28, the last version with a prebuilt arm-pi binary.
Use node 0.10.28, the last version with a prebuilt arm-pi binary.
Shell
mit
bekk/bekkboard,bekk/bekkboard,bekk/bekkboard,bekk/bekkboard
shell
## Code Before: sudo apt-get install \ chromium-browser \ ttf-mscorefonts-installer \ git \ vim \ build-essential \ openssl \ libssl-dev \ bluetooth \ bluez-utils \ blueman # install node version manager (nvm) curl https://raw.githubusercontent.com/creationix/nvm/v0.17.1/install.sh | bash nvm install v0.10.32 ## Instruction: Use node 0.10.28, the last version with a prebuilt arm-pi binary. ## Code After: sudo apt-get install \ chromium-browser \ ttf-mscorefonts-installer \ git \ vim \ build-essential \ openssl \ libssl-dev \ bluetooth \ bluez-utils \ blueman # install node version manager (nvm) curl https://raw.githubusercontent.com/creationix/nvm/v0.17.1/install.sh | bash # 0.10.28 is the last version with a prebuilt arm-pi binary for node nvm install v0.10.28
sudo apt-get install \ chromium-browser \ ttf-mscorefonts-installer \ git \ vim \ build-essential \ openssl \ libssl-dev \ bluetooth \ bluez-utils \ blueman # install node version manager (nvm) curl https://raw.githubusercontent.com/creationix/nvm/v0.17.1/install.sh | bash + # 0.10.28 is the last version with a prebuilt arm-pi binary for node - nvm install v0.10.32 ? - + nvm install v0.10.28 ? +
3
0.1875
2
1
84dea9ec30135e193789bc81c982070f4389427e
api/serializers.py
api/serializers.py
from django.forms import widgets from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User class ReadingSerializer(serializers.ModelSerializer): owner = serializers.Field(source='owner.username') class Meta: model = Reading fields = ('created', 'owner', 'pm10', 'pm10_reading', 'pm25', 'pm25_reading')
from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User import datetime class ReadingSerializer(serializers.HyperlinkedModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Reading fields = ('url', 'pm10', 'pm25', 'pm10count', 'pm25count','created', 'owner','createdHour') def create(self, validated_data): return Reading.objects.create(**validated_data) class UserSerializer(serializers.HyperlinkedModelSerializer): readings = serializers.HyperlinkedRelatedField(many=True, view_name='reading-detail', read_only=True) class Meta: model = User fields = ('url', 'username', 'password', 'email', 'readings') write_only_fields = ('password',)
Add User Serializer to be able to create users from REST API
Add User Serializer to be able to create users from REST API
Python
bsd-3-clause
developmentseed/dustduino-server,codefornigeria/dustduino-server,developmentseed/dustduino-server,codefornigeria/dustduino-server,codefornigeria/dustduino-server,developmentseed/dustduino-server
python
## Code Before: from django.forms import widgets from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User class ReadingSerializer(serializers.ModelSerializer): owner = serializers.Field(source='owner.username') class Meta: model = Reading fields = ('created', 'owner', 'pm10', 'pm10_reading', 'pm25', 'pm25_reading') ## Instruction: Add User Serializer to be able to create users from REST API ## Code After: from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User import datetime class ReadingSerializer(serializers.HyperlinkedModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Reading fields = ('url', 'pm10', 'pm25', 'pm10count', 'pm25count','created', 'owner','createdHour') def create(self, validated_data): return Reading.objects.create(**validated_data) class UserSerializer(serializers.HyperlinkedModelSerializer): readings = serializers.HyperlinkedRelatedField(many=True, view_name='reading-detail', read_only=True) class Meta: model = User fields = ('url', 'username', 'password', 'email', 'readings') write_only_fields = ('password',)
- from django.forms import widgets from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User + import datetime + - class ReadingSerializer(serializers.ModelSerializer): + class ReadingSerializer(serializers.HyperlinkedModelSerializer): ? +++++++++++ - owner = serializers.Field(source='owner.username') + owner = serializers.ReadOnlyField(source='owner.username') ? ++++++++ + class Meta: model = Reading - fields = ('created', 'owner', 'pm10', 'pm10_reading', - 'pm25', 'pm25_reading') + fields = ('url', 'pm10', 'pm25', 'pm10count', 'pm25count','created', 'owner','createdHour') + + def create(self, validated_data): + return Reading.objects.create(**validated_data) + + class UserSerializer(serializers.HyperlinkedModelSerializer): + readings = serializers.HyperlinkedRelatedField(many=True, view_name='reading-detail', read_only=True) + + class Meta: + model = User + fields = ('url', 'username', 'password', 'email', 'readings') + write_only_fields = ('password',)
22
2
17
5
9cc150f01f8c2f57b29bb074b2fc75b18416c9ce
cluster/addons/metadata-agent/stackdriver/metadata-agent-rbac.yaml
cluster/addons/metadata-agent/stackdriver/metadata-agent-rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: system:metadata-agent labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile rules: - apiGroups: - "" - "apps" - "extensions" resources: - "*" verbs: - watch - get - list --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: system:metadata-agent labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: system:metadata-agent subjects: - kind: ServiceAccount name: metadata-agent namespace: kube-system
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: stackdriver:metadata-agent labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile rules: - apiGroups: - "" - "apps" - "extensions" resources: - "*" verbs: - watch - get - list --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: stackdriver:metadata-agent labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: stackdriver:metadata-agent subjects: - kind: ServiceAccount name: metadata-agent namespace: kube-system
Remove 'system' prefix from Metadata Agent rbac configuration
Remove 'system' prefix from Metadata Agent rbac configuration
YAML
apache-2.0
kjvalencik/kubernetes,kjvalencik/kubernetes,kjvalencik/kubernetes,kjvalencik/kubernetes,kjvalencik/kubernetes,kjvalencik/kubernetes
yaml
## Code Before: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: system:metadata-agent labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile rules: - apiGroups: - "" - "apps" - "extensions" resources: - "*" verbs: - watch - get - list --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: system:metadata-agent labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: system:metadata-agent subjects: - kind: ServiceAccount name: metadata-agent namespace: kube-system ## Instruction: Remove 'system' prefix from Metadata Agent rbac configuration ## Code After: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: stackdriver:metadata-agent labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile rules: - apiGroups: - "" - "apps" - "extensions" resources: - "*" verbs: - watch - get - list --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: stackdriver:metadata-agent labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: stackdriver:metadata-agent subjects: - kind: ServiceAccount name: metadata-agent namespace: kube-system
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: system:metadata-agent ? -- ^ + name: stackdriver:metadata-agent ? +++++++ ^ labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile rules: - apiGroups: - "" - "apps" - "extensions" resources: - "*" verbs: - watch - get - list --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: system:metadata-agent ? -- ^ + name: stackdriver:metadata-agent ? +++++++ ^ labels: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: system:metadata-agent ? -- ^ + name: stackdriver:metadata-agent ? +++++++ ^ subjects: - kind: ServiceAccount name: metadata-agent namespace: kube-system
6
0.176471
3
3
a2493238da3ac77c5af7856001310cca9152be86
app/views/tools/directory.html.erb
app/views/tools/directory.html.erb
<%= provide(:title, "Tools Directory") %> <%= provide(:description, "Browse and search Chef tools and plugins.") %> <div class="page nobg"> <div class="tools_info"> <h2>About Tools</h2> </div> <div class="recently_added_tools"> <div class="cookbooks_column_content"> <h2 class="title">Recently Added Tools</h2> <ul class="simple_listing"> <% @recently_added_tools.each do |tool| %> <%= render "simple_tool", tool: tool %> <% end %> </ul> <%= link_to 'View All Tools', cookbooks_path(featured: true), class: 'button radius expand' %> </div> </div> </div>
<%= provide(:title, "Tools Directory") %> <%= provide(:description, "Browse and search Chef tools and plugins.") %> <div class="page nobg"> <div class="tools_info"> <h2>About Tools</h2> <p>Tools are software that improve Chef's ecosystem. An example of a tool is Foodcritic. Foodcritic is a Ruby gem that analyzes the code of a cookbook. Most tools are open source and available on GitHub.</p> <p>If you have created a tool or plugin that interfaces with or improves Chef, <%= link_to "add it to Supermarket", new_tool_path %> to share it with the community.</p> <h3>Types of Tools</h3> <p>There are various types of tools, each serving a slightly different purpose. If your tool does not fall into one of the types below, <a href="https://github.com/opscode/supermarket/issues/new">open a GitHub issue requesting to add that type</a>. <ul> <% Tool::ALLOWED_TYPES.each do |type| %> <li><%= link_to type.titleize, params.merge(type: type) %></li> <% end %> </ul> </div> <div class="recently_added_tools"> <div class="cookbooks_column_content"> <h2 class="title">Recently Added Tools</h2> <ul class="simple_listing"> <% @recently_added_tools.each do |tool| %> <%= render "simple_tool", tool: tool %> <% end %> </ul> <%= link_to 'View All Tools', cookbooks_path(featured: true), class: 'button radius expand' %> </div> </div> </div>
Add content to Tools directory.
Add content to Tools directory. Explain what tools are, give an example of tools, display a link for adding a tool and list out the tool types.
HTML+ERB
apache-2.0
dpnl87/supermarket,chef/supermarket,tas50/supermarket,chef/supermarket,rafaelmagu/supermarket,dpnl87/supermarket,tas50/supermarket,chef/supermarket,robbkidd/supermarket,nellshamrell/supermarket,leftathome/supermarket,nellshamrell/supermarket,dpnl87/supermarket,juliandunn/supermarket,leftathome/supermarket,nellshamrell/supermarket,robbkidd/supermarket,chef/supermarket,robbkidd/supermarket,jzohrab/supermarket,rafaelmagu/supermarket,nellshamrell/supermarket,leftathome/supermarket,robbkidd/supermarket,tas50/supermarket,juliandunn/supermarket,jzohrab/supermarket,juliandunn/supermarket,tas50/supermarket,jzohrab/supermarket,juliandunn/supermarket,leftathome/supermarket,rafaelmagu/supermarket,chef/supermarket,rafaelmagu/supermarket,dpnl87/supermarket,jzohrab/supermarket
html+erb
## Code Before: <%= provide(:title, "Tools Directory") %> <%= provide(:description, "Browse and search Chef tools and plugins.") %> <div class="page nobg"> <div class="tools_info"> <h2>About Tools</h2> </div> <div class="recently_added_tools"> <div class="cookbooks_column_content"> <h2 class="title">Recently Added Tools</h2> <ul class="simple_listing"> <% @recently_added_tools.each do |tool| %> <%= render "simple_tool", tool: tool %> <% end %> </ul> <%= link_to 'View All Tools', cookbooks_path(featured: true), class: 'button radius expand' %> </div> </div> </div> ## Instruction: Add content to Tools directory. Explain what tools are, give an example of tools, display a link for adding a tool and list out the tool types. ## Code After: <%= provide(:title, "Tools Directory") %> <%= provide(:description, "Browse and search Chef tools and plugins.") %> <div class="page nobg"> <div class="tools_info"> <h2>About Tools</h2> <p>Tools are software that improve Chef's ecosystem. An example of a tool is Foodcritic. Foodcritic is a Ruby gem that analyzes the code of a cookbook. Most tools are open source and available on GitHub.</p> <p>If you have created a tool or plugin that interfaces with or improves Chef, <%= link_to "add it to Supermarket", new_tool_path %> to share it with the community.</p> <h3>Types of Tools</h3> <p>There are various types of tools, each serving a slightly different purpose. If your tool does not fall into one of the types below, <a href="https://github.com/opscode/supermarket/issues/new">open a GitHub issue requesting to add that type</a>. <ul> <% Tool::ALLOWED_TYPES.each do |type| %> <li><%= link_to type.titleize, params.merge(type: type) %></li> <% end %> </ul> </div> <div class="recently_added_tools"> <div class="cookbooks_column_content"> <h2 class="title">Recently Added Tools</h2> <ul class="simple_listing"> <% @recently_added_tools.each do |tool| %> <%= render "simple_tool", tool: tool %> <% end %> </ul> <%= link_to 'View All Tools', cookbooks_path(featured: true), class: 'button radius expand' %> </div> </div> </div>
<%= provide(:title, "Tools Directory") %> <%= provide(:description, "Browse and search Chef tools and plugins.") %> <div class="page nobg"> <div class="tools_info"> <h2>About Tools</h2> + <p>Tools are software that improve Chef's ecosystem. An example of a tool is Foodcritic. Foodcritic is a Ruby gem that analyzes the code of a cookbook. Most tools are open source and available on GitHub.</p> + + <p>If you have created a tool or plugin that interfaces with or improves Chef, <%= link_to "add it to Supermarket", new_tool_path %> to share it with the community.</p> + + <h3>Types of Tools</h3> + + <p>There are various types of tools, each serving a slightly different purpose. If your tool does not fall into one of the types below, <a href="https://github.com/opscode/supermarket/issues/new">open a GitHub issue requesting to add that type</a>. + <ul> + <% Tool::ALLOWED_TYPES.each do |type| %> + <li><%= link_to type.titleize, params.merge(type: type) %></li> + <% end %> + </ul> </div> <div class="recently_added_tools"> <div class="cookbooks_column_content"> <h2 class="title">Recently Added Tools</h2> <ul class="simple_listing"> <% @recently_added_tools.each do |tool| %> <%= render "simple_tool", tool: tool %> <% end %> </ul> <%= link_to 'View All Tools', cookbooks_path(featured: true), class: 'button radius expand' %> </div> </div> </div>
12
0.631579
12
0
0a8190aa2845190ec67806abbf24be59efff8529
auth/src/main/java/com/vimeo/networking2/requests/AuthService.kt
auth/src/main/java/com/vimeo/networking2/requests/AuthService.kt
package com.vimeo.networking2.requests import com.vimeo.networking2.VimeoAccount import com.vimeo.networking2.adapters.VimeoCall import retrofit2.http.Field import retrofit2.http.FormUrlEncoded import retrofit2.http.Header import retrofit2.http.POST /** * All the authentication endpoints. */ interface AuthService { /** * Get an access token by providing the client id and client secret along with grant * and scope types. * * @param authHeader It is created from the client id and client secret. * @param grantType Determines whether you have access to public or private accessToken. * @param scope Determines what you want to access to in the Vimeo API. * * @return A [VimeoAccount] that has an access token. * */ @FormUrlEncoded @POST("oauth/authorize/client") fun authorizeWithClientCredentialsGrant( @Header("Authorization") authHeader: String, @Field("grant_type") grantType: String, @Field("scope") scope: String ): VimeoCall<VimeoAccount> }
package com.vimeo.networking2.requests import com.vimeo.networking2.VimeoAccount import com.vimeo.networking2.adapters.VimeoCall import retrofit2.Call import retrofit2.http.Field import retrofit2.http.FormUrlEncoded import retrofit2.http.Header import retrofit2.http.POST /** * All the authentication endpoints. */ interface AuthService { /** * Get an access token by providing the client id and client secret along with grant * and scope types. * * @param authHeader Created from the client id and client secret. * @param grantType Determines your access level. * @param scope Determines what you want to access to in the Vimeo API. * * @return A [VimeoAccount] that has an access token. * */ @FormUrlEncoded @POST("oauth/authorize/client") fun authorizeWithClientCredentialsGrant( @Header("Authorization") authHeader: String, @Field("grant_type") grantType: String, @Field("scope") scope: String ): VimeoCall<VimeoAccount> /** * Login with with Google. An access token will be returned after a successful login. * * @param authHeader Created from the client id and client secret. * @param grantType The grant type. Must be set to `google`. * @param idToken The Google ID token */ @FormUrlEncoded @POST("oauth/authorize/google") fun logInWithGoogle(@Header("Authorization") authHeader: String, @Field("grant_type") grantType: String, @Field("id_token") idToken: String ): Call<VimeoAccount> }
Add google login method to service
Add google login method to service
Kotlin
mit
vimeo/vimeo-networking-java,vimeo/vimeo-networking-java,vimeo/vimeo-networking-java
kotlin
## Code Before: package com.vimeo.networking2.requests import com.vimeo.networking2.VimeoAccount import com.vimeo.networking2.adapters.VimeoCall import retrofit2.http.Field import retrofit2.http.FormUrlEncoded import retrofit2.http.Header import retrofit2.http.POST /** * All the authentication endpoints. */ interface AuthService { /** * Get an access token by providing the client id and client secret along with grant * and scope types. * * @param authHeader It is created from the client id and client secret. * @param grantType Determines whether you have access to public or private accessToken. * @param scope Determines what you want to access to in the Vimeo API. * * @return A [VimeoAccount] that has an access token. * */ @FormUrlEncoded @POST("oauth/authorize/client") fun authorizeWithClientCredentialsGrant( @Header("Authorization") authHeader: String, @Field("grant_type") grantType: String, @Field("scope") scope: String ): VimeoCall<VimeoAccount> } ## Instruction: Add google login method to service ## Code After: package com.vimeo.networking2.requests import com.vimeo.networking2.VimeoAccount import com.vimeo.networking2.adapters.VimeoCall import retrofit2.Call import retrofit2.http.Field import retrofit2.http.FormUrlEncoded import retrofit2.http.Header import retrofit2.http.POST /** * All the authentication endpoints. */ interface AuthService { /** * Get an access token by providing the client id and client secret along with grant * and scope types. * * @param authHeader Created from the client id and client secret. * @param grantType Determines your access level. * @param scope Determines what you want to access to in the Vimeo API. * * @return A [VimeoAccount] that has an access token. * */ @FormUrlEncoded @POST("oauth/authorize/client") fun authorizeWithClientCredentialsGrant( @Header("Authorization") authHeader: String, @Field("grant_type") grantType: String, @Field("scope") scope: String ): VimeoCall<VimeoAccount> /** * Login with with Google. An access token will be returned after a successful login. * * @param authHeader Created from the client id and client secret. * @param grantType The grant type. Must be set to `google`. * @param idToken The Google ID token */ @FormUrlEncoded @POST("oauth/authorize/google") fun logInWithGoogle(@Header("Authorization") authHeader: String, @Field("grant_type") grantType: String, @Field("id_token") idToken: String ): Call<VimeoAccount> }
package com.vimeo.networking2.requests import com.vimeo.networking2.VimeoAccount import com.vimeo.networking2.adapters.VimeoCall + import retrofit2.Call import retrofit2.http.Field import retrofit2.http.FormUrlEncoded import retrofit2.http.Header import retrofit2.http.POST /** * All the authentication endpoints. */ interface AuthService { /** * Get an access token by providing the client id and client secret along with grant * and scope types. * - * @param authHeader It is created from the client id and client secret. ? ^^^^^^^ + * @param authHeader Created from the client id and client secret. ? ^ - * @param grantType Determines whether you have access to public or private accessToken. + * @param grantType Determines your access level. * @param scope Determines what you want to access to in the Vimeo API. * * @return A [VimeoAccount] that has an access token. * */ @FormUrlEncoded @POST("oauth/authorize/client") fun authorizeWithClientCredentialsGrant( @Header("Authorization") authHeader: String, @Field("grant_type") grantType: String, @Field("scope") scope: String ): VimeoCall<VimeoAccount> + /** + * Login with with Google. An access token will be returned after a successful login. + * + * @param authHeader Created from the client id and client secret. + * @param grantType The grant type. Must be set to `google`. + * @param idToken The Google ID token + */ + @FormUrlEncoded + @POST("oauth/authorize/google") + fun logInWithGoogle(@Header("Authorization") authHeader: String, + @Field("grant_type") grantType: String, + @Field("id_token") idToken: String + ): Call<VimeoAccount> + }
19
0.558824
17
2
9639cb7607d301abbc7ad6c8b22aa97e6a0eb5cb
tests/examples/test_examples_run.py
tests/examples/test_examples_run.py
import pytest from os.path import abspath, basename, dirname, join import subprocess import glob import sys cwd = abspath(dirname(__file__)) examples_dir = join(cwd, "..", "..", "examples") example_files = glob.glob("%s/*.py" % examples_dir) @pytest.fixture(params=[pytest.param(f, marks=pytest.mark.xfail(reason="unreliable")) if f.endswith("mountain_hydrostatic.py") else f for f in example_files], ids=lambda x: basename(x)) def example_file(request): return abspath(request.param) def test_example_runs(example_file, tmpdir, monkeypatch): # This ensures that the test writes output in a temporary # directory, rather than where pytest was run from. monkeypatch.chdir(tmpdir) subprocess.check_call([sys.executable, example_file, "--running-tests"])
import pytest from os.path import abspath, basename, dirname, join import subprocess import glob import sys cwd = abspath(dirname(__file__)) examples_dir = join(cwd, "..", "..", "examples") example_files = glob.glob("%s/*.py" % examples_dir) @pytest.fixture(params=glob.glob("%s/*.py" % examples_dir), ids=lambda x: basename(x)) def example_file(request): return abspath(request.param) def test_example_runs(example_file, tmpdir, monkeypatch): # This ensures that the test writes output in a temporary # directory, rather than where pytest was run from. monkeypatch.chdir(tmpdir) subprocess.check_call([sys.executable, example_file, "--running-tests"])
Remove pytest flag for xfails
Remove pytest flag for xfails
Python
mit
firedrakeproject/gusto,firedrakeproject/dcore
python
## Code Before: import pytest from os.path import abspath, basename, dirname, join import subprocess import glob import sys cwd = abspath(dirname(__file__)) examples_dir = join(cwd, "..", "..", "examples") example_files = glob.glob("%s/*.py" % examples_dir) @pytest.fixture(params=[pytest.param(f, marks=pytest.mark.xfail(reason="unreliable")) if f.endswith("mountain_hydrostatic.py") else f for f in example_files], ids=lambda x: basename(x)) def example_file(request): return abspath(request.param) def test_example_runs(example_file, tmpdir, monkeypatch): # This ensures that the test writes output in a temporary # directory, rather than where pytest was run from. monkeypatch.chdir(tmpdir) subprocess.check_call([sys.executable, example_file, "--running-tests"]) ## Instruction: Remove pytest flag for xfails ## Code After: import pytest from os.path import abspath, basename, dirname, join import subprocess import glob import sys cwd = abspath(dirname(__file__)) examples_dir = join(cwd, "..", "..", "examples") example_files = glob.glob("%s/*.py" % examples_dir) @pytest.fixture(params=glob.glob("%s/*.py" % examples_dir), ids=lambda x: basename(x)) def example_file(request): return abspath(request.param) def test_example_runs(example_file, tmpdir, monkeypatch): # This ensures that the test writes output in a temporary # directory, rather than where pytest was run from. monkeypatch.chdir(tmpdir) subprocess.check_call([sys.executable, example_file, "--running-tests"])
import pytest from os.path import abspath, basename, dirname, join import subprocess import glob import sys cwd = abspath(dirname(__file__)) examples_dir = join(cwd, "..", "..", "examples") example_files = glob.glob("%s/*.py" % examples_dir) + @pytest.fixture(params=glob.glob("%s/*.py" % examples_dir), - @pytest.fixture(params=[pytest.param(f, marks=pytest.mark.xfail(reason="unreliable")) - if f.endswith("mountain_hydrostatic.py") - else f for f in example_files], ids=lambda x: basename(x)) def example_file(request): return abspath(request.param) def test_example_runs(example_file, tmpdir, monkeypatch): # This ensures that the test writes output in a temporary # directory, rather than where pytest was run from. monkeypatch.chdir(tmpdir) subprocess.check_call([sys.executable, example_file, "--running-tests"])
4
0.16
1
3
6fda7a0b9c9866f7f1e3893e0ac2461fd6f20128
README.rst
README.rst
.. _Python: http://python.org/ .. _circuits: http://circuitsframework.org/ .. _docker: http://docker.com/ charla ====== charla is `Spanish for chat <http://www.spanishcentral.com/translate/charla>`_ and is an IRC Server and Daemon written in `Python`_ using the `circuits`_ Application Framework. Installation and Usage ---------------------- From Source:: $ hg clone https://bitbucket.org/circuits/charla $ cd charla $ ./server.py Using `Docker`_:: $ docker run -d 6667:6667 prologic/charla From PyPi (*ccoming soon*):: $ pip install charla $ charla
.. _Python: http://python.org/ .. _circuits: http://circuitsframework.org/ .. _Docker: http://docker.com/ .. _fig: http://fig.sh/ charla ====== charla is `Spanish for chat <http://www.spanishcentral.com/translate/charla>`_ and is an IRC Server and Daemon written in `Python`_ using the `circuits`_ Application Framework. Installation and Usage ---------------------- From Source:: $ hg clone https://bitbucket.org/circuits/charla $ cd charla $ ./server.py From Source using `fig`_ and `Docker`_:: $ hg clone https://bitbucket.org/circuits/charla $ cd charla $ fig up Using `Docker`_:: $ docker run -d 6667:6667 prologic/charla From PyPi (*ccoming soon*):: $ pip install charla $ charla
Add how to use fig
Add how to use fig
reStructuredText
mit
spaceone/charla,MrSwiss/charla,prologic/charla
restructuredtext
## Code Before: .. _Python: http://python.org/ .. _circuits: http://circuitsframework.org/ .. _docker: http://docker.com/ charla ====== charla is `Spanish for chat <http://www.spanishcentral.com/translate/charla>`_ and is an IRC Server and Daemon written in `Python`_ using the `circuits`_ Application Framework. Installation and Usage ---------------------- From Source:: $ hg clone https://bitbucket.org/circuits/charla $ cd charla $ ./server.py Using `Docker`_:: $ docker run -d 6667:6667 prologic/charla From PyPi (*ccoming soon*):: $ pip install charla $ charla ## Instruction: Add how to use fig ## Code After: .. _Python: http://python.org/ .. _circuits: http://circuitsframework.org/ .. _Docker: http://docker.com/ .. _fig: http://fig.sh/ charla ====== charla is `Spanish for chat <http://www.spanishcentral.com/translate/charla>`_ and is an IRC Server and Daemon written in `Python`_ using the `circuits`_ Application Framework. Installation and Usage ---------------------- From Source:: $ hg clone https://bitbucket.org/circuits/charla $ cd charla $ ./server.py From Source using `fig`_ and `Docker`_:: $ hg clone https://bitbucket.org/circuits/charla $ cd charla $ fig up Using `Docker`_:: $ docker run -d 6667:6667 prologic/charla From PyPi (*ccoming soon*):: $ pip install charla $ charla
.. _Python: http://python.org/ .. _circuits: http://circuitsframework.org/ - .. _docker: http://docker.com/ ? ^ + .. _Docker: http://docker.com/ ? ^ + .. _fig: http://fig.sh/ charla ====== charla is `Spanish for chat <http://www.spanishcentral.com/translate/charla>`_ and is an IRC Server and Daemon written in `Python`_ using the `circuits`_ Application Framework. Installation and Usage ---------------------- From Source:: $ hg clone https://bitbucket.org/circuits/charla $ cd charla $ ./server.py + From Source using `fig`_ and `Docker`_:: + + $ hg clone https://bitbucket.org/circuits/charla + $ cd charla + $ fig up + Using `Docker`_:: $ docker run -d 6667:6667 prologic/charla From PyPi (*ccoming soon*):: $ pip install charla $ charla
9
0.3
8
1
8bd236ee24b80d70906b14e6a64fbcaff526cd5f
app/mailers/permit_sender.rb
app/mailers/permit_sender.rb
class PermitSender < ActionMailer::Base default from: "from@example.com" # send the permit email to San Antonio Gov, pass in the user object that contains the user's email address def send_permit_application(user) @permit = permit mail( :to => @permit.email, :subject => 'Thanks for signing up for our amazing app' ) end end
class PermitSender < ActionMailer::Base default from: "donotreply@homebasefix.com" # send the permit email to San Antonio Gov, pass in the user object that contains the user's email address def send_permit_application(user) @permit = permit mail( :to => @permit.email, :subject => 'Thanks for signing up for our amazing app' ) end end
Configure email from permit sender to be donotreply@homebasefix
Configure email from permit sender to be donotreply@homebasefix
Ruby
isc
codeforamerica/homebase,randy-r-masters/homebase,randy-r-masters/homebase,schlos/homebase,randy-r-masters/homebase,schlos/homebase,codeforamerica/homebase,schlos/homebase,codeforamerica/homebase
ruby
## Code Before: class PermitSender < ActionMailer::Base default from: "from@example.com" # send the permit email to San Antonio Gov, pass in the user object that contains the user's email address def send_permit_application(user) @permit = permit mail( :to => @permit.email, :subject => 'Thanks for signing up for our amazing app' ) end end ## Instruction: Configure email from permit sender to be donotreply@homebasefix ## Code After: class PermitSender < ActionMailer::Base default from: "donotreply@homebasefix.com" # send the permit email to San Antonio Gov, pass in the user object that contains the user's email address def send_permit_application(user) @permit = permit mail( :to => @permit.email, :subject => 'Thanks for signing up for our amazing app' ) end end
class PermitSender < ActionMailer::Base - default from: "from@example.com" + default from: "donotreply@homebasefix.com" # send the permit email to San Antonio Gov, pass in the user object that contains the user's email address def send_permit_application(user) @permit = permit mail( :to => @permit.email, :subject => 'Thanks for signing up for our amazing app' ) end end
2
0.2
1
1
74728ef66fd13bfd7ad01f930114c2375e752d13
examples/skel.py
examples/skel.py
try: import _path except NameError: pass import pygame import spyral import sys SIZE = (640, 480) BG_COLOR = (0, 0, 0) class Game(spyral.Scene): """ A Scene represents a distinct state of your game. They could be menus, different subgames, or any other things which are mostly distinct. A Scene should define two methods, update and render. """ def __init__(self): """ The __init__ message for a scene should set up the camera(s) for the scene, and other structures which are needed for the scene """ spyral.Scene.__init__(self, SIZE) self.register("system.quit", sys.exit) print spyral.widgets spyral.widgets.register('Testing', 'a') print spyral.widgets.Testing(1,2,3) print spyral.widgets.TextInputWidget if __name__ == "__main__": spyral.director.init(SIZE) # the director is the manager for your scenes spyral.director.run(scene=Game()) # This will run your game. It will not return.
try: import _path except NameError: pass import pygame import spyral import sys SIZE = (640, 480) BG_COLOR = (0, 0, 0) class Game(spyral.Scene): """ A Scene represents a distinct state of your game. They could be menus, different subgames, or any other things which are mostly distinct. A Scene should define two methods, update and render. """ def __init__(self): """ The __init__ message for a scene should set up the camera(s) for the scene, and other structures which are needed for the scene """ spyral.Scene.__init__(self, SIZE) self.register("system.quit", sys.exit) if __name__ == "__main__": spyral.director.init(SIZE) # the director is the manager for your scenes spyral.director.run(scene=Game()) # This will run your game. It will not return.
Remove some accidentally committed code.
Remove some accidentally committed code.
Python
lgpl-2.1
platipy/spyral
python
## Code Before: try: import _path except NameError: pass import pygame import spyral import sys SIZE = (640, 480) BG_COLOR = (0, 0, 0) class Game(spyral.Scene): """ A Scene represents a distinct state of your game. They could be menus, different subgames, or any other things which are mostly distinct. A Scene should define two methods, update and render. """ def __init__(self): """ The __init__ message for a scene should set up the camera(s) for the scene, and other structures which are needed for the scene """ spyral.Scene.__init__(self, SIZE) self.register("system.quit", sys.exit) print spyral.widgets spyral.widgets.register('Testing', 'a') print spyral.widgets.Testing(1,2,3) print spyral.widgets.TextInputWidget if __name__ == "__main__": spyral.director.init(SIZE) # the director is the manager for your scenes spyral.director.run(scene=Game()) # This will run your game. It will not return. ## Instruction: Remove some accidentally committed code. ## Code After: try: import _path except NameError: pass import pygame import spyral import sys SIZE = (640, 480) BG_COLOR = (0, 0, 0) class Game(spyral.Scene): """ A Scene represents a distinct state of your game. They could be menus, different subgames, or any other things which are mostly distinct. A Scene should define two methods, update and render. """ def __init__(self): """ The __init__ message for a scene should set up the camera(s) for the scene, and other structures which are needed for the scene """ spyral.Scene.__init__(self, SIZE) self.register("system.quit", sys.exit) if __name__ == "__main__": spyral.director.init(SIZE) # the director is the manager for your scenes spyral.director.run(scene=Game()) # This will run your game. It will not return.
try: import _path except NameError: pass import pygame import spyral import sys SIZE = (640, 480) BG_COLOR = (0, 0, 0) class Game(spyral.Scene): """ A Scene represents a distinct state of your game. They could be menus, different subgames, or any other things which are mostly distinct. A Scene should define two methods, update and render. """ def __init__(self): """ The __init__ message for a scene should set up the camera(s) for the scene, and other structures which are needed for the scene """ spyral.Scene.__init__(self, SIZE) self.register("system.quit", sys.exit) - print spyral.widgets - spyral.widgets.register('Testing', 'a') - print spyral.widgets.Testing(1,2,3) - print spyral.widgets.TextInputWidget - - if __name__ == "__main__": spyral.director.init(SIZE) # the director is the manager for your scenes spyral.director.run(scene=Game()) # This will run your game. It will not return.
6
0.166667
0
6
69f55e14ccc6855dfea536f7a38e81289cd326ab
recipes/cgns/meta.yaml
recipes/cgns/meta.yaml
{% set name = "cgns" %} {% set version = "3.2.1" %} package: name: {{ name|lower }} version: {{ version }} source: url: https://github.com/{{ name|upper }}/{{ name|upper }}/archive/v{{ version }}.tar.gz sha256: 677d0da94f0892b72b96da7cf4de51f661acfff1141c585af50a531fa161773f patches: - if-block.patch build: number: 0 skip: True # [win] requirements: build: - {{ compiler('c') }} - {{ compiler('fortran') }} - cmake - make - zlib - hdf5 =1.8 test: commands: - cgnscheck about: home: http://cgns.org license: Zlib license_file: LICENSE summary: 'CFD General Notation System (CGNS)' description: | The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations. doc_url: http://cgns.github.io/CGNS_docs_current/index.html dev_url: https://github.com/CGNS/CGNS extra: recipe-maintainers: - mdpiper
{% set name = "cgns" %} {% set version = "3.2.1" %} package: name: {{ name|lower }} version: {{ version }} source: url: https://github.com/{{ name|upper }}/{{ name|upper }}/archive/v{{ version }}.tar.gz sha256: 677d0da94f0892b72b96da7cf4de51f661acfff1141c585af50a531fa161773f patches: - if-block.patch build: number: 0 skip: True # [win] requirements: build: - {{ compiler('c') }} - {{ compiler('fortran') }} - cmake - make - zlib - hdf5 =1.8 run: - zlib - hdf5 =1.8 test: commands: - cgnscheck about: home: http://cgns.org license: Zlib license_file: LICENSE summary: 'CFD General Notation System (CGNS)' description: | The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations. doc_url: http://cgns.github.io/CGNS_docs_current/index.html dev_url: https://github.com/CGNS/CGNS extra: recipe-maintainers: - mdpiper
Add zlib and hdf5 to run requirements
Add zlib and hdf5 to run requirements
YAML
bsd-3-clause
isuruf/staged-recipes,asmeurer/staged-recipes,conda-forge/staged-recipes,patricksnape/staged-recipes,jakirkham/staged-recipes,SylvainCorlay/staged-recipes,synapticarbors/staged-recipes,ReimarBauer/staged-recipes,chrisburr/staged-recipes,dschreij/staged-recipes,cpaulik/staged-recipes,Juanlu001/staged-recipes,hadim/staged-recipes,birdsarah/staged-recipes,scopatz/staged-recipes,mariusvniekerk/staged-recipes,birdsarah/staged-recipes,mcs07/staged-recipes,igortg/staged-recipes,ocefpaf/staged-recipes,asmeurer/staged-recipes,chrisburr/staged-recipes,jakirkham/staged-recipes,conda-forge/staged-recipes,kwilcox/staged-recipes,johanneskoester/staged-recipes,petrushy/staged-recipes,kwilcox/staged-recipes,cpaulik/staged-recipes,ReimarBauer/staged-recipes,ocefpaf/staged-recipes,isuruf/staged-recipes,ceholden/staged-recipes,dschreij/staged-recipes,SylvainCorlay/staged-recipes,scopatz/staged-recipes,stuertz/staged-recipes,johanneskoester/staged-recipes,goanpeca/staged-recipes,petrushy/staged-recipes,hadim/staged-recipes,patricksnape/staged-recipes,goanpeca/staged-recipes,mariusvniekerk/staged-recipes,Juanlu001/staged-recipes,igortg/staged-recipes,jochym/staged-recipes,jochym/staged-recipes,synapticarbors/staged-recipes,stuertz/staged-recipes,ceholden/staged-recipes,mcs07/staged-recipes
yaml
## Code Before: {% set name = "cgns" %} {% set version = "3.2.1" %} package: name: {{ name|lower }} version: {{ version }} source: url: https://github.com/{{ name|upper }}/{{ name|upper }}/archive/v{{ version }}.tar.gz sha256: 677d0da94f0892b72b96da7cf4de51f661acfff1141c585af50a531fa161773f patches: - if-block.patch build: number: 0 skip: True # [win] requirements: build: - {{ compiler('c') }} - {{ compiler('fortran') }} - cmake - make - zlib - hdf5 =1.8 test: commands: - cgnscheck about: home: http://cgns.org license: Zlib license_file: LICENSE summary: 'CFD General Notation System (CGNS)' description: | The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations. doc_url: http://cgns.github.io/CGNS_docs_current/index.html dev_url: https://github.com/CGNS/CGNS extra: recipe-maintainers: - mdpiper ## Instruction: Add zlib and hdf5 to run requirements ## Code After: {% set name = "cgns" %} {% set version = "3.2.1" %} package: name: {{ name|lower }} version: {{ version }} source: url: https://github.com/{{ name|upper }}/{{ name|upper }}/archive/v{{ version }}.tar.gz sha256: 677d0da94f0892b72b96da7cf4de51f661acfff1141c585af50a531fa161773f patches: - if-block.patch build: number: 0 skip: True # [win] requirements: build: - {{ compiler('c') }} - {{ compiler('fortran') }} - cmake - make - zlib - hdf5 =1.8 run: - zlib - hdf5 =1.8 test: commands: - cgnscheck about: home: http://cgns.org license: Zlib license_file: LICENSE summary: 'CFD General Notation System (CGNS)' description: | The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations. doc_url: http://cgns.github.io/CGNS_docs_current/index.html dev_url: https://github.com/CGNS/CGNS extra: recipe-maintainers: - mdpiper
{% set name = "cgns" %} {% set version = "3.2.1" %} package: name: {{ name|lower }} version: {{ version }} source: url: https://github.com/{{ name|upper }}/{{ name|upper }}/archive/v{{ version }}.tar.gz sha256: 677d0da94f0892b72b96da7cf4de51f661acfff1141c585af50a531fa161773f patches: - if-block.patch build: number: 0 skip: True # [win] requirements: build: - {{ compiler('c') }} - {{ compiler('fortran') }} - cmake - make - zlib - hdf5 =1.8 + run: + - zlib + - hdf5 =1.8 test: commands: - cgnscheck about: home: http://cgns.org license: Zlib license_file: LICENSE summary: 'CFD General Notation System (CGNS)' description: | The CFD General Notation System (CGNS) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations. doc_url: http://cgns.github.io/CGNS_docs_current/index.html dev_url: https://github.com/CGNS/CGNS extra: recipe-maintainers: - mdpiper
3
0.065217
3
0
2fc23ca753ca68d3c0531cf9c58d5864adfc373f
tests/test_short_url.py
tests/test_short_url.py
import unittest from random import randrange import short_url class TestShortUrl(unittest.TestCase): def test_one(self): url = short_url.encode_url(12) self.assertEqual(url, 'jy7yj') key = short_url.decode_url(url) self.assertEqual(key, 12) def test_1000_random(self): for random_int in range(1000): random_int = randrange(100000000) url = short_url.encode_url(random_int) int_ = short_url.decode_url(url) self.assertEqual(random_int, int_) def test_custom_alphabet(self): encoder = short_url.UrlEncoder(alphabet='ab') url = encoder.encode_url(12) self.assertEqual(url, 'bbaaaaaaaaaaaaaaaaaaaa') key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa') self.assertEqual(key, 12) def test_short_alphabet(self): with self.assertRaises(AttributeError): short_url.UrlEncoder(alphabet='aa') with self.assertRaises(AttributeError): short_url.UrlEncoder(alphabet='a')
from random import randrange from pytest import raises import short_url def test_custom_alphabet(): encoder = short_url.UrlEncoder(alphabet='ab') url = encoder.encode_url(12) assert url == 'bbaaaaaaaaaaaaaaaaaaaa' key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa') assert key == 12 def test_too_short_alphabet(): with raises(AttributeError): short_url.UrlEncoder(alphabet='aa') with raises(AttributeError): short_url.UrlEncoder(alphabet='a')
Use simple test functions and remove too special tests
Use simple test functions and remove too special tests
Python
mit
Alir3z4/python-short_url
python
## Code Before: import unittest from random import randrange import short_url class TestShortUrl(unittest.TestCase): def test_one(self): url = short_url.encode_url(12) self.assertEqual(url, 'jy7yj') key = short_url.decode_url(url) self.assertEqual(key, 12) def test_1000_random(self): for random_int in range(1000): random_int = randrange(100000000) url = short_url.encode_url(random_int) int_ = short_url.decode_url(url) self.assertEqual(random_int, int_) def test_custom_alphabet(self): encoder = short_url.UrlEncoder(alphabet='ab') url = encoder.encode_url(12) self.assertEqual(url, 'bbaaaaaaaaaaaaaaaaaaaa') key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa') self.assertEqual(key, 12) def test_short_alphabet(self): with self.assertRaises(AttributeError): short_url.UrlEncoder(alphabet='aa') with self.assertRaises(AttributeError): short_url.UrlEncoder(alphabet='a') ## Instruction: Use simple test functions and remove too special tests ## Code After: from random import randrange from pytest import raises import short_url def test_custom_alphabet(): encoder = short_url.UrlEncoder(alphabet='ab') url = encoder.encode_url(12) assert url == 'bbaaaaaaaaaaaaaaaaaaaa' key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa') assert key == 12 def test_too_short_alphabet(): with raises(AttributeError): short_url.UrlEncoder(alphabet='aa') with raises(AttributeError): short_url.UrlEncoder(alphabet='a')
- import unittest + from random import randrange + + from pytest import raises import short_url - class TestShortUrl(unittest.TestCase): - def test_one(self): - url = short_url.encode_url(12) - self.assertEqual(url, 'jy7yj') - key = short_url.decode_url(url) - self.assertEqual(key, 12) - def test_1000_random(self): - for random_int in range(1000): - random_int = randrange(100000000) - url = short_url.encode_url(random_int) - int_ = short_url.decode_url(url) - self.assertEqual(random_int, int_) - def test_custom_alphabet(self): ? ---- ---- + def test_custom_alphabet(): - encoder = short_url.UrlEncoder(alphabet='ab') ? ---- + encoder = short_url.UrlEncoder(alphabet='ab') - url = encoder.encode_url(12) ? ---- + url = encoder.encode_url(12) - self.assertEqual(url, 'bbaaaaaaaaaaaaaaaaaaaa') ? --------- ^^^^^^ ^ - + assert url == 'bbaaaaaaaaaaaaaaaaaaaa' ? ^ ^^^ - key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa') ? ---- + key = encoder.decode_url('bbaaaaaaaaaaaaaaaaaaaa') - self.assertEqual(key, 12) + assert key == 12 + - def test_short_alphabet(self): ? ---- ---- + def test_too_short_alphabet(): ? ++++ - with self.assertRaises(AttributeError): ? ---- --------- -- + with raises(AttributeError): - short_url.UrlEncoder(alphabet='aa') ? ---- + short_url.UrlEncoder(alphabet='aa') - with self.assertRaises(AttributeError): ? ---- --------- -- + with raises(AttributeError): - short_url.UrlEncoder(alphabet='a') ? ---- + short_url.UrlEncoder(alphabet='a')
39
1.181818
15
24
2af11721e2bfc0c6710ace36da7e1fac0e4202c5
.gitlab-ci.yml
.gitlab-ci.yml
stages: - publish_launcher - build - publish publishWindowsExecutable: stage: publish_launcher tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish" publishLinuxExecutable: stage: publish_launcher tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish publishOsxExecutable: stage: publish_launcher tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish buildWindows: stage: build tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build" buildMac: stage: build tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build publishLinux: stage: publish tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build publish after_script: - echo "End CI"
stages: - publish_launcher - build - publish publishWindowsExecutable: stage: publish_launcher tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish" publishLinuxExecutable: stage: publish_launcher tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish publishOsxExecutable: stage: publish_launcher tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish buildWindows: stage: build needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build" artifacts: when: always reports: junit: ./**/build/test-results/test/**/TEST-*.xml buildMac: stage: build needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build artifacts: when: always reports: junit: ./**/build/test-results/test/**/TEST-*.xml publishLinux: stage: publish needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build publish artifacts: when: always reports: junit: ./**/build/test-results/test/**/TEST-*.xml after_script: - echo "End CI"
Add directed acyclic graphs and JUnit artifacts to GitLab CI
Add directed acyclic graphs and JUnit artifacts to GitLab CI
YAML
apache-2.0
libgdx/packr,libgdx/packr,libgdx/packr,libgdx/packr
yaml
## Code Before: stages: - publish_launcher - build - publish publishWindowsExecutable: stage: publish_launcher tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish" publishLinuxExecutable: stage: publish_launcher tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish publishOsxExecutable: stage: publish_launcher tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish buildWindows: stage: build tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build" buildMac: stage: build tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build publishLinux: stage: publish tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build publish after_script: - echo "End CI" ## Instruction: Add directed acyclic graphs and JUnit artifacts to GitLab CI ## Code After: stages: - publish_launcher - build - publish publishWindowsExecutable: stage: publish_launcher tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish" publishLinuxExecutable: stage: publish_launcher tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish publishOsxExecutable: stage: publish_launcher tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish buildWindows: stage: build needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build" artifacts: when: always reports: junit: ./**/build/test-results/test/**/TEST-*.xml buildMac: stage: build needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build artifacts: when: always reports: junit: ./**/build/test-results/test/**/TEST-*.xml publishLinux: stage: publish needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build publish artifacts: when: always reports: junit: ./**/build/test-results/test/**/TEST-*.xml after_script: - echo "End CI"
stages: - publish_launcher - build - publish publishWindowsExecutable: stage: publish_launcher tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish" publishLinuxExecutable: stage: publish_launcher tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish publishOsxExecutable: stage: publish_launcher tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache clean PackrLauncher:publish buildWindows: stage: build + needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - windows script: - cmd.exe "/c gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build" + artifacts: + when: always + reports: + junit: ./**/build/test-results/test/**/TEST-*.xml buildMac: stage: build + needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - osx script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build + artifacts: + when: always + reports: + junit: ./**/build/test-results/test/**/TEST-*.xml publishLinux: stage: publish + needs: [ "publishWindowsExecutable", "publishLinuxExecutable", "publishOsxExecutable" ] tags: - ubuntu script: - ./gradlew --no-daemon -i --no-build-cache --refresh-dependencies clean build publish + artifacts: + when: always + reports: + junit: ./**/build/test-results/test/**/TEST-*.xml after_script: - echo "End CI"
15
0.306122
15
0
89baedfe15b658bb4bb8dee3cff0944d13f00301
.travis.yml
.travis.yml
language: scala script: ./tools/travis-script.sh env: - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=1 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=no WORKERS=4 TESTS=1000 - PLATFORM=js SBT_PARALLEL=yes WORKERS=1 TESTS=100 scala: - 2.10.5 - 2.11.6 matrix: include: - scala: 2.12.0-M1 env: PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 jdk: - openjdk7 branches: only: - master - scalacheck2 notifications: email: - adriaan.moors@typesafe.com - rickynils@gmail.com
language: scala script: ./tools/travis-script.sh env: - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=1 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=no WORKERS=4 TESTS=1000 - PLATFORM=js SBT_PARALLEL=yes WORKERS=1 TESTS=100 scala: - 2.10.5 - 2.11.6 jdk: - openjdk7 matrix: include: - scala: 2.12.0-M1 jdk: openjdk7 env: PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 branches: only: - master - scalacheck2 notifications: email: - adriaan.moors@typesafe.com - rickynils@gmail.com
Fix Travis build matrix inclusion
Fix Travis build matrix inclusion
YAML
bsd-3-clause
xuwei-k/scalacheck,rickynils/scalacheck
yaml
## Code Before: language: scala script: ./tools/travis-script.sh env: - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=1 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=no WORKERS=4 TESTS=1000 - PLATFORM=js SBT_PARALLEL=yes WORKERS=1 TESTS=100 scala: - 2.10.5 - 2.11.6 matrix: include: - scala: 2.12.0-M1 env: PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 jdk: - openjdk7 branches: only: - master - scalacheck2 notifications: email: - adriaan.moors@typesafe.com - rickynils@gmail.com ## Instruction: Fix Travis build matrix inclusion ## Code After: language: scala script: ./tools/travis-script.sh env: - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=1 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=no WORKERS=4 TESTS=1000 - PLATFORM=js SBT_PARALLEL=yes WORKERS=1 TESTS=100 scala: - 2.10.5 - 2.11.6 jdk: - openjdk7 matrix: include: - scala: 2.12.0-M1 jdk: openjdk7 env: PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 branches: only: - master - scalacheck2 notifications: email: - adriaan.moors@typesafe.com - rickynils@gmail.com
language: scala script: ./tools/travis-script.sh env: - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=1 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 - PLATFORM=jvm SBT_PARALLEL=no WORKERS=4 TESTS=1000 - PLATFORM=js SBT_PARALLEL=yes WORKERS=1 TESTS=100 scala: - 2.10.5 - 2.11.6 + jdk: + - openjdk7 matrix: include: - scala: 2.12.0-M1 + jdk: openjdk7 env: PLATFORM=jvm SBT_PARALLEL=yes WORKERS=4 TESTS=1000 - jdk: - - openjdk7 branches: only: - master - scalacheck2 notifications: email: - adriaan.moors@typesafe.com - rickynils@gmail.com
5
0.208333
3
2
f390eb967b1d38835177d3370c9391e601fda0cf
templates/Includes/FormField_holder.ss
templates/Includes/FormField_holder.ss
<div id="$Name" class="field<% if extraClass %> $extraClass<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>> <% if Title %><label class="left" for="$ID">$Title</label><% end_if %> <div class="middleColumn"> $Field </div> <% if RightTitle %><label class="right" for="$ID">$RightTitle</label><% end_if %> <% if Message %><span class="message $MessageType">$Message</span><% end_if %> <% if DisplayLogic %> <script type="text/template" class="display-logic-eval">$DisplayLogic</script> <% end_if %> </div>
<div id="$Name" class="field<% if extraClass %> $extraClass<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>> <% if Title %><label class="left" for="$ID">$Title</label><% end_if %> <div class="middleColumn"> $Field </div> <% if RightTitle %><label class="right" for="$ID">$RightTitle</label><% end_if %> <% if Message %><span class="message $MessageType">$Message</span><% end_if %> <% if DisplayLogic %> <div class="display-logic-eval">$DisplayLogic</div> <% end_if %> </div>
Use div in display logic eval
BUGFIX: Use div in display logic eval
Scheme
bsd-3-clause
unclecheese/silverstripe-display-logic,unclecheese/silverstripe-display-logic
scheme
## Code Before: <div id="$Name" class="field<% if extraClass %> $extraClass<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>> <% if Title %><label class="left" for="$ID">$Title</label><% end_if %> <div class="middleColumn"> $Field </div> <% if RightTitle %><label class="right" for="$ID">$RightTitle</label><% end_if %> <% if Message %><span class="message $MessageType">$Message</span><% end_if %> <% if DisplayLogic %> <script type="text/template" class="display-logic-eval">$DisplayLogic</script> <% end_if %> </div> ## Instruction: BUGFIX: Use div in display logic eval ## Code After: <div id="$Name" class="field<% if extraClass %> $extraClass<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>> <% if Title %><label class="left" for="$ID">$Title</label><% end_if %> <div class="middleColumn"> $Field </div> <% if RightTitle %><label class="right" for="$ID">$RightTitle</label><% end_if %> <% if Message %><span class="message $MessageType">$Message</span><% end_if %> <% if DisplayLogic %> <div class="display-logic-eval">$DisplayLogic</div> <% end_if %> </div>
<div id="$Name" class="field<% if extraClass %> $extraClass<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>> <% if Title %><label class="left" for="$ID">$Title</label><% end_if %> <div class="middleColumn"> $Field </div> <% if RightTitle %><label class="right" for="$ID">$RightTitle</label><% end_if %> <% if Message %><span class="message $MessageType">$Message</span><% end_if %> <% if DisplayLogic %> - <script type="text/template" class="display-logic-eval">$DisplayLogic</script> + <div class="display-logic-eval">$DisplayLogic</div> <% end_if %> </div>
2
0.166667
1
1
f2c0b268912c081cb2452f632b05093d4a2cc92c
app/renderer/createLogger.ts
app/renderer/createLogger.ts
// tslint:disable-next-line no-implicit-dependencies import { ipcRenderer } from "electron"; import * as toastify from "react-toastify"; import Logger, { ILoggerObj, IMessage } from "../common/Logger"; export default (loggerObj: ILoggerObj): Logger => { const logger = Logger.fromObj(loggerObj); logger.addGlobalListener((category: string, msg: IMessage) => { Logger.log2Console(category, msg); toastify.toast( msg.title + (msg.description ? ". Look at the console for more info ctrl+shift+i" : ""), { type: category as toastify.ToastType } ); ipcRenderer.send("clean-history"); }); // Catch up logger.history.forEach(logged => { logger.report(logged.category, logged.msg.title, logged.msg.description); }); ipcRenderer.on( "log", (event: Electron.Event, category: string, msg: IMessage) => { logger.report(category, msg.title, msg.description); } ); return logger; };
// tslint:disable-next-line no-implicit-dependencies import { ipcRenderer } from "electron"; import * as toastify from "react-toastify"; import Logger, { ILoggerObj, IMessage } from "../common/Logger"; export default (loggerObj: ILoggerObj): Logger => { const logger = Logger.fromObj(loggerObj); logger.addGlobalListener((category: string, msg: IMessage) => { Logger.log2Console(category, msg); toastify.toast( msg.title + (msg.description ? ". Look at the console for more info ctrl+shift+i" : ""), { type: (category === "warn" ? "warning" : category) as toastify.ToastType } ); ipcRenderer.send("clean-history"); }); // Catch up logger.history.forEach(logged => { logger.report(logged.category, logged.msg.title, logged.msg.description); }); ipcRenderer.on( "log", (event: Electron.Event, category: string, msg: IMessage) => { logger.report(category, msg.title, msg.description); } ); return logger; };
Fix warnings not working with toastify
Fix warnings not working with toastify
TypeScript
mit
ocboogie/action-hub,ocboogie/action-hub,ocboogie/action-hub
typescript
## Code Before: // tslint:disable-next-line no-implicit-dependencies import { ipcRenderer } from "electron"; import * as toastify from "react-toastify"; import Logger, { ILoggerObj, IMessage } from "../common/Logger"; export default (loggerObj: ILoggerObj): Logger => { const logger = Logger.fromObj(loggerObj); logger.addGlobalListener((category: string, msg: IMessage) => { Logger.log2Console(category, msg); toastify.toast( msg.title + (msg.description ? ". Look at the console for more info ctrl+shift+i" : ""), { type: category as toastify.ToastType } ); ipcRenderer.send("clean-history"); }); // Catch up logger.history.forEach(logged => { logger.report(logged.category, logged.msg.title, logged.msg.description); }); ipcRenderer.on( "log", (event: Electron.Event, category: string, msg: IMessage) => { logger.report(category, msg.title, msg.description); } ); return logger; }; ## Instruction: Fix warnings not working with toastify ## Code After: // tslint:disable-next-line no-implicit-dependencies import { ipcRenderer } from "electron"; import * as toastify from "react-toastify"; import Logger, { ILoggerObj, IMessage } from "../common/Logger"; export default (loggerObj: ILoggerObj): Logger => { const logger = Logger.fromObj(loggerObj); logger.addGlobalListener((category: string, msg: IMessage) => { Logger.log2Console(category, msg); toastify.toast( msg.title + (msg.description ? ". Look at the console for more info ctrl+shift+i" : ""), { type: (category === "warn" ? "warning" : category) as toastify.ToastType } ); ipcRenderer.send("clean-history"); }); // Catch up logger.history.forEach(logged => { logger.report(logged.category, logged.msg.title, logged.msg.description); }); ipcRenderer.on( "log", (event: Electron.Event, category: string, msg: IMessage) => { logger.report(category, msg.title, msg.description); } ); return logger; };
// tslint:disable-next-line no-implicit-dependencies import { ipcRenderer } from "electron"; import * as toastify from "react-toastify"; import Logger, { ILoggerObj, IMessage } from "../common/Logger"; export default (loggerObj: ILoggerObj): Logger => { const logger = Logger.fromObj(loggerObj); logger.addGlobalListener((category: string, msg: IMessage) => { Logger.log2Console(category, msg); toastify.toast( msg.title + (msg.description ? ". Look at the console for more info ctrl+shift+i" : ""), { - type: category as toastify.ToastType + type: (category === "warn" ? "warning" : category) as toastify.ToastType } ); ipcRenderer.send("clean-history"); }); // Catch up logger.history.forEach(logged => { logger.report(logged.category, logged.msg.title, logged.msg.description); }); ipcRenderer.on( "log", (event: Electron.Event, category: string, msg: IMessage) => { logger.report(category, msg.title, msg.description); } ); return logger; };
2
0.054054
1
1
9cb9d25b447f4e88f54398149fa7f01e57d54145
index.html
index.html
<!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid red; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html>
UPDATE remove red border from website
UPDATE remove red border from website
HTML
mit
Micro-Holding-Co-Ownership/micro-holding-co-ownership.github.io
html
## Code Before: <!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid red; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html> ## Instruction: UPDATE remove red border from website ## Code After: <!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; - border: 1px solid red; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html>
1
0.038462
0
1
bbf9adf073f079bc5493a46b9fce9c6baaead057
server/src/main/twirl/views/tags/_asset.scala.html
server/src/main/twirl/views/tags/_asset.scala.html
@(path: String)(implicit config: play.api.Configuration)@{config.getString("application.cdn").getOrElse("") + routes.Assets.versioned(path)}
@(path: String)(implicit config: play.api.Configuration)@{ config.getOptional[String]("application.cdn").getOrElse("") + routes.Assets.versioned(path) }
Fix Play config deprecation warning
Fix Play config deprecation warning
HTML
apache-2.0
guilgaly/pokemon-stats
html
## Code Before: @(path: String)(implicit config: play.api.Configuration)@{config.getString("application.cdn").getOrElse("") + routes.Assets.versioned(path)} ## Instruction: Fix Play config deprecation warning ## Code After: @(path: String)(implicit config: play.api.Configuration)@{ config.getOptional[String]("application.cdn").getOrElse("") + routes.Assets.versioned(path) }
- @(path: String)(implicit config: play.api.Configuration)@{config.getString("application.cdn").getOrElse("") + routes.Assets.versioned(path)} + @(path: String)(implicit config: play.api.Configuration)@{ + config.getOptional[String]("application.cdn").getOrElse("") + routes.Assets.versioned(path) + }
4
4
3
1
0a8f1e5704a56eddeac9a7d3ed3e0a0b2e744a29
src/components/TestCardNumber.js
src/components/TestCardNumber.js
import React, { Component } from 'react'; import { faintBlack, cyan500 } from 'material-ui/styles/colors'; import MenuItem from 'material-ui/MenuItem'; import IconMenu from 'material-ui/IconMenu'; import IconButton from 'material-ui/IconButton/IconButton'; import ActionHelpOutline from 'material-ui/svg-icons/action/help-outline'; const TEST_CARD_NUMBERS = [ '01-2167-30-92545' ]; class TestCardNumber extends Component { constructor() { super(); this.state = { cardNumber: '' }; } renredCardNumbers() { return TEST_CARD_NUMBERS.map((number, index) => <MenuItem key={index} value={number} primaryText={number} />); } render() { return ( <IconMenu className='buka-cardnumber__help' onChange={this.props.onChange} iconButtonElement={<IconButton><ActionHelpOutline color={faintBlack} hoverColor={cyan500} /></IconButton>} anchorOrigin={{horizontal: 'left', vertical: 'top'}} targetOrigin={{horizontal: 'left', vertical: 'top'}}> {this.renredCardNumbers()} </IconMenu> ); } } TestCardNumber.propTypes = { onChange: React.PropTypes.func }; export default TestCardNumber;
import React, { Component } from 'react'; import { faintBlack, cyan500 } from 'material-ui/styles/colors'; import MenuItem from 'material-ui/MenuItem'; import IconMenu from 'material-ui/IconMenu'; import IconButton from 'material-ui/IconButton/IconButton'; import ActionHelpOutline from 'material-ui/svg-icons/action/help-outline'; const TEST_CARD_NUMBERS = [ '01-2167-30-92545', '26-2167-19-35623', '29-2167-26-31433' ]; class TestCardNumber extends Component { constructor() { super(); this.state = { cardNumber: '' }; } renredCardNumbers() { return TEST_CARD_NUMBERS.map((number, index) => <MenuItem key={index} value={number} primaryText={number} />); } render() { return ( <IconMenu className='buka-cardnumber__help' onChange={this.props.onChange} iconButtonElement={<IconButton><ActionHelpOutline color={faintBlack} hoverColor={cyan500} /></IconButton>} anchorOrigin={{horizontal: 'left', vertical: 'top'}} targetOrigin={{horizontal: 'left', vertical: 'top'}}> {this.renredCardNumbers()} </IconMenu> ); } } TestCardNumber.propTypes = { onChange: React.PropTypes.func }; export default TestCardNumber;
Add some test card numbers.
Add some test card numbers.
JavaScript
apache-2.0
blobor/buka,blobor/buka,blobor/skipass.site,blobor/skipass.site
javascript
## Code Before: import React, { Component } from 'react'; import { faintBlack, cyan500 } from 'material-ui/styles/colors'; import MenuItem from 'material-ui/MenuItem'; import IconMenu from 'material-ui/IconMenu'; import IconButton from 'material-ui/IconButton/IconButton'; import ActionHelpOutline from 'material-ui/svg-icons/action/help-outline'; const TEST_CARD_NUMBERS = [ '01-2167-30-92545' ]; class TestCardNumber extends Component { constructor() { super(); this.state = { cardNumber: '' }; } renredCardNumbers() { return TEST_CARD_NUMBERS.map((number, index) => <MenuItem key={index} value={number} primaryText={number} />); } render() { return ( <IconMenu className='buka-cardnumber__help' onChange={this.props.onChange} iconButtonElement={<IconButton><ActionHelpOutline color={faintBlack} hoverColor={cyan500} /></IconButton>} anchorOrigin={{horizontal: 'left', vertical: 'top'}} targetOrigin={{horizontal: 'left', vertical: 'top'}}> {this.renredCardNumbers()} </IconMenu> ); } } TestCardNumber.propTypes = { onChange: React.PropTypes.func }; export default TestCardNumber; ## Instruction: Add some test card numbers. ## Code After: import React, { Component } from 'react'; import { faintBlack, cyan500 } from 'material-ui/styles/colors'; import MenuItem from 'material-ui/MenuItem'; import IconMenu from 'material-ui/IconMenu'; import IconButton from 'material-ui/IconButton/IconButton'; import ActionHelpOutline from 'material-ui/svg-icons/action/help-outline'; const TEST_CARD_NUMBERS = [ '01-2167-30-92545', '26-2167-19-35623', '29-2167-26-31433' ]; class TestCardNumber extends Component { constructor() { super(); this.state = { cardNumber: '' }; } renredCardNumbers() { return TEST_CARD_NUMBERS.map((number, index) => <MenuItem key={index} value={number} primaryText={number} />); } render() { return ( <IconMenu className='buka-cardnumber__help' onChange={this.props.onChange} iconButtonElement={<IconButton><ActionHelpOutline color={faintBlack} hoverColor={cyan500} /></IconButton>} anchorOrigin={{horizontal: 'left', vertical: 'top'}} targetOrigin={{horizontal: 'left', vertical: 'top'}}> {this.renredCardNumbers()} </IconMenu> ); } } TestCardNumber.propTypes = { onChange: React.PropTypes.func }; export default TestCardNumber;
import React, { Component } from 'react'; import { faintBlack, cyan500 } from 'material-ui/styles/colors'; import MenuItem from 'material-ui/MenuItem'; import IconMenu from 'material-ui/IconMenu'; import IconButton from 'material-ui/IconButton/IconButton'; import ActionHelpOutline from 'material-ui/svg-icons/action/help-outline'; const TEST_CARD_NUMBERS = [ - '01-2167-30-92545' + '01-2167-30-92545', ? + + '26-2167-19-35623', + '29-2167-26-31433' ]; class TestCardNumber extends Component { constructor() { super(); this.state = { cardNumber: '' }; } renredCardNumbers() { return TEST_CARD_NUMBERS.map((number, index) => <MenuItem key={index} value={number} primaryText={number} />); } render() { return ( <IconMenu className='buka-cardnumber__help' onChange={this.props.onChange} iconButtonElement={<IconButton><ActionHelpOutline color={faintBlack} hoverColor={cyan500} /></IconButton>} anchorOrigin={{horizontal: 'left', vertical: 'top'}} targetOrigin={{horizontal: 'left', vertical: 'top'}}> {this.renredCardNumbers()} </IconMenu> ); } } TestCardNumber.propTypes = { onChange: React.PropTypes.func }; export default TestCardNumber;
4
0.090909
3
1
a931a5e59c25830be87b9d73117d127bdaae6176
common-parent/codegen/src/main/java/com/speedment/common/codegen/internal/java/view/value/InvocationValueView.java
common-parent/codegen/src/main/java/com/speedment/common/codegen/internal/java/view/value/InvocationValueView.java
package com.speedment.common.codegen.internal.java.view.value; import com.speedment.common.codegen.Generator; import com.speedment.common.codegen.Transform; import com.speedment.common.codegen.model.value.InvocationValue; import java.util.Optional; import static com.speedment.common.codegen.util.Formatting.nl; import static com.speedment.common.codegen.util.Formatting.tab; import static java.util.stream.Collectors.joining; /** * Transforms from an {@link InvocationValue} to java code. * * @author Emil Forslund * @since 2.4.6 */ public final class InvocationValueView implements Transform<InvocationValue, String> { @Override public Optional<String> transform(Generator gen, InvocationValue model) { return Optional.of( (model.getType() == null ? "" : gen.on(model.getType()).get() + ".") + model.getValue() + (model.getValues().size() <= 3 ? gen.onEach(model.getValues()).collect(joining(", ", "(", ")")) : gen.onEach(model.getValues()).collect(joining( "," + nl() + tab(), "(" + nl() + tab(), nl() + ")" )) ) ); } }
package com.speedment.common.codegen.internal.java.view.value; import com.speedment.common.codegen.Generator; import com.speedment.common.codegen.Transform; import com.speedment.common.codegen.model.value.InvocationValue; import java.util.Optional; import static com.speedment.common.codegen.util.Formatting.indent; import static com.speedment.common.codegen.util.Formatting.nl; import static java.util.stream.Collectors.joining; /** * Transforms from an {@link InvocationValue} to java code. * * @author Emil Forslund * @since 2.4.6 */ public final class InvocationValueView implements Transform<InvocationValue, String> { @Override public Optional<String> transform(Generator gen, InvocationValue model) { return Optional.of( (model.getType() == null ? "" : gen.on(model.getType()).get() + ".") + model.getValue() + (model.getValues().size() <= 3 ? gen.onEach(model.getValues()).collect(joining(", ", "(", ")")) : ("(" + nl() + indent(gen.onEach(model.getValues()) .collect(joining("," + nl()))) + nl() + ")" ) ) ); } }
Fix minor formatting issues with new views
codegen: Fix minor formatting issues with new views
Java
apache-2.0
speedment/speedment,speedment/speedment
java
## Code Before: package com.speedment.common.codegen.internal.java.view.value; import com.speedment.common.codegen.Generator; import com.speedment.common.codegen.Transform; import com.speedment.common.codegen.model.value.InvocationValue; import java.util.Optional; import static com.speedment.common.codegen.util.Formatting.nl; import static com.speedment.common.codegen.util.Formatting.tab; import static java.util.stream.Collectors.joining; /** * Transforms from an {@link InvocationValue} to java code. * * @author Emil Forslund * @since 2.4.6 */ public final class InvocationValueView implements Transform<InvocationValue, String> { @Override public Optional<String> transform(Generator gen, InvocationValue model) { return Optional.of( (model.getType() == null ? "" : gen.on(model.getType()).get() + ".") + model.getValue() + (model.getValues().size() <= 3 ? gen.onEach(model.getValues()).collect(joining(", ", "(", ")")) : gen.onEach(model.getValues()).collect(joining( "," + nl() + tab(), "(" + nl() + tab(), nl() + ")" )) ) ); } } ## Instruction: codegen: Fix minor formatting issues with new views ## Code After: package com.speedment.common.codegen.internal.java.view.value; import com.speedment.common.codegen.Generator; import com.speedment.common.codegen.Transform; import com.speedment.common.codegen.model.value.InvocationValue; import java.util.Optional; import static com.speedment.common.codegen.util.Formatting.indent; import static com.speedment.common.codegen.util.Formatting.nl; import static java.util.stream.Collectors.joining; /** * Transforms from an {@link InvocationValue} to java code. * * @author Emil Forslund * @since 2.4.6 */ public final class InvocationValueView implements Transform<InvocationValue, String> { @Override public Optional<String> transform(Generator gen, InvocationValue model) { return Optional.of( (model.getType() == null ? "" : gen.on(model.getType()).get() + ".") + model.getValue() + (model.getValues().size() <= 3 ? gen.onEach(model.getValues()).collect(joining(", ", "(", ")")) : ("(" + nl() + indent(gen.onEach(model.getValues()) .collect(joining("," + nl()))) + nl() + ")" ) ) ); } }
package com.speedment.common.codegen.internal.java.view.value; import com.speedment.common.codegen.Generator; import com.speedment.common.codegen.Transform; import com.speedment.common.codegen.model.value.InvocationValue; import java.util.Optional; + import static com.speedment.common.codegen.util.Formatting.indent; import static com.speedment.common.codegen.util.Formatting.nl; - import static com.speedment.common.codegen.util.Formatting.tab; import static java.util.stream.Collectors.joining; /** * Transforms from an {@link InvocationValue} to java code. * * @author Emil Forslund * @since 2.4.6 */ public final class InvocationValueView implements Transform<InvocationValue, String> { @Override public Optional<String> transform(Generator gen, InvocationValue model) { return Optional.of( (model.getType() == null ? "" : gen.on(model.getType()).get() + ".") + model.getValue() + (model.getValues().size() <= 3 ? gen.onEach(model.getValues()).collect(joining(", ", "(", ")")) + : ("(" + nl() + indent(gen.onEach(model.getValues()) + .collect(joining("," + nl()))) + nl() + ")" - : gen.onEach(model.getValues()).collect(joining( - "," + nl() + tab(), - "(" + nl() + tab(), - nl() + ")" - )) ? - + ) ) ); } }
10
0.263158
4
6
e677926b79da8a0f19a0924d8ff707d856ea5b77
yamcs-core/src/main/java/org/yamcs/yarch/streamsql/Utils.java
yamcs-core/src/main/java/org/yamcs/yarch/streamsql/Utils.java
package org.yamcs.yarch.streamsql; public class Utils { public static boolean like(String str, String pattern) { pattern = pattern.toLowerCase(); pattern = pattern.replace(".", "\\."); pattern = pattern.replace("?", "."); pattern = pattern.replace("%", ".*"); str = str.toLowerCase(); return str.matches(pattern); } }
package org.yamcs.yarch.streamsql; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Utils { public static boolean like(String str, String pattern) { pattern = pattern.toLowerCase(); pattern = pattern.replace(".", "\\."); pattern = pattern.replace("?", "."); pattern = pattern.replace("%", ".*"); str = str.toLowerCase(); Matcher m = Pattern.compile(pattern, Pattern.DOTALL).matcher(str); return m.matches(); } }
Fix LIKE expression not working for multiline strings
Fix LIKE expression not working for multiline strings
Java
agpl-3.0
yamcs/yamcs,fqqb/yamcs,yamcs/yamcs,fqqb/yamcs,yamcs/yamcs,fqqb/yamcs,yamcs/yamcs,fqqb/yamcs,fqqb/yamcs,fqqb/yamcs,yamcs/yamcs,yamcs/yamcs
java
## Code Before: package org.yamcs.yarch.streamsql; public class Utils { public static boolean like(String str, String pattern) { pattern = pattern.toLowerCase(); pattern = pattern.replace(".", "\\."); pattern = pattern.replace("?", "."); pattern = pattern.replace("%", ".*"); str = str.toLowerCase(); return str.matches(pattern); } } ## Instruction: Fix LIKE expression not working for multiline strings ## Code After: package org.yamcs.yarch.streamsql; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Utils { public static boolean like(String str, String pattern) { pattern = pattern.toLowerCase(); pattern = pattern.replace(".", "\\."); pattern = pattern.replace("?", "."); pattern = pattern.replace("%", ".*"); str = str.toLowerCase(); Matcher m = Pattern.compile(pattern, Pattern.DOTALL).matcher(str); return m.matches(); } }
package org.yamcs.yarch.streamsql; + + import java.util.regex.Matcher; + import java.util.regex.Pattern; public class Utils { public static boolean like(String str, String pattern) { - pattern = pattern.toLowerCase(); ? - + pattern = pattern.toLowerCase(); - pattern = pattern.replace(".", "\\."); ? - + pattern = pattern.replace(".", "\\."); pattern = pattern.replace("?", "."); pattern = pattern.replace("%", ".*"); str = str.toLowerCase(); + Matcher m = Pattern.compile(pattern, Pattern.DOTALL).matcher(str); - return str.matches(pattern); ? ^^^ ------- + return m.matches(); ? ^ } }
10
0.833333
7
3