original_prompt stringlengths 327 2.5k | original_completion stringlengths 22 2.84k | enhanced_prompt float64 | enhanced_completion float64 |
|---|---|---|---|
Remove usage of `mavenLocal()` from `:integTest`
Apply this change to `subprojects/integ-test/integ-test.gradle.kts` and return the full updated file.
```kotlin
import org.gradle.gradlebuild.test.integrationtests.IntegrationTest
import org.gradle.gradlebuild.testing.integrationtests.cleanup.WhenNotEmpty
import org.gr... | ```kotlin
import org.gradle.gradlebuild.test.integrationtests.IntegrationTest
import org.gradle.gradlebuild.testing.integrationtests.cleanup.WhenNotEmpty
import org.gradle.gradlebuild.unittestandcompile.ModuleType
plugins {
gradlebuild.classycle
}
dependencies {
integTestCompile(library("groovy"))
integTe... | null | null |
Introduce cache clear logic through GoogleDrive webhook endpoint.
Apply this change to `api/drive.py` and return the full updated file.
```python
# -*- encoding:utf8 -*-
import httplib2
from flask import Blueprint, redirect, request, Response, abort
from model.oauth import OAuth
from model.utils import Utils
driv... | ```python
# -*- encoding:utf8 -*-
import httplib2
from flask import Blueprint, redirect, request, Response, abort
from model.cache import Cache
from model.oauth import OAuth
from model.utils import Utils
drive = Blueprint('drive', __name__, url_prefix='/drive')
@drive.route("/auth", methods=['GET'])
def hookauth(... | null | null |
Allow TAs to see assignment summaries page
Apply this change to `app/controllers/summaries_controller.rb` and return the full updated file.
```ruby
class SummariesController < ApplicationController
include SummariesHelper
before_filter :authorize_only_for_admin
def index
@assignment = Assignment.find(par... | ```ruby
class SummariesController < ApplicationController
include SummariesHelper
before_filter :authorize_for_ta_and_admin
def index
@assignment = Assignment.find(params[:assignment_id])
@section_column = ''
if Section.all.size > 0
@section_column = "{
id: 'section',
content:... | null | null |
optimize: Remove conditional compilation on instance
Co-authored-by: bjorn3 <de4e812b534fa9cc35c77a0c909d6ebb8ac118a3@users.noreply.github.com>
Apply this change to `src/optimize/mod.rs` and return the full updated file.
```rust
use crate::prelude::*;
mod code_layout;
mod stack2reg;
pub(crate) fn optimize_function... | ```rust
use crate::prelude::*;
mod code_layout;
mod stack2reg;
pub(crate) fn optimize_function<'tcx>(
tcx: TyCtxt<'tcx>,
instance: Instance<'tcx>,
ctx: &mut Context,
cold_blocks: &EntitySet<Block>,
clif_comments: &mut crate::pretty_clif::CommentWriter,
) {
// The code_layout optimization is ve... | null | null |
Fix for flake8 checks on new test file.
Apply this change to `vispy/app/tests/test_interactive.py` and return the full updated file.
```python
from nose.tools import assert_equal, assert_true, assert_false, assert_raises
from vispy.testing import assert_in, run_tests_if_main
from vispy.app import set_interactive
fro... | ```python
from nose.tools import assert_equal, assert_true, assert_false
from vispy.testing import assert_in, run_tests_if_main
from vispy.app import set_interactive
from vispy.ext.ipy_inputhook import inputhook_manager
# Expect the inputhook_manager to set boolean `_in_event_loop`
# on instances of this class when ... | null | null |
Add support for command line arguments to configuration
Apply this change to `src/KillrVideo.Host/Config/EnvironmentConfigurationSource.cs` and return the full updated file.
```csharp
using System;
using System.Text.RegularExpressions;
namespace KillrVideo.Host.Config
{
/// <summary>
/// Gets configuration ... | ```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace KillrVideo.Host.Config
{
/// <summary>
/// Gets configuration values from command line args and environment variables.
/// </summary>
public class EnvironmentConfigurationSource... | null | null |
Remove a nonsence test function
Apply this change to `src/lib.rs` and return the full updated file.
```rust
//! This crate currently provides pull parser for Binary FBX.
//!
//! FBX data consists of generic node and node properties, and it requires interpretation to use as
//! 3D contents.
//! It is similar to relati... | ```rust
//! This crate currently provides pull parser for Binary FBX.
//!
//! FBX data consists of generic node and node properties, and it requires interpretation to use as
//! 3D contents.
//! It is similar to relation of XML and COLLADA. COLLADA is represented using XML, but XML DOM is
//! difficult to use directly ... | null | null |
Remove invalid module access in webview test
Fix line endings in gradlew.bat
Apply this change to `TachiServer/DesktopUI/src/main/java/xyz/nulldev/ts/dui/DUIView.kt` and return the full updated file.
```kotlin
package xyz.nulldev.ts.dui
import com.github.salomonbrys.kodein.conf.KodeinGlobalAware
import com.github.sa... | ```kotlin
package xyz.nulldev.ts.dui
import com.github.salomonbrys.kodein.conf.KodeinGlobalAware
import com.github.salomonbrys.kodein.instance
import tornadofx.View
import tornadofx.stackpane
import tornadofx.webview
import xyz.nulldev.ts.config.ConfigManager
import xyz.nulldev.ts.config.ServerConfig
class DUIView : ... | null | null |
Fix assignment to nil map
Apply this change to `announcements.go` and return the full updated file.
```go
package main
import (
"github.com/gbl08ma/disturbancesmlx/dataobjects"
"github.com/gbl08ma/disturbancesmlx/scraper"
)
var annStore AnnouncementStore
// AnnouncementStore implements dataobjects.AnnouncementSt... | ```go
package main
import (
"github.com/gbl08ma/disturbancesmlx/dataobjects"
"github.com/gbl08ma/disturbancesmlx/scraper"
)
var annStore AnnouncementStore
// AnnouncementStore implements dataobjects.AnnouncementStore
type AnnouncementStore struct {
scrapers map[string]scraper.AnnouncementScraper
}
// AddScraper ... | null | null |
Include RFC2616 quote on unit test for User-Agent.
Apply this change to `src/test/java/org/chaplib/TestDefaultUserAgentGenerator.java` and return the full updated file.
```java
package org.chaplib;
import static org.junit.Assert.*;
import org.apache.http.HttpRequest;
import org.apache.http.client.methods.HttpGet;
i... | ```java
package org.chaplib;
import static org.junit.Assert.*;
import org.apache.http.HttpRequest;
import org.apache.http.client.methods.HttpGet;
import org.junit.Before;
import org.junit.Test;
public class TestDefaultUserAgentGenerator {
private DefaultUserAgentGenerator impl;
@Before
public void setU... | null | null |
Remove java 8 api call to avoid crash on Android
Apply this change to `kotpref/src/main/kotlin/com/chibatching/kotpref/KotprefPreferences.kt` and return the full updated file.
```kotlin
package com.chibatching.kotpref
import android.annotation.TargetApi
import android.content.SharedPreferences
import android.os.Buil... | ```kotlin
package com.chibatching.kotpref
import android.annotation.TargetApi
import android.content.SharedPreferences
import android.os.Build
import com.chibatching.kotpref.pref.StringSetPref
import java.util.*
internal class KotprefPreferences(val preferences: SharedPreferences) : SharedPreferences by preferences ... | null | null |
Apply Close method for ReadSeeker
Apply this change to `utils/buffer.go` and return the full updated file.
```go
package utils
import (
"bytes"
)
// ClosingBuffer implement Closer interface for Buffer
type ClosingBuffer struct {
*bytes.Buffer
}
// Close implement Closer interface for Buffer
func (ClosingBuffer) ... | ```go
package utils
import "io"
// ClosingReadSeeker implement Closer interface for ReadSeeker
type ClosingReadSeeker struct {
io.ReadSeeker
}
// Close implement Closer interface for Buffer
func (ClosingReadSeeker) Close() error {
return nil
}
``` | null | null |
Update google analytics tracking code
Apply this change to `public/javascripts/ga.js` and return the full updated file.
```javascript
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o... | ```javascript
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/ana... | null | null |
Rename typu - oprava SQL skriptu pro nasazeni typu
Apply this change to `application/schema/type/install.sql` and return the full updated file.
```sql
@&&run_dir_begin
prompt Creating type QUILT_REPORT_PROCESS_TYPE
@@quilt_report_process.tps
prompt Creating type QUILT_REPORT_TYPE
@@quilt_report_type.tps
prompt Cr... | ```sql
@&&run_dir_begin
prompt Creating type QUILT_REPORT_PROCESS_TYPE
@@quilt_report_process_type.tps
prompt Creating type QUILT_REPORT_TYPE
@@quilt_report_type.tps
prompt Creating type body QUILT_REPORT_PROCESS_TYPE
@@quilt_report_process_type.tpb
prompt Creating type QUILT_OBJECT_TYPE
@@quilt_object_type.tps
p... | null | null |
Set default value for terrain_data field
Apply this change to `src/rpg_chipset.cpp` and return the full updated file.
```cpp
/////////////////////////////////////////////////////////////////////////////
// This file is part of EasyRPG.
//
// EasyRPG is free software: you can redistribute it and/or modify
// it under ... | ```cpp
/////////////////////////////////////////////////////////////////////////////
// This file is part of EasyRPG.
//
// EasyRPG is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the Lic... | null | null |
Set return type of onAuthStateChanged function
Apply this change to `app/src/lib/firebase.ts` and return the full updated file.
```typescript
import * as firebase from "firebase";
const projectId = process.env.REACT_APP_FIREBASE_PROJECT_ID;
export function initialize(): void {
firebase.initializeApp({
a... | ```typescript
import * as firebase from "firebase";
const projectId = process.env.REACT_APP_FIREBASE_PROJECT_ID;
export function initialize(): void {
firebase.initializeApp({
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: `${projectId}.firebaseapp.com`,
databaseURL: `https://$... | null | null |
Bring back -h option to ls variants
The -h options in l, ll, and la were lost in 25b1cd6. There's no reason
to remove them.
Apply this change to `lib/directories.zsh` and return the full updated file.
```bash
# Changing/making/removing directory
setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
alias -g ... | ```bash
# Changing/making/removing directory
setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g ......='../../../../..'
alias 1='cd -'
alias 2='cd -2'
alias 3='cd -3'
alias 4='cd -4'
alias 5='cd -5'
alias 6='cd -6'
alias 7='... | null | null |
Add subcommands help to 'area' command
Apply this change to `Sources/Smud/Commands/EditorCommands.swift` and return the full updated file.
```swift
//
// EditorCommands.swift
//
// This source file is part of the SMUD open source project
//
// Copyright (c) 2016 SMUD project authors
// Licensed under Apache License v... | ```swift
//
// EditorCommands.swift
//
// This source file is part of the SMUD open source project
//
// Copyright (c) 2016 SMUD project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SMUD project authors... | null | null |
Fix SQL syntax in the examples
Apply this change to `examples/helloworld/helloworld.sql` and return the full updated file.
```sql
CREATE TABLE HELLOWORLD (
HELLO VARCHAR(15),
WORLD VARCHAR(15),
DIALECT VARCHAR(15) NOT NULL,
PRIMARY KEY (DIALECT)
);
PARTITION TABLE HELLOWORLD ON COLUMN DIALECT;
CREATE PRO... | ```sql
CREATE TABLE helloworld (
hello VARCHAR(15),
world VARCHAR(15),
dialect VARCHAR(15) NOT NULL,
PRIMARY KEY (DIALECT)
);
PARTITION TABLE HELLOWORLD ON COLUMN DIALECT;
CREATE PROCEDURE INSERT PARTITION ON TABLE helloworld COLUMN dialect
AS INSERT INTO helloworld (dialect, hello, world) VALUES (?, ?,... | null | null |
Extend the tests for -Wmissing-variable-declarations.
We shouldn't throw a warning when the static keyword is not present in
an anonymous namespace, just like we do for -Wmissing-prototypes.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@290443 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `test/S... | ```cpp
// RUN: %clang -Wmissing-variable-declarations -fsyntax-only -Xclang -verify %s
// Variable declarations that should trigger a warning.
int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}}
int vbad2 = 10; // expected-warning{{no previous extern declaration for non-sta... | null | null |
Disable throttle in debug mode
Apply this change to `Source/NetworkActivityIndicator.swift` and return the full updated file.
```swift
#if os(iOS)
import UIKit
#endif
public class NetworkActivityIndicator {
/**
The shared instance.
*/
public static let sharedIndicator = NetworkActivityIndicato... | ```swift
#if os(iOS)
import UIKit
#endif
public class NetworkActivityIndicator {
/**
The shared instance.
*/
public static let sharedIndicator = NetworkActivityIndicator()
/**
The number of activities in progress.
*/
internal var activitiesCount = 0
/**
A Boolean val... | null | null |
Exit typescript with error code 1 if fails
Apply this change to `lib/tasks/Typescript.ts` and return the full updated file.
```typescript
import {buildHelper as helper} from "../Container";
const gulp = require("gulp");
const ts = require("gulp-typescript");
export default function Typescript() {
let settings = ... | ```typescript
import {buildHelper as helper} from "../Container";
const gulp = require("gulp");
const ts = require("gulp-typescript");
export default function Typescript() {
let settings = helper.getSettings(),
tsProject = ts.createProject("tsconfig.json");
return gulp.src(settings.scripts)
.p... | null | null |
Remove the accessors, use public properties instead
Apply this change to `src/Engines/WebGPU/webgpuHardwareTexture.ts` and return the full updated file.
```typescript
import { HardwareTextureWrapper } from '../../Materials/Textures/hardwareTextureWrapper';
import { Nullable } from '../../types';
import * as WebGPUC... | ```typescript
import { HardwareTextureWrapper } from '../../Materials/Textures/hardwareTextureWrapper';
import { Nullable } from '../../types';
import * as WebGPUConstants from './webgpuConstants';
/** @hidden */
export class WebGPUHardwareTexture implements HardwareTextureWrapper {
private _webgpuTexture:... | null | null |
Remove the "doma.entity.field.prefix" option because the prefix is none by default.
Apply this change to `test-doma-criteria/build.gradle.kts` and return the full updated file.
```kotlin
plugins {
kotlin("jvm") apply true
kotlin("kapt") apply true
}
kapt {
arguments {
arg("doma.entity.field.prefi... | ```kotlin
plugins {
kotlin("jvm") apply true
kotlin("kapt") apply true
}
dependencies {
kapt(project(":doma-processor"))
implementation(project(":doma-core"))
implementation(project(":doma-criteria"))
implementation(kotlin("stdlib-jdk8"))
testRuntimeOnly("com.h2database:h2:1.4.199")
}
task... | null | null |
Update MetaLogEntry.swift making it internal explicitly
Apply this change to `Pod/Cache/Internal/Meta/MetaLogEntry+CoreDataProperties.swift` and return the full updated file.
```swift
/**
* MetaLogEntry+CoreDataProperties.swift
*
* Copyright 2015 Tony Stone
*
* Licensed under the Apache License, Version 2.... | ```swift
/**
* MetaLogEntry+CoreDataProperties.swift
*
* Copyright 2015 Tony Stone
*
* 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/LICE... | null | null |
[ARM] Fix buggy __phys_to_pfn / __pfn_to_phys
Macro arguments should _always_ be surrounded by parentheses
when used to prevent unexpected problems with operator precedence.
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>
Apply this change to `include/asm-arm/mach/map.h` and r... | ```c
/*
* linux/include/asm-arm/map.h
*
* Copyright (C) 1999-2000 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Page table mapping constructs and funct... | null | null |
Update bug reference link in ExtensionApiTest.Toolstrip
TBR=erikkay
TEST=no code change
BUG=30151, 35034
Review URL: http://codereview.chromium.org/580015
git-svn-id: http://src.chromium.org/svn/trunk/src@38394 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: 60021e16292fb6851b314ce10c2f0b2eca6981d3
Apply th... | ```cpp
// Copyright (c) 2009 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/extensions/extension_apitest.h"
// Disabled, http://crbug.com/30151 (Linux and ChromeOS),
// http://crbug.com/35034 (... | null | null |
Modify solution to preserve letters
Apply this change to `go/isogram/isogram.go` and return the full updated file.
```go
package isogram
import "strings"
// IsIsogram returns whether the provided string is an isogram.
// In other words, whether the string does not contain any duplicate characters.
func IsIsogram(s ... | ```go
package isogram
import (
"strings"
"unicode"
)
// IsIsogram returns whether the provided string is an isogram.
// In other words, whether the string does not contain any duplicate characters.
func IsIsogram(s string) bool {
parsed := strings.ToLower(preserveOnlyLetters(s))
seen := make(map[rune]bool)
for _... | null | null |
Add queries for patents min max years
Apply this change to `api/queries/minMaxYearsPatents.sql` and return the full updated file.
```sql
SELECT
v.research_entity as research_entity,
rit.type as item_type,
rit.key as item_key,
MIN(p.filing_year) AS min,
MAX(p.filing_year) AS max
FROM... | ```sql
SELECT
v.research_entity as research_entity,
rit.type as item_type,
'prosecutions' as item_key,
CAST(MIN(p.filing_year) AS text) AS min,
CAST(MAX(p.filing_year) AS text) AS max
FROM verify v
JOIN patent p on v.research_item = p.id
JOIN research_item_type rit ON p.... | null | null |
en-2015-10-03: Replace non-ASCII quotes from GCC with ASCII quotes.
Apply this change to `en-2015-10-03-structures-and-member-initializers-in-cpp/cpp11.cpp` and return the full updated file.
```cpp
// C++11 code with initializers.
//
// g++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp
// clang++ -std=c++11 -pedan... | ```cpp
// C++11 code with initializers.
//
// g++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp
// clang++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp
struct A {
int i = 0;
double j = 0.0;
};
int main() {
A a; // OK, a.i is 0 and a.j is 0.0
A b = {}; // OK, b.i is 0 and b.j is 0.0... | null | null |
Add stack trace to exceptions in detailed mode
Apply this change to `src/ObjectService/Formats/Json/Serializers/DefaultExceptionSerializer.php` and return the full updated file.
```php
<?php
namespace Light\ObjectService\Formats\Json\Serializers;
use Light\ObjectService\Service\Protocol\ExceptionSerializer;
class D... | ```php
<?php
namespace Light\ObjectService\Formats\Json\Serializers;
use Light\ObjectService\Service\Protocol\ExceptionSerializer;
class DefaultExceptionSerializer extends BaseSerializer implements ExceptionSerializer
{
/** @var bool */
protected $detailed;
public function __construct($detailed = false, $contentT... | null | null |
Remove unused includes from the C++11 solution for Nov. 2013 Bronze Problem 1
Apply this change to `2013-nov-bronze/1-combo/cpp11/main.cpp` and return the full updated file.
```cpp
#include <istream>
#include <fstream>
#include <set>
#include <vector>
#include <array>
#include <algorithm>
#include <iterator>
using n... | ```cpp
#include <fstream>
#include <set>
using namespace std;
int main() {
ifstream cin("combo.in");
ofstream cout("combo.out");
int size;
cin >> size;
set<int> options;
for (int i = 0; i < 2; i++) {
int a, b, c;
cin >> a >> b >> c;
// creates permutations of allowable combinations and turns them into
... | null | null |
Add simple parcelable implementation for reference
Apply this change to `smuggler-sample/src/main/java/io/mironov/smuggler/sample/SampleActivity.kt` and return the full updated file.
```kotlin
package io.mironov.smuggler.sample
import android.app.Activity
import android.os.Bundle
import io.mironov.smuggler.AutoParce... | ```kotlin
package io.mironov.smuggler.sample
import android.app.Activity
import android.os.Bundle
import android.os.Parcel
import android.os.Parcelable
import io.mironov.smuggler.AutoParcelable
class SampleActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceS... | null | null |
Remove unneccessary 'extern crate' declaration.
Apply this change to `src/rust/qork/src/execution_timer.rs` and return the full updated file.
```rust
extern crate slog;
use std::time::Instant;
use slog::Logger;
// When this struct is dropped, it logs a message stating its name and how long, in seconds,
// execution... | ```rust
use std::time::Instant;
use slog::Logger;
// When this struct is dropped, it logs a message stating its name and how long, in seconds,
// execution time was. Can be used to time functions or other critical areas.
pub struct ExecutionTimer<'a> {
start_time: Instant,
name: &'a str,
logger: &'a Logger
}
impl<... | null | null |
Fix mock of request for block rendering
Apply this change to `tests/unit/blocks/test_two_column_layout_block.py` and return the full updated file.
```python
import mock
from django.test import TestCase
from django.template import RequestContext
from fancypages.models import Container
from fancypages.models.blocks i... | ```python
import mock
from django.test import TestCase
from django.template import RequestContext
from fancypages.models import Container
from fancypages.models.blocks import TwoColumnLayoutBlock
from fancypages.test import factories
class TestTwoColumnLayoutBlock(TestCase):
def setUp(self):
super(Tes... | null | null |
Add a potential buffer overrun test.
Apply this change to `test/22-backreferences.cc` and return the full updated file.
```cpp
FIXED_TEST("(cat|dog|)\\1", ANCHOR_START, "catcat", true, "catcat", "cat");
FIXED_TEST("(cat|dog|)\\1", ANCHOR_START, "dogdog", true, "dogdog", "dog");
FIXED_TEST("(cat|dog|)\\1", ANCHOR_STAR... | ```cpp
FIXED_TEST("(cat|dog|)\\1", ANCHOR_START, "catcat", true, "catcat", "cat");
FIXED_TEST("(cat|dog|)\\1", ANCHOR_START, "dogdog", true, "dogdog", "dog");
FIXED_TEST("(cat|dog|)\\1", ANCHOR_START, "snek", true, "", "");
FIXED_TEST("(cat|dog|)\\1", ANCHOR_START, "catdog", false);
FIXED_TEST("(cat|dog|)\\1", ... | null | null |
Add echos to cpp benchmark for more context
Apply this change to `bench-cpp.sh` and return the full updated file.
```bash
#!/bin/bash -e
# This script must be invoked as a sudoer
THE_USER=${SUDO_USER:=$USER}
cd "$(dirname "$0")"
cd Farmhash.Benchmarks
sudo -u $THE_USER make all
nice -n -20 ./benchmark-farmhash
nic... | ```bash
#!/bin/bash -e
# This script must be invoked as a sudoer
THE_USER=${SUDO_USER:=$USER}
cd "$(dirname "$0")"
cd Farmhash.Benchmarks
sudo -u $THE_USER make all
echo ""
echo "Executing hardware accelerated farmhash"
nice -n -20 ./benchmark-farmhash
echo ""
echo "Executing non-hardware accelerated farmhash"
nice... | null | null |
Use an array to label all commands and add `ptr_write` command
Apply this change to `filesystem/apps/test/test.rs` and return the full updated file.
```rust
use std::{io, fs};
macro_rules! readln {
() => {
{
let mut line = String::new();
match io::stdin().read_line(&mut line) {
... | ```rust
#![feature(alloc)]
#![feature(core)]
extern crate alloc;
extern crate core;
use alloc::boxed::Box;
use std::{io, fs, rand};
use core::ptr;
macro_rules! readln {
() => {
{
let mut line = String::new();
match io::stdin().read_line(&mut line) {
Ok(n) => Some(l... | null | null |
Set isolation level to 'Repeatable Read'. Seems to prevent index errors (WrongExpectedVersion) that default isolation level can generate. Doesn't result in deadlocks that 'Serializable' raises.
Apply this change to `src/Cedar.EventStore.MsSql2008/SqlScripts/AppendStreamExpectedVersionAny.sql` and return the full updat... | ```sql
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN TRANSACTION AppendStream;
DECLARE @streamIdInternal AS INT;
DECLARE @latestStreamVersion AS INT;
SELECT @streamIdInternal = dbo.Streams.IdInternal
FROM dbo.Streams
WHERE dbo.Streams.Id = @streamId;
IF @streamIdInternal IS... | null | null |
Update for new closure syntax
Apply this change to `main.rs` and return the full updated file.
```rust
#[allow(ctypes)];
#[no_std];
#[no_core];
mod zero;
enum Color {
Black = 0,
Blue = 1,
Green = 2,
Cyan = 3,
Red = 4,
Pink = 5,
Brown = 6,
... | ```rust
#[allow(ctypes)];
#[no_std];
#[no_core];
mod zero;
enum Color {
Black = 0,
Blue = 1,
Green = 2,
Cyan = 3,
Red = 4,
Pink = 5,
Brown = 6,
LightGray = 7,
DarkGray = 8,
LightBlue = 9,
LightGreen = 10,
LightCyan ... | null | null |
Put min/max constraints on sidecar.port
Apply this change to `spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarProperties.java` and return the full updated file.
```java
/*
* Copyright 2013-2015 the original author or authors.
*
* Licensed under the Apache License, Versio... | ```java
/*
* Copyright 2013-2015 the original author or authors.
*
* 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 requir... | null | null |
Trim down the crate attribute listings
Apply this change to `src/lib.rs` and return the full updated file.
```rust
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache Lic... | ```rust
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LI... | null | null |
Fix compass dependencies when more gems are installed
Apply this change to `common_config.rb` and return the full updated file.
```ruby
require 'bootstrap-sass'
require 'font-awesome-sass'
fonts_dir = "viaduct/static/font"
http_fonts_path = "/static/font"
http_fonts_dir = "/static/font"
environment = :development
cs... | ```ruby
gem 'bootstrap-sass', '=3.2.0.2'
gem 'font-awesome-sass', '=4.2.0'
require 'bootstrap-sass'
require 'font-awesome-sass'
fonts_dir = "viaduct/static/font"
http_fonts_path = "/static/font"
http_fonts_dir = "/static/font"
environment = :development
css_dir = "viaduct/static/css"
http_css_path = "/static/css"
imag... | null | null |
Update J2K test to always use linefeeds
Apply this change to `server/src/test/kotlin/org/javacs/kt/JavaToKotlinTest.kt` and return the full updated file.
```kotlin
package org.javacs.kt
import org.javacs.kt.j2k.convertJavaToKotlin
import org.junit.Test
import org.junit.Assert.assertThat
import org.hamcrest.Matchers.... | ```kotlin
package org.javacs.kt
import org.javacs.kt.j2k.convertJavaToKotlin
import org.junit.Test
import org.junit.Assert.assertThat
import org.hamcrest.Matchers.equalTo
import java.nio.file.Paths
class JavaToKotlinTest : LanguageServerTestFixture("j2k") {
@Test fun `test j2k conversion`() {
val javaCode... | null | null |
Include sub-folders when watching for changes
Apply this change to `gulpfile.js` and return the full updated file.
```javascript
var name = require('./package.json').moduleName,
fs = require('fs'),
gulp = require('gulp'),
plugins = require('gulp-load-plugins')()
var head = fs.readFileSync('./n... | ```javascript
var name = require('./package.json').moduleName,
fs = require('fs'),
gulp = require('gulp'),
plugins = require('gulp-load-plugins')()
var head = fs.readFileSync('./node_modules/@electerious/modulizer/head.js', { encoding: 'utf8' }),
foot = fs.readFileSync('./node_modules/@elect... | null | null |
Rename Pair to pair, since it’s the constructor, not the type.
Apply this change to `Manifold/Module+ChurchPair.swift` and return the full updated file.
```swift
// Copyright © 2015 Rob Rix. All rights reserved.
extension Module {
public static var churchPair: Module {
let Pair = Declaration("Pair",
type: Rec... | ```swift
// Copyright © 2015 Rob Rix. All rights reserved.
extension Module {
public static var churchPair: Module {
let pair = Declaration("pair",
type: Recur.lambda(.Type, .Type, .Type) { A, B, Result in Recur.lambda(A, B, Recur.FunctionType(A, B, Result), const(Result)) },
value: Recur.lambda(.Type, .Type... | null | null |
Refactor tests to improve readability
Apply this change to `BothamNetworkingTests/BothamAPIClientTests.swift` and return the full updated file.
```swift
//
// BothamAPIClientTests.swift
// BothamNetworking
//
// Created by Pedro Vicente Gomez on 23/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
... | ```swift
//
// BothamAPIClientTests.swift
// BothamNetworking
//
// Created by Pedro Vicente Gomez on 23/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import Foundation
import Nimble
import BrightFutures
import Nocilla
@testable import BothamNetworking
class BothamAPIClientTests: NocillaTestCas... | null | null |
[network] Add documentation for Direct Send Message
Apply this change to `network/src/protocols/direct_send/mod.rs` and return the full updated file.
```rust
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{protocols::network::SerializedRequest, ProtocolId};
use bytes::B... | ```rust
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{protocols::network::SerializedRequest, ProtocolId};
use bytes::Bytes;
use serde::Serialize;
use std::fmt::Debug;
#[derive(Clone, Eq, PartialEq, Serialize)]
pub struct Message {
/// The [`ProtocolId`] for which o... | null | null |
Add flag to stage API change
Test: make
Bug: 178700363
Change-Id: I15d678d3896efb896d1b87f11f32df7787a53577
Apply this change to `include/config/SkUserConfigManual.h` and return the full updated file.
```c
/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
... | ```c
/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_L... | null | null |
Remove start when running tests
Apply this change to `src/main.rs` and return the full updated file.
```rust
#![no_std]
#![no_main]
use daedalos::println;
#[no_mangle]
pub extern "C" fn _start() -> ! {
println!("Hello, world!");
loop {}
}
#[cfg(not(test))]
use core::panic::PanicInfo;
#[cfg(not(test))]
#[pa... | ```rust
#![no_std]
#![no_main]
#[cfg(not(test))]
use daedalos::println;
#[cfg(not(test))]
#[no_mangle]
pub extern "C" fn _start() -> ! {
println!("Hello, world!");
loop {}
}
#[cfg(not(test))]
use core::panic::PanicInfo;
#[cfg(not(test))]
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
println!("{}", i... | null | null |
Adjust coherence test to reflect that only the orphan rule prevents you from adding *generalizing* impls
Apply this change to `src/test/compile-fail/coherence-cross-crate-conflict.rs` and return the full updated file.
```rust
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level di... | ```rust
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE... | null | null |
Rename SocialNetworkAdapter and make it private
Apply this change to `app/src/main/kotlin/com/gdgnantes/devfest/android/http/JsonConverters.kt` and return the full updated file.
```kotlin
package com.gdgnantes.devfest.android.http
import com.gdgnantes.devfest.android.model.SocialNetwork
import com.google.gson.FieldN... | ```kotlin
package com.gdgnantes.devfest.android.http
import com.gdgnantes.devfest.android.model.SocialNetwork
import com.google.gson.FieldNamingPolicy
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.TypeAdapter
import com.google.gson.stream.JsonReader
import com.google.gson.stream... | null | null |
Test that nested functions produce a partial patch.
Apply this change to `TesseractCoreTests/TypeDifferentialTests.swift` and return the full updated file.
```swift
// Copyright (c) 2015 Rob Rix. All rights reserved.
final class TypeDifferentialTests: XCTestCase {
// MARK: Diffing
func testTheDiffOfATypeWithItse... | ```swift
// Copyright (c) 2015 Rob Rix. All rights reserved.
final class TypeDifferentialTests: XCTestCase {
// MARK: Diffing
func testTheDiffOfATypeWithItselfIsEmpty() {
assert(TypeDifferentiator.differentiate(before: .Bool, after: .Bool), ==, TypeDifferential.Empty)
}
func testTheDiffOfAConstructorWithADiff... | null | null |
Define STATUS_MOVED constant ahead of its implementation
Summary: I landed some patches out of order and we haven't landed the one which actually implements this yet. Define the constant for now.
Test Plan: Deleted a page in Phriction without issue.
Reviewers: AnhNhan
Reviewed By: AnhNhan
CC: aran
Differential Re... | ```php
<?php
/**
* @group phriction
*/
final class PhrictionDocumentStatus extends PhrictionConstants {
const STATUS_EXISTS = 0;
const STATUS_DELETED = 1;
const STATUS_MOVED = 2;
const STATUS_STUB = 3;
public static function getConduitConstant($const) {
static $map = array(
se... | null | null |
Use a more generic application name.
Apply this change to `newrelic/helpers.go` and return the full updated file.
```go
package newrelic
import "github.com/newrelic/go-agent"
// NullNewRelic returns a disabled New Relic appliaction.
func NullNewRelic() newrelic.Application {
config := newrelic.NewConfig("smsproces... | ```go
package newrelic
import "github.com/newrelic/go-agent"
// NullNewRelic returns a disabled New Relic appliaction.
func NullNewRelic() newrelic.Application {
config := newrelic.NewConfig("application", "")
config.Enabled = false
app, _ := newrelic.NewApplication(config)
return app
}
``` | null | null |
Use insiders build for test suite
Apply this change to `test/runTest.ts` and return the full updated file.
```typescript
import * as path from "path";
import { runTests } from "vscode-test";
async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `... | ```typescript
import {resolve} from "path";
import { downloadAndUnzipVSCode, runTests } from "vscode-test";
async function main() {
try {
const extensionDevelopmentPath = resolve(__dirname, "..", "..");
const extensionTestsPath = resolve(__dirname, "index");
const vscodeExecutablePath = ... | null | null |
Save and load dark mode preference to local storage
Apply this change to `src/app/theme.service.ts` and return the full updated file.
```typescript
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class ThemeService {
priv... | ```typescript
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class ThemeService {
private darkMode = new BehaviorSubject(false);
constructor() {
const setting = localStorage.getItem('darkMode');
if (setting === ... | null | null |
Fix calls to missing files
Apply this change to `zshrc/mac.zsh` and return the full updated file.
```bash
# JAVA_HOME
export JAVA_HOME=$(/usr/libexec/java_home)
# mac specific aliases
alias o='open'
alias mou='open -a Mou'
alias subl='Open -a "Sublime Text 2"'
alias br='Open -a "Brackets"'
alias v='qlmanage 2>/dev/... | ```bash
# JAVA_HOME
export JAVA_HOME=$(/usr/libexec/java_home)
# mac specific aliases
alias o='open'
alias mou='open -a Mou'
alias subl='Open -a "Sublime Text 2"'
alias br='Open -a "Brackets"'
alias v='qlmanage 2>/dev/null -p'
alias rstudio='open -a "Rstudio"'
alias javarepl='java -jar /usr/local/lib/javarepl.jar'
al... | null | null |
REFACTOR: Split controller fetcher into its own function
Apply this change to `ngXenophilous.js` and return the full updated file.
```javascript
/**
* Run a given function within a controller scope
* This has the effect that Angular is aware of variable changes within scope
* @param string controller The name of the ... | ```javascript
/**
* Run a given function within a controller scope
* This has the effect that Angular is aware of variable changes within scope
* @param string controller The name of the controller to run the function within
* @param function cb The function to execute
*/
function ngApply(controller, cb) {
var scope =... | null | null |
Move service call in OnInit
Apply this change to `src/app/partner/coach/view/coach-view.component.ts` and return the full updated file.
```typescript
import { Component } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { Coach } from '../../../models/index';
import { C... | ```typescript
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { Coach } from '../../../models/index';
import { CoachService } from '../../../_services/index';
@Component({
selector: 'coach-view',
templateUrl: 'coach-view.component.html'
... | null | null |
Add a user for each role
Fix #87
Apply this change to `database/seeds/UsersTableSeeder.php` and return the full updated file.
```php
<?php
use App\Models\User;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
class UsersTableSeeder extends Seeder
{
public function run(): void
{
/*... | ```php
<?php
use App\Models\Club;
use App\Models\Competition;
use App\Models\Division;
use App\Models\Season;
use App\Models\Team;
use App\Models\User;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
class UsersTableSeeder extends Seeder
{
public function run(): void
{
/** @var User... | null | null |
Add onTitleMouseEnter and onTitleMouseLeave to public interface
Apply this change to `components/menu/SubMenu.tsx` and return the full updated file.
```typescript
import * as React from 'react';
import * as PropTypes from 'prop-types';
import { SubMenu as RcSubMenu } from 'rc-menu';
import classNames from 'classnames... | ```typescript
import * as React from 'react';
import * as PropTypes from 'prop-types';
import { SubMenu as RcSubMenu } from 'rc-menu';
import classNames from 'classnames';
interface TitleEventEntity {
key: string;
domEvent: Event;
}
export interface SubMenuProps {
rootPrefixCls?: string;
className?: string;
... | null | null |
Add constants - max events
Apply this change to `src/selector.h` and return the full updated file.
```c
#pragma once
#include <atomic>
#include "util.h"
namespace happyntrain {
template <typename SelectorImpt>
class Selector : NoCopy {
SelectorImpt _selector;
int64_t _id;
public:
template <typename... Var... | ```c
#pragma once
#include <atomic>
#include "util.h"
namespace happyntrain {
const int kMaxSelectEvents = 2000;
template <typename SelectorImpt>
class Selector : NoCopy {
SelectorImpt _selector;
int64_t _id;
public:
template <typename... Vars>
Selector(Vars&&... args) : _id(GetNewId()), _selector(args..... | null | null |
Fix zero-length field error when building docs in Python 2.6
Apply this change to `docs/conf.py` and return the full updated file.
```python
import os
import taxii_services
project = u'django-taxii-services'
copyright = u'2014, The MITRE Corporation'
version = taxii_services.__version__
release = version
extension... | ```python
import os
import taxii_services
project = u'django-taxii-services'
copyright = u'2014, The MITRE Corporation'
version = taxii_services.__version__
release = version
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
rst_p... | null | null |
Allow for passing arguments to pygmentize
Apply this change to `plugins/available/less-pretty-cat.plugin.bash` and return the full updated file.
```bash
cite about-plugin
about-plugin 'pygmentize instead of cat to terminal if poss... | ```bash
cite about-plugin
about-plugin 'pygmentize instead of cat to terminal if possible'
if [ -z $(which pygmentize) ]
then
echo "Pygments is required to use this plugin"
echo "Ins... | null | null |
Make sure notification is shown at most once
Apply this change to `src/main/kotlin/org/rust/toml/Util.kt` and return the full updated file.
```kotlin
/*
* Use of this source code is governed by the MIT license that can be
* found in the LICENSE file.
*/
package org.rust.toml
import com.intellij.notification.Noti... | ```kotlin
/*
* Use of this source code is governed by the MIT license that can be
* found in the LICENSE file.
*/
package org.rust.toml
import com.intellij.notification.NotificationType
import org.rust.ide.notifications.showBalloonWithoutProject
import org.toml.lang.psi.*
import kotlin.reflect.KProperty
fun toml... | null | null |
Add default RESOLUTION and STATUS in BugFactory.
* Fixes failing tests.
Apply this change to `remo/remozilla/tests/__init__.py` and return the full updated file.
```python
import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from... | ```python
import datetime
from django.utils.timezone import utc
import factory
from factory import fuzzy
from remo.profiles.tests import UserFactory
from remo.remozilla.models import Bug
from remo.remozilla.tasks import COMPONENTS
CHANGE_DT = datetime.datetime(2012, 1, 1, tzinfo=utc)
CREATION_DT = datetime.datetime... | null | null |
Add running indicies script to upgrade
Apply this change to `server/sql/upgrade-sqlite3.sql` and return the full updated file.
```sql
-- upgrade the previous schema to the current schema
-- 1.4.3 -> 1.5.0 in this version
--
-- Copyright 2013,2014 Google Inc. All Rights Reserved.
--
-- Licensed under the Apache Licens... | ```sql
-- upgrade the previous schema to the current schema
-- 1.4.3 -> 1.5.0 in this version
--
-- Copyright 2013,2014 Google Inc. All Rights Reserved.
--
-- 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 t... | null | null |
Update user model interface name
Apply this change to `Module.php` and return the full updated file.
```php
<?php
namespace ZfcUserDoctrineORM;
use Zend\Module\Manager,
Zend\Module\Consumer\AutoloaderProvider,
ZfcUserDoctrineORM\Event\ResolveTargetEntityListener,
ZfcUser\Module as ZfcUser,
Doctrine\... | ```php
<?php
namespace ZfcUserDoctrineORM;
use Zend\Module\Manager,
Zend\Module\Consumer\AutoloaderProvider,
ZfcUserDoctrineORM\Event\ResolveTargetEntityListener,
ZfcUser\Module as ZfcUser,
Doctrine\ORM\Events,
Zend\EventManager\StaticEventManager;
class Module implements AutoloaderProvider
{
... | null | null |
Add more tests around the proposal model behaviour
Apply this change to `testing/models/test_proposal.py` and return the full updated file.
```python
import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models... | ```python
import pytest
try:
from unittest import mock
except ImportError:
import mock
from k2catalogue import models
@pytest.fixture
def proposal():
return models.Proposal(proposal_id='abc', pi='pi', title='title',
pdf_url='pdf_url')
def test_proposal_printing(proposal):
... | null | null |
Allow sorting navigation items in the root site
Apply this change to `app/graphql/mutations/sort_cms_navigation_items.rb` and return the full updated file.
```ruby
class Mutations::SortCmsNavigationItems < Mutations::BaseMutation
argument :sort_items, [Mutations::UpdateCmsNavigationItem.input_type], required: true,... | ```ruby
class Mutations::SortCmsNavigationItems < Mutations::BaseMutation
argument :sort_items, [Mutations::UpdateCmsNavigationItem.input_type], required: true, camelize: false
authorize_arbitrary_cms_model :cms_navigation_items, :update
def resolve(**args)
args[:sort_items].each do |sort_item|
cms_na... | null | null |
Revert "A test of the assumption that perhaps it was wrong to eliminate the default value in resolving the conflicting sql"
This reverts commit 4324b47021c7f8109e7ac647445353a943aa4f8f.
Apply this change to `GridFrontend/schema.sql` and return the full updated file.
```sql
CREATE TABLE IF NOT EXISTS `sgf_sessions` (... | ```sql
CREATE TABLE IF NOT EXISTS `sgf_sessions` (
`session_id` varchar(40) collate utf8_bin NOT NULL default '0',
`ip_address` varchar(16) collate utf8_bin NOT NULL default '0',
`user_agent` varchar(150) collate utf8_bin NOT NULL,
`last_activity` int(10) unsigned NOT NULL default '0',
`user_data` text collat... | null | null |
Add a comment to CreateUserInfo
Apply this change to `user_create.go` and return the full updated file.
```go
package zoom // Use this file for /user endpoints
// CreateUserPath - v2 path for creating a user
const CreateUserPath = "/users"
type CreateUserInfo struct {
Email string `json:"email"`
Type U... | ```go
package zoom // Use this file for /user endpoints
// CreateUserPath - v2 path for creating a user
const CreateUserPath = "/users"
// CreateUserInfo are details about a user to create
type CreateUserInfo struct {
Email string `json:"email"`
Type UserType `json:"type"`
FirstName string `json:"firs... | null | null |
Refactor artifact view to provide event pointer created by the artifact after applying a change
Apply this change to `cqrs/artifact_view.h` and return the full updated file.
```c
#pragma once
#include "cqrs/artifact.h"
namespace cddd {
namespace cqrs {
template<class> class basic_artifact_view;
template<class Do... | ```c
#pragma once
#include "cqrs/artifact.h"
namespace cddd {
namespace cqrs {
template<class> class basic_artifact_view;
template<class DomainEventDispatcher, class DomainEventContainer>
class basic_artifact_view<basic_artifact<DomainEventDispatcher, DomainEventContainer>> {
public:
using id_type = typename ba... | null | null |
Set dynamic realm object as param in migration
Apply this change to `migration/src/main/java/br/com/bloder/migration/Migration.kt` and return the full updated file.
```kotlin
package br.com.bloder.migration
import br.com.bloder.migration.internal.InternalMigration
/**
* Class to abstract realm migration
*/
class ... | ```kotlin
package br.com.bloder.migration
import br.com.bloder.migration.internal.InternalMigration
import io.realm.DynamicRealm
/**
* Class to abstract realm migration
*/
open class Migration : InternalMigration {
/**
* Represents what will change in a migration version
*/
override fun up(realm:... | null | null |
Allow override of configure function
Apply this change to `src/main/java/io/github/malteseduck/springframework/data/marklogic/core/query/QueryCriteria.kt` and return the full updated file.
```kotlin
package io.github.malteseduck.springframework.data.marklogic.core.query
import com.fasterxml.jackson.databind.JsonNode... | ```kotlin
package io.github.malteseduck.springframework.data.marklogic.core.query
import com.fasterxml.jackson.databind.JsonNode
import io.github.malteseduck.springframework.data.marklogic.repository.query.CombinedQueryDefinition
abstract class QueryCriteria<T> {
// Allow support of passing a query string
var... | null | null |
Split line to fix tidy
Apply this change to `src/test/ui/coherence/impl-foreign[foreign]-for-foreign.rs` and return the full updated file.
```rust
#![feature(re_rebalance_coherence)]
// compile-flags:--crate-name=test
// aux-build:coherence_lib.rs
extern crate coherence_lib as lib;
use lib::*;
use std::rc::Rc;
str... | ```rust
#![feature(re_rebalance_coherence)]
// compile-flags:--crate-name=test
// aux-build:coherence_lib.rs
extern crate coherence_lib as lib;
use lib::*;
use std::rc::Rc;
struct Local;
impl Remote1<u32> for f64 {
//~^ ERROR only traits defined in the current crate
// | can be implemented for arbitrary typ... | null | null |
Remove default value for createSleepPromise options
Apply this change to `lib/index.js` and return the full updated file.
```javascript
// Store a reference to the global setTimeout,
// in case it gets replaced (e.g. sinon.useFakeTimers())
const cachedSetTimeout = setTimeout;
function createSleepPromise(timeout, { u... | ```javascript
// Store a reference to the global setTimeout,
// in case it gets replaced (e.g. sinon.useFakeTimers())
const cachedSetTimeout = setTimeout;
function createSleepPromise(timeout, { useCachedSetTimeout }) {
const timeoutFunction = useCachedSetTimeout ? cachedSetTimeout : setTimeout;
return new Pro... | null | null |
Remove public in interface methods
Apply this change to `aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/metrics/MetricsMessage.java` and return the full updated file.
```java
/**
* JBoss, Home of Professional Open Source
* Copyright Red Hat, Inc., and individual contributors.
*
* Licen... | ```java
/**
* JBoss, Home of Professional Open Source
* Copyright Red Hat, Inc., and individual contributors.
*
* 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.or... | null | null |
Add missing import to umbrella header
Apply this change to `objc/PromiseKit.h` and return the full updated file.
```c
#import "PromiseKit/Promise.h"
#ifdef PMK_CORELOCATION
#import "PromiseKit+CoreLocation.h"
#endif
#ifdef PMK_FOUNDATION
#import "PromiseKit+Foundation.h"
#endif
#ifdef PMK_UIKIT
#import "PromiseKit+UI... | ```c
#import "PromiseKit/Promise.h"
#ifdef PMK_CORELOCATION
#import "PromiseKit+CoreLocation.h"
#endif
#ifdef PMK_FOUNDATION
#import "PromiseKit+Foundation.h"
#endif
#ifdef PMK_UIKIT
#import "PromiseKit+UIKit.h"
#endif
#ifdef PMK_MAPKIT
#import "PromiseKit+MapKit.h"
#endif
#ifdef PMK_SOCIAL
#import "PromiseKit+Social.h... | null | null |
Remove spare usage of EXTENDED_GLOB
Apply this change to `modules_minimal/20_parser.zsh` and return the full updated file.
```bash
# ============
# Auto handler
# ============
function _accept-line() {
emulate -LR zsh
setopt extended_glob prompt_subst transient_rprompt
if [[ ! -n $BUFFER ]]; then
zle clea... | ```bash
# ============
# Auto handler
# ============
function _accept-line() {
emulate -LR zsh
setopt prompt_subst transient_rprompt
if [[ ! -n $BUFFER ]]; then
zle clear-screen
zle-line-init
return 0
fi
# expand all aliases on return
if [[ $#RBUFFER == 0 ]]; then
expandAlias no_space
f... | null | null |
Fix small bug in conda-install script
Apply this change to `install_conda.sh` and return the full updated file.
```bash
#!/usr/bin/env bash
## INSTALL CONDA
# Set up where we're going to stick it
# Somewhere to stick local packages
export LOCAL="${HOME}/.local"
export CONDA_URL="https://repo.continuum.io/miniconda/M... | ```bash
#!/usr/bin/env bash
## INSTALL CONDA
# Set up where we're going to stick it
# Somewhere to stick local packages
export LOCAL="${HOME}/.local"
export CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh"
export CONDA_HOME="${LOCAL}/conda"
# Set up paths
# Note that conda spews if CO... | null | null |
Make identifiers error case more generic
Apply this change to `Sources/VBPerfectStoreError.swift` and return the full updated file.
```swift
//
// VBPerfectStoreError.swift
// VBPerfectArchitecture
//
// Created by Valentin Bercot on 13/02/2017.
//
//
import Foundation
/**
`Error` enum used to represent error c... | ```swift
//
// VBPerfectStoreError.swift
// VBPerfectArchitecture
//
// Created by Valentin Bercot on 13/02/2017.
//
//
import Foundation
/**
`Error` enum used to represent error cases throw by `VBPerfectStore` extended classes.
- authors: Valentin Bercot
*/
public enum VBPerfectStoreError: Error
{
case a... | null | null |
Set default now() for created_at field.
Apply this change to `steve-server/src/main/resources/db/migration/V1__Create_job_table.sql` and return the full updated file.
```sql
create table "job" (
"id" BIGSERIAL PRIMARY KEY,
"app_name" TEXT NOT NULL,
"status" TEXT NOT NULL,
"attributes" JSONB NOT NULL,
create... | ```sql
create table "job" (
"id" BIGSERIAL PRIMARY KEY,
"app_name" TEXT NOT NULL,
"status" TEXT NOT NULL,
"attributes" JSONB NOT NULL,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now(),
updated_at TIMESTAMP WITHOUT TIME ZONE NULL DEFAULT NULL
);
``` | null | null |
[Core] Fix class loading on Windows
Fixes: #1540
Apply this change to `core/src/main/java/cucumber/runtime/io/FileResource.java` and return the full updated file.
```java
package cucumber.runtime.io;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
class ... | ```java
package cucumber.runtime.io;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
class FileResource implements Resource {
private final File root;
private final File file;
private final boolean classpathFileResource;
static FileResource... | null | null |
Make the setenv tests threadsafe(ish)
Apply this change to `src/test/stdtest/os.rs` and return the full updated file.
```rust
import std::generic_os::setenv;
import std::generic_os::getenv;
import std::option;
#[test]
fn test_setenv() {
setenv("NAME", "VALUE");
assert getenv("NAME") == option::some("VALUE");... | ```rust
import std::generic_os::setenv;
import std::generic_os::getenv;
import std::option;
#[test]
fn test_setenv() {
// NB: Each test of setenv needs to use different variable names or the
// tests will not be threadsafe
setenv("NAME1", "VALUE");
assert getenv("NAME1") == option::some("VALUE");
}
#[... | null | null |
Return user id in has user stored procedure.
Apply this change to `src/Repository/Sql/Programmability/HasUser.sql` and return the full updated file.
```sql
IF OBJECT_ID(N'[Membership].[HasUser]', N'P') IS NULL
EXEC('CREATE PROCEDURE [Membership].[HasUser] AS SELECT 1')
GO
ALTER PROCEDURE [Membership].[HasUser]
(
... | ```sql
IF OBJECT_ID(N'[Membership].[HasUser]', N'P') IS NULL
EXEC('CREATE PROCEDURE [Membership].[HasUser] AS SELECT 1')
GO
ALTER PROCEDURE [Membership].[HasUser]
(
@Email nvarchar(254)
)
AS
BEGIN
SELECT Id FROM [Membership].[User]
WHERE Email = @Email
END
GO
GRANT EXECUTE ON [Membership].[HasUser] TO [ro]
GO
... | null | null |
[test] Fix importer test to not use 'nosource'.
Probably a copy/paste error, but this led to issues when the real overlays
are out of sync with the mock SDK.
Swift SVN r32946
Apply this change to `test/ClangModules/no-import-objc.swift` and return the full updated file.
```swift
// RUN: %target-swift-frontend(mock-... | ```swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -I %S/Inputs/no-import-objc %s -verify
// REQUIRES: objc_interop
// Note that we don't import ObjectiveC.
import People
class MyFrank : Frank {
override func frank() {}
}
``` | null | null |
Update notifiable upon job send (theoretically)
Apply this change to `app/Notifications/GeneralInterestNotification.php` and return the full updated file.
```php
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
us... | ```php
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Mail\GeneralInterestInvite as Mailable;
class GeneralInterestNotification extends Notification implements ShouldQueue
{
use Queueable;
/**
... | null | null |
Check interfaces, and abstract classes
Apply this change to `tests/AlgorithmTest.php` and return the full updated file.
```php
<?php
namespace Tests;
use PHPUnit\Framework\TestCase;
use App\Contracts\SortingAlgorithm;
class AlgorithmTest extends TestCase
{
/**
* List of algorithms to test
... | ```php
<?php
namespace Tests;
use PHPUnit\Framework\TestCase;
use App\Contracts\SortingAlgorithm;
use App\Contracts\ProvidesFeedback;
class AlgorithmTest extends TestCase
{
/**
* List of algorithms to test
*
* @var array
*/
private $algorithms = [
\App\Algorithms\BubbleSort::... | null | null |
Create secret number randomly and output it
Apply this change to `src/main.rs` and return the full updated file.
```rust
use std::io;
fn main() {
println!("Guess the number!");
println!("Please input your guess.");
let mut guess = String::new();
io::stdin().read_line(&mut guess)
... | ```rust
extern crate rand;
use std::io;
use rand::Rng;
fn main() {
println!("Guess the number!");
let secret_number = rand::thread_rng().gen_range(1, 101);
println!("The secret number is: {}", secret_number);
println!("Please input your guess.");
let mut guess = String::new... | null | null |
Remove last redux-fields message from the code
Apply this change to `src/common/app/linksMessages.js` and return the full updated file.
```javascript
import { defineMessages } from 'react-intl';
export default defineMessages({
intl: {
defaultMessage: 'Intl',
id: 'app.links.intl'
},
fields: {
defaul... | ```javascript
import { defineMessages } from 'react-intl';
export default defineMessages({
intl: {
defaultMessage: 'Intl',
id: 'app.links.intl'
},
fields: {
defaultMessage: 'Fields',
id: 'app.links.fields'
},
firebase: {
defaultMessage: 'Firebase',
id: 'app.links.firebase'
},
home... | null | null |
Use yarn instead of npm in docker
Apply this change to `docker-test.sh` and return the full updated file.
```bash
export NPROCS=1 && export JOBS=1 && export CXX=g++-4.9 && export PGUSER=postgres
npm install
/etc/init.d/postgresql start
createdb template_postgis && createuser publicuser
psql -c "CREATE EXTENSION p... | ```bash
export NPROCS=1 && export JOBS=1 && export CXX=g++-4.9 && export PGUSER=postgres
npm install -g yarn@0.27.5
yarn
/etc/init.d/postgresql start
createdb template_postgis && createuser publicuser
psql -c "CREATE EXTENSION postgis" template_postgis
npm test
``` | null | null |
Add primary key to removals table
Apply this change to `create_tables.sql` and return the full updated file.
```sql
CREATE TABLE users(
id INTEGER PRIMARY KEY,
username TEXT UNIQUE
);
CREATE TABLE modmails(
id INTEGER PRIMARY KEY,
author INTEGER,
time DATETIME,
body TEXT,
subreddit INTEGER,
FOREIGN K... | ```sql
CREATE TABLE users(
id INTEGER PRIMARY KEY,
username TEXT UNIQUE
);
CREATE TABLE modmails(
id INTEGER PRIMARY KEY,
author INTEGER,
time DATETIME,
body TEXT,
subreddit INTEGER,
FOREIGN KEY(author) REFERENCES users(id),
FOREIGN KEY(subreddit) REFERENCES subreddits(id)
);
CREATE TABLE actions(
... | null | null |
Disable THERMAL_DATA_UART by default. This is a big CPU sink, and is a pretty non-standard config.
Apply this change to `Inc/project_config.h` and return the full updated file.
```c
#ifndef _PROJECT_CONFIG_H_
#define _PROJECT_CONFIG_H_
#ifdef USART_DEBUG // this happens by 'make USART_DEBUG=1'
#undef THERMAL_DATA_UA... | ```c
#ifndef _PROJECT_CONFIG_H_
#define _PROJECT_CONFIG_H_
#ifdef USART_DEBUG // this happens by 'make USART_DEBUG=1'
#undef THERMAL_DATA_UART
#else
#define USART_DEBUG
// #define THERMAL_DATA_UART
#endif
#define TMP007_OVERLAY
#define SPLASHSCREEN_OVERLAY
#define ENABLE_LEPTON_AGC
// #define Y16
#ifndef Y16
// Value... | null | null |
Add test 'it_stops_with_source_path_being_empty' for baselib - createFileByCpIfNotExists
Apply this change to `tests/baselib-createFileByCpIfNotExists-1-test.sh` and return the full updated file.
```bash
#!/usr/bin/env roundup
#
# Baselib test
#/ usage: rerun stubbs:test -m MODULE -p baselib
#
# Author: Ines Neubach ... | ```bash
#!/usr/bin/env roundup
#
# Baselib test
#/ usage: rerun stubbs:test -m MODULE -p baselib
#
# Author: Ines Neubach <ines.neubach@idn.astzweig.de>
#
# Include baselib file
# -----------------
MODULE="$(basename $(cd ..; pwd))";
BASELIB_PATH="${RERUN_MODULES}/${MODULE}/lib/baselib.sh";
if [ ! -f ${BASELIB_PATH} ]... | null | null |
Update tests to match new equality not including online ID checks
Apply this change to `osu.Game.Tests/NonVisual/BeatmapSetInfoEqualityTest.cs` and return the full updated file.
```csharp
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for ... | ```csharp
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Extensions;
namespace osu.Game.Tests.NonVisual
{
[TestFixture]
public class BeatmapSetIn... | null | null |
Remove invalid concept relationships when looking up mapped concepts.
Fixes #85
Apply this change to `src/main/resources/resources/vocabulary/sql/getMappedSourcecodes.sql` and return the full updated file.
```sql
select CONCEPT_ID, CONCEPT_NAME, ISNULL(STANDARD_CONCEPT,'N') STANDARD_CONCEPT, ISNULL(c.INVALID_REASON,... | ```sql
select CONCEPT_ID, CONCEPT_NAME, ISNULL(STANDARD_CONCEPT,'N') STANDARD_CONCEPT, ISNULL(c.INVALID_REASON,'V') INVALID_REASON, CONCEPT_CODE, CONCEPT_CLASS_ID, DOMAIN_ID, VOCABULARY_ID
from @CDM_schema.concept_relationship cr
join @CDM_schema.concept c on c.concept_id = cr.concept_id_1
where cr.concept_id_2 in (@id... | null | null |
feat: Add compatibility for PostgreSQL 12+
Replaces use of `pg_constraint.consrc` (which was deprecated in PostgreSQL 12) column with `pg_get_expr(pg_constraint.conbin, pg_constraint.conrelid)`.
Apply this change to `src/inspectors/schema.sql` and return the full updated file.
```sql
SELECT
columns.column_name AS ... | ```sql
SELECT
columns.column_name AS name,
columns.data_type AS type,
columns.udt_name::regtype AS udt,
columns.column_default AS default,
columns.is_nullable::boolean AS nullable,
columns.character_maximum_length AS length,
attributes.attndims AS dimensions,
indexes.indisprimary AS isPrimaryKey,
cons... | null | null |
Add a few more modules
Apply this change to `.npm.sh` and return the full updated file.
```bash
#!/usr/bin/env bash
npm cache clean
npm i -g npm
npm i -g yo bower grunt-cli gulp turn-it-off-and-on-again electron-prebuilt
npm i -g generator-p generator-c generator-index generator-rework
npm i -g cssstats scrutiniz... | ```bash
#!/usr/bin/env bash
npm cache clean
npm i -g npm
npm i -g yo bower grunt-cli gulp turn-it-off-and-on-again electron-prebuilt
npm i -g generator-p generator-c generator-index generator-rework
npm i -g cssstats scrutinize get-css get-contrast a11y psi immutable-css-cli semi jshint sri-cli np
npm i -g postcss... | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.