original_prompt stringlengths 327 2.5k | original_completion stringlengths 22 2.84k | enhanced_prompt float64 | enhanced_completion float64 |
|---|---|---|---|
Sort out locales - keeps gem installations happy.
Apply this change to `bootstrap.sh` and return the full updated file.
```bash
#!/bin/bash
set -e
# Things included by travis
apt-get update -y
apt-get -y install software-properties-common ruby1.9.1 ruby1.9.1-dev
# Travis from this point onwards
apt-add-repository ... | ```bash
#!/bin/bash
set -e
# Sort out locales
locale-gen en_GB.UTF-8
# Things included by travis
apt-get update -y
apt-get -y install software-properties-common ruby1.9.1 ruby1.9.1-dev
# Travis from this point onwards
apt-add-repository --yes ppa:mapnik/nightly-2.3
apt-add-repository --yes ppa:mapnik/nightly-trunk... | null | null |
Revert changes to postgres config
Apply this change to `jenkins/prep_sytest_for_postgres.sh` and return the full updated file.
```bash
#!/bin/sh
#
# Configure sytest to use postgres databases, per the env vars. This is used
# by both the sytest builds and the synapse ones.
#
set -e
cd "`dirname $0`/.."
if [ -z "$... | ```bash
#!/bin/sh
#
# Configure sytest to use postgres databases, per the env vars. This is used
# by both the sytest builds and the synapse ones.
#
set -e
cd "`dirname $0`/.."
if [ -z "$POSTGRES_DB_1" ]; then
echo >&2 "Variable POSTGRES_DB_1 not set"
exit 1
fi
if [ -z "$POSTGRES_DB_2" ]; then
echo >&2... | null | null |
Update use strict test to only check for line numbers
Apply this change to `tests/__tests__/use-strict.spec.ts` and return the full updated file.
```typescript
import { } from 'jest';
import { } from 'node';
import runJest from '../__helpers__/runJest';
describe('use strict', () => {
it('should show the error loc... | ```typescript
import { } from 'jest';
import { } from 'node';
import runJest from '../__helpers__/runJest';
describe('use strict', () => {
fit('should show the error locations for "use strict" violations', () => {
const result = runJest('../use-strict', ['--no-cache', '-t', 'Invalid Strict']);
const stder... | null | null |
fix: Add missing semicolon in crawler controller
Apply this change to `Mini/Model/TypeCrawler/TypeCrawlerController.php` and return the full updated file.
```php
<?php
namespace Mini\Model\TypeCrawler;
use \Mini\Model\TypeCrawler\Storage\StorageFactory;
//TODO disable crawlers if the type is disabled in the DB.
cl... | ```php
<?php
namespace Mini\Model\TypeCrawler;
use \Mini\Model\TypeCrawler\Storage\StorageFactory;
//TODO disable crawlers if the type is disabled in the DB.
class TypeCrawlerController {
/** @var array */
private $crawlers;
/** @var StorageFactory */
private $storage;
function __construct(Stora... | null | null |
Add listening to the std out as well.
Apply this change to `misc.go` and return the full updated file.
```go
package main
import (
"bufio"
"fmt"
"log"
"os"
"os/exec"
)
func executeCmd(command string, args ...string) {
cmd := exec.Command(command, args...)
cmdReader, err := cmd.StdoutPipe()
if err != nil {
... | ```go
package main
import (
"bufio"
"fmt"
"log"
"os"
"os/exec"
)
func executeCmd(command string, args ...string) {
cmd := exec.Command(command, args...)
stdOut, err := cmd.StdoutPipe()
if err != nil {
log.Fatal(os.Stderr, "Error creating StdoutPipe for Cmd", err)
}
defer stdOut.Close()
scanner := bufi... | null | null |
Fix vendor for Santa Tracker smoke test jvm
Apply this change to `.teamcity/src/main/kotlin/common/JvmCategory.kt` and return the full updated file.
```kotlin
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except ... | ```kotlin
/*
* Copyright 2019 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 required ... | null | null |
libplatsupport: Define PIT interrupt more correctly if using the IOAPIC
The definition is not really correct as you cannot really talk about
interrupts by a single number. But this does provide the path of least
resistance for legacy code using the PIT when the IOAPIC is enabled
Apply this change to `libplatsupport/p... | ```c
/*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef _PLATSUPPORT_PIT_H
#define _PLATSUPPORT_PIT_H
#include <autoconf.h>
#in... | null | null |
Add y-dimension, downwards movement, clickHandler
Apply this change to `virun.js` and return the full updated file.
```javascript
console.log("Helllo world");
var virus = document.querySelector("div");
virus.style.top = "400px";
var x = 1;
var velocity = .1; // px per millisecond
var startTime = Date.now();
timer = ... | ```javascript
console.log("Helllo world");
var virus = document.querySelector("div");
virus.style.top = "400px";
var x = 1;
var y = 0;
var vy = 0;
var velocity = .1; // px per millisecond
var startTime = Date.now();
var clickTime;
timer = setInterval(function animate() {
var t = Date.now() - startTime;
x = veloci... | null | null |
Use mono file in AKFunctionTableLooper test
Apply this change to `Tests/AKFunctionTableLooper/AKFunctionTableLooper/main.swift` and return the full updated file.
```swift
//
// main.swift
// AudioKit
//
// Auto-generated on 12/28/14.
// Customized by Aurelius Prochazka on 12/28/14.
//
// Copyright (c) 2014 Aurel... | ```swift
//
// main.swift
// AudioKit
//
// Auto-generated on 12/28/14.
// Customized by Aurelius Prochazka on 12/28/14.
//
// Copyright (c) 2014 Aurelius Prochazka. All rights reserved.
//
import Foundation
class Instrument : AKInstrument {
override init() {
super.init()
let fi... | null | null |
Add example of brunch file concatenation order
Fixes https://github.com/phoenixframework/phoenix/issues/690
Apply this change to `priv/static/brunch/brunch-config.js` and return the full updated file.
```javascript
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
... | ```javascript
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
joinTo: 'js/app.js'
// To change the order of concatenation of files, explictly mention here
// https://github.com/brunch/brunch/tree/stable/docs#concatenation
// order: {
// ... | null | null |
Add convenient methods to get some common metrics
Apply this change to `src/main/java/at/medunigraz/imi/bst/trec/model/Metrics.java` and return the full updated file.
```java
package at.medunigraz.imi.bst.trec.model;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
public class Metrics {
pri... | ```java
package at.medunigraz.imi.bst.trec.model;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
public class Metrics {
private Map<String, Double> metrics = new TreeMap<>();
public void put(String name, double value) {
metrics.put(name, value);
}
public double getMetric(String name)... | null | null |
Add necessary email for business
Apply this change to `src/app/_services/api/api-models/business-api.ts` and return the full updated file.
```typescript
import { Organization } from '../../../models/organization';
export class BusinessApi {
public id: number;
public legalName: string;
public commonName: ... | ```typescript
import { Organization } from '../../../models/organization';
export class BusinessApi {
public id: number;
public legalName: string;
public commonName: string;
public mail: string;
public legalStatus: string;
public siret: string;
public shareCapital: number;
public RCSNum... | null | null |
Move module import declarations to the top of the file
Apply this change to `Source/RotatingContent/RotatingContentController.swift` and return the full updated file.
```swift
// Copyright © 2016 Gavan Chan. All rights reserved.
import UIKit
final class RotatingContentController: UIViewController {
override fun... | ```swift
// Copyright © 2016 Gavan Chan. All rights reserved.
import RxCocoa
import RxSwift
import UIKit
final class RotatingContentController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func... | null | null |
Remove some of ACPICA's x32 support
To actually work properly in x32, it would need to manage mappings of
physical memory into the lower 4GB. Let's just require that you build it
in 64-bit mode...
Apply this change to `cuser/acpica/acenv_header.h` and return the full updated file.
```c
#include <stdarg.h>
#include <... | ```c
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define ACPI_MACHINE_WIDTH __INTPTR_WIDTH__
#define ACPI_SINGLE_THREADED
#define ACPI_USE_LOCAL_CACHE
#define ACPI_USE_NATIVE_DIVIDE
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
#undef ACPI_GET_FUNCTION_NAME
#ifdef ACPI_FULL... | null | null |
Fix terrible perf test for FAST detector
Apply this change to `modules/features2d/perf/perf_fast.cpp` and return the full updated file.
```cpp
#include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using std::tr1::make_tuple;
using std::tr1::get;
typedef perf::TestBaseWithParam<s... | ```cpp
#include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using std::tr1::make_tuple;
using std::tr1::get;
enum { TYPE_5_8 =FastFeatureDetector::TYPE_5_8, TYPE_7_12 = FastFeatureDetector::TYPE_7_12, TYPE_9_16 = FastFeatureDetector::TYPE_9_16 };
CV_ENUM(FastType, TYPE_5_8, TYPE_... | null | null |
Make widget always fit the view
Apply this change to `src/mainwindow.cpp` and return the full updated file.
```cpp
#include "mainwindow.h"
#include "bucketlist.h"
#include <QLabel>
#include <QBoxLayout>
#include <QtWebKit>
#include <QSettings>
#include <QInputDialog>
MainWindow::MainWindow(QWidget *parent) :
Q... | ```cpp
#include "mainwindow.h"
#include "bucketlist.h"
#include <QLabel>
#include <QBoxLayout>
#include <QtWebKit>
#include <QSettings>
#include <QInputDialog>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
QWidget *central = new QWidget;
setCentralWidget(central);
QBoxLayout *topLa... | null | null |
Fix TextArea interface usage in docs
Apply this change to `sample/components/text-area.js` and return the full updated file.
```javascript
import React from 'react';
import { Spacing, Text, TextArea } from 'react-elemental';
const SampleTextArea = () => (
<div>
<Spacing size="huge" bottom>
<Text size="ga... | ```javascript
import React from 'react';
import { Spacing, Text, TextArea } from 'react-elemental';
const SampleTextArea = () => (
<div>
<Spacing size="huge" bottom>
<Text size="gamma" color="primary" uppercase>
Text areas
</Text>
<Text>
Allow the user to enter an arbitrary-leng... | null | null |
Update problem0004 to use streams
Apply this change to `src/main/java/Problem0004.java` and return the full updated file.
```java
/**
* A palindromic number reads the same both ways.
* The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
*
* Find the largest palindrome made from ... | ```java
import java.util.stream.LongStream;
/**
* A palindromic number reads the same both ways.
* The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
* <p>
* Find the largest palindrome made from the product of two 3-digit numbers.
*
* @author David Clutter
*/
public class Pr... | null | null |
Add extension dependencies to telemetry data
Apply this change to `src/vs/platform/extensionManagement/common/extensionTelemetry.ts` and return the full updated file.
```typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. ... | ```typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*-------------------------------------------------... | null | null |
Add comment explaining remote and local messages
Apply this change to `BluetoothLeChat/app/src/main/java/com/example/bluetoothlechat/bluetooth/Message.kt` and return the full updated file.
```kotlin
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "Lic... | ```kotlin
/*
* Copyright (C) 2020 The Android Open Source Project
*
* 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 requi... | null | null |
Remove glow lib from dummy load path
Apply this change to `test/dummy/config/boot.rb` and return the full updated file.
```ruby
require 'rubygems'
gemfile = File.expand_path('../../Gemfile', __FILE__)
if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end
$:.unshift File.e... | ```ruby
require 'rubygems'
gemfile = File.expand_path('../../Gemfile', __FILE__)
if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end
``` | null | null |
Make python2-urllib2 compatible with more Python 2.7 versions
Try to catch ssl.CertificateError only if CertificateError is
defined. Otherwise bail out by effectively doing a dummy
"catch ():".
Apply this change to `stubs/python2-urllib2/run.py` and return the full updated file.
```python
import sys
import ssl
impor... | ```python
import sys
import ssl
import urllib2
if len(sys.argv) < 3 or len(sys.argv) > 4:
exit("Usage: %s <HOST> <PORT> [CA_FILE]" % sys.argv[0])
host = sys.argv[1]
port = sys.argv[2]
cafile = sys.argv[3] if len(sys.argv) > 3 else None
try:
urllib2.urlopen("https://" + host + ":" + port, cafile=cafile)
excep... | null | null |
Complete the information for the help-plugin
Apply this change to `maps.php` and return the full updated file.
```php
<?php
class maps extends Script
{
public function run()
{
switch (strtolower($this->matches[1])) {
case 'hybridmap':
$this->type = 'hybrid';
... | ```php
<?php
class maps extends Script
{
protected $helpMessage = "'map LOCATION': Returns a roadmap\n"
."'satellitemap LOCATION': Returns a satellitemap\n"
."'hybridmap LOCATION': Returns a hybridmap"
."'terrainmap LOCATION': Retur... | null | null |
Simplify the shortcut for AllRoutes
Apply this change to `utils.go` and return the full updated file.
```go
package minion
// AllRoutes a shortcut to be used on the UnauthenticatedRoutes when
// you want to have all your routes without jwt verification
const AllRoutes = "^.*$"
func lastChar(str string) (lc uint8) {... | ```go
package minion
// AllRoutes a shortcut to be used on the UnauthenticatedRoutes when
// you want to have all your routes without jwt verification
var AllRoutes = []string{"^.*$"}
func lastChar(str string) (lc uint8) {
size := len(str)
if size == 0 {
return lc
}
return str[size-1]
}
``` | null | null |
Create failing test that subview frame set to self bounds. Had to specifically set frame otherwise defaults of 0,0,0,0 would pass without setting the frame.
Apply this change to `FuelGaugeKit/FuelGaugeKitTests/FuelGaugeKitTests.swift` and return the full updated file.
```swift
//
// FuelGaugeKitTests.swift
// FuelG... | ```swift
//
// FuelGaugeKitTests.swift
// FuelGaugeKitTests
//
// Created by Ron Lisle on 3/19/15.
// Copyright (c) 2015 Ron Lisle. All rights reserved.
//
import UIKit
import XCTest
class FuelGaugeKitTests: XCTestCase {
var fuelGauge: FuelGaugeView!
override func setUp() {
super.setUp()... | null | null |
Make this file a bit prettier.
Apply this change to `CompilationDatabaseMagic.h` and return the full updated file.
```c
// __COMPDB_ENTRY: The contents of this compilation database entry.
// Should be a string literal.
// __COMPDB_SYMNAME: ATM I can't think of a way to generate a unique symbol
// name, so just force ... | ```c
// The following macros should be defined on entry to this file:
// __COMPDB_ENTRY:
// The contents of this compilation database entry. Should be a string
// literal.
// __COMPDB_SYMNAME:
// ATM I can't think of a way to generate a unique symbol name, so just
// force it to be passed in.
__attribute__((se... | null | null |
Use correct style in the text node.
Apply this change to `FigmaKit.playgroundbook/Edits/UserEdits.diffpack/UserModules/FigmaKit.playgroundmodule/Sources/Node-Text.swift` and return the full updated file.
```swift
extension Node {
public final class Text: Vector {
/// Text contained within a text box.
... | ```swift
extension Node {
public final class Text: Vector {
/// Text contained within a text box.
public let characters: String
/// Style of text including font family and weight.
public let style: TypeStyle
/// Array with same number of elements as characeters in text box.
... | null | null |
Introduce type for parsing jsonb
Apply this change to `db/psql/psql.go` and return the full updated file.
```go
package psql
import (
"errors"
_ "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/postgres"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
"github.com/spf13/cobra"
... | ```go
package psql
import (
"errors"
"database/sql/driver"
"encoding/json"
_ "github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/dialers/postgres"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var (
DB *gorm.DB
DBError error
... | null | null |
Add new option to enable/disable compression
Apply this change to `src/Config.h` and return the full updated file.
```c
#ifndef CTCONFIG_H
#define CTCONFIG_H
//#define ENABLE_ASSERT_CHECKS
//#define CT_NODE_DEBUG
//#define ENABLE_INTEGRITY_CHECK
//#define ENABLE_COUNTERS
//#define ENABLE_PAGING
//#define SNAPPY_COMP... | ```c
#ifndef CTCONFIG_H
#define CTCONFIG_H
//#define ENABLE_ASSERT_CHECKS
//#define CT_NODE_DEBUG
//#define ENABLE_INTEGRITY_CHECK
//#define ENABLE_COUNTERS
//#define ENABLE_PAGING
#define ENABLE_COMPRESSION
//#define SNAPPY_COMPRESSION
#endif // CTCONFIG_H
``` | null | null |
Add JSON struct tags to Order.
Apply this change to `models.go` and return the full updated file.
```go
package campbx
// Ticker
//
// Sample response
//
// {"Last Trade":"244.99","Best Bid":"236.38","Best Ask":"244.99"}
type Ticker struct {
LastTrade float32 `json:"Last Trade,string"`
Bid float32 `json:... | ```go
package campbx
// Ticker
//
// Sample response
//
// {"Last Trade":"244.99","Best Bid":"236.38","Best Ask":"244.99"}
type Ticker struct {
LastTrade float32 `json:"Last Trade,string"`
Bid float32 `json:"Best Bid,string"`
Ask float32 `json:"Best Ask,string"`
}
// OrderBook represents the full o... | null | null |
Replace stubs with command execution
Apply this change to `src/main/java/seedu/address/model/StateCommandPair.java` and return the full updated file.
```java
//@@author A0114395E
package seedu.address.model;
import seedu.address.logic.commands.*;
/**
* Class to store an action, and it's inverse
*/
public class St... | ```java
//@@author A0114395E
package seedu.address.model;
import seedu.address.logic.commands.*;
import seedu.address.logic.commands.exceptions.CommandException;
/**
* Class to store an action, and it's inverse
*/
public class StateCommandPair {
private Command executeCommand;
private Command undoCommand;
... | null | null |
Write in terms of test operation
Apply this change to `subprojects/tooling-api/src/main/java/org/gradle/tooling/events/test/TestOperationDescriptor.java` and return the full updated file.
```java
/*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");... | ```java
/*
* Copyright 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 required by... | null | null |
Add more informative error message for yank options assertion test.
Apply this change to `Yank/tests/test_utils.py` and return the full updated file.
```python
#!/usr/local/bin/env python
"""
Test various utility functions.
"""
#======================================================================================... | ```python
#!/usr/local/bin/env python
"""
Test various utility functions.
"""
#=============================================================================================
# GLOBAL IMPORTS
#=============================================================================================
from yank.utils import YankOpti... | null | null |
Add tags stanza to Earlybird
Apply this change to `Casks/earlybird.rb` and return the full updated file.
```ruby
cask :v1 => 'earlybird' do
version '42.0a2'
sha256 :no_check # required as upstream package is updated in-placea
url "https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-earlybird/th... | ```ruby
cask :v1 => 'earlybird' do
version '42.0a2'
sha256 :no_check # required as upstream package is updated in-placea
url "https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-earlybird/thunderbird-#{version}.en-US.mac.dmg"
name 'Earlybird'
name 'Thunderbird Nightly'
homepage 'https://www... | null | null |
Increase Go timeouts to 30min
Apply this change to `hack/test-go.sh` and return the full updated file.
```bash
#!/usr/bin/env bash
# Copyright 2019 The Kubernetes 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 ... | ```bash
#!/usr/bin/env bash
# Copyright 2019 The Kubernetes 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 required by... | null | null |
Fix test case 11 to set the number of omp threads and make it portable
Apply this change to `test/srcs/11-omp-for.c` and return the full updated file.
```c
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double sinTable[256];
#pragma omp parallel for
for(int n=0; n<256... | ```c
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double sinTable[256];
#pragma omp parallel for
for(int n=0; n<256; ++n)
sinTable[n] = sin(2 * M_PI * n / 256);
// the table is now initialized
}
// RUN: clang -fopenmp -c -g -emit-llvm %s -o %t.1.bc
// R... | null | null |
Add abstract getObserverClass() and use it for dynamic updateMethods()
invocation
OPEN - task 33: Problem with EntityModelObserver architecture
http://github.com/DevOpsDistilled/OpERP/issues/issue/33
updateMethods() are methods in EntityObservers like "updateItems(List)"
Apply this change to `OpERP/src/main/java/de... | ```java
package devopsdistilled.operp.client.abstracts;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.List;
import devopsdistilled.operp.server.data.entity.Entiti;
import devopsdistilled.operp.server.data... | null | null |
[libcxx] Fix test failure on GCC 4.9
GCC 4.9 seems to think that a constexpr default constructor implies
the constructor to be noexcept.
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@348850 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `test/libcxx/utilities/utility/pairs/pairs.pair/default.pass.c... | ```cpp
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... | null | null |
Update path to Gondola repository
Apply this change to `web.go` and return the full updated file.
```go
package main
import (
"path"
"gnd.la/app"
"gnd.la/apps/docs"
"gnd.la/net/urlutil"
)
const (
//gondolaURL = "http://www.gondolaweb.com"
gondolaURL = "ssh://abra.rm-fr.net/home/fiam/git/gondola.git"
)
func ... | ```go
package main
import (
"path"
"gnd.la/app"
"gnd.la/apps/docs"
"gnd.la/net/urlutil"
)
const (
gondolaURL = "http://www.gondolaweb.com"
)
func gndlaHandler(ctx *app.Context) {
if ctx.FormValue("go-get") == "1" {
ctx.MustExecute("goget.html", nil)
return
}
// Check if the request path is a pkg name
v... | null | null |
test: Add test cases for `TreemapSerie.ColorMappingBy`
Apply this change to `SwiftyEchartsTest_iOS/TreemapSerieSpec.swift` and return the full updated file.
```swift
//
// TreemapSerieSpec.swift
// SwiftyEcharts
//
// Created by Pluto Y on 20/08/2017.
// Copyright © 2017 com.pluto-y. All rights reserved.
//
impo... | ```swift
//
// TreemapSerieSpec.swift
// SwiftyEcharts
//
// Created by Pluto Y on 20/08/2017.
// Copyright © 2017 com.pluto-y. All rights reserved.
//
import Quick
import Nimble
@testable import SwiftyEcharts
class TreemapSerieSpec: QuickSpec {
override func spec() {
describe("For TreemapSerie.NodeCl... | null | null |
Remove margin-type from CLI test
Apply this change to `examples/basic-cli-test.sh` and return the full updated file.
```bash
#!/bin/bash
script_directory(){
local source="${BASH_SOURCE[0]}"
local dir=""
while [ -h "$source" ]; do # resolve $source until the file is no longer a symlink
dir="$( cd -P "$( di... | ```bash
#!/bin/bash
script_directory(){
local source="${BASH_SOURCE[0]}"
local dir=""
while [ -h "$source" ]; do # resolve $source until the file is no longer a symlink
dir="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
[[ $source != /* ]] && source="$dir/$source" # if $... | null | null |
Fix the windows allocator to behave properly on realloc.
The spec says that calling realloc(ptr, 0) should free ptr
and return NULL.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/196041
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@25612 0039d316-1c4b-4281-b951-d872f2087c98
Apply this chang... | ```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.
// This is a simple allocator based on the windows heap.
extern "C" {
HANDLE win_heap;
bool win_heap_init(bool use_lfh) {
win_heap = HeapC... | null | null |
Use new method to generate JSON
Apply this change to `Samples/Lambda/Sources/main.swift` and return the full updated file.
```swift
import Foundation
import AlexaSkillsKit
func echo(string: String) -> String {
guard let data = string.data(using: .utf8),
let requestParser = try? RequestParser(with: data),... | ```swift
import Foundation
import AlexaSkillsKit
func echo(string: String) -> String {
guard let data = string.data(using: .utf8),
let requestParser = try? RequestParser(with: data),
let _ = requestParser.parseRequestType() else {
return "error parsing input\n"
}
let output... | null | null |
Fix nullreference when try to call disabled component
Apply this change to `Assets/Scripts/ClipPlane.cs` and return the full updated file.
```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ClipPlane : MonoBehaviour
{
// input objects
... | ```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ClipPlane : MonoBehaviour
{
// input objects
public Slider slider;
public Material clipPlaneMaterial;
// private objects
private Renderer cube;
private float clipX;
... | null | null |
Change session length to 3 minutes
Apply this change to `server/src/apache/analyzer/detail/session_length.h` and return the full updated file.
```c
/*
* Copyright 2016 Adam Chyła, adam@chyla.org
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef SRC_APACHE_ANALYZER_DETAIL_SESSION_LE... | ```c
/*
* Copyright 2016 Adam Chyła, adam@chyla.org
* All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H
#define SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H
namespace apache
{
namespace analyzer
{
namespace detail
{
constexpr int SESSION_L... | null | null |
Throw HttpException when trying to resolve unknown controller
Apply this change to `SnittListan/IoC/WindsorControllerFactory.cs` and return the full updated file.
```csharp
using System;
using System.Web.Mvc;
using System.Web.Routing;
using Castle.MicroKernel;
namespace SnittListan.IoC
{
public class Windso... | ```csharp
using System;
using System.Web.Mvc;
using System.Web.Routing;
using Castle.MicroKernel;
using System.Web;
namespace SnittListan.IoC
{
public class WindsorControllerFactory : DefaultControllerFactory
{
private readonly IKernel kernel;
public WindsorControllerFactory(IKernel kernel)
{
... | null | null |
Use half of available CPUs
Or 1 CPU if there is only one CPU in the system
Apply this change to `goslow.go` and return the full updated file.
```go
// goslow is a slow HTTP server that responds with errors.
// Visit https://github.com/alexandershov/goslow for more details.
package main
import (
"log"
)
// main st... | ```go
// goslow is a slow HTTP server that responds with errors.
// Visit https://github.com/alexandershov/goslow for more details.
package main
import (
"log"
"runtime"
)
// main starts a slow HTTP server that responds with errors.
func main() {
// GOMAXPROCS call is ignored if NumCPU returns 1 (GOMAXPROCS(0) doe... | null | null |
Use require equal for testing equality
Apply this change to `languages/C++-Boost.Test/hiker.tests.cpp` and return the full updated file.
```cpp
#include "hiker.hpp"
#define BOOST_TEST_MODULE HikerTest
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(Life_the_universe_and_everything)
{
// The initial code... | ```cpp
#include "hiker.hpp"
#define BOOST_TEST_MODULE HikerTest
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(Life_the_universe_and_everything)
{
// The initial code and test files are completely
// *unrelated* to the chosen exercise. They are
// merely a simple example to start you off.
// ... | null | null |
Fix IMPALA-122: Lzo scanner with small scan ranges.
Change-Id: I5226fd1a1aa368f5b291b78ad371363057ef574e
Reviewed-on: http://gerrit.ent.cloudera.com:8080/140
Reviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
Reviewed-by: Nong Li <99a5e5f8f5911755b88e0b536d46aafa102bed41@cloudera... | ```python
#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
# Validates running with different scan range length values
#
import pytest
from copy import copy
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite, ALL_NODES_ONLY
# We u... | null | null |
Fix skip computePath if not changing parent
Apply this change to `src/hooks/compute-path.js` and return the full updated file.
```javascript
import makeDebug from 'debug';
import fp from 'mostly-func';
import path from 'path';
import { getParentDocument, shortname } from '../helpers';
const debug = makeDebug('playin... | ```javascript
import assert from 'assert';
import makeDebug from 'debug';
import fp from 'mostly-func';
import path from 'path';
import { getParentDocument, shortname } from '../helpers';
const debug = makeDebug('playing:content-services:hooks:computePath');
// compute current path by parent
export default function c... | null | null |
Correct cfg for optional rand dependency
Apply this change to `src/lib.rs` and return the full updated file.
```rust
// Copyright 2014 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// htt... | ```rust
// Copyright 2014 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/M... | null | null |
Reimplement derivative using h conditionally derived from machine epsilon
Apply this change to `Sources/Euler/Calculus.swift` and return the full updated file.
```swift
import Foundation
// MARK: Derivative
postfix operator ′
public postfix func ′(function: @escaping (Double) -> (Double)) -> (Double) -> (Double) {
... | ```swift
import Foundation
// MARK: Derivative
postfix operator ′
public postfix func ′(function: @escaping (Double) -> (Double)) -> (Double) -> (Double) {
return { x in
let h: Double = x.isZero ? 1e-3 : √(ε * x)
return round((function(x + h) - function(x - h)) / (2 * h) / h) * h
}
}
// MARK:... | null | null |
Change default service port to 2381
Apply this change to `lib/config.js` and return the full updated file.
```javascript
var Path = require('path');
var config = global.Config = module.exports = require('nconf');
var package = require('../package.json');
config.argv();
config.file(Path.resolve(__dirname, '../config... | ```javascript
var Path = require('path');
var config = global.Config = module.exports = require('nconf');
var package = require('../package.json');
config.argv();
config.file(Path.resolve(__dirname, '../config/site.json'));
config.defaults({
name: package.name,
version: package.version,
service: {
listen: ... | null | null |
Use PRIi64 macro to work around clang weirdness.
Apply this change to `src/rdb_protocol/configured_limits.cc` and return the full updated file.
```cpp
#include "rdb_protocol/configured_limits.hpp"
#include <limits>
#include "rdb_protocol/wire_func.hpp"
#include "rdb_protocol/func.hpp"
namespace ql {
configured_limit... | ```cpp
#include "rdb_protocol/configured_limits.hpp"
#include <limits>
#include "rdb_protocol/wire_func.hpp"
#include "rdb_protocol/func.hpp"
namespace ql {
configured_limits_t
from_optargs(rdb_context_t *ctx, signal_t *interruptor, global_optargs_t *arguments)
{
if (arguments->has_optarg("array_limit")) {
... | null | null |
Include branch name in fetch
Apply this change to `GitToolBox/src/main/java/zielu/gittoolbox/ui/statusBar/FetchAction.java` and return the full updated file.
```java
package zielu.gittoolbox.ui.statusBar;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareAction;
imp... | ```java
package zielu.gittoolbox.ui.statusBar;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.DumbAwareAction;
import git4idea.GitLocalBranch;
import git4idea.GitRemoteBranch;
import git4idea.i18n.GitBundle;
import git4... | null | null |
Remove Smoothing From Temp Sensor
Apply this change to `src/services/TemperatureMonitor/src/temperature.py` and return the full updated file.
```python
import smbus
class TemperatureSensor:
temp_history = []
last_temp = 0
def __init__(self, address):
self.bus = smbus.SMBus(1)
self.addre... | ```python
import smbus
class TemperatureSensor:
temp_history = []
last_temp = 0
def __init__(self, address):
self.bus = smbus.SMBus(1)
self.address = address
def get_temp(self):
MSB = self.bus.read_byte_data(self.address, 0)
LSB = self.bus.read_byte_data(self.address,... | null | null |
Revert "fix frontend redirection after token expires"
This reverts commit ef82d0dc3e4a762edcb843ee20e70132b8b9c01a.
Apply this change to `frontend/src/app/services/unauthorized.interceptor.ts` and return the full updated file.
```typescript
import { Injectable } from '@angular/core';
import { Router, ActivatedRoute ... | ```typescript
import { Injectable } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpErrorResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observ... | null | null |
Add crowd GET controller methods
Apply this change to `controllers/crowdController.js` and return the full updated file.
```javascript
/**
* Created by Stein-Otto Svorstøl on 26.08.15.
* Logic of requests regarding crowds
*/
var Crowds = require('../models/crowd.js');
module.exports = {
create: function(req,... | ```javascript
/**
* Created by Stein-Otto Svorstøl on 26.08.15.
* Logic of requests regarding crowds
*/
var Crowds = require('../models/crowd.js');
module.exports = {
create: function(req, res){
Crowds.insertCrowd(crowd, function(){
res.sendStatus(201);
});
},
addMember: fu... | null | null |
Fix azure terraform fixture filename.
Apply this change to `terraform/azure/template_generator_test.go` and return the full updated file.
```go
package azure_test
import (
"io/ioutil"
"github.com/cloudfoundry/bosh-bootloader/storage"
"github.com/cloudfoundry/bosh-bootloader/terraform/azure"
. "github.com/onsi/g... | ```go
package azure_test
import (
"io/ioutil"
"github.com/cloudfoundry/bosh-bootloader/storage"
"github.com/cloudfoundry/bosh-bootloader/terraform/azure"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("TemplateGenerator", func() {
var (
templateGenerator azure.TemplateGenerator
)
... | null | null |
Fix container with nil backgroundColor
Apply this change to `Source/ClearContainerView.swift` and return the full updated file.
```swift
//
// ClearContainerView.swift
// SlideOutable
//
// Created by Domas Nutautas on 20/05/16.
// Copyright © 2016 Domas Nutautas. All rights reserved.
//
import UIKit
// MARK: -... | ```swift
//
// ClearContainerView.swift
// SlideOutable
//
// Created by Domas Nutautas on 20/05/16.
// Copyright © 2016 Domas Nutautas. All rights reserved.
//
import UIKit
// MARK: - ContainterView
///
/// Passes touches if background is clear and point is not inside one of its subviews
///
public class ClearC... | null | null |
Make parent protected so that the child can know their parents
Apply this change to `include/ParseNode.h` and return the full updated file.
```c
//=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// ... | ```c
//=======================================================================
// 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 |
Revert "adding source code compatibility"
Apply this change to `json_formatter.go` and return the full updated file.
```go
package logmatic
import (
"encoding/json"
"fmt"
"time"
log "github.com/Sirupsen/logrus"
"os"
)
const defaultTimestampFormat = time.RFC3339
var markers = [2]string{"sourcecode", "golang"}
... | ```go
package logmatic
import (
"encoding/json"
"fmt"
"time"
log "github.com/Sirupsen/logrus"
)
const defaultTimestampFormat = time.RFC3339
var markers = [2]string{"sourcecode", "golang"}
type JSONFormatter struct {
}
func (f *JSONFormatter) Format(entry *log.Entry) ([]byte, error) {
data := make(log.Fields, ... | null | null |
Update to the serialization module - only construct object mapper once.
Apply this change to `mmtf-serialization/src/main/java/org/rcsb/mmtf/serialization/MessagePackSerialization.java` and return the full updated file.
```java
package org.rcsb.mmtf.serialization;
import java.io.IOException;
import java.io.InputStre... | ```java
package org.rcsb.mmtf.serialization;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.msgpack.jackson.dataformat.MessagePackFactory;
import org.rcsb.mmtf.dataholders.MmtfStructure;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml... | null | null |
Update DB Script for loan counter changes
Apply this change to `mifosng-db/migrations/core_db/V74__alter_m_loan_counter_table_add_group.sql` and return the full updated file.
```sql
ALTER TABLE `m_client_loan_counter`
ADD COLUMN `group_id` BIGINT(20) NOT NULL AFTER `client_id`,
ADD CONSTRAINT `FK_m_group_loan_count... | ```sql
DROP TABLE `m_client_loan_counter`;
ALTER TABLE `m_loan`
ADD COLUMN `loan_counter` SMALLINT NULL DEFAULT NULL AFTER `sync_disbursement_with_meeting`,
ADD COLUMN `loan_product_counter` SMALLINT NULL DEFAULT NULL AFTER `loan_counter`;
``` | null | null |
Add type constant for data one of.
Apply this change to `src/main/java/de/uni_stuttgart/vis/vowl/owl2vowl/constants/Node_Types.java` and return the full updated file.
```java
package de.uni_stuttgart.vis.vowl.owl2vowl.constants;
public class Node_Types {
public static final String TYPE_CLASS = "owl:Class";
public ... | ```java
package de.uni_stuttgart.vis.vowl.owl2vowl.constants;
public class Node_Types {
public static final String TYPE_CLASS = "owl:Class";
public static final String TYPE_RDFSCLASS = "rdfs:Class";
public static final String TYPE_EQUIVALENT = "owl:equivalentClass";
public static final String TYPE_EXTERNALCLASS = ... | null | null |
Update paths for Squoosh PWA
Apply this change to `src/codecs/mozjpeg/encoder.ts` and return the full updated file.
```typescript
import mozjpeg_enc, { MozJPEGModule } from '../../../codecs/mozjpeg_enc/mozjpeg_enc';
import wasmUrl from '../../../codecs/mozjpeg_enc/mozjpeg_enc.wasm';
import { EncodeOptions } from './e... | ```typescript
import mozjpeg_enc, { MozJPEGModule } from '../../../codecs/mozjpeg/enc/mozjpeg_enc';
import wasmUrl from '../../../codecs/mozjpeg/enc/mozjpeg_enc.wasm';
import { EncodeOptions } from './encoder-meta';
import { initEmscriptenModule } from '../util';
let emscriptenModule: Promise<MozJPEGModule>;
export a... | null | null |
Add active field to manuscript table
Apply this change to `dspace/etc/postgres/dryad-rest-webapp.sql` and return the full updated file.
```sql
-- Author: dan.leehr@nescent.org
--
-- Organizations
CREATE SEQUENCE organization_seq;
CREATE TABLE organization
(
organization_id INTEGER PRIMARY KEY not null default next... | ```sql
-- Author: dan.leehr@nescent.org
--
-- Organizations
CREATE SEQUENCE organization_seq;
CREATE TABLE organization
(
organization_id INTEGER PRIMARY KEY not null default nextval('organization_seq'),
code VARCHAR(32) not null,
name VARCHAR(255) not null
);
CREATE UNIQUE INDEX org_code_idx on organization(co... | null | null |
Add deleted and copied to the parsed statuses
Apply this change to `GitDataExplorer/Results/ListSimpleCommitsResult.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitDataExplorer.Results.Commits;
namespace GitDataExplorer.Results
{... | ```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using GitDataExplorer.Results.Commits;
namespace GitDataExplorer.Results
{
class ListSimpleCommitsResult : IResult
{
private char[] statusLetters = { 'M', 'A', 'R', 'C', 'D' };
public ExecutionResult Execu... | null | null |
Simplify `SSDT::new()` with fewer `unsafe` blocks
Apply this change to `kernel/acpi/ssdt.rs` and return the full updated file.
```rust
use core::ptr;
use super::SDTHeader;
#[repr(packed)]
#[derive(Clone, Copy, Debug, Default)]
pub struct SSDT {
pub header: SDTHeader,
pub data: &'static [u8]
}
impl SSDT {
... | ```rust
use core::ptr;
use super::SDTHeader;
#[repr(packed)]
#[derive(Clone, Copy, Debug, Default)]
pub struct SSDT {
pub header: SDTHeader,
pub data: &'static [u8]
}
impl SSDT {
pub fn new(header: *const SDTHeader) -> Option<Self> {
let header = unsafe { *header };
if header.valid("SSDT... | null | null |
Add link to where the async relay command is from
Apply this change to `AutoReservation.Ui/ViewModels/AsyncRelayCommand.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
name... | ```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace AutoReservation.Ui.ViewModels
{
/**
* From: http://blog.mycupof.net/2012/08/23/mvvm-asyncdelegatecommand-what-asyncawait-can-do-for-uidevelopment... | null | null |
Check assemblies reference System.Net.Http v4.0
Check all GitHub.* assemblies reference System.Net.Http v4.0.0.0.
Apply this change to `test/GitHub.VisualStudio.UnitTests/GitHubAssemblyTests.cs` and return the full updated file.
```csharp
using System.IO;
using System.Reflection;
using NUnit.Framework;
public clas... | ```csharp
using System;
using System.IO;
using System.Reflection;
using NUnit.Framework;
public class GitHubAssemblyTests
{
[Theory]
public void GitHub_Assembly_Should_Not_Reference_DesignTime_Assembly(string assemblyFile)
{
var asm = Assembly.LoadFrom(assemblyFile);
foreach (var reference... | null | null |
Add support for agent forwarding
Apply this change to `plugins/ssh-agent/ssh-agent.plugin.zsh` and return the full updated file.
```bash
# Based on code from Joseph M. Reagle
# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
local SSH_ENV=$HOME/.ssh/environment-$HOST
function start_agent {
/usr/bin/env ssh-... | ```bash
#
# INSTRUCTIONS
#
# To enabled agent forwarding support add the following to
# your .zshrc file:
#
# zstyle :omz:plugins:ssh-agent agent-forwarding on
#
#
# CREDITS
#
# Based on code from Joseph M. Reagle
# http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html
#
# Agent forwarding support based o... | null | null |
Add the OS to the User-Agent header, as in Macintosh or iOS.
Apply this change to `Frameworks/RSWeb/RSWeb/UserAgent.swift` and return the full updated file.
```swift
//
// UserAgent.swift
// RSWeb
//
// Created by Brent Simmons on 8/27/16.
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
//
impor... | ```swift
//
// UserAgent.swift
// RSWeb
//
// Created by Brent Simmons on 8/27/16.
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
//
import Foundation
public struct UserAgent {
public static func fromInfoPlist() -> String? {
guard let userAgentName = Bundle.main.object(forInfoDictionaryKey... | null | null |
Clean up install-deps debug stuff
Apply this change to `bin/install_deps.sh` and return the full updated file.
```bash
# This is here so we can build with Travis; if you just want to use the
# library then you would probably be better off linking to a packaged
# version of libmarquise.
sudo apt-get install -y autoco... | ```bash
# This is here so we can build with Travis; if you just want to use the
# library then you would probably be better off linking to a packaged
# version of libmarquise.
sudo apt-get install -y autoconf libtool automake build-essential libglib2.0-dev libprotobuf-c0-dev protobuf-c-compiler
mkdir -p deps/
cd deps
... | null | null |
Migrate Mobile Config plugin to tsx
Summary: This diff migrates the Mobile config plugin to typescript. In the later diffs, I will refactor the logic of the plugin to use persisted state as it can then be used to export the data, which is required for the litho support form.
Reviewed By: jknoxville
Differential Revi... | ```typescript
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
declare module 'react-virtualized' {
const AutoSizer: any;
const Collection: any;
const CellMeasurerCache: any;
cons... | null | null |
Revert "Bux in variable name"
In favour of 3564cc2bfffac78fd7f85f1f2cd9bfbbaa45bf6e.
This reverts commit b57c8258a0932719143c9205b411524e8c4d006d.
Apply this change to `app/model/repository/Roles.php` and return the full updated file.
```php
<?php
namespace App\Model\Repository;
use Nette;
use DateTime;
use Kdyby... | ```php
<?php
namespace App\Model\Repository;
use Nette;
use DateTime;
use Kdyby\Doctrine\EntityManager;
use App\Model\Entity\Role;
class Roles extends BaseRepository {
public function __construct(EntityManager $em) {
parent::__construct($em, Role::CLASS);
}
public function findLowestLevelRoles() {
r... | null | null |
Update view definition to match renamed access context group roles table
Apply this change to `sql/wf_ac_perms_v.sql` and return the full updated file.
```sql
CREATE OR REPLACE VIEW wf_ac_perms_v AS
SELECT ac.ns_id, ac.group_id, gu.user_id, ac.role_id, rdas.doctype_id, rdas.docaction_id
FROM wf_access_contexts ac
JOI... | ```sql
CREATE OR REPLACE VIEW wf_ac_perms_v AS
SELECT ac_grs.ns_id, ac_grs.group_id, gu.user_id, ac_grs.role_id, rdas.doctype_id, rdas.docaction_id
FROM wf_ac_group_roles ac_grs
JOIN wf_group_users gu ON ac_grs.group_id = gu.group_id
JOIN wf_role_docactions rdas ON ac_grs.role_id = rdas.role_id;
``` | null | null |
Validate required env vars existence
Apply this change to `config/config.go` and return the full updated file.
```go
package config
import (
"bytes"
"github.com/eyecuelab/kit/assets"
"github.com/spf13/viper"
)
func Load(envPrefix string, configPath string) error {
viper.SetConfigType("yaml")
if len(configPat... | ```go
package config
import (
"bytes"
"errors"
"fmt"
"github.com/eyecuelab/kit/assets"
"github.com/spf13/viper"
)
func Load(envPrefix string, configPath string) error {
viper.SetConfigType("yaml")
if len(configPath) > 0 {
viper.SetConfigFile(configPath)
if err := viper.ReadInConfig(); err != nil {
ret... | null | null |
Use relative paths for includes.
Apply this change to `third_party/omnilog/tests/test.mod_omnilog.php` and return the full updated file.
```php
<?php if ( ! defined('BASEPATH')) exit('Invalid file request.');
/**
* OmniLog module tests.
*
* @author Stephen Lewis <stephen@experienceinternet.co.uk>
* @cop... | ```php
<?php if ( ! defined('BASEPATH')) exit('Invalid file request.');
/**
* OmniLog module tests.
*
* @author Stephen Lewis <stephen@experienceinternet.co.uk>
* @copyright Experience Internet
* @package Omnilog
*/
require_once dirname(__FILE__) .'/../mcp.omnilog.php';
require_once dirname(__F... | null | null |
Refactoring: Replace single quotes -> double quotes
Apply this change to `angular-typescript-webpack-jasmine/webpack/loaders.js` and return the full updated file.
```javascript
module.exports = [
{
test: /\.ts(x?)$/,
loader: 'ts-loader'
}, {
test: /\.css$/,
loader: 'style-loade... | ```javascript
module.exports = [
{
test: /\.ts(x?)$/,
loader: "ts-loader"
}, {
test: /\.css$/,
loader: "style-loader!css-loader"
}, {
test: /\.scss$/,
loader: "style-loader!css-loader!sass-loader"
}, {
test: /\.html$/,
exclude: /node_module... | null | null |
Add tests to main testacular test file
rherlitz/GooEngine#52
Apply this change to `test/main-test.js` and return the full updated file.
```javascript
require.config({
paths: {
"goo": "src/goo",
"test": "test"
},
waitSeconds: 5
});
require([
// Require does not allow us to add depend... | ```javascript
require.config({
paths: {
"goo": "src/goo",
"test": "test"
},
waitSeconds: 5
});
require([
// Require does not allow us to add dependencies with wildcards...
'test/math/MathUtils',
'test/math/Matrix',
'test/math/Matrix2x2',
'test/math/Matrix3x3',
'test... | null | null |
Add cypress test of /shows route
Apply this change to `cypress/integration/shows.spec.ts` and return the full updated file.
```typescript
/* eslint-disable jest/expect-expect */
import { visitWithStatusRetries } from "../helpers/visitWithStatusRetries"
describe("Shows", () => {
it("/shows", () => {
visitWithSt... | ```typescript
/* eslint-disable jest/expect-expect */
import { visitWithStatusRetries } from "../helpers/visitWithStatusRetries"
describe("Shows", () => {
it("/shows", () => {
visitWithStatusRetries("shows")
cy.get("h1").should("contain", "Featured Shows")
cy.title().should("eq", "Art Gallery Shows and M... | null | null |
Rename LoadPseudo to just Load
Apply this change to `src/main/kotlin/venus/assembler/PseudoDispatcher.kt` and return the full updated file.
```kotlin
package venus.assembler
import venus.assembler.pseudos.* // ktlint-disable no-wildcard-imports
/** Describes each instruction for writing */
enum class PseudoDispatch... | ```kotlin
package venus.assembler
import venus.assembler.pseudos.* // ktlint-disable no-wildcard-imports
/** Describes each instruction for writing */
enum class PseudoDispatcher(val pw: PseudoWriter) {
j(J),
jal(JAL),
jalr(JALR),
jr(JR),
la(LA),
lb(Load),
lbu(Load),
lh(Load),
lhu(... | null | null |
Remove idiotic "-" from script
Apply this change to `create_symlinks.sh` and return the full updated file.
```bash
#!/bin/bash
-rm dist themes site
ln -s ../../frontend/components/lib/semantic-ui/dist dist
ln -s ../../frontend/components/lib/semantic-ui/themes themes
ln -s ../../frontend/components/lib/semantic-ui/s... | ```bash
#!/bin/bash
rm dist themes site
ln -s ../../frontend/components/lib/semantic-ui/dist dist
ln -s ../../frontend/components/lib/semantic-ui/themes themes
ln -s ../../frontend/components/lib/semantic-ui/src site
``` | null | null |
Disable provider filtering for Alexa
Disable filtering of external authentication schemes to investigate #36.
Apply this change to `src/LondonTravel.Site/Views/Shared/_SignInForm.cshtml` and return the full updated file.
```csharp
@inject Microsoft.AspNetCore.Identity.SignInManager<LondonTravelUser> SignInManager
@... | ```csharp
@inject Microsoft.AspNetCore.Identity.SignInManager<LondonTravelUser> SignInManager
@{
var providers = SignInManager.GetExternalAuthenticationSchemes()
.OrderBy((p) => p.DisplayName)
.ThenBy((p) => p.AuthenticationScheme)
.ToList();
/*
var schemesToShow = ViewData["Authen... | null | null |
Add missing import for string.h
Apply this change to `spec/runtime/helpers/spy_reader.cc` and return the full updated file.
```cpp
#include "runtime/helpers/spy_reader.h"
#include <algorithm>
using std::string;
static const char * spy_read(void *data, size_t *bytes_read) {
SpyReader *reader = static_cast<SpyReade... | ```cpp
#include "runtime/helpers/spy_reader.h"
#include <string.h>
#include <algorithm>
using std::string;
static const char * spy_read(void *data, size_t *bytes_read) {
SpyReader *reader = static_cast<SpyReader *>(data);
string result = reader->content.substr(reader->position, reader->chunk_size);
reader->posi... | null | null |
Add condition on scan of pci.ids to exclude sub-classes from being caught up as a device.
Apply this change to `pkg/pci/parse.go` and return the full updated file.
```go
package pci
import (
"bufio"
"bytes"
)
func isHex(b byte) bool {
return ('a' <= b && b <= 'f') || ('A' <= b && b <= 'F') || ('0' <= b && b <= '... | ```go
package pci
import (
"bufio"
"bytes"
)
func isHex(b byte) bool {
return ('a' <= b && b <= 'f') || ('A' <= b && b <= 'F') || ('0' <= b && b <= '9')
}
// scan searches for Vendor and Device lines from the input *bufio.Scanner based
// on pci.ids format. Found Vendors and Devices are added to the input ids map... | null | null |
Add a triple to this test so it passes for targets where alignof(double)
really should be equal to alignof(float).
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@352102 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `test/CXX/dcl.dcl/dcl.attr/dcl.align/p8.cpp` and return the full updated file.
```cp... | ```cpp
// RUN: %clang_cc1 -std=c++11 -verify %s -triple x86_64-linux-gnu
alignas(double) void f(); // expected-error {{'alignas' attribute only applies to variables, data members and tag types}}
alignas(double) unsigned char c[sizeof(double)]; // expected-note {{previous}}
extern unsigned char c[sizeof(double)];
align... | null | null |
Refactor GraphColumns to use a Set()
Apply this change to `packages/gitgraph-core/src/graph-columns.ts` and return the full updated file.
```typescript
import Branch from "./branch";
import Commit from "./commit";
export class GraphColumns<TNode> {
private columns: Array<Branch["name"]> = [];
/**
* Compute t... | ```typescript
import Branch from "./branch";
import Commit from "./commit";
export class GraphColumns<TNode> {
private branches: Set<Branch["name"]> = new Set();
public constructor(commits: Array<Commit<TNode>>) {
commits.forEach((commit) => this.branches.add(commit.branchToDisplay));
}
/**
* Return t... | null | null |
Add application test for “too many arguments”.
Apply this change to `src/test/java/com/skraylabs/poker/ApplicationTest.java` and return the full updated file.
```java
package com.skraylabs.poker;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.containsString;
import static org.... | ```java
package com.skraylabs.poker;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io... | null | null |
Delete break from the test
Apply this change to `src/WtsApi32.Tests/WtsApi32Facts.cs` and return the full updated file.
```csharp
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the projec... | ```csharp
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
using System;
using System.Linq;
using PInvoke;
using Xunit;
using Xunit.Abstraction... | null | null |
Remove get user service method
Apply this change to `capstone-project/src/main/angular-webapp/src/app/authentication/authentication.component.ts` and return the full updated file.
```typescript
import { Component, OnInit } from '@angular/core';
import { SocialAuthService, GoogleLoginProvider, SocialUser } from "angul... | ```typescript
import { Component, OnInit } from '@angular/core';
import { SocialAuthService, GoogleLoginProvider, SocialUser } from "angularx-social-login";
import { UserService } from "../user.service";
@Component({
selector: 'app-authentication',
templateUrl: './authentication.component.html',
styleUrls: ['./a... | null | null |
Add unit test to verify javacc dependency configuration
Apply this change to `subprojects/plugin/src/test/java/ca/coglinc/gradle/plugins/javacc/JavaccPluginTest.java` and return the full updated file.
```java
package ca.coglinc.gradle.plugins.javacc;
import java.util.HashMap;
import java.util.Map;
import org.gradle... | ```java
package ca.coglinc.gradle.plugins.javacc;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
import org.gradle.testfixtures.ProjectBuilder;
import org.junit.Before;
i... | null | null |
Change size of inline images
Apply this change to `config/config.app.php` and return the full updated file.
```php
<?php
/**
*
*
* @author Knut Kohl <github@knutkohl.de>
* @copyright 2012-2013 Knut Kohl
* @license GNU General Public License http://www.gnu.org/licenses/gpl.txt
* @version $Id$
*/
... | ```php
<?php
/**
*
*
* @author Knut Kohl <github@knutkohl.de>
* @copyright 2012-2013 Knut Kohl
* @license GNU General Public License http://www.gnu.org/licenses/gpl.txt
* @version $Id$
*/
return array(
// -----------------------------------------------------------------------
// INTERNAL SETTIN... | null | null |
Test automatic generation of checksums
Apply this change to `tests/MessageTest.php` and return the full updated file.
```php
<?php
use Icmp\Message;
use Icmp\Icmp;
use React\EventLoop\Factory;
class MessageTest extends TestCase
{
public function testGetters()
{
$message = new Message(1, 2, null, 3, ... | ```php
<?php
use Icmp\Message;
use Icmp\Icmp;
use React\EventLoop\Factory;
class MessageTest extends TestCase
{
public function testGetters()
{
$message = new Message(1, 2, 3, 4, 'payload');
$this->assertEquals(1, $message->getType());
$this->assertEquals(2, $message->getCode());
... | null | null |
Add `date` column to SQL script.
Apply this change to `resources/sql/standard.sql` and return the full updated file.
```sql
CREATE TABLE `xsolla_standard_user` (
`v1` VARCHAR(255) NOT NULL,
`v2` VARCHAR(200) NULL DEFAULT NULL,
`v3` VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (`v1`))
ENGINE = InnoDB
DEFAUL... | ```sql
CREATE TABLE `xsolla_standard_user` (
`v1` VARCHAR(255) NOT NULL,
`v2` VARCHAR(200) NULL DEFAULT NULL,
`v3` VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (`v1`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;
CREATE TABLE `xsolla_standard_invoice` (
`id` INT NOT NULL AUTO_... | null | null |
Add test for register/unregister in event class map.
Apply this change to `src/test/Apha/EventStore/EventClassMap.spec.ts` and return the full updated file.
```typescript
import {expect} from "chai";
import {EventClassMap} from "../../../main/Apha/EventStore/EventClassMap";
import {Event, EventType} from "../../../m... | ```typescript
import {expect} from "chai";
import {EventClassMap} from "../../../main/Apha/EventStore/EventClassMap";
import {Event, EventType} from "../../../main/Apha/Message/Event";
import {UnknownEventException} from "../../../main/Apha/EventStore/UnknownEventException";
describe("EventClassMap", () => {
desc... | null | null |
Use hashbang routing while on github pages
Apply this change to `app/appConfig.js` and return the full updated file.
```javascript
// This config file does not define any routes.
// For module-level route definitions, use the *Routes.js files found in the module folders.
'use strict';
function appConfig($urlRouterP... | ```javascript
// This config file does not define any routes.
// For module-level route definitions, use the *Routes.js files found in the module folders.
'use strict';
function appConfig($urlRouterProvider, $locationProvider, $breadcrumbProvider) {
$locationProvider.html5Mode(false).hashPrefix('!');
// For ... | null | null |
Remove mildly useful but highly dangerous debug feature.
Apply this change to `classes/config.php` and return the full updated file.
```php
<?php
class Config {
public function __construct() {
$raw_config = file_get_contents(__DIR__ . '/../config.json');
if (!$raw_config) {
throw new FileNotFoundExce... | ```php
<?php
class Config {
public function __construct() {
$raw_config = file_get_contents(__DIR__ . '/../config.json');
if (!$raw_config) {
throw new FileNotFoundException('Unable to load config.');
}
$vars = json_decode($raw_config, true /* as array */);
$this->vars = [];
foreach ($v... | null | null |
Add optimizations to problem 10
Apply this change to `BasicDataStructures/10.PythagoreanNumbers/PythagoreanNumbers.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _10.PythagoreanNumbers
{
... | ```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _10.PythagoreanNumbers
{
class PythagoreanNumbers
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int[] num... | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.