original_prompt stringlengths 327 2.5k | original_completion stringlengths 22 2.84k | enhanced_prompt float64 | enhanced_completion float64 |
|---|---|---|---|
Make the data remote js more generic, triggers events
Apply this change to `public/javascripts/application.js` and return the full updated file.
```javascript
$(document).ready(function(){
$('form[data-remote=true]').on('submit', function(e){
var method, form, action, methodOveride, params;
form = $(this);
... | ```javascript
$(document).ready(function(){
// Remote form hadler
$('form[data-remote=true]').on('submit', function(e){
var method, form, action, methodOveride, params;
form = $(this);
action = form.attr("action");
method = form.attr("method");
method = method || 'get';
params = form.serial... | null | null |
Return sheets, not header, data
Apply this change to `mfr/extensions/tabular/libs/ezodf_tools.py` and return the full updated file.
```python
""" This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import d... | ```python
""" This library works for some ods files but not others. Because it doesn't
work consistently, we have disabled this for the moment."""
import ezodf
from ..utilities import data_population, header_population
def ods_ezodf(fp):
"""Read and convert a ods file to JSON format using the ezodf library
:... | null | null |
lexer.Consume(): Add test for insignificant comma
Apply this change to `internal/common/lexer_test.go` and return the full updated file.
```go
package common_test
import (
"testing"
"github.com/graph-gophers/graphql-go/internal/common"
)
type consumeTestCase struct {
description string
definition string
expe... | ```go
package common_test
import (
"testing"
"github.com/graph-gophers/graphql-go/internal/common"
)
type consumeTestCase struct {
description string
definition string
expected string // expected description
}
var consumeTests = []consumeTestCase{{
description: "initial test",
definition: `
# Comment li... | null | null |
Make the proxy server listen port configurable
Apply this change to `turbulence.go` and return the full updated file.
```go
package main
import (
"net"
"os"
)
func handleConnection(conn net.Conn) {
connection := NewConnection(conn)
defer connection.Close()
connection.Handle()
}
func acceptedConnsChannel(liste... | ```go
package main
import (
"net"
"os"
"flag"
"strconv"
)
func handleConnection(conn net.Conn) {
connection := NewConnection(conn)
defer connection.Close()
connection.Handle()
}
func acceptedConnsChannel(listener net.Listener) chan net.Conn {
channel := make(chan net.Conn)
go func() {
for {
conn, err :... | null | null |
Add update timestamp to retrieved columns
Apply this change to `sql/selectOrganization.sql` and return the full updated file.
```sql
DROP PROCEDURE IF EXISTS selectOrganization;
DELIMITER $$
CREATE PROCEDURE selectOrganization(p_orgid INT UNSIGNED)
BEGIN
SELECT org.orgid, org.org_name, usr.person_name, usr.ema... | ```sql
DROP PROCEDURE IF EXISTS selectOrganization;
DELIMITER $$
CREATE PROCEDURE selectOrganization(p_orgid INT UNSIGNED)
BEGIN
SELECT org.orgid, org.org_name, usr.person_name, usr.email, usr.email_is_verified, org.user_id, org.update_timestamp,
org.org_website, org.money_url, org.mission, org.abbreviated_nam... | null | null |
Fix Swift/T on Dunedin, use which_check()
Apply this change to `workflows/common/sh/langs-dunedin.sh` and return the full updated file.
```bash
# LANGS DUNEDIN
# Language settings for Dunedin
# Assumes WORKFLOWS_ROOT is set
# # Python
# COMMON_DIR=$WORKFLOWS_ROOT/common/python
# export PYTHONPATH=${PYTHONPATH:-}${P... | ```bash
# LANGS DUNEDIN
# Language settings for Dunedin
# Assumes WORKFLOWS_ROOT is set
# # Python
# COMMON_DIR=$WORKFLOWS_ROOT/common/python
# export PYTHONPATH=${PYTHONPATH:-}${PYTHONPATH:+:}
# PYTHONPATH+=$EMEWS_PROJECT_ROOT/python:
# PYTHONPATH+=$BENCHMARK_DIR:
# PYTHONPATH+=$BENCHMARKS_ROOT/common:
# PYTHONPATH+... | null | null |
Improve they way contact is printed
Apply this change to `src/main/java/com/antonioleiva/kataagenda/ui/SysOutContactsListView.kt` and return the full updated file.
```kotlin
package com.antonioleiva.kataagenda.ui
import com.antonioleiva.kataagenda.domain.Contact
class SysOutContactsListView : ContactsListPresenter.... | ```kotlin
package com.antonioleiva.kataagenda.ui
import com.antonioleiva.kataagenda.domain.Contact
class SysOutContactsListView : ContactsListPresenter.View {
override fun showWelcomeMessage() {
println("Welcome to your awesome agenda!")
println("I'm going to ask you about some of your contacts i... | null | null |
Add more processing for removing style tags in entries
Apply this change to `sstannouncer/app/src/main/java/sst/com/anouncements/feed/data/Entry.kt` and return the full updated file.
```kotlin
package sst.com.anouncements.feed.data
import org.apache.commons.text.StringEscapeUtils
import java.text.SimpleDateFormat
im... | ```kotlin
package sst.com.anouncements.feed.data
import org.apache.commons.text.StringEscapeUtils
import java.text.SimpleDateFormat
import java.util.*
data class Entry(
val id: String,
val publishedDate: Date,
val updatedDate: Date,
val authorName: String,
val url: String,
val title: String,
... | null | null |
Remove discrete install of make RPM as it's already a base dependency
Apply this change to `scripts/virtualbox.sh` and return the full updated file.
```bash
#!/bin/bash
# Install the VirtualBox Guest Additions from an ISO.
yum -y install gcc make kernel-devel-`uname -r`
VBOX_VERSION=$(cat /tmp/.vbox_version)
cd /tm... | ```bash
#!/bin/bash
# Install the VirtualBox Guest Additions from an ISO.
yum -y install gcc kernel-devel-`uname -r`
VBOX_VERSION=$(cat /tmp/.vbox_version)
cd /tmp
mount -o loop /tmp/VBoxGuestAdditions_$VBOX_VERSION.iso /media
sh /media/VBoxLinuxAdditions.run
umount /media
rm -rf /tmp/VBoxGuestAdditions_*.iso
``` | null | null |
Test for DB_URL being present in environment.
Apply this change to `tracker/src/main/tracker/util/connection.py` and return the full updated file.
```python
import os
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from sqlalchemy.orm.scopi... | ```python
import os
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from sqlalchemy.orm.scoping import scoped_session
DB_URL = os.environ['DB_URL']
if not DB_URL:
raise ValueError("DB_URL not present in the environment")
Base = automap... | null | null |
Fix forgotten case in previous commit.
Apply this change to `src/structures/congruence_atom.cpp` and return the full updated file.
```cpp
#include <cassert>
#include "structures/congruence_atom.h"
using namespace theorysolver;
Term::Term(unsigned int symbol_id) : type(Term::SYMBOL), symbol_id(symbol_id), function_... | ```cpp
#include <cassert>
#include "structures/congruence_atom.h"
using namespace theorysolver;
Term::Term(unsigned int symbol_id) : type(Term::SYMBOL), symbol_id(symbol_id), function_name(), arguments() {
}
Term::Term(std::string function_name, std::vector<std::shared_ptr<Term>> arguments) : type(Term::FUNCTION), s... | null | null |
Fix tests for clear command
Apply this change to `src/test/java/guitests/ClearCommandTest.java` and return the full updated file.
```java
//@@author A0142102E
package guitests;
import seedu.tasklist.testutil.TypicalTestTasks;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class ClearComm... | ```java
//@@author A0142102E
package guitests;
import seedu.tasklist.testutil.TypicalTestTasks;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class ClearCommandTest extends TaskListGuiTest {
@Test
public void clear() {
//verify a non-empty list can be cleared
ass... | null | null |
Add gridImageId to continueReading fragments
Apply this change to `packages/lesswrong/components/recommendations/withContinueReading.js` and return the full updated file.
```javascript
import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import { getFragment } from 'meteor/vulcan:core';
export cons... | ```javascript
import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import { getFragment } from 'meteor/vulcan:core';
export const withContinueReading = component => {
// FIXME: For some unclear reason, using a ...fragment in the 'sequence' part
// of this query doesn't work (leads to a 400 Bad Re... | null | null |
Set schedule status as OPEN when it is created
Apply this change to `src/main/java/com/jmb/springfactory/service/productionschedule/ProductionScheduleServiceImpl.java` and return the full updated file.
```java
package com.jmb.springfactory.service.productionschedule;
import org.springframework.beans.factory.annotati... | ```java
package com.jmb.springfactory.service.productionschedule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jmb.springfactory.dao.GenericMySQLService;
import com.jmb.springfactory.dao.productionschedule.ProductionScheduleMySQLService;
impo... | null | null |
Change dividend for all benchmark tests to 1024
Apply this change to `division_test.go` and return the full updated file.
```go
package main
import (
"testing"
)
func BenchmarkDivisionMod(b *testing.B) {
d := NewDivisionMod(1000)
// run the dividable check function b.N times
for n := 0; n < b.N; n++ {
d.IsRes... | ```go
package main
import (
"testing"
)
func BenchmarkDivisionMod(b *testing.B) {
d := NewDivisionMod(1024)
// run the dividable check function b.N times
for n := 0; n < b.N; n++ {
d.IsRestlessDividable(uint64(n))
}
}
func BenchmarkDivisionPow2(b *testing.B) {
d := NewDivisionPow2(1024)
// run the dividable... | null | null |
Use dynamicType instead of hardcoding the name of the xib
Apply this change to `BothamUI/BothamCustomView.swift` and return the full updated file.
```swift
//
// BothamCustomView.swift
// BothamUI
//
// Created by Davide Mendolia on 23/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import Found... | ```swift
//
// BothamCustomView.swift
// BothamUI
//
// Created by Davide Mendolia on 23/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import Foundation
public class BothamCustomView: UIView {
var view: UIView!
public override init(frame: CGRect) {
super.init(frame: frame)
... | null | null |
Add simple test of assert_eq!.
Apply this change to `test/std.rs` and return the full updated file.
```rust
#![feature(custom_attribute, box_syntax)]
#![allow(dead_code, unused_attributes)]
#[miri_run]
fn rc_cell() -> i32 {
use std::rc::Rc;
use std::cell::Cell;
let r = Rc::new(Cell::new(42));
let x =... | ```rust
#![feature(custom_attribute, box_syntax)]
#![allow(dead_code, unused_attributes)]
#[miri_run]
fn rc_cell() -> i32 {
use std::rc::Rc;
use std::cell::Cell;
let r = Rc::new(Cell::new(42));
let x = r.get();
r.set(x + x);
r.get()
}
#[miri_run]
fn arc() -> i32 {
use std::sync::Arc;
l... | null | null |
Remove author name from rustup-setup UI
Apply this change to `src/multirust-cli/setup_mode.rs` and return the full updated file.
```rust
use std::env;
use self_update;
use multirust::Result;
use clap::{App, Arg};
pub fn main() -> Result<()> {
let args: Vec<_> = env::args().collect();
let arg1 = args.get(1).m... | ```rust
use std::env;
use self_update;
use multirust::Result;
use clap::{App, Arg};
pub fn main() -> Result<()> {
let args: Vec<_> = env::args().collect();
let arg1 = args.get(1).map(|a| &**a);
// Secret command used during self-update. Not for users.
if arg1 == Some("--self-replace") {
return... | null | null |
Add support for Objective-C++ '.mm' files
Apply this change to `Sources/Code/GenStringsCommander.swift` and return the full updated file.
```swift
//
// GenStringsCommander.swift
// BartyCrouch
//
// Created by Cihat Gündüz on 03.05.16.
// Copyright © 2016 Flinesoft. All rights reserved.
//
import Foundation
//... | ```swift
//
// GenStringsCommander.swift
// BartyCrouch
//
// Created by Cihat Gündüz on 03.05.16.
// Copyright © 2016 Flinesoft. All rights reserved.
//
import Foundation
/// Sends `genstrings` commands with specified input/output paths to bash.
public class GenStringsCommander {
// MARK: - Stored Class... | null | null |
Update plugin org.jetbrains.kotlin.kapt to v1.6.0-RC2
Apply this change to `settings.gradle.kts` and return the full updated file.
```kotlin
pluginManagement {
repositories {
gradlePluginPortal()
}
plugins {
id("com.diffplug.eclipse.apt") version "3.33.1"
id("com.diffplug.spotless"... | ```kotlin
pluginManagement {
repositories {
gradlePluginPortal()
}
plugins {
id("com.diffplug.eclipse.apt") version "3.33.1"
id("com.diffplug.spotless") version "5.17.1"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("net.researchgate.release") version... | null | null |
Hide TabControl's dropdown's header when no items are inside the dropdown.
Apply this change to `osu.Framework/Graphics/UserInterface/Tab/TabDropDownMenu.cs` and return the full updated file.
```csharp
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubuse... | ```csharp
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System.Linq;
namespace osu.Framework.Graphics.UserInterface.Tab
{
public abstract class TabDropDownMenu<T> : DropDownMenu<T>
... | null | null |
Add description to :build-option project
Apply this change to `subprojects/build-option/build.gradle.kts` and return the full updated file.
```kotlin
plugins {
id("gradlebuild.distribution.api-java")
}
gradlebuildJava.usedInWorkers()
dependencies {
implementation(project(":cli"))
implementation(project... | ```kotlin
plugins {
id("gradlebuild.distribution.api-java")
}
description = "The Gradle build option parser."
gradlebuildJava.usedInWorkers()
dependencies {
implementation(project(":cli"))
implementation(project(":base-annotations"))
implementation(libs.commonsLang)
}
``` | null | null |
Add support for PHP's built-in server
Apply this change to `public/index.php` and return the full updated file.
```php
<?php
require __DIR__ . '/../vendor/autoload.php';
session_start();
// Instantiate the app
$settings = require __DIR__ . '/../app/settings.php';
$app = new \Slim\App($settings);
// Set up dependen... | ```php
<?php
if (PHP_SAPI == 'cli-server') {
// To help the built-in PHP dev server, check if the request was actually for
// something which should probably be served as a static file
$file = __DIR__ . $_SERVER['REQUEST_URI'];
if (is_file($file)) {
return false;
}
}
require __DIR__ . '/..... | null | null |
Adjust a comment line that prevents cloud from deploying
Apply this change to `deployments/schema/postgres/1000_schema.sql` and return the full updated file.
```sql
--
-- PostgreSQL database dump
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedura... | ```sql
--
-- PostgreSQL database dump
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
CREATE FUNCTION update_updated_at_column() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$;
CREATE TABLE deployment_tracker (
id integer NOT N... | null | null |
Update link to Kotlin Conf.
Apply this change to `app/src/banner/banner.tsx` and return the full updated file.
```typescript
import * as React from "react";
const styles = require("./banner.less");
export function Banner() {
return (
<a className={styles.conference_banner} href="https://kotlinconf.com">... | ```typescript
import * as React from "react";
const styles = require("./banner.less");
export function Banner() {
return (
<a className={styles.conference_banner}
href="https://kotlinconf.com/?utm_source=kotlinlink&utm_medium=web">
<div className={styles.conference_banner__img}/>
... | null | null |
Fix a SQL syntax error
Add parentheses around "now() at time zone 'UTC'" in a column
definition requires to avoid a SQL syntax error.
Apply this change to `kmtool/db/postgresql/schema.sql` and return the full updated file.
```sql
-- avoid innocuous NOTICEs about automatic sequence creation
set client_min_messages='W... | ```sql
-- avoid innocuous NOTICEs about automatic sequence creation
set client_min_messages='WARNING';
-- Tell psql to stop on an error. Default behavior is to proceed.
\set ON_ERROR_STOP 1
-- Tables for the KM
-- ----------------------------------------------------------------------
DROP TABLE IF EXISTS km_asserted... | null | null |
Set log limit back to 3.5 megabytes
Apply this change to `source/logging.c` and return the full updated file.
```c
#include "logging.h"
void error_log(const char *format, ...){
FILE *flog;
//If the log file is over 3.5 megabytes, empty it and start again
struct stat st;
if (!stat(log_filename, &st) && st.st_size... | ```c
#include "logging.h"
void error_log(const char *format, ...){
FILE *flog;
//If the log file is over 3.5 megabytes, empty it and start again
struct stat st;
if (!stat(log_filename, &st) && st.st_size >= 3670016) //1048576 per megabyte
flog = fopen(log_filename, "w+");
else flog = fopen(log_filename, "a+");
... | null | null |
Add explicit name to cookbook
Better than relying on cookbook directory and plays better with Berkshelf.
Apply this change to `metadata.rb` and return the full updated file.
```ruby
maintainer "Bryan Berry"
maintainer_email "bryan.berry@gmail.com"
license "Apache 2.0"
description "Installs and co... | ```ruby
name "minitest-handler"
maintainer "Bryan Berry"
maintainer_email "bryan.berry@gmail.com"
license "Apache 2.0"
description "Installs and configures minitest-chef-handler"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.1.3"
depends "c... | null | null |
Increase signature verification test timeout
Apply this change to `Core/src/androidTest/java/com/braintreepayments/api/internal/SignatureVerificationTest.java` and return the full updated file.
```java
package com.braintreepayments.api.internal;
import android.os.SystemClock;
import android.support.test.runner.Andro... | ```java
package com.braintreepayments.api.internal;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.SystemClock;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import android.util.Log;
... | null | null |
Use bash, pipefail is a bash option...
Apply this change to `build/test-and-coverage.sh` and return the full updated file.
```bash
#!/bin/sh
# Test each Go package separately, as go test does not support
# writing coverage profiles for multiple packages into a single file.
: > coverage.txt
: > report-golang.txt
mkdir... | ```bash
#!/bin/bash
# Test each Go package separately, as go test does not support
# writing coverage profiles for multiple packages into a single file.
: > coverage.txt
: > report-golang.txt
mkdir -p "${CIRCLE_TEST_REPORTS}/golang"
RET=0
set -o pipefail
for d in $(go list "${IMPORT_PATH}/..." | grep -v vendor); do
g... | null | null |
Use COALESCE on autobarcode trigger to avoid writing NULL
Apply this change to `files/installer/triggers/autoCopyNumberAndBarcode.sql` and return the full updated file.
```sql
-- trigger for å øke eksemplarnummer på biblios automatisk
-- bruker coalesce for å defaulte til 1 hvis ingen eksemplarer fra før
-- legger og... | ```sql
-- trigger for å øke eksemplarnummer på biblios automatisk
-- bruker coalesce for å defaulte til 1 hvis ingen eksemplarer fra før
-- legger også på strekkode inkrementert med 1
DROP TRIGGER IF EXISTS autoCopyNumberAndBarcode;
DELIMITER $$;
CREATE TRIGGER autoCopyNumberAndBarcode BEFORE INSERT ON items
FOR EACH R... | null | null |
Use http instead of https in repo URL
Apply this change to `scripts/jenkins/install_packages_from_repo.sh` and return the full updated file.
```bash
#!/bin/sh
# Build R packages from source tar files on the EOL repo
# install to the first site library, .Library.site[1].
pkgs="c('eolts','isfs','eolsonde')"
rlib=$(R... | ```bash
#!/bin/sh
# Build R packages from source tar files on the EOL repo
# install to the first site library, .Library.site[1].
pkgs="c('eolts','isfs','eolsonde')"
rlib=$(R --vanilla --slave -e 'cat(.Library.site[1])')
if [ ! -d $rlib ]; then
echo "$rlib not found"
exit 1
fi
R --vanilla -e "tryCatch(inst... | null | null |
Replace equals and compareTo with FastByteComparison
Apply this change to `ethereumj-core/src/main/java/org/ethereum/db/ByteArrayWrapper.java` and return the full updated file.
```java
package org.ethereum.db;
import com.google.common.primitives.UnsignedBytes;
import java.util.Arrays;
import java.util.Comparator;
... | ```java
package org.ethereum.db;
import java.util.Arrays;
import org.ethereum.util.FastByteComparisons;
/**
* www.ethereumJ.com
*
* @author: Roman Mandeleil Created on: 11/06/2014 15:02
*/
public class ByteArrayWrapper implements Comparable<ByteArrayWrapper> {
private final byte[] data;
public ByteArrayWrap... | null | null |
Change AboutComponent member variables to 'public'
Apply this change to `src/app/components/about/about.component.ts` and return the full updated file.
```typescript
import { Component, OnInit, AfterViewChecked } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { DocumentRef } from '../... | ```typescript
import { Component, OnInit, AfterViewChecked } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { DocumentRef } from '../../services/documentRef.service';
import { UserConfig } from '../../config/user.config';
@Component({
selector: 'about-component',
templateUrl: './ab... | null | null |
Add file basic graph basm test.
Apply this change to `bbvm-core/src/test/java/me/wener/bbvm/vm/BasmSpecTest.java` and return the full updated file.
```java
package me.wener.bbvm.vm;
import me.wener.bbvm.asm.ParseException;
import org.junit.Test;
import java.io.IOException;
import java.nio.file.Files;
import java.ni... | ```java
package me.wener.bbvm.vm;
import me.wener.bbvm.asm.ParseException;
import org.junit.Test;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
/**
* @author wener
* @since 15/12/18
*/
public class BasmSpecTest {
@Test
public void in() throws IOException, ParseExcepti... | null | null |
Improve exception message from previous commit.
Apply this change to `src/java/org/dellroad/stuff/pobj/PersistentObjectValidationException.java` and return the full updated file.
```java
/*
* Copyright (C) 2012 Archie L. Cobbs. All rights reserved.
*
* $Id$
*/
package org.dellroad.stuff.pobj;
import java.util.... | ```java
/*
* Copyright (C) 2012 Archie L. Cobbs. All rights reserved.
*
* $Id$
*/
package org.dellroad.stuff.pobj;
import java.util.Set;
import javax.validation.ConstraintViolation;
/**
* Runtime exception thrown during {@link PersistentObject} operations.
*/
@SuppressWarnings("serial")
public class Persiste... | null | null |
Use AppCompatActivity in example project
Apply this change to `example/src/main/java/me/mattlogan/artiste/example/MainActivity.java` and return the full updated file.
```java
package me.mattlogan.artiste.example;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
public class MainActivity ex... | ```java
package me.mattlogan.artiste.example;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.la... | null | null |
Use IListNodeBase instead of type redefinition.
Apply this change to `lib/ADT/IListIterator.cpp` and return the full updated file.
```cpp
//===- IListIterator.cpp --------------------------------------------------===//
//
// The Bold Project
//
// This file is distributed under the New BSD... | ```cpp
//===- IListIterator.cpp --------------------------------------------------===//
//
// The Bold Project
//
// This file is distributed under the New BSD License.
// See LICENSE for details.
//
//===----------------------------------------------------------------------===//
#include <... | null | null |
Add shortcut key to edit current file
Apply this change to `src/renderer/index.ts` and return the full updated file.
```typescript
///<reference path='user_settings_dialog.ts'/>
var remote = require('remote');
var fs = require('fs');
var path = require('path');
var settings = require('../browser/user_settings')
var ... | ```typescript
///<reference path='user_settings_dialog.ts'/>
var remote = require('remote');
var fs = require('fs');
var path = require('path');
var settings = require('../browser/user_settings')
var externalEditor = require('./../browser/external_editor');
var MainController = require('./main_controller');
var Naviga... | null | null |
Allow workshops to be favourited
Apply this change to `app/src/main/java/net/squanchy/eventdetails/widget/EventDetailsCoordinatorLayout.kt` and return the full updated file.
```kotlin
package net.squanchy.eventdetails.widget
import android.content.Context
import android.support.design.widget.CoordinatorLayout
import... | ```kotlin
package net.squanchy.eventdetails.widget
import android.content.Context
import android.support.design.widget.CoordinatorLayout
import android.util.AttributeSet
import androidx.view.isVisible
import kotlinx.android.synthetic.main.activity_event_details.view.*
import net.squanchy.R
import net.squanchy.schedule... | null | null |
Disable __WINCRYPT_H__ headers for Windows
Apply this change to `src/core/common.h` and return the full updated file.
```c
#ifndef OSSL_CORE_COMMON_H_INCLUDE
#define OSSL_CORE_COMMON_H_INCLUDE
#include <nan.h>
#include "logger.h"
#include "scoped_ssl.h"
#include "excep.h"
#include "key_exp.h"
#include "dig... | ```c
#ifndef OSSL_CORE_COMMON_H_INCLUDE
#define OSSL_CORE_COMMON_H_INCLUDE
#ifdef _WIN32
#define __WINCRYPT_H__
#endif
#include <nan.h>
#include "logger.h"
#include "scoped_ssl.h"
#include "excep.h"
#include "key_exp.h"
#include "digest.h"
#include "bn.h"
#include <openssl/bn.h>
#endif // OSSL_CORE... | null | null |
Use ES import to see if it works
Apply this change to `types/react-big-calendar/lib/addons/dragAndDrop.d.ts` and return the full updated file.
```typescript
import BigCalendar, { BigCalendarProps, Event, stringOrDate } from '../../index';
import React = require('react');
interface withDragAndDropProps<TEvent> {
on... | ```typescript
import BigCalendar, { BigCalendarProps, Event, stringOrDate } from '../../index';
import React from 'react';
interface withDragAndDropProps<TEvent> {
onEventDrop?: (args: { event: TEvent, start: stringOrDate, end: stringOrDate, allDay: boolean }) => void;
onEventResize?: (args: { event: TEvent, start... | null | null |
Reduce the requirements a little bit.
Apply this change to `setup.py` and return the full updated file.
```python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import sys
data = dict(
name='python-datetime_tz',
version='0.1',
author='Tim Ansell',
auth... | ```python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import sys
data = dict(
name='python-datetime_tz',
version='0.1',
author='Tim Ansell',
author_email='mithro@mithis.com',
packages=['datetime_tz'],
install_requires=['pytz'],
)
if sys.versi... | null | null |
Update the initial admin creation object when executing the environment for the first time with no User models. This update keeps the model consistent with the changes made to the User model.
Apply this change to `updates/0.0.1-admins.js` and return the full updated file.
```javascript
/**
* This script automatical... | ```javascript
/**
* This script automatically creates a default Admin user when an
* empty database is used for the first time. You can use this
* technique to insert data into any List you have defined.
*
* Alternatively, you can export a custom function for the update:
* module.exports = function(done) { ... }... | null | null |
Upgrade JUnit in buildSrc to latest
Apply this change to `buildSrc/subprojects/packaging/packaging.gradle.kts` and return the full updated file.
```kotlin
dependencies {
implementation(project(":build"))
implementation(project(":configuration"))
implementation(project(":kotlinDsl"))
implementation(pro... | ```kotlin
dependencies {
implementation(project(":build"))
implementation(project(":configuration"))
implementation(project(":kotlinDsl"))
implementation(project(":versioning"))
implementation("com.google.guava:guava")
implementation("org.ow2.asm:asm:7.1")
implementation("org.ow2.asm:asm-co... | null | null |
Make migration add_search_to_service_version a bit more resilient
On production the extension might have been pre-installed, so we only install it
if it doesn't exist
Apply this change to `db/migrate/20160610190445_add_search_to_service_version.rb` and return the full updated file.
```ruby
class AddSearchToServiceVe... | ```ruby
class AddSearchToServiceVersion < ActiveRecord::Migration[5.0]
def up
execute <<-SQL
CREATE EXTENSION IF NOT EXISTS unaccent;
CREATE TEXT SEARCH CONFIGURATION es ( COPY = spanish );
ALTER TEXT SEARCH CONFIGURATION es ALTER MAPPING FOR hword, hword_part, word WITH unaccent, spanish_stem;... | null | null |
[Mod]: Make close button properties optional.
Apply this change to `Classes/YTConnector.h` and return the full updated file.
```c
//
// YTConnector.h
// AKYouTube
//
// Created by Anton Pomozov on 10.09.13.
// Copyright (c) 2013 Akademon Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@class YTCo... | ```c
//
// YTConnector.h
// AKYouTube
//
// Created by Anton Pomozov on 10.09.13.
// Copyright (c) 2013 Akademon Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@class YTConnector;
@protocol YTLoginViewControllerInterface <NSObject>
@property (nonatomic, strong, readonly) UIWebView *webView;
@op... | null | null |
Remove obsolete call
When calling the script with SQLcl, the following is displayed:
line 2: "set tab off" is Obsolete.
As such, removed that line
Apply this change to `lib/compile.sql` and return the full updated file.
```sql
set linesize 200
set tab off
set serveroutput on
COLUMN MY_USER FORMAT A20
COLUMN DB FORM... | ```sql
set linesize 200
set serveroutput on
COLUMN MY_USER FORMAT A20
COLUMN DB FORMAT A20
COLUMN SID FORMAT A10
COLUMN NOW FORMAT A35
--Show the details of the connection for confirmation
select
user as MY_USER
, ora_database_name as DB
--, '$3' as SID
, systimestamp as NOW
from dua... | null | null |
Fix bug in chunk arguments
Apply this change to `disposable_email_checker/__init__.py` and return the full updated file.
```python
from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(... | ```python
from django.conf import settings
import re
import sys
class DisposableEmailChecker():
"""
Check if an email is from a disposable
email service
"""
def __init__(self):
self.emails = [line.strip() for line in open(settings.DISPOSABLE_EMAIL_DOMAINS)]
def chunk(self,l,n... | null | null |
Disable DownloadsApiTest.DownloadsApiTest because it is too flaky and times out too often.
BUG=130950
TBR=benjhayden@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10499011
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@140249 0039d316-1c4b-4281-b951-d872f2087c98
Apply this change to `chrome/... | ```cpp
// Copyright (c) 2012 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"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profi... | null | null |
Fix listener not being released
Apply this change to `app/src/main/java/com/marverenic/reader/utils/ViewUtils.kt` and return the full updated file.
```kotlin
package com.marverenic.reader.utils
import android.view.View
inline fun <V : View> V.whenMeasured(crossinline action: V.() -> Unit) {
if (isLaidOut) {
... | ```kotlin
package com.marverenic.reader.utils
import android.view.View
import android.view.ViewTreeObserver
inline fun <V : View> V.whenMeasured(crossinline action: V.() -> Unit) {
if (isLaidOut) {
action()
} else {
viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalL... | null | null |
Add test-unit as a dependency to fix tests on 2.2.0
Fixes #29
Referenced fix from;
https://github.com/rails/rails/pull/18306
https://github.com/tmm1/rails/commit/aa01162ffeba391329ab2b8559d9aa6d0182b74e
Apply this change to `knife-block.gemspec` and return the full updated file.
```ruby
# -*- encoding: utf-8 -*-
re... | ```ruby
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/knife-block/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["proffalken"]
gem.email = ["theprofessor@threedrunkensysadsonthe.net"]
gem.description = %q{Create and manage knife.rb files for OpsCodes' Chef}
gem.... | null | null |
Update vtable offsets for 2014-06-11 TF2 update.
Apply this change to `src/hooks.h` and return the full updated file.
```c
/*
* hooks.h
* StatusSpec project
*
* Copyright (c) 2014 thesupremecommander
* BSD 2-Clause License
* http://opensource.org/licenses/BSD-2-Clause
*
*/
#pragma once
#include "stda... | ```c
/*
* hooks.h
* StatusSpec project
*
* Copyright (c) 2014 thesupremecommander
* BSD 2-Clause License
* http://opensource.org/licenses/BSD-2-Clause
*
*/
#pragma once
#include "stdafx.h"
#include <map>
#define CLIENT_DLL
#define GLOWS_ENABLE
#include "cdll_int.h"
#include "KeyValues.h"
#include "i... | null | null |
Remove missing Hive drop test table
Apply this change to `presto-hive/src/test/sql/drop-test.sql` and return the full updated file.
```sql
DROP TABLE IF EXISTS presto_test_sequence;
DROP TABLE IF EXISTS presto_test;
DROP TABLE IF EXISTS presto_test_partition_format;
DROP TABLE IF EXISTS presto_test_unpartitioned;
... | ```sql
DROP TABLE IF EXISTS presto_test_sequence;
DROP TABLE IF EXISTS presto_test;
DROP TABLE IF EXISTS presto_test_partition_format;
DROP TABLE IF EXISTS presto_test_unpartitioned;
CREATE TABLE IF NOT EXISTS presto_test_offline (x INT);
ALTER TABLE presto_test_offline DISABLE OFFLINE;
DROP TABLE IF EXISTS presto_... | null | null |
Add baseline benchmark to distinguish TokenStream::clone from syn::parse2
Apply this change to `benches/file.rs` and return the full updated file.
```rust
// $ cargo bench --features full --bench file
#![feature(rustc_private, test)]
#![recursion_limit = "1024"]
#![allow(clippy::missing_panics_doc, clippy::must_use_... | ```rust
// $ cargo bench --features full --bench file
#![feature(rustc_private, test)]
#![recursion_limit = "1024"]
#![allow(clippy::missing_panics_doc, clippy::must_use_candidate)]
extern crate test;
#[macro_use]
#[path = "../tests/macros/mod.rs"]
mod macros;
#[path = "../tests/common/mod.rs"]
mod common;
#[path =... | null | null |
Clean up more touchbar->rubrail stuff
Apply this change to `build.rs` and return the full updated file.
```rust
use std::fs;
use std::path::Path;
fn main() {
// Copy connectr.ini.in to connectr.ini if connectr.ini does not exist.
//
// The local changes in connectr.ini are always preserved, so you can
... | ```rust
use std::fs;
use std::path::Path;
fn main() {
// Copy connectr.ini.in to connectr.ini if connectr.ini does not exist.
//
// The local changes in connectr.ini are always preserved, so you can
// set private keys without worrying about git.
let ini_file = Path::new("connectr.ini");
if !ini... | null | null |
Check parameters and session before checking sermepa result.
Apply this change to `src/Controller/SermepaController.php` and return the full updated file.
```php
<?php
namespace Drupal\sermepa_payment\Controller;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Compon... | ```php
<?php
namespace Drupal\sermepa_payment\Controller;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Request;
use Drupal\payment\Entity\Payment;
use Drupal\sermepa_payment\Plugin\Payment\Method\Sermepa as SermepaMethod;
class SermepaContr... | null | null |
Handle duplicate end slice events in startup traces
Bug: 233732092
Change-Id: I8f6449397132c7fa245955f2f216f88c59faf764
Apply this change to `src/trace_processor/metrics/sql/android/startup/launches_minsdk33.sql` and return the full updated file.
```sql
--
-- Copyright 2022 The Android Open Source Project
--
-- Lice... | ```sql
--
-- Copyright 2022 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
--
-- https://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by ... | null | null |
Add Binary Search Tree in C++
Apply this change to `Binary_Search_Tree/C++/mike168m/binaryseachtreetest.cpp` and return the full updated file.
```cpp
#include <iostream>
#include "binarysearchtree.h"
int main() {
BinarySearchTree<int> tree;
tree.insert(0);
tree.insert(4);
tree.insert(3);
tree.in... | ```cpp
#include <iostream>
#include "binarysearchtree.h"
// test binary search tree
int main() {
BinarySearchTree<int> tree;
tree.insert(0);
tree.insert(4);
tree.insert(3);
tree.insert(2);
tree.insert(1);
if (tree.contains(1)) {
std::cout << "Item found" << std::endl;
}
... | null | null |
Migrate ::StringPiece to absl::string_view.
PiperOrigin-RevId: 222828687
Apply this change to `tensorflow/core/platform/regexp.h` and return the full updated file.
```c
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this ... | ```c
/* Copyright 2015 The TensorFlow Authors. 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 the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law... | null | null |
Fix unit tests, they were not working because of namespace changes and
class refactoring.
Apply this change to `test/Object/TestAsset/BarcodeTest.php` and return the full updated file.
```php
<?php
namespace ZendTest\Barcode\Object\TestAsset;
class BarcodeTest extends \Zend\Barcode\Object\AbstractObject
{
prote... | ```php
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the lic... | null | null |
Add 5s timeout to http call
Apply this change to `gitio.go` and return the full updated file.
```go
/*
Package gitio shortens github urls using the git.io service.
*/
package gitio
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
)
// Shorten a long github url.
func Shorten(longurl string) (string, error) {
res... | ```go
/*
Package gitio shortens github urls using the git.io service.
*/
package gitio
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"time"
)
// Shorten a long github url.
func Shorten(longurl string) (string, error) {
client := new(http.Client)
client.Timeout = 5 * time.Second
resp, err := client.PostForm... | null | null |
[REFAC] Change variable to paradigm instead of controller to improve naming consistency
Apply this change to `Assets/Paradigms/SearchAndFind/Scripts/SubjectInteractions.cs` and return the full updated file.
```csharp
using UnityEngine;
using System.Collections;
namespace Assets.BeMoBI.Paradigms.SearchAndFind {
/... | ```csharp
using UnityEngine;
using System.Collections;
namespace Assets.BeMoBI.Paradigms.SearchAndFind {
/// <summary>
/// Represents all possible interactions for subject regarding the paradigm or trial behaviour
/// </summary>
public class SubjectInteractions : MonoBehaviour {
private const string SUBMIT_I... | null | null |
Disable Airlift admin servlet in Proxy
Same as e9c217ae4a3e1a3c73be5bcd417bb5cf1384eaca, this time for Presto
Proxy.
Apply this change to `presto-proxy/src/main/java/io/prestosql/proxy/ProxyModule.java` and return the full updated file.
```java
/*
* Licensed under the Apache License, Version 2.0 (the "License");
*... | ```java
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* d... | null | null |
Fix undefined quotes causing error
Apply this change to `app/routes/quotes/components/QuoteList.js` and return the full updated file.
```javascript
// @flow
import React, { Component } from 'react';
import Quote from './Quote';
type Props = {
quotes: Array<Object>,
approve: number => Promise<*>,
deleteQuote: ... | ```javascript
// @flow
import React, { Component } from 'react';
import Quote from './Quote';
type Props = {
quotes: Array<Object>,
approve: number => Promise<*>,
deleteQuote: number => Promise<*>,
unapprove: number => Promise<*>,
actionGrant: Array<string>,
currentUser: any,
loggedIn: boolean,
commen... | null | null |
Update market insights to be RN safe(r)
Apply this change to `src/Styleguide/Components/MarketInsights.tsx` and return the full updated file.
```typescript
import React from "react"
import { Responsive } from "../Utils/Responsive"
import { BorderBox } from "../Elements/Box"
import { Sans } from "@artsy/palette"
impor... | ```typescript
import React from "react"
import { Responsive } from "../Utils/Responsive"
import { Box, BorderBox } from "../Elements/Box"
import { Flex } from "../Elements/Flex"
import { Sans } from "@artsy/palette"
const wrapper = xs => props =>
xs ? <Flex flexDirection="column" mb={3} {...props} /> : <Box {...prop... | null | null |
Fix routes in apply router
Apply this change to `src/js/server/routes/apply-router.ts` and return the full updated file.
```typescript
import { Request, Router } from 'express';
import { logout, requireAuth } from 'js/server/auth';
import { dashboardController, hackerApplicationsController, rsvpsController, teamsCon... | ```typescript
import { Request, Router } from 'express';
import { logout, requireAuth } from 'js/server/auth';
import { dashboardController, hackerApplicationsController, rsvpsController, teamsController } from 'js/server/controllers/apply';
import { applicationsMiddleware } from 'js/server/middleware';
import { Hacke... | null | null |
Add a small 5x5 test map
Apply this change to `src/engine/world.rs` and return the full updated file.
```rust
use std::vec::Vec;
use engine::{Actor, Map};
use engine::builders::MapFromString;
use util::units::{Direction, Point};
pub struct World {
pub player: Actor,
pub actors: Vec<Actor>,
pub map: Map,... | ```rust
use std::vec::Vec;
use engine::{Actor, Map};
use engine::builders::MapFromString;
use util::units::{Direction, Point};
pub struct World {
pub player: Actor,
pub actors: Vec<Actor>,
pub map: Map,
}
impl World {
pub fn new() -> World {
World {
player: Actor::new("Player".to... | null | null |
Add footer fields to Attachment
Apply this change to `attachments.go` and return the full updated file.
```go
package slack
// https://api.slack.com/docs/attachments
// It is possible to create more richly-formatted messages using Attachments.
type AttachmentField struct {
Title string `json:"title"`
Value string ... | ```go
package slack
// https://api.slack.com/docs/attachments
// It is possible to create more richly-formatted messages using Attachments.
type AttachmentField struct {
Title string `json:"title"`
Value string `json:"value"`
Short bool `json:"short"`
}
type Attachment struct {
Color string `json:"color,omit... | null | null |
Add support for navigating to Twitter profile and external URL
Apply this change to `app/src/main/java/net/squanchy/navigation/Navigator.java` and return the full updated file.
```java
package net.squanchy.navigation;
import android.content.Context;
import android.content.Intent;
import net.squanchy.eventdetails.Ev... | ```java
package net.squanchy.navigation;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import net.squanchy.eventdetails.EventDetailsActivity;
import net.squanchy.search.SearchActivity;
import net.squanchy.speaker.SpeakerDetailsActivity;
public class Navigator {
private f... | null | null |
Disable back button for thank-you frame
Do not allow participants to click the back
button after completing the study.
Apply this change to `app/routes/participate/survey/index.js` and return the full updated file.
```javascript
import Ember from 'ember';
export default Ember.Route.extend({
setupController(contro... | ```javascript
import Ember from 'ember';
export default Ember.Route.extend({
setupController(controller, session) {
this._super(controller, session);
controller.set('experiment', this.controllerFor('participate.survey').get('experiment'));
controller.set('session', session);
controller.set('pastSessi... | null | null |
Make this header file self-contained
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@12480 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `include/llvm/Transforms/Utils/FunctionUtils.h` and return the full updated file.
```c
//===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-... | ```c
//===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===---... | null | null |
Use ts_tree_root_node in fuzz driver
Apply this change to `test/fuzz/fuzzer.cc` and return the full updated file.
```cpp
#include <string.h>
#include "tree_sitter/runtime.h"
void test_log(void *payload, TSLogType type, const char *string) { }
TSLogger logger = {
.log = test_log,
};
extern "C" const TSLanguage *T... | ```cpp
#include <string.h>
#include "tree_sitter/runtime.h"
void test_log(void *payload, TSLogType type, const char *string) { }
TSLogger logger = {
.log = test_log,
};
extern "C" const TSLanguage *TS_LANG();
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
const char *str = reinterpret... | null | null |
Update the view in prep to display logged transactions.
Apply this change to `views/my_history.php` and return the full updated file.
```php
<?php require_once "../config.php"; ?>
<!DOCTYPE html>
<html>
<head>
<?php require_once SITEROOT."/templates/top.php"; ?>
</head>
<body>
<noscript>
<h3>This se... | ```php
<?php
require_once __DIR__."/../config.php";
require_once __DIR__."/templates/auth_check.php";
require_once __DIR__."/../controllers/history_class.php";
$historyClass = new historyClass;
$h_data = $historyClass->readHistory($_COOKIE['USER']);
?>
<!DOCTYPE html>
<html>
<head>
<?php require_once SITEROOT."/t... | null | null |
Update the comment for the extension of UINavigationBar
Apply this change to `RGUIExtension/RGUIExtension/UINavigationBar/UINavigationBar+Colors.swift` and return the full updated file.
```swift
//
// UINavigationBar+Colors.swift
// RGUIExtension
//
// Created by RAIN on 15/11/30.
// Copyright © 2015年 Smartech. A... | ```swift
//
// UINavigationBar+Colors.swift
// RGUIExtension
//
// Created by RAIN on 15/11/30.
// Copyright © 2015年 Smartech. All rights reserved.
//
import UIKit
extension UINavigationBar {
/**
修改 Navigation Bar 的背景颜色
- parameter color: 提供给 Navigation Bar 的背景的 tint color
*/
static f... | null | null |
Use lower case import path for logrus
Due to some import problems the author of logrus encourages users to
use all lower case paths. Cf. a [comment on the respective issue on the
logrus
repository](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276)
Apply this change to `ginerus.go` and return the f... | ```go
package ginerus
import (
"fmt"
"time"
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
)
func Ginerus() gin.HandlerFunc {
return GinerusWithLogger(logrus.StandardLogger())
}
func GinerusWithLogger(logger *logrus.Logger) gin.HandlerFunc {
return func(c *gin.Context) {
start := time.Now()
path ... | null | null |
Fix the bad packets! Naughty naughty packets!
Apply this change to `protocol/src/main/java/net/md_5/bungee/protocol/packet/PacketCFScoreboardScore.java` and return the full updated file.
```java
package net.md_5.bungee.protocol.packet;
import io.netty.buffer.ByteBuf;
import lombok.EqualsAndHashCode;
import lombok.Ge... | ```java
package net.md_5.bungee.protocol.packet;
import io.netty.buffer.ByteBuf;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
@Getter
@ToString
@EqualsAndHashCode(callSuper = false)
public class PacketCFScoreboardScore extends DefinedPacket
{
private String itemName;
/**
... | null | null |
Make front page load using API v2.1
Apply this change to `Model/Collection/Event.php` and return the full updated file.
```php
<?php
namespace Joindin\Model\Collection;
class Event
{
public function retrieve($filter = 'all', $limit = 10, $page = 1)
{
$events = (array)json_decode(
file_get... | ```php
<?php
namespace Joindin\Model\Collection;
class Event
{
public function retrieve($filter = 'all', $limit = 10, $page = 1)
{
$events = (array)json_decode(
file_get_contents(
// '../Cache/events.'.$filter.'.json'
'http://api.joind.in/v2.1/events?format=js... | null | null |
Add hamming distance and test cases
Apply this change to `src/behavioral_bitvec.rs` and return the full updated file.
```rust
use primal_bit::BitVec;
pub struct BehavioralBitvec {
bitvec: BitVec,
bitpos: usize,
}
impl BehavioralBitvec {
pub fn new(n: usize) -> Self {
BehavioralBitvec {
... | ```rust
use primal_bit::BitVec;
use hamming;
pub struct BehavioralBitvec {
bitvec: BitVec,
bitpos: usize,
}
impl BehavioralBitvec {
pub fn new(n: usize) -> Self {
BehavioralBitvec {
bitvec: BitVec::from_elem(n, false),
bitpos: 0,
}
}
pub fn hamming_distance... | null | null |
Increase wait time to account for travis slowness
Apply this change to `Test/XCTestCase+Async.swift` and return the full updated file.
```swift
//
// XCTestCase+Async.swift
// edX
//
// Created by Akiva Leffert on 6/3/15.
// Copyright (c) 2015 edX. All rights reserved.
//
import Foundation
import XCTest
import e... | ```swift
//
// XCTestCase+Async.swift
// edX
//
// Created by Akiva Leffert on 6/3/15.
// Copyright (c) 2015 edX. All rights reserved.
//
import Foundation
import XCTest
import edX
extension XCTestCase {
// Standardize on a reasonable timeout to account for slow CI systems interacting with slow operation... | null | null |
Use systemctl commands instead of service and chkconfig to disable the firewall daemons.
Apply this change to `works_in_progress/centos-7-amd64/scripts/base.sh` and return the full updated file.
```bash
# Base install
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
#disable iptables
chkconfig iptables o... | ```bash
# Base install
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
#Stop and disable iptables
systemctl stop iptables
systemctl disable iptables
#Stop and disable firewalld
systemctl stop firewalld
systemctl disable firewalld
#Don't do reverse DNS lookups of SSH clients that connect; this usually s... | null | null |
Add the nodes name to the dot output
Apply this change to `src/DotGraphOutput.cc` and return the full updated file.
```cpp
#include "DotGraphOutput.hh"
#include "EdgeType.hh"
string getEdgeStyle(EdgeType t) {
switch (t) {
case EdgeType::Plane:
return "[color=red]";
case EdgeType::Train:
return "[color=... | ```cpp
#include "DotGraphOutput.hh"
#include "EdgeType.hh"
string getEdgeStyle(EdgeType t) {
switch (t) {
case EdgeType::Plane:
return "[color=red]";
case EdgeType::Train:
return "[color=blue,style=dotted]";
default:
return "";
}
}
template <typename V>
void DotGraphOutput<V>::output(string path... | null | null |
Update homepage url in gemspec
Apply this change to `lhm.gemspec` and return the full updated file.
```ruby
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$:.unshift(lib) unless $:.include?(lib)
require 'lhm/version'
Gem::Specification.new do |s|
s.name = "lhm"
s.version = ... | ```ruby
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$:.unshift(lib) unless $:.include?(lib)
require 'lhm/version'
Gem::Specification.new do |s|
s.name = "lhm"
s.version = Lhm::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["SoundCloud", "Rany Keddo", ... | null | null |
Add test for git clone
Apply this change to `risu_test.go` and return the full updated file.
```go
package main
import (
"net/http"
"net/http/httptest"
"testing"
)
func TestRootAccess(t *testing.T) {
response := httptest.NewRecorder()
n := setUpServer()
req, err := http.NewRequest("GET", "http://localhost:8... | ```go
package main
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/wantedly/risu/schema"
)
func TestGitClone(t *testing.T) {
opts := schema.BuildCreateOpts{
SourceRepo: "wantedly/private-nginx-image-server",
Name: "quay.io/wantedly/private-nginx-image-server:test",
}
build := schema.Ne... | null | null |
Allow us to edit this
Apply this change to `Classes/LVTFolder.h` and return the full updated file.
```c
//
// LVTFolder.h
// LayerVaultAPIClient
//
// Created by Matt Thomas on 12/4/13.
// Copyright (c) 2013 codecaffeine. All rights reserved.
//
#import <Mantle/Mantle.h>
#import "LVTColor.h"
@interface LVTFolde... | ```c
//
// LVTFolder.h
// LayerVaultAPIClient
//
// Created by Matt Thomas on 12/4/13.
// Copyright (c) 2013 codecaffeine. All rights reserved.
//
#import <Mantle/Mantle.h>
#import "LVTColor.h"
@interface LVTFolder : MTLModel <MTLJSONSerializing>
@property (readonly, nonatomic, copy) NSString *name;
@property (n... | null | null |
Change email to mail in LDAP
Apply this change to `uchicagohvz/users/backend.py` and return the full updated file.
```python
from django.contrib.auth import get_user_model
import ldap
User = get_user_model()
class UChicagoLDAPBackend(object):
LDAP_SERVER = "ldaps://ldap.uchicago.edu:636"
def authenticate(self, c... | ```python
from django.contrib.auth import get_user_model
import ldap
User = get_user_model()
class UChicagoLDAPBackend(object):
LDAP_SERVER = "ldaps://ldap.uchicago.edu:636"
def authenticate(self, cnetid=None, password=None):
if cnetid and password:
cnetid = ldap.filter.escape_filter_chars(cnetid)
try:
... | null | null |
Change birthdayCounts from method to property
Apply this change to `Sources/Birthdays/BirthdaysManager.swift` and return the full updated file.
```swift
// Created by dasdom on 13.04.20.
//
//
import Foundation
public class BirthdaysManager {
public private(set) var all: [Birthday]
public init() {
all... | ```swift
// Created by dasdom on 13.04.20.
//
//
import Foundation
public class BirthdaysManager {
public private(set) var all: [Birthday] {
didSet {
birthdayCounts = all
.map { BirthdayCount(birthday: $0) }
.sorted(by: { $0.remainingDays < $1.remainingDays })
}
}
public private... | null | null |
Add whos next view and controller.
Apply this change to `Perspective/Perspective/WhosNextVC.swift` and return the full updated file.
```swift
//
// WhosNextVC.swift
// Perspective
//
// Created by Apprentice on 2/17/15.
// Copyright (c) 2015 Dev Bootcamp. All rights reserved.
//
import UIKit
class WhosNextVC: U... | ```swift
//
// WhosNextVC.swift
// Perspective
//
// Created by Apprentice on 2/17/15.
// Copyright (c) 2015 Dev Bootcamp. All rights reserved.
//
import UIKit
class WhosNextVC: UIViewController {
var url: String!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additiona... | null | null |
Fix for missing closure args
Apply this change to `Tests/TriassicTests/TriassicTests.swift` and return the full updated file.
```swift
//
// TriassicTests.swift
// Triassic
//
// Created by Kilian Költzsch on 29/11/2016.
// Copyright © 2016 Triassic Park. All rights reserved.
//
import Foundation
import XCTest
@... | ```swift
//
// TriassicTests.swift
// Triassic
//
// Created by Kilian Költzsch on 29/11/2016.
// Copyright © 2016 Triassic Park. All rights reserved.
//
import Foundation
import XCTest
@testable import Triassic
class TriassicTests: XCTestCase {
func testExample() {
XCTAssertEqual(Triassic.play(), "<?... | null | null |
Add my-2 class in Sidebar component
Apply this change to `src/components/Sidebar/index.js` and return the full updated file.
```javascript
import React from 'react';
// import LazyLoad from 'react-lazyload';
import PropTypes from 'prop-types';
import './index.scss';
const Sidebar = ({ post }) => (
<header classN... | ```javascript
import React from 'react';
// import LazyLoad from 'react-lazyload';
import PropTypes from 'prop-types';
import './index.scss';
const Sidebar = ({ post }) => (
<header className={`my-2 mx-3 intro-header site-heading text-center col-lg-2 col-xs-12 order-lg-1 ${post === true ? 'order-11' : 'order-1'}`}... | null | null |
Fix an issue with custom arrows example
Apply this change to `examples/CustomArrows.js` and return the full updated file.
```javascript
import React, { Component } from 'react'
import createReactClass from 'create-react-class'
import Slider from '../src/slider'
var SampleNextArrow = createReactClass({
render: func... | ```javascript
import React, { Component } from 'react'
import createReactClass from 'create-react-class'
import Slider from '../src/slider'
var SampleNextArrow = createReactClass({
render: function() {
const {className, style, onClick} = this.props
return (
<div
className={className}
st... | null | null |
Add BritBox to weekly cron job
Apply this change to `timeBothScripts.sh` and return the full updated file.
```bash
#! /bin/bash
# Time the primary variants of shell scripts that make spreadsheets
echo "========================================"
echo "==> time ./makeMHzSpreadsheet.sh -t"
date
time ./makeMHzSpreadshee... | ```bash
#! /bin/bash
# Time the primary variants of shell scripts that make spreadsheets
echo "========================================"
echo "==> time ./makeMHzSpreadsheet.sh -t"
date
time ./makeMHzSpreadsheet.sh -t
echo ""
echo "----------------------------------------"
echo "==> time ./makeMHzSpreadsheet.sh -tld"
... | null | null |
Clean up provider test script migrations.
Apply this change to `StaticQL.Provider/user-migrations/V1.sql` and return the full updated file.
```sql
create table Users
( Id int not null primary key
, Name string(128)
, Email string(128)
, Password binary(64)
, Salt binary(64)
)... | ```sql
create table Users
( Id int not null primary key
, Name string(128)
, Email string(128)
, Password binary(64)
, Salt binary(64)
);
create Table Groups
( Id int not null primary key
, Name string(128)
);
create table UserGroupMaps
( UserId in... | null | null |
Add :visible attr_accessor to Facebooker:Album model
Apply this change to `lib/facebooker/models/album.rb` and return the full updated file.
```ruby
require 'facebooker/model'
module Facebooker
##
# A simple representation of a photo album.
class Album
include Model
attr_accessor :aid, :cover_pid, :owne... | ```ruby
require 'facebooker/model'
module Facebooker
##
# A simple representation of a photo album.
class Album
include Model
attr_accessor :aid, :cover_pid, :owner, :name, :created,
:modified, :description, :location, :link, :size, :visible
end
end
``` | null | null |
Fix formatting of log string
Apply this change to `src/nl/hannahsten/texifyidea/util/Log.kt` and return the full updated file.
```kotlin
package nl.hannahsten.texifyidea.util
import com.intellij.openapi.diagnostic.Logger
/**
* Log messages to idea.log. During plugin development, it logs to build/idea-sandbox/syste... | ```kotlin
package nl.hannahsten.texifyidea.util
import com.intellij.openapi.diagnostic.Logger
/**
* Log messages to idea.log. During plugin development, it logs to build/idea-sandbox/system/log/idea.log.
* @author Hannah Schellekens
*/
object Log {
private val logger: Logger by lazy { Logger.getInstance(Log::... | null | null |
Add a : after the course number
Apply this change to `src/components/course-summary.tsx` and return the full updated file.
```typescript
import * as React from "react";
import {Class, Course} from "../class"
import {Toggle} from "./utilities/toggle"
import {ClassList} from "./class-list"
import {Department} from "./d... | ```typescript
import * as React from "react";
import {Class, Course} from "../class"
import {Toggle} from "./utilities/toggle"
import {ClassList} from "./class-list"
import {Department} from "./department"
export interface CourseSummaryProps {
classes: Class[],
course: Course
}
export class CourseSummary exten... | null | null |
Return null of param not found
Apply this change to `_js/utils/get-url-parameter.js` and return the full updated file.
```javascript
import URI from 'urijs';
/**
* Return a URL parameter.
*/
const getUrlParameter = function(url, param, type) {
const uri = new URI(url),
query = URI.parseQuery(uri.quer... | ```javascript
import URI from 'urijs';
/**
* Return a URL parameter.
*/
const getUrlParameter = function(url, param, type) {
const uri = new URI(url),
query = URI.parseQuery(uri.query());
if (!uri.hasQuery(param)) {
return null;
}
if (type == 'int') {
if (isNaN(parseInt(qu... | null | null |
Mark another test as flaky
Reported on the NetBSD 8 buildbot.
git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@352064 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `test/std/thread/thread.mutex/thread.mutex.requirements/thread.timedmutex.requirements/thread.timedmutex.recursive/lock.pass.cpp` and re... | ```cpp
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------... | null | null |
Update the App Users documentation links
Apply this change to `BoxContentSDK/BoxContentSDK/QueueManagers/BOXAPIAccessTokenDelegate.h` and return the full updated file.
```c
//
// BOXAPIAccessTokenDelegate.h
// BoxContentSDK
//
// Created by Andrew Chun on 6/6/15.
// Copyright (c) 2015 Box. All rights reserved.
//... | ```c
//
// BOXAPIAccessTokenDelegate.h
// BoxContentSDK
//
// Created by Andrew Chun on 6/6/15.
// Copyright (c) 2015 Box. All rights reserved.
//
/**
* App Users are full-featured enterprise Box accounts that belong to your application not a Box user. Unlike typical Box accounts,
* these accounts do not have a... | null | null |
Enable building hybrid capsule/non-capsule packages (CNY-3271)
Apply this change to `conary/build/capsulerecipe.py` and return the full updated file.
```python
#
# Copyright (c) 2009 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should ... | ```python
#
# Copyright (c) 2009 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/... | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.