original_prompt stringlengths 327 2.5k | original_completion stringlengths 22 2.84k | enhanced_prompt float64 | enhanced_completion float64 |
|---|---|---|---|
Make note clarification in doc comment
Apply this change to `Pitch/Dyad.swift` and return the full updated file.
```swift
//
// Dyad.swift
// Pitch
//
// Created by James Bean on 3/13/16.
// Copyright © 2016 James Bean. All rights reserved.
//
import Foundation
import func ArithmeticTools.ordered
/**
Collectio... | ```swift
//
// Dyad.swift
// Pitch
//
// Created by James Bean on 3/13/16.
// Copyright © 2016 James Bean. All rights reserved.
//
import Foundation
import func ArithmeticTools.ordered
/**
Collection of two `Pitch` values.
- TODO: Make generic
*/
public struct Dyad {
// MARK: - Instance properties
... | null | null |
Add primary key and constraints to roads
Apply this change to `sql/queries.sql` and return the full updated file.
```sql
DROP TABLE IF EXISTS roads;
CREATE TABLE roads AS
SELECT
DISTINCT ON (osm_id)
osm_id as id,
name,
CASE WHEN oneway = 'yes' THEN true ELSE false END AS oneway,
way as geom
FRO... | ```sql
DROP TABLE IF EXISTS roads;
CREATE TABLE roads AS
SELECT
DISTINCT ON (osm_id)
osm_id as id,
name,
CASE WHEN oneway = 'yes' THEN true ELSE false END AS oneway,
way as geom
FROM
planet_osm_line
WHERE
highway NOT IN ('cycleway', 'footway', 'pedestrian', 'steps', 'service', 'path', '... | null | null |
Add a second circle to the loading animation
Apply this change to `block-layout/examples/loadingAnimation.ts` and return the full updated file.
```typescript
var circle;
var continueAnimating : boolean;
var animationProgress : number;
function startLoadingAnimation()
{
var svg = <HTMLElement> document.querySelec... | ```typescript
var circle;
var circle2;
var continueAnimating : boolean;
var animationProgress : number;
function makeCircle(document, svgNS)
{
var circle = document.createElementNS(svgNS,'circle');
circle.setAttribute('cx','320');
circle.setAttribute('cy','240');
circle.setAttribute('r','16');
circ... | null | null |
Make api poitn to the right object
Apply this change to `cryptography/bindings/openssl/__init__.py` and return the full updated file.
```python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... | ```python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed... | null | null |
Fix crash when starting app without network
Apply this change to `app/src/main/java/me/echeung/moemoekyun/util/ext/CoroutineExtensions.kt` and return the full updated file.
```kotlin
package me.echeung.moemoekyun.util.ext
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineStart
import kotlin... | ```kotlin
package me.echeung.moemoekyun.util.ext
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.la... | null | null |
Clear today cell before use
Apply this change to `VindsidenToday/RHCTodayCell.swift` and return the full updated file.
```swift
//
// RHCTodayCell.swift
// VindsidenApp
//
// Created by Ragnar Henriksen on 10.07.14.
// Copyright (c) 2014 RHC. All rights reserved.
//
import UIKit
extension UITableViewCell {
... | ```swift
//
// RHCTodayCell.swift
// VindsidenApp
//
// Created by Ragnar Henriksen on 10.07.14.
// Copyright (c) 2014 RHC. All rights reserved.
//
import UIKit
extension UITableViewCell {
func configureSelectedBackgroundView() -> Void
{
let vibrancyView = UIVisualEffectView(effect: UIVibrancyEff... | null | null |
Fix formatting on reexport of num
Apply this change to `src/lib.rs` and return the full updated file.
```rust
extern crate num;
// Must re-export num for the unit! macro.
#[doc(hidden)]pub use num as num_export;
mod vec2;
mod vec3;
mod vec4;
mod float;
mod clamp;
#[macro_use] pub mod unit;
pub use num::{Zero, One,... | ```rust
extern crate num;
// Must re-export num for the unit! macro.
#[doc(hidden)] pub use num as num_export;
mod vec2;
mod vec3;
mod vec4;
mod float;
mod clamp;
#[macro_use] pub mod unit;
pub use num::{Zero, One, Num};
pub use self::vec2::{Vec2, Point2};
pub use self::vec3::{Vec3, Point3};
pub use self::vec4::Vec4... | null | null |
Refactor the initialization a bit to make configuration easier.
Apply this change to `tempwatcher/watch.py` and return the full updated file.
```python
import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_... | ```python
import json
import requests
class TemperatureWatch(object):
thermostat_url = None
alert_high = 80
alert_low = 60
_last_response = None
def get_info(self):
r = requests.get(self.thermostat_url + '/tstat')
self._last_response = json.loads(r.text)
return r.text
... | null | null |
Fix formatting of table load errors
Apply this change to `Rant/Vocabulary/RantTableLoadException.cs` and return the full updated file.
```csharp
using System;
using Rant.Localization;
namespace Rant.Vocabulary
{
/// <summary>
/// Thrown when Rant encounters an error while loading a dictionary table.
/// </summa... | ```csharp
using System;
using Rant.Localization;
namespace Rant.Vocabulary
{
/// <summary>
/// Thrown when Rant encounters an error while loading a dictionary table.
/// </summary>
public sealed class RantTableLoadException : Exception
{
internal RantTableLoadException(string origin, int line, int col, string... | null | null |
Add hspec template to metadata
Apply this change to `lib/metadata_hook.rb` and return the full updated file.
```ruby
class HaskellMetadataHook < Mumukit::Hook
def metadata
{language: {
name: 'haskell',
icon: {type: 'devicon', name: 'haskell'},
version: 'ghc-7.10.1',
extension: 'h... | ```ruby
class HaskellMetadataHook < Mumukit::Hook
def metadata
{language: {
name: 'haskell',
icon: {type: 'devicon', name: 'haskell'},
version: 'ghc-7.10.1',
extension: 'hs',
ace_mode: 'haskell'
},
test_framework: {
name: 'hspec',
version: '2',
... | null | null |
Support multiple @var tags and also no @var tags at all
Apply this change to `src/TypesFinder/FindPropertyType.php` and return the full updated file.
```php
<?php
namespace BetterReflection\TypesFinder;
use PhpParser\Node\Stmt\Property as PropertyNode;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflec... | ```php
<?php
namespace BetterReflection\TypesFinder;
use PhpParser\Node\Stmt\Property as PropertyNode;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\ContextFactory;
use BetterReflection\Reflection\ReflectionProperty;
class FindPropertyType
{
/**
... | null | null |
Allow for passthrough of kubeconfig location
Apply this change to `hack/terminate-namespace.sh` and return the full updated file.
```bash
#!/bin/bash
set -e
set -u
set -x
if [[ $# < 1 ]]; then
echo "Deletes all Active namespaces matchting regex, and waits for their termination"
echo "Usage: $0 namespace_regex
... | ```bash
#!/bin/bash
set -e
set -u
set -x
if [[ $# < 1 ]]; then
echo "Deletes all Active namespaces matchting regex, and waits for their termination"
echo "Usage: $0 namespace_regex
echo "eg: $0 density
exit
fi
kubeconfig=${KUBECONFIG:-"${HOME}/.kube/config"}
regex="$1"
poll_delay_secs=5
# Delete all Active... | null | null |
Delete specs for low-level implementation details
Apply this change to `spec/trie_spec.rb` and return the full updated file.
```ruby
require_relative './spec_helper'
trie = seed_test_ssearch.trie
describe Ssearch::Trie do
describe 'when new prefix is looked up' do
it 'creates new node from reverse indexes'
... | ```ruby
require_relative './spec_helper'
trie = seed_test_ssearch.trie
describe Ssearch::Trie do
describe '#prefix' do
it 'returns array of node strings' do
trie.prefix('a').must_equal []
end
end
end
``` | null | null |
Add blacklist to wcloud client
Apply this change to `cmd/wcloud/types.go` and return the full updated file.
```go
package main
import (
"time"
)
// Deployment describes a deployment
type Deployment struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
ImageName string `json:"image_... | ```go
package main
import (
"time"
)
// Deployment describes a deployment
type Deployment struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
ImageName string `json:"image_name"`
Version string `json:"version"`
Priority int `json:"priority"`
State string `json... | null | null |
Add parse_var methode to the RustParser
Apply this change to `lib/languages/rust.js` and return the full updated file.
```javascript
var DocsParser = require("../docsparser");
var xregexp = require('../xregexp').XRegExp;
function RustParser(settings) {
DocsParser.call(this, settings);
}
RustParser.prototype = O... | ```javascript
var DocsParser = require("../docsparser");
var xregexp = require('../xregexp').XRegExp;
function RustParser(settings) {
DocsParser.call(this, settings);
}
RustParser.prototype = Object.create(DocsParser.prototype);
RustParser.prototype.setup_settings = function() {
this.settings = {
'cu... | null | null |
Test Insertion Sort: Test for sorting the array
Apply this change to `test/algorithms/sorting/testInsertionSort.js` and return the full updated file.
```javascript
/* eslint-env mocha */
const InsertionSort = require('../../../src').Algorithms.Sorting.InsertionSort;
const assert = require('assert');
describe('Insert... | ```javascript
/* eslint-env mocha */
const InsertionSort = require('../../../src').Algorithms.Sorting.InsertionSort;
const assert = require('assert');
describe('Insertion Sort', () => {
it('should have no data when empty initialization', () => {
const inst = new InsertionSort();
assert.equal(inst.size, 0);
... | null | null |
Add guarded 'extern "C"' attributes so that this header files can
be used from both C and C++ programs.
Apply this change to `common/user/capi.h` and return the full updated file.
```c
// Harshad Kasture
//
// This file declares the user level message passing functions used in multithreaded applications
// for the ... | ```c
// Harshad Kasture
//
// This file declares the user level message passing functions used in multithreaded applications
// for the multicore simulator.
#ifndef CAPI_H
#define CAPI_H
typedef int CAPI_return_t;
typedef int CAPI_endpoint_t;
#ifdef __cplusplus
// externed so the names don't get name-mangled
exter... | null | null |
Add char count and disable submit feature
Apply this change to `lib/components/MessageInput.js` and return the full updated file.
```javascript
import React from 'react';
export default class MessageInput extends React.Component {
constructor() {
super();
this.state = {
input: '',
};
}
su... | ```javascript
import React from 'react';
export default class MessageInput extends React.Component {
constructor() {
super();
this.state = {
input: '',
charLimit: 140,
};
}
submitItem() {
this.props.displayMessage(this.state);
this.clearField();
}
clearField() {
this.... | null | null |
Update javadocs to more accurately reflect intent
Apply this change to `core/src/main/java/org/realityforge/arez/spy/package-info.java` and return the full updated file.
```java
/**
* This package contains the core spy events used in an Arez system.
* While the {@link org.realityforge.arez} package and this package... | ```java
/**
* This package contains the spy events and models used in an Arez system.
* The {@link org.realityforge.arez} package and this package are
* highly inter-dependent but they are kept separated as production builds
* typically compile out everything in this package when spies are disabled.
*/
package org... | null | null |
Remove gates for stablized features
Apply this change to `src/lib.rs` and return the full updated file.
```rust
#![cfg(any(target_arch="x86", target_arch="x86_64"))]
#![no_std]
#![crate_name="cpu"]
#![crate_type="rlib"]
#![feature(no_std)]
#![feature(asm)]
#![feature(associated_consts)]
#![feature(core, core_slice_e... | ```rust
#![cfg(any(target_arch="x86", target_arch="x86_64"))]
#![no_std]
#![crate_name="cpu"]
#![crate_type="rlib"]
#![feature(asm)]
#![feature(associated_consts)]
#[macro_use]
extern crate bitflags;
pub use cpu::*;
#[cfg(target_arch="x86")]
#[path = "x86.rs"]
mod cpu;
#[cfg(target_arch="x86_64")]
#[path = "x86_64.... | null | null |
Add default votes and topscores
Apply this change to `models.py` and return the full updated file.
```python
import datetime
from flask import url_for
from Simpoll import db
class Poll(db.Document):
created_at = db.DateTimeField(default=datetime.datetime.now, required=True)
question = db.StringField(max_len... | ```python
import datetime
from flask import url_for
from Simpoll import db
class Poll(db.Document):
created_at = db.DateTimeField(default=datetime.datetime.now, required=True)
question = db.StringField(max_length=255, required=True)
option1 = db.StringField(max_length=255, required=True)
option2 = db.... | null | null |
Fix inconsistent linebreaks after file headers
Apply this change to `vc_zoom/setup.py` and return the full updated file.
```python
# This file is part of the Indico plugins.
# Copyright (C) 2020 - 2021 CERN and ENEA
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the ter... | ```python
# This file is part of the Indico plugins.
# Copyright (C) 2020 - 2021 CERN and ENEA
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from setuptools import setup
setup()
``` | null | null |
Truncate manager activity log on upgrade
Apply this change to `upgrade/includes/311to320.sql` and return the full updated file.
```sql
UPDATE `settings` SET `cmumversion`='3.2.0', `dbversion`='3.2.0' WHERE `id`=1;
ALTER TABLE `groups` ADD `enabled` tinyint(1) NULL DEFAULT '1' AFTER `comment`;
ALTER TABLE `settings` D... | ```sql
UPDATE `settings` SET `cmumversion`='3.2.0', `dbversion`='3.2.0' WHERE `id`=1;
ALTER TABLE `groups` ADD `enabled` tinyint(1) NULL DEFAULT '1' AFTER `comment`;
ALTER TABLE `settings` DROP `dbversion`;
ALTER TABLE `settings` ADD `autoupdcheck` TINYINT(1) NULL AFTER `soonexpusrorder`;
UPDATE `settings` SET `autoupd... | null | null |
Fix for function not returning boolean value
Apply this change to `src/rehyved/utilities/StringHelper.php` and return the full updated file.
```php
<?php
namespace Rehyved\utilities;
class StringHelper
{
public static function endsWith(string $haystack, string $needle, bool $caseSensitive = true){
$hay... | ```php
<?php
namespace Rehyved\utilities;
class StringHelper
{
public static function endsWith(string $haystack, string $needle, bool $caseSensitive = true){
$haystackLength = strlen($haystack);
$needleLength = strlen($needle);
if ($needleLength > $haystackLength) return false;
re... | null | null |
Change to relax dev deps
Apply this change to `tty-tree.gemspec` and return the full updated file.
```ruby
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'tty/tree/version'
Gem::Specification.new do |spec|
spec.name = "tty-tree"
spec.version ... | ```ruby
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'tty/tree/version'
Gem::Specification.new do |spec|
spec.name = "tty-tree"
spec.version = TTY::Tree::VERSION
spec.authors = ["Piotr Murach"]
spec.email = ["me@piotrmur... | null | null |
Fix "Notice: Undefined offset: 1"
Apply this change to `update.php` and return the full updated file.
```php
<?php
/**
* Part of ci-phpunit-test
*
* @author Kenji Suzuki <https://github.com/kenjis>
* @license MIT License
* @copyright 2015 Kenji Suzuki
* @link https://github.com/kenjis/ci-phpunit-t... | ```php
<?php
/**
* Part of ci-phpunit-test
*
* @author Kenji Suzuki <https://github.com/kenjis>
* @license MIT License
* @copyright 2015 Kenji Suzuki
* @link https://github.com/kenjis/ci-phpunit-test
*/
require __DIR__ . '/Installer.php';
$app = 'application';
if (isset($argv[1]) && is_dir($argv[... | null | null |
Use new API in rtc-blinker app
The rtc-blinker app now uses new event API for RTC and also
new API for GPIO.
Apply this change to `apps/rtc-blinker/main.cpp` and return the full updated file.
```cpp
#include "gpio.h"
#include "nvic.h"
#include "driver/timer.hpp"
extern "C" void __cxa_pure_virtual() {
while (1);... | ```cpp
#include "gpio.h"
#include "nvic.h"
#include "driver/timer.hpp"
#include "memio.h"
namespace {
int counter = 0;
void toggle_leds(int) {
auto gpio_n = 17 + (counter++ & 3);
gpio_toggle(0, (1 << gpio_n));
}
}
int main(void) {
nvic_init();
gpio_set_option(0, (1 << 17) | (1 << 18) | (1 << 19) ... | null | null |
[LibraNode] Fix ordering argument for term
Use acquire/release instead of relaxed.
Apply this change to `libra_node/src/main.rs` and return the full updated file.
```rust
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use executable_helpers::helpers::{
setup_executable, ARG_... | ```rust
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use executable_helpers::helpers::{
setup_executable, ARG_CONFIG_PATH, ARG_DISABLE_LOGGING, ARG_PEER_ID,
};
use signal_hook;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
fn register_signals(term: Arc<Ato... | null | null |
Add aliases for a few frequently used docker commands on our EC2 instances.
Apply this change to `roles/aws.ec2-autoscaling-group/files/etc/profile.d/99-dockercmd.sh` and return the full updated file.
```bash
alias watch='watch '
alias dps='docker ps'
function dl { (docker ps | fgrep 'aws.com/kafka:' | awk '{print $1... | ```bash
alias watch='watch '
alias dps='docker ps'
function dl { (docker ps | fgrep 'aws.com/kafka:' | awk '{print $1}'; docker ps -l -q) | head -1;}
function dlog { x="$(dl)"; if [ -z "$x" ]; then echo "Container not running."; else docker logs "$@" $x; fi ;}
alias dlogf='dlog -f'
alias dlogt='dlog -t'
function dex { ... | null | null |
Use regexp to match end of html; let local test function to return bool status
Apply this change to `src/urlfetch/proxy_test.go` and return the full updated file.
```go
package urlfetch
import "testing"
import "fmt"
// Local helper functions
func test_getdata4urls(urls []string) {
// create HTTP client
clie... | ```go
package urlfetch
import "testing"
import "regexp"
// Local helper functions
func parse(output string) bool {
test, err := regexp.MatchString("</html>", output)
if err != nil {
return false
}
return test
}
func test_getdata4urls(urls []string) bool {
ch := make(chan []byte)
for _... | null | null |
Move processEvents call to properly maximize.
Apply this change to `src/main.cpp` and return the full updated file.
```cpp
#include "MainWindow.h"
#include <QApplication>
namespace cygnus {
class MainApp : public QApplication {
QString fileName_{};
MainWindow *mainWindow_;
public:
MainApp(int argc, char *ar... | ```cpp
#include "MainWindow.h"
#include <QApplication>
namespace cygnus {
class MainApp : public QApplication {
QString fileName_{};
MainWindow *mainWindow_;
public:
MainApp(int argc, char *argv[])
: QApplication(argc, argv), mainWindow_(new MainWindow()) {
mainWindow_->showMaximized();
QApplica... | null | null |
Fix hot reload of reducer
Apply this change to `src/assets/app.tsx` and return the full updated file.
```typescript
import 'normalize.css'
import * as React from 'react'
import {render as renderToDOM} from 'react-dom'
import {AppRoot} from '../app/components/root'
import {createReducer} from '../app/reducer'
import {... | ```typescript
import 'normalize.css'
import * as React from 'react'
import {render as renderToDOM} from 'react-dom'
import {AppRoot} from '../app/components/root'
import {createReducer} from '../app/reducer'
import {saga} from '../app/saga'
import {Container} from '../common/components/container'
import {createStore} f... | null | null |
Revise flow of 'start' method
Apply this change to `src/main/java/edu/cwru/sicu_sms/Main.java` and return the full updated file.
```java
/* *\
** SICU Stress Measurement System **
** Project... | ```java
/* *\
** SICU Stress Measurement System **
** Project P04 | C380 Team A **
** EBME 380: Biomedical Engineering Design Experience **
** ... | null | null |
Trim output from sysprocesses since they're not variable length...variables. yea.
Apply this change to `src/queries/connections.sql` and return the full updated file.
```sql
SELECT spid SPID,
sp.[status] Status,
loginame [Login],
hostname HostName,
blocked BlockedBy,
sd.name ... | ```sql
SELECT spid SPID,
RTRIM(sp.[status]) Status,
RTRIM(loginame) [Login],
RTRIM(hostname) HostName,
RTRIM(blocked) BlockedBy,
RTRIM(sd.name) DatabaseName,
RTRIM(cmd) Command,
cpu CPUTime,
physical_io DiskIO,
RTRIM(last_batch) LastBatch,
... | null | null |
Fix CrOS Official build from options2 copy.
BUG=none
TEST=none
TBR=csilv
Review URL: http://codereview.chromium.org/8907049
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@114493 0039d316-1c4b-4281-b951-d872f2087c98
Apply this change to `chrome/browser/ui/webui/options2/chromeos/stats_options_handler.cc` and r... | ```cpp
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/options2/chromeos/stats_options_handler.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "b... | null | null |
Revert "Add new hooks for global level (@BeforeAll and @AfterAll) that run only once before all and after all existing features/scenarios. Unit test and cucumber test to cover the new hooks and the running order between hooks."
This reverts commit 34332ef30d22ad24aa8186b5112f93f0ba8e1b3d.
Apply this change to `java/s... | ```java
package cucumber.runtime.java.hooks;
public class HttpServerStub {
private boolean isStarted;
private Request<String> request;
public void start() {
if (isStarted) {
throw new IllegalStateException("Server already started!");
}
try {
Thread.sleep(200... | null | null |
Support REDIS_HOST and REDIS_PORT environment variables
Apply this change to `demo/startWorker.php` and return the full updated file.
```php
<?php
require_once '../lib/Qless/Worker.php';
require_once '../lib/Qless/Queue.php';
require_once '../lib/Qless/Client.php';
require_once 'TestWorkerImpl.php';
$queues = ['tes... | ```php
<?php
require_once '../lib/Qless/Worker.php';
require_once '../lib/Qless/Queue.php';
require_once '../lib/Qless/Client.php';
require_once 'TestWorkerImpl.php';
$queues = ['testQueue1','testQueue2'];
$REDIS_HOST = getenv('REDIS_HOST') ?: 'localhost';
$REDIS_PORT = getenv('REDIS_PORT') ?: 6380;
$client = new Ql... | null | null |
Put variable assignment in brackets
Apply this change to `app/controllers/sessions_controller.rb` and return the full updated file.
```ruby
class SessionsController < ApplicationController
def new
end
def create
if user = UserAuthenticator.authenticate(params[:session])
log_in user
redirect_to ... | ```ruby
class SessionsController < ApplicationController
def new
end
def create
if (user = UserAuthenticator.authenticate(params[:session]))
log_in user
redirect_to user
else
flash.now[:danger] = "Invalid email/password combination"
render "new"
end
end
def destroy
end... | null | null |
Use processConfiguration() instead of process()
Apply this change to `DependencyInjection/BeanstalkAPIExtension.php` and return the full updated file.
```php
<?php
namespace Beanstalkapp\BeanstalkAPI\DependencyInjection;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Dependenc... | ```php
<?php
namespace Beanstalkapp\BeanstalkAPI\DependencyInjection;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\Definition\Processor;
use Symfo... | null | null |
Use GUARD_NOTIFY to disable guard notifications
Apply this change to `ruby/options.zsh` and return the full updated file.
```bash
# Ruby GC tuning
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_... | ```bash
# Ruby GC tuning
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
export IRBRC="$HOME/.irbrc"
export GEM_EDITOR="$GIT_EDITOR"
# Disable all Guard notifications
export GUAR... | null | null |
Rename expert contract state: Pending -> Waiting for proposals [WAL-1410]
Apply this change to `app/scripts/components/experts/requests/ExpertRequestState.tsx` and return the full updated file.
```typescript
import * as classNames from 'classnames';
import * as React from 'react';
import { react2angular } from 'react... | ```typescript
import * as classNames from 'classnames';
import * as React from 'react';
import { react2angular } from 'react2angular';
import { RequestState } from './types';
interface ExpertRequestStateProps {
model: {
state: RequestState;
};
}
const LabelClasses = {
Active: '',
Pending: 'progress-bar-w... | null | null |
Add a few more compile fail tests for mixed selects
Just adds the test cases from #1586 to our compile test suite to verify
that the `ValidGrouping<G>` rewrite fixed those issues.
Closes #1586
Apply this change to `diesel_compile_tests/tests/compile-fail/cannot_mix_aggregate_and_non_aggregate_selects.rs` and return ... | ```rust
#[macro_use]
extern crate diesel;
use diesel::dsl::count_star;
use diesel::sql_types::{Integer, Nullable};
use diesel::*;
table! {
users {
id -> Integer,
nullable_int_col -> Nullable<Integer>,
}
}
sql_function!(fn f(x: Nullable<Integer>, y: Nullable<Integer>) -> Nullable<Integer>);
f... | null | null |
Add test to verify correct early termination behavior.
Apply this change to `Tests/PenguinParallelTests/ZipPipelineIteratorTests.swift` and return the full updated file.
```swift
import XCTest
import PenguinParallel
final class ZipPipelineIteratorTests: XCTestCase {
func testZipAndMapTwoArrays() {
let a... | ```swift
import XCTest
import PenguinParallel
final class ZipPipelineIteratorTests: XCTestCase {
func testZipAndMapTwoArrays() {
let arr = [0, 1, 2, 3, 4]
let tmp = PipelineIterator.zip(arr.makePipelineIterator(), arr.makePipelineIterator().map { $0 + 1 })
var itr = tmp.map { $0.0 + $0.1 }... | null | null |
Add me to the authors
Apply this change to `clockwork.gemspec` and return the full updated file.
```ruby
Gem::Specification.new do |s|
s.name = "clockwork"
s.version = "0.5.2"
s.authors = ["Adam Wiggins"]
s.description = "A scheduler process to replace cron, using a more flexible Ruby syntax running as a sin... | ```ruby
Gem::Specification.new do |s|
s.name = "clockwork"
s.version = "0.5.2"
s.authors = ["Adam Wiggins", "tomykaira"]
s.description = "A scheduler process to replace cron, using a more flexible Ruby syntax running as a single long-running process. Inspired by rufus-scheduler and resque-scheduler."
s.emai... | null | null |
Put the resources user to the right place
Apply this change to `config/routes.rb` and return the full updated file.
```ruby
Rails.application.routes.draw do
resources :users
scope '/:locale', :locale => /de|fr|it|en/, :format => /json|html/ do
resources :words
resources :categories
end
root :to =... | ```ruby
Rails.application.routes.draw do
resources :users
scope '/:locale', :locale => /de|fr|it|en/, :format => /json|html/ do
resources :words
resources :categories
resources :users
end
root :to => 'infos#home'
end
``` | null | null |
Use Enum.Parse overload available in PCL
Apply this change to `EvilDICOM.Core/EvilDICOM.Core/Helpers/EnumHelper.cs` and return the full updated file.
```csharp
using System;
namespace EvilDICOM.Core.Helpers
{
public class EnumHelper
{
public static T StringToEnum<T>(string name)
{
... | ```csharp
using System;
namespace EvilDICOM.Core.Helpers
{
public class EnumHelper
{
public static T StringToEnum<T>(string name)
{
return (T) Enum.Parse(typeof (T), name, false);
}
}
}
``` | null | null |
Use migrations inside test class
Apply this change to `tests/Unit/Pages/Help/HelpIndexPageTest.php` and return the full updated file.
```php
<?php
namespace Tests\Unit\Pages\Help;
use Tests\TestCase;
use Tests\CreatesUser;
use Illuminate\Foundation\Testing\RefreshDatabase;
class HelpIndexPageTest extends TestCase
... | ```php
<?php
namespace Tests\Unit\Pages\Help;
use Tests\TestCase;
use Tests\CreatesUser;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class HelpIndexPageTest extends TestCase
{
use DatabaseMigrations, DatabaseTransactions, CreatesUser;
/** @te... | null | null |
Adjust test to fix bot error from r254927.
Remove the part of the error message that may vary across systems.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@254938 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `test/CodeGen/thinlto_backend.c` and return the full updated file.
```c
// RUN: %clang -... | ```c
// RUN: %clang -target x86_64-unknown-linux -O2 %s -flto=thin -c -o %t.o
// RUN: llvm-lto -thinlto -o %t %t.o
// Ensure clang -cc1 give expected error for incorrect input type
// RUN: not %clang_cc1 -target x86_64-unknown-linux -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHE... | null | null |
Rename ContactFlowLayout’s protocol to match the class name
Apply this change to `MBContactPicker/UICollectionViewContactFlowLayout.h` and return the full updated file.
```c
//
// UICollectionViewContactFlowLayout.h
// MBContactPicker
//
// Created by Matt Bowman on 12/1/13.
// Copyright (c) 2013 Citrrus, LLC. Al... | ```c
//
// UICollectionViewContactFlowLayout.h
// MBContactPicker
//
// Created by Matt Bowman on 12/1/13.
// Copyright (c) 2013 Citrrus, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol UICollectionViewContactFlowLayoutDelegate
- (void)collectionView:(UICollectionView*)collectionView willChangeCon... | null | null |
Use QGIS LTR for Polyhedralsurface support.
Apply this change to `vagrant/qgis.sh` and return the full updated file.
```bash
#!/bin/bash -e
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 3FF5FFCAD71472C4
sudo sh -c 'echo "deb http://qgis.org/debian trusty main" > /etc/apt/sources.list.d/qgis.list'
sudo ... | ```bash
#!/bin/bash -e
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 3FF5FFCAD71472C4
sudo sh -c 'echo "deb http://qgis.org/debian-ltr trusty main" > /etc/apt/sources.list.d/qgis.list'
sudo apt-get update -qq
sudo apt-get install -y --force-yes qgis python-qgis
``` | null | null |
Fix broken wrapper around Meteor.defer
Apply this change to `packages/lesswrong/lib/executionEnvironment.ts` and return the full updated file.
```typescript
import { Meteor } from 'meteor/meteor';
export const isServer = Meteor.isServer
export const isClient = Meteor.isClient
export const isDevelopment = Meteor.isDe... | ```typescript
import { Meteor } from 'meteor/meteor';
export const isServer = Meteor.isServer
export const isClient = Meteor.isClient
export const isDevelopment = Meteor.isDevelopment
export const isProduction = Meteor.isProduction
export const isAnyTest = Meteor.isTest || Meteor.isAppTest || Meteor.isPackageTest
expo... | null | null |
[opentitanlib] Add auto-default values for the ti50 emulator backend
Signed-off-by: Miles Dai <0447d2cf64f2d947597a59a7749da4cb3bbe9dd1@google.com>
Apply this change to `sw/host/opentitanlib/src/backend/ti50emulator.rs` and return the full updated file.
```rust
// Copyright lowRISC contributors.
// Licensed under th... | ```rust
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
use crate::transport::ti50emulator::Ti50Emulator;
use crate::transport::Transport;
use anyhow::Result;
use std::path::PathBuf;
use structopt::StructOpt;
#[deriv... | null | null |
Add condition when create jenkins volume.
Apply this change to `createJenkins.sh` and return the full updated file.
```bash
#!/bin/bash
set -e
JENKINS_NAME=${JENKINS_NAME:-jenkins}
JENKINS_VOLUME=${JENKINS_VOLUME:-jenkins-volume}
GERRIT_NAME=${GERRIT_NAME:-gerrit}
JENKINS_IMAGE_NAME=${JENKINS_IMAGE_NAME:-openfrontier... | ```bash
#!/bin/bash
set -e
JENKINS_NAME=${JENKINS_NAME:-jenkins}
JENKINS_VOLUME=${JENKINS_VOLUME:-jenkins-volume}
GERRIT_NAME=${GERRIT_NAME:-gerrit}
JENKINS_IMAGE_NAME=${JENKINS_IMAGE_NAME:-openfrontier/jenkins}
JENKINS_OPTS=${JENKINS_OPTS:---prefix=/jenkins}
# Create Jenkins volume.
if [ -z "$(docker ps -a | grep ${J... | null | null |
Add missing `CanPreload` to Slack notifier phase
Apply this change to `config/phase_slack_notifier.go` and return the full updated file.
```go
package config
import (
"github.com/nlopes/slack"
)
type SlackNotifierPhase struct {
Client *slack.Client
Channel string
Format func(Deployment) (string, error)
}
fun... | ```go
package config
import (
"github.com/nlopes/slack"
)
type SlackNotifierPhase struct {
Client *slack.Client
Channel string
Format func(Deployment) (string, error)
}
func (snp *SlackNotifierPhase) CanPreload() bool {
return false
}
func (snp *SlackNotifierPhase) HasExecuted(deployment Deployment) (bool, e... | null | null |
Check that we have exactly one argument.
Apply this change to `tools/screenshots.sh` and return the full updated file.
```bash
#!/usr/bin/env bash
function chkcmd {
which $1 >/dev/null
if [ $? -ne 0 ];then
echo "Program '$1' not found."
exit 1
fi
}
chkcmd "phantomjs"
chkcmd "convert"
SCR... | ```bash
#!/usr/bin/env bash
function die () {
echo >&2 "$@"
exit 1
}
function chkcmd {
which $1 >/dev/null
if [ $? -ne 0 ];then
die "Program '$1' not found."
fi
}
chkcmd "phantomjs"
chkcmd "convert"
# check that we have exactly one argument
[ "$#" -eq 1 ] || die "1 argument required, $# p... | null | null |
Add call to build lookup table
Apply this change to `core/how_to_scan_images/ReduceColours.cpp` and return the full updated file.
```cpp
// Copyright 2015 Matt Heard
// http://mattheard.net
// matt@mattheard.net
// @mattheard
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string>
int main(int argc, cha... | ```cpp
// Copyright 2015 Matt Heard
// http://mattheard.net
// matt@mattheard.net
// @mattheard
#include <opencv2/opencv.hpp>
#include <iostream>
#include <string>
using cv::Mat;
Mat buildLookUpTable(const int divideWith) {
return Mat();
}
int main(int argc, char **argv) {
using std::string;
const int e... | null | null |
:green_heart: Build rensa_tracker only with AVX2
RensaTracker needs AVX2 and BMI2. Add #[cfg] so that it's not built
on non AVX2 or BMI2 machine.
Apply this change to `puyocore/src/lib.rs` and return the full updated file.
```rust
#![feature(platform_intrinsics)]
#![feature(simd, simd_ffi, link_llvm_intrinsics)]
#![... | ```rust
#![feature(platform_intrinsics)]
#![feature(simd, simd_ffi, link_llvm_intrinsics)]
#![feature(cfg_target_feature)]
extern crate rand;
extern crate x86intrin;
pub mod color;
pub mod decision;
pub mod field;
mod field_bit;
#[cfg(all(target_feature = "avx2", target_feature="bmi2"))]
mod field_bit_256;
pub mod fi... | null | null |
Use a different default website prefix
Apply this change to `config.inc.php` and return the full updated file.
```php
<?php
/**
* Configuration file
*
* Settings to configure the functionality of Saberva
*
* PHP version 5
*
* @author Waldo Jaquith <waldo at jaquith.org>
* @copyright 2013 Waldo Jaquith
* @... | ```php
<?php
/**
* Configuration file
*
* Settings to configure the functionality of Saberva
*
* PHP version 5
*
* @author Waldo Jaquith <waldo at jaquith.org>
* @copyright 2013 Waldo Jaquith
* @license MIT
* @version 0.1
* @link http://www.github.com/waldoj/saberva
* @since 0.1
*
*/
/*
* Specify... | null | null |
Make all end-points accepting post
Apply this change to `jedihttp/handlers.py` and return the full updated file.
```python
import bottle
from bottle import response, request
import json
import jedi
import logging
app = bottle.Bottle( __name__ )
logger = logging.getLogger( __name__ )
@app.get( '/healthy' )
def hea... | ```python
import bottle
from bottle import response, request
import json
import jedi
import logging
app = bottle.Bottle( __name__ )
logger = logging.getLogger( __name__ )
@app.post( '/healthy' )
def healthy():
return _Json({})
@app.post( '/ready' )
def ready():
return _Json({})
@app.post( '/completions' )
d... | null | null |
Simplify class by removing unnecessary stuff
Apply this change to `app/src/main/java/coatapp/coat/ForecastRequestTask.java` and return the full updated file.
```java
package coatapp.coat;
import android.os.AsyncTask;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;... | ```java
package coatapp.coat;
import android.os.AsyncTask;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class ForecastRequestTask extends AsyncTask<String, Void, String> {
private static String getForecastRequest(String urlToRead... | null | null |
Fix command line error display
Apply this change to `src/Meraki.Console/Program.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CommandLine;
using Meraki;
namespace Meraki.Console
{
class Program
{
... | ```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CommandLine;
using Meraki;
namespace Meraki.Console
{
class Program
{
static void Main(string[] args)
{
try
{
Parser.Default.ParseArguments<L... | null | null |
Add settings for has_invitation field of csiprova2 meeting
Apply this change to `db/diff.new/201412220900all_csiprova2_schedule.sql` and return the full updated file.
```sql
-- Inizio script
/*!40101 SET character_set_client = latin1 */;
/*!40103 SET TIME_ZONE='+00:00' */;
SET AUTOCOMMIT=0;
START TRANSACTION;
... | ```sql
-- Inizio script
/*!40101 SET character_set_client = latin1 */;
/*!40103 SET TIME_ZONE='+00:00' */;
SET AUTOCOMMIT=0;
START TRANSACTION;
-- Add schedule details to csi prova 2
update meeting_sessions
set warm_up_time = '14:00:00',
begin_time = '14:50:00',
day_part_type_id = (select dpt.id from da... | null | null |
Change the method body of times() to expression
Apply this change to `src/main/kotlin/money/Money.kt` and return the full updated file.
```kotlin
package money
sealed class Money(private val amount: Int, val currency: String) {
fun times(mul: Int): Money {
return when(this) {
is Dollar -> do... | ```kotlin
package money
sealed class Money(private val amount: Int, val currency: String) {
fun times(mul: Int): Money = when (this) {
is Dollar -> dollar(amount * mul)
is Franc -> franc(amount * mul)
}
companion object {
fun dollar(amount: Int): Money = Money.Dollar(amount, "USD"... | null | null |
Add NO-OP for pong messages (to handle unsolicited pongs)
git-svn-id: 79cef5a5a257cc9dbe40a45ac190115b4780e2d0@1425646 13f79535-47bb-0310-9956-ffa450edef68
Apply this change to `webapps/examples/WEB-INF/classes/websocket/echo/EchoAnnotation.java` and return the full updated file.
```java
/*
* Licensed to the Apach... | ```java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "Licens... | null | null |
Tidy up some Swift code
Apply this change to `swift/custom_operator_example.swift` and return the full updated file.
```swift
precedencegroup A {higherThan: AdditionPrecedence lowerThan: MultiplicationPrecedence associativity: left }
infix operator ~|*|~ : A
postfix operator ^^
func ~|*|~ (x: Int, y: Int) -> Int {
... | ```swift
precedencegroup A {
higherThan: AdditionPrecedence
lowerThan: MultiplicationPrecedence
associativity: left
}
infix operator ~|*|~ : A
postfix operator ^^
func ~|*|~ (x: Int, y: Int) -> Int {
return 2 * x + y
}
postfix func ^^ (x: Int) -> Int {
return x - 2
}
assert(8^^ ~|*|~ 3 == 15)
``` | null | null |
[doc] Hide the ioctl FFI declaration
Apply this change to `src/lib.rs` and return the full updated file.
```rust
extern crate libc as real_libc;
#[macro_use]
extern crate bitflags;
#[cfg(target_os = "linux")]
#[path = "platform/linux.rs"]
#[macro_use]
mod platform;
pub use platform::*;
/// A hack to get the macros... | ```rust
extern crate libc as real_libc;
#[macro_use]
extern crate bitflags;
#[cfg(target_os = "linux")]
#[path = "platform/linux.rs"]
#[macro_use]
mod platform;
pub use platform::*;
/// A hack to get the macros to work nicely.
#[doc(hidden)]
pub use real_libc as libc;
extern "C" {
#[doc(hidden)]
pub fn ioct... | null | null |
Test the non-idempotency of compositions with non-idempotent substitutions.
Apply this change to `ManifoldTests/SubstitutionTests.swift` and return the full updated file.
```swift
// Copyright (c) 2015 Rob Rix. All rights reserved.
final class SubstitutionTests: XCTestCase {
let (a, b) = (Variable(), Variable())
... | ```swift
// Copyright (c) 2015 Rob Rix. All rights reserved.
final class SubstitutionTests: XCTestCase {
let (a, b) = (Variable(), Variable())
let (c, d) = (Variable(), Variable())
var t1: Type { return Type(c) }
var t2: Type { return Type(d) }
func testCompositionIsIdempotentIfOperandsAreIdempotent() {
let s... | null | null |
Change package name to hal-assistant
Apply this change to `setup.py` and return the full updated file.
```python
from distutils.core import setup
from hal.version import __version__ as version
setup(
name='hal',
packages=['hal'],
version=version,
description='Command Line Assistant',
author='Anu... | ```python
from distutils.core import setup
from hal.version import __version__ as version
setup(
name='hal-assistant',
packages=['hal'],
version=version,
description='Command Line Assistant',
author='Anup Pokhrel',
author_email='virtualanup@gmail.com',
url='https://github.com/virtualanup/h... | null | null |
Add documentation about sandbox attribute
Apply this change to `applications/mail/src/app/components/message/helpers/getIframeSandboxAttributes.ts` and return the full updated file.
```typescript
import { isSafari } from '@proton/shared/lib/helpers/browser';
const getIframeSandboxAttributes = (isPrint: boolean) => {... | ```typescript
import { isSafari } from '@proton/shared/lib/helpers/browser';
const getIframeSandboxAttributes = (isPrint: boolean) => {
/**
* "allow-same-origin"
* Because iframe origin is set to protonmail.com we need
* to be able to access it's origin
* "allow-modals"
* Al... | null | null |
Update only one settings dialog can be opened
Apply this change to `src/browser/settings/settings-dialog/settings-dialog.ts` and return the full updated file.
```typescript
import { Injectable } from '@angular/core';
import { Dialog, DialogRef } from '../../ui/dialog';
import { SettingsDialogData } from './settings-d... | ```typescript
import { Injectable, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs';
import { Dialog, DialogRef } from '../../ui/dialog';
import { SettingsDialogData } from './settings-dialog-data';
import { SettingsDialogComponent } from './settings-dialog.component';
@Injectable()
export class ... | null | null |
[test] Fix test for new filename.
Swift SVN r31541
Apply this change to `test/Driver/sdk-linux.swift` and return the full updated file.
```swift
// RUN: %swiftc_driver -driver-print-jobs -g %s 2>&1 | FileCheck %s
// XFAIL: darwin
// CHECK-NOT: warning: no such SDK:
// CHECK: bin/swift
// CHECK: Driver/sdk.swift
// ... | ```swift
// RUN: %swiftc_driver -driver-print-jobs -g %s 2>&1 | FileCheck %s
// XFAIL: darwin
// CHECK-NOT: warning: no such SDK:
// CHECK: bin/swift
// CHECK: Driver/sdk-linux.swift
// CHECK: -sdk /{{ }}
// CHECK-NEXT: bin/swift
// CHECK: -sdk /{{ }}
``` | null | null |
Use full class name for Context class
Apply this change to `modules/helma/parser.js` and return the full updated file.
```javascript
/**
* @fileoverview A JS interface to the Rhino parser.
*/
/**
* Parse a script resource and return its AST tree.
* @param resource {Resource} an instance of org.helma.repository.R... | ```javascript
/**
* @fileoverview A JS interface to the Rhino parser.
*/
/**
* Parse a script resource and return its AST tree.
* @param resource {Resource} an instance of org.helma.repository.Resource
*/
exports.parseScriptResource = function(resource) {
return getParser().parse(resource.content, resource.na... | null | null |
Make input string a multiline string
Apply this change to `pluto.go` and return the full updated file.
```go
package main
import (
"fmt"
"os"
"github.com/Zac-Garby/pluto/bytecode"
"github.com/Zac-Garby/pluto/compiler"
"github.com/Zac-Garby/pluto/parser"
"github.com/Zac-Garby/pluto/vm"
)
func main() {
compil... | ```go
package main
import (
"fmt"
"os"
"github.com/Zac-Garby/pluto/bytecode"
"github.com/Zac-Garby/pluto/compiler"
"github.com/Zac-Garby/pluto/parser"
"github.com/Zac-Garby/pluto/vm"
)
func main() {
compiler := compiler.New()
p := parser.New(`
a = 5
a
`)
program := p.Parse()
if len(p.Errors) > 0 {
p.... | null | null |
Add the ability to create a readonly deploy key
Apply this change to `Octokit/Models/Request/NewDeployKey.cs` and return the full updated file.
```csharp
using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
/// <summary>
/// Describes a new deployment key to create.
//... | ```csharp
using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
/// <summary>
/// Describes a new deployment key to create.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class NewDeployKey
{
public string Title { get; set; }
... | null | null |
Synchronize logging to stderr and stdout in debug mode
Apply this change to `src/debugUtils.h` and return the full updated file.
```c
#pragma once
#include <string>
#include <iostream>
#include <fstream>
#include <exception>
#include <boost/format.hpp>
using boost::format;
class LogFile
{
public:
LogFile();
... | ```c
#pragma once
#include <string>
#include <iostream>
#include <fstream>
#include <exception>
#include <boost/format.hpp>
using boost::format;
class LogFile
{
public:
LogFile();
explicit LogFile(const std::string& filename);
~LogFile();
void open(const std::string& filename);
void close();
... | null | null |
Implement "(*matrixImpl).Shape()" with "(*matrixImple).Rows()" and "(*matrixImple).Columns()".
Apply this change to `mutable/dense/dense.go` and return the full updated file.
```go
/*
Package "dense" provides an implementation of "Matrix" which stores elements in a slide.
*/
package dense
import (
"errors"
"fmt"
... | ```go
/*
Package "dense" provides an implementation of "Matrix" which stores elements in a slide.
*/
package dense
import (
"errors"
"fmt"
"github.com/mitsuse/matrix-go"
)
type matrixImpl struct {
rows int
columns int
elements []float64
}
func New(rows, columns int) func(elements ...float64) (matrix.Matr... | null | null |
bench: Tweak threadring benchmark so it pretty-prints
Apply this change to `src/test/bench/shootout-threadring.rs` and return the full updated file.
```rust
// Based on threadring.erlang by Jira Isa
use std;
const n_threads: int = 503;
fn start(+token: int) {
import iter::*;
let p = comm::port();
let c... | ```rust
// Based on threadring.erlang by Jira Isa
use std;
const n_threads: int = 503;
fn start(+token: int) {
import iter::*;
let p = comm::port();
let ch = iter::foldl(bind int::range(2, n_threads + 1, _),
comm::chan(p)) { |ch, i|
let id = n_threads + 2 - i;
let... | null | null |
Use `zip -qr` instead of `cat`
Apply this change to `docker-entrypoint.sh` and return the full updated file.
```bash
#!/bin/sh
OPT=`getopt -o "" -l "tarball,zipball" -- "$@"`
set -- $OPT
while [ $# -gt 0 ]; do
case $1 in
--tarball) tarball=true ;;
--zipball) zipball=true ;;
esac
shift
done
cd /Ricty-${RICTY... | ```bash
#!/bin/sh
OPT=`getopt -o "" -l "tarball,zipball" -- "$@"`
set -- $OPT
while [ $# -gt 0 ]; do
case $1 in
--tarball) tarball=true ;;
--zipball) zipball=true ;;
esac
shift
done
cd /Ricty-${RICTY_VERSION}
if [ ! -e Ricty-Regular.ttf ]; then
if [ ! "$tarball" -a ! "$zipball" ]; then
./ricty_generator.s... | null | null |
Fix bug with 1000 character fix
Apply this change to `groupme/gmservice.go` and return the full updated file.
```go
package groupme
import (
"bytes"
"encoding/json"
"io"
"net/http"
"time"
"github.com/nelsonleduc/calmanbot/service"
"github.com/nelsonleduc/calmanbot/utility"
)
const postDelayMilliseconds = 50... | ```go
package groupme
import (
"bytes"
"encoding/json"
"io"
"net/http"
"time"
"github.com/nelsonleduc/calmanbot/service"
"github.com/nelsonleduc/calmanbot/utility"
)
const postDelayMilliseconds = 500
const groupmeLengthLimit = 1000
func init() {
service.AddService("groupme", gmService{})
}
type gmService s... | null | null |
Interrupt signal handler for POSIX.
Apply this change to `src/platform/posix.cpp` and return the full updated file.
```cpp
#include "platform.hpp"
#ifndef WIN32
namespace Mirb
{
namespace Platform
{
std::string BenchmarkResult::format()
{
std::stringstream result;
result << ((double)time / 1000) << " m... | ```cpp
#include "platform.hpp"
#include "../collector.hpp"
#include <signal.h>
#ifndef WIN32
namespace Mirb
{
namespace Platform
{
std::string BenchmarkResult::format()
{
std::stringstream result;
result << ((double)time / 1000) << " ms";
return result.str();
}
void *allocate_region(size_t bytes... | null | null |
Add API call to return service dialogs
https://trello.com/c/qfdnTNlk
Apply this change to `spa_ui/self_service/client/app/states/marketplace/details/details.state.js` and return the full updated file.
```javascript
(function() {
'use strict';
angular.module('app.states')
.run(appRun);
/** @ngInject */
... | ```javascript
(function() {
'use strict';
angular.module('app.states')
.run(appRun);
/** @ngInject */
function appRun(routerHelper) {
routerHelper.configureStates(getStates());
}
function getStates() {
return {
'marketplace.details': {
url: '/:serviceTemplateId',
templat... | null | null |
Rewrite test to pure junit
Apply this change to `src/test/kotlin/RemoteToLocalFileTranslatorTest.kt` and return the full updated file.
```kotlin
import com.elpassion.intelijidea.configuration.RemoteToLocalFileTranslator
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase
import org.juni... | ```kotlin
import com.elpassion.intelijidea.configuration.RemoteToLocalFileTranslator
import com.intellij.openapi.project.Project
import com.nhaarman.mockito_kotlin.doReturn
import com.nhaarman.mockito_kotlin.mock
import org.junit.Assert.assertEquals
import org.junit.Test
class RemoteToLocalFileTranslatorTest {
pr... | null | null |
Reduce float multiplication in strength
Apply this change to `src/tac/ReduceInStrength.cpp` and return the full updated file.
```cpp
//=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompa... | ```cpp
//=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//==============================================... | null | null |
Remove bogus reference to nexus.yested.net
Apply this change to `build.gradle.kts` and return the full updated file.
```kotlin
buildscript {
var kotlinVer: String by extra
kotlinVer = "1.2.40"
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gra... | ```kotlin
buildscript {
var kotlinVer: String by extra
kotlinVer = "1.2.40"
repositories {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVer")
}
}
allprojects {
apply { plugin("idea") }
group = "com.github.epabst.kotlin-showc... | null | null |
Remove the proc_macro feature gate
Apply this change to `json_tests/tests/test.rs` and return the full updated file.
```rust
#![cfg_attr(feature = "nightly-testing", feature(plugin))]
#![cfg_attr(feature = "nightly-testing", plugin(clippy))]
#![cfg_attr(not(feature = "with-syntex"), feature(proc_macro, plugin))]
#![... | ```rust
#![cfg_attr(feature = "nightly-testing", feature(plugin))]
#![cfg_attr(feature = "nightly-testing", plugin(clippy))]
#![cfg_attr(not(feature = "with-syntex"), feature(plugin))]
#![cfg_attr(not(feature = "with-syntex"), plugin(indoc))]
#[cfg(not(feature = "with-syntex"))]
#[macro_use]
extern crate serde_derive... | null | null |
Fix the home sending worker being too generic on how it sends people home
Apply this change to `src/main/java/com/graywolf336/trailingperspective/workers/HomeSendingWorker.java` and return the full updated file.
```java
package com.graywolf336.trailingperspective.workers;
import org.bukkit.ChatColor;
import com.gra... | ```java
package com.graywolf336.trailingperspective.workers;
import org.bukkit.ChatColor;
import com.graywolf336.trailingperspective.TrailingPerspectiveMain;
import com.graywolf336.trailingperspective.enums.Settings;
import com.graywolf336.trailingperspective.interfaces.ITrailer;
import com.graywolf336.trailingperspe... | null | null |
Use llc+gcc instead of lli, so we can link against gmp
Apply this change to `test.sh` and return the full updated file.
```bash
#!/bin/bash
set -e
if [ "$1" = "-" ]; then
testdir=`mktemp -d` || exit 1
trap "rm -fr $testdir" exit
outdir=${testdir}
mod=temp_test
cat > ${testdir}/${mod}.m
else
mod="$1"
fi
outdir=${ou... | ```bash
#!/bin/bash
set -e
if [ "$1" = "-" ]; then
testdir=`mktemp -d` || exit 1
trap "rm -fr $testdir" exit
outdir=${testdir}
mod=temp_test
cat > ${testdir}/${mod}.m
else
mod="$1"
fi
outdir=${outdir-out}
shift
dist/build/m3/m3 ${testdir:+-I${testdir} -o${outdir}} ${mod}
file=${outdir}/${mod/::/__}
llvm-as ${file}... | null | null |
Handle empty response in help texts
Apply this change to `templates.go` and return the full updated file.
```go
package main
import (
"text/template"
)
var (
BANNER_TEMPLATE = template.Must(template.New("banner").Parse(
`===================== goslow ====================
`))
CREATE_SITE_TEMPLATE = template.Mus... | ```go
package main
import (
"text/template"
)
var (
BANNER_TEMPLATE = template.Must(template.New("banner").Parse(
`===================== goslow ====================
`))
CREATE_SITE_TEMPLATE = template.Must(template.New("create site").Parse(
`Your personal goslow domain is {{ .Domain }}
You can configure your ... | null | null |
Fix SQL statement to prevent always asking for updates
Apply this change to `ext_tables.sql` and return the full updated file.
```sql
#
# Table structure for table 'tx_tevglossary_domain_model_entry'
#
CREATE TABLE tx_tevglossary_domain_model_entry (
uid int(11) unsigned NOT NULL auto_increment,
pid int(11) ... | ```sql
#
# Table structure for table 'tx_tevglossary_domain_model_entry'
#
CREATE TABLE tx_tevglossary_domain_model_entry (
uid int(11) unsigned NOT NULL auto_increment,
pid int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL... | null | null |
Change port number 8888 to 8898
In linux platform, self hosting demo throws an error: "System.Net.Sockets.SocketException: Address already in use"
Apply this change to `src/Nancy.Demo.Hosting.Self/Program.cs` and return the full updated file.
```csharp
namespace Nancy.Demo.Hosting.Self
{
using System;
us... | ```csharp
namespace Nancy.Demo.Hosting.Self
{
using System;
using System.Diagnostics;
using Nancy.Hosting.Self;
class Program
{
static void Main()
{
using (var nancyHost = new NancyHost(new Uri("http://localhost:8888/nancy/"), new Uri("http://127.0.0.1:8898/... | null | null |
Use default layout in search controller.
Fixes regression introduced in d6c95f99745067790410e1e3aacffcae6828d785.
Apply this change to `app/controllers/searches_controller.rb` and return the full updated file.
```ruby
class SearchesController < ApplicationController
layout 'default'
def index
@search = Sear... | ```ruby
class SearchesController < ApplicationController
def index
@search = Search.new
@search.find_venue(params[:search]) if request.post?
@venue = @search.venue
@current_conditions = @search.current_conditions
end
end
``` | null | null |
Support arrays of paths, with the callback getting an array of mime-types.
Apply this change to `lib/mime-magic.js` and return the full updated file.
```javascript
var p = require('path');
var cp = require('child_process');
var fileExec = p.resolve(__dirname + '/../bin/file');
var fileFlags = ['--magic-file', p.reso... | ```javascript
var p = require('path');
var cp = require('child_process');
var fileExec = p.resolve(__dirname + '/../bin/file');
var fileFlags = ['--magic-file', p.resolve(__dirname + '/../share/magic.mgc'), '--brief', '--mime-type'];
var fileWrapper = function (path, cb) {
cp.execFile(fileExec, fileFlags.concat(Arra... | null | null |
Make the module declarations more compact.
Apply this change to `src/lib.rs` and return the full updated file.
```rust
// The MIT License (MIT)
//
// Copyright (c) 2015 dinowernli
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files ... | ```rust
// The MIT License (MIT)
//
// Copyright (c) 2015 dinowernli
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to u... | null | null |
Simplify qualification with use statement
Apply this change to `src/main.rs` and return the full updated file.
```rust
mod vm;
mod command;
mod parse;
mod program;
use vm::VM;
use program::Program;
use std::io::Write;
use std::env;
use std::path::Path;
use std::fs::File;
use std::io::prelude::*;
fn main() {
le... | ```rust
mod vm;
mod command;
mod parse;
mod program;
use vm::VM;
use program::Program;
use parse::parse;
use std::io::Write;
use std::env;
use std::path::Path;
use std::fs::File;
use std::io::prelude::*;
fn main() {
let vm = VM::new();
let program = Program::new();
match env::args().nth(1) {
None... | null | null |
Make this test portable on Win32.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@139464 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `test/CodeGen/2007-06-15-AnnotateAttribute.c` and return the full updated file.
```c
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations
// RUN: %c... | ```c
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.var.annotation | count 3
/* Global variable with attribute */
int X __attribute__((annotate("GlobalValAnnotation")));
/* Function with attribute */
int foo(int y) __attribute__((annotate("Global... | null | null |
Fix title bar action group ID not registered exception
Apply this change to `src/main/kotlin/cn/yiiguxing/plugin/translate/action/TitleBarActionRegistrar.kt` and return the full updated file.
```kotlin
package cn.yiiguxing.plugin.translate.action
import cn.yiiguxing.plugin.translate.util.Plugin
import com.intellij.i... | ```kotlin
package cn.yiiguxing.plugin.translate.action
import com.intellij.ide.AppLifecycleListener
import com.intellij.ide.plugins.DynamicPluginListener
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.Constraints
impo... | null | null |
Include newline at end of rewritten manifest.json
Apply this change to `update-manifest.js` and return the full updated file.
```javascript
#!/usr/bin/env node
var manifestPath = __dirname + '/manifest.json';
var fs = require('fs');
var manifest = JSON.parse(fs.readFileSync(manifestPath));
console.assert(Array.isA... | ```javascript
#!/usr/bin/env node
var manifestPath = __dirname + '/manifest.json';
var fs = require('fs');
var manifest = JSON.parse(fs.readFileSync(manifestPath));
console.assert(Array.isArray(manifest.content_scripts));
console.assert(Array.isArray(manifest.content_scripts[0].matches));
console.log('Fetching Goog... | null | null |
Support to map swagger UI to application root url
UseSwaggerUI will check for special case empty RoutePrefix and allow mapping swagger UI to application root url.
Apply this change to `src/Swashbuckle.AspNetCore.SwaggerUI/Application/SwaggerUIBuilderExtensions.cs` and return the full updated file.
```csharp
using S... | ```csharp
using System;
using Microsoft.AspNetCore.StaticFiles;
using Swashbuckle.AspNetCore.SwaggerUI;
namespace Microsoft.AspNetCore.Builder
{
public static class SwaggerUIBuilderExtensions
{
public static IApplicationBuilder UseSwaggerUI(
this IApplicationBuilder app,
Action... | null | null |
Remove support for FreeBSD < 11
This was put in to allow the 10.3 templates to work. Those are gone now
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
Apply this change to `packer_templates/freebsd/scripts/minimize.sh` and return the full updated file.
```bash
#!/bin/sh -eux
case "$PAC... | ```bash
#!/bin/sh -eux
case "$PACKER_BUILDER_TYPE" in
qemu) exit 0 ;;
esac
ZROOT="zroot/ROOT/default"
COMPRESSION=$(zfs get -H compression $ZROOT | cut -f3);
zfs set compression=off $ZROOT;
dd if=/dev/zero of=/EMPTY bs=1m &
PID=$!;
avail=$(zfs get -pH avail $ZROOT | cut -f3);
while [ "$avail" -ne 0 ]; do
sleep ... | null | null |
Update deployed settings to access mysql.
Apply this change to `clintools/deployed_settings.py` and return the full updated file.
```python
from settings import *
DEBUG = TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['pttrack.snhc.wustl.edu']
with open(os.path.join(BASE_DIR, 'secrets/secret_key.txt')) as f:
SECRET_KE... | ```python
from settings import *
DEBUG = TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['pttrack.snhc.wustl.edu']
with open(os.path.join(BASE_DIR, 'secrets/secret_key.txt')) as f:
SECRET_KEY = f.read().strip()
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_... | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.