original_prompt stringlengths 327 2.5k | original_completion stringlengths 22 2.84k | enhanced_prompt float64 | enhanced_completion float64 |
|---|---|---|---|
Add backend tables translation and translation2.translation
Apply this change to `tests/_data/dump.sql` and return the full updated file.
```sql
DROP TABLE IF EXISTS basic;
DROP TABLE IF EXISTS table1;
DROP TABLE IF EXISTS table2;
DROP TABLE IF EXISTS table3;
DROP TABLE IF EXISTS translatable2.table1;
DROP TABLE IF E... | ```sql
USE translatable;
DROP TABLE IF EXISTS basic;
DROP TABLE IF EXISTS table1;
DROP TABLE IF EXISTS table2;
DROP TABLE IF EXISTS table3;
DROP TABLE IF EXISTS translation;
DROP TABLE IF EXISTS translatable2.table1;
DROP TABLE IF EXISTS translatable2.table2;
DROP TABLE IF EXISTS translatable2.translation;
CREATE TABL... | null | null |
Clean up transformations of multimaps into JSON
Apply this change to `support/cas-server-support-json-service-registry/src/test/java/org/apereo/cas/services/JsonServiceRegistryDaoTests.java` and return the full updated file.
```java
package org.apereo.cas.services;
import org.apereo.cas.util.services.RegisteredServi... | ```java
package org.apereo.cas.services;
import org.apereo.cas.util.services.RegisteredServiceJsonSerializer;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
... | null | null |
DOC: Fix X -> x in cubic_rectification
Apply this change to `package_name/module.py` and return the full updated file.
```python
"""
Module provides a simple cubic_rectification function.
"""
import numpy as np
def cubic_rectification(x):
"""
Rectified cube of an array.
Parameters
----------
X... | ```python
"""
Module provides a simple cubic_rectification function.
"""
import numpy as np
def cubic_rectification(x):
"""
Rectified cube of an array.
Parameters
----------
x : numpy.ndarray
Input array.
Returns
-------
numpy.ndarray
Elementwise, the cube of `x` whe... | null | null |
Update for new React types, context, forwardRef, etc
Apply this change to `src/elementType.js` and return the full updated file.
```javascript
import React from 'react';
import createChainableTypeChecker from './utils/createChainableTypeChecker';
function elementType(props, propName, componentName, location, propFu... | ```javascript
import React from 'react';
import createChainableTypeChecker from './utils/createChainableTypeChecker';
function elementType(props, propName, componentName, location, propFullName) {
const propValue = props[propName];
const propType = typeof propValue;
if (React.isValidElement(propValue)) {
... | null | null |
Fix published_version return nil for Leap
Build name in 42.3 is openSUSE-42.3-x86_64-Build0144 what matchdata regex will
return nil for matchdata[1]. Update regex for Leap.
Apply this change to `app/models/obs_factory/distribution_strategy_opensuse.rb` and return the full updated file.
```ruby
module ObsFactory
#... | ```ruby
module ObsFactory
# this class tracks the differences between Factory and the upcoming release
class DistributionStrategyOpenSUSE < DistributionStrategyFactory
def opensuse_version
# Remove the "openSUSE:" part
project.name[9..-1]
end
def opensuse_leap_version
# Remove the "o... | null | null |
Fix compile error on Windows
Apply this change to `ext/pycall/thread.c` and return the full updated file.
```c
#include "pycall_internal.h"
#if defined(PYCALL_THREAD_WIN32)
int pycall_tls_create(pycall_tls_key *tls_key)
{
*tls_key = TlsAlloc();
return *tls_key == TLS_OUT_OF_INDEXES;
}
void *pycall_tls_get(pycal... | ```c
#include "pycall_internal.h"
#if defined(PYCALL_THREAD_WIN32)
int pycall_tls_create(pycall_tls_key *tls_key)
{
*tls_key = TlsAlloc();
return *tls_key == TLS_OUT_OF_INDEXES;
}
void *pycall_tls_get(pycall_tls_key tls_key)
{
return TlsGetValue(tls_key);
}
int pycall_tls_set(pycall_tls_key tls_key, void *ptr)... | null | null |
Change async/await constructs for withContext
Apply this change to `app/src/main/java/chat/rocket/android/server/domain/GetChatRoomsInteractor.kt` and return the full updated file.
```kotlin
package chat.rocket.android.server.domain
import chat.rocket.core.model.ChatRoom
import kotlinx.coroutines.experimental.Common... | ```kotlin
package chat.rocket.android.server.domain
import chat.rocket.core.model.ChatRoom
import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.withContext
import javax.inject.Inject
class GetChatRoomsInteractor @Inject constructor(private val repository: ChatRoomsRepository) {
... | null | null |
feat(interfaces): Make FunctionalGroup contain TypeMap type parameter
Apply this change to `modules/interfaces/src/functional-group.ts` and return the full updated file.
```typescript
import { CustomCommandDefinition } from "./custom-command-definition";
import { CustomQueryDefinition } from "./custom-query-definitio... | ```typescript
import { CustomCommandDefinition } from "./custom-command-definition";
import { CustomQueryDefinition } from "./custom-query-definition";
import { EntityDefinition } from "./entity-definition";
import { UserDefinition } from "./user-definition";
import {
GeneralTypeMap,
UserEntityNameOf,
NonUserEnti... | null | null |
Use `app.bowerDirectory` instead of hardcoded `bower_components`
Apply this change to `Brocfile.js` and return the full updated file.
```javascript
/* jshint node: true */
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
var app = new EmberAddon();
// Use `app.import` to... | ```javascript
/* jshint node: true */
/* global require, module */
var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
var app = new EmberAddon();
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, spec... | null | null |
Make DeleteStatement and UpdateStatement public
Apply this change to `src/lib.rs` and return the full updated file.
```rust
#[macro_use]
extern crate nom;
extern crate serde;
#[macro_use]
extern crate serde_derive;
pub use self::arithmetic::{ArithmeticBase, ArithmeticExpression, ArithmeticOperator};
pub use self::c... | ```rust
#[macro_use]
extern crate nom;
extern crate serde;
#[macro_use]
extern crate serde_derive;
pub use self::arithmetic::{ArithmeticBase, ArithmeticExpression, ArithmeticOperator};
pub use self::common::{FieldExpression, Literal, Operator, SqlType, TableKey};
pub use self::column::{Column, ColumnConstraint, Colum... | null | null |
Enforce the invariant contraints of the parent.
Apply this change to `assignment2/src/assignment2/PerfectBinTree.java` and return the full updated file.
```java
package assignment2;
import be.ac.ua.ansymo.adbc.annotations.invariant;
@invariant("$this.sameHeight() == true")
public class PerfectBinTree extends FullBi... | ```java
package assignment2;
import be.ac.ua.ansymo.adbc.annotations.invariant;
@invariant({"$super", "$this.sameHeight() == true"})
public class PerfectBinTree extends FullBinTree {
public PerfectBinTree(long id) {
super(id);
}
public boolean sameHeight() {
int leftHeight = (this.getLeft() != null) ? this.g... | null | null |
Fix put_json test helper to work with Rails 3.
Rails 3 integration stuff has some special handling for content-type,
but this is done before the case etc. is normalised, so if this doesn't
match the case that Rails uses internally, oddness ensues.
Apply this change to `spec/support/json_request_helper.rb` and return ... | ```ruby
module JSONRequestHelper
def put_json(path, attrs, headers = {})
put path, attrs.to_json, {"CONTENT_TYPE" => "application/json"}.merge(headers)
end
end
RSpec.configuration.include JSONRequestHelper, :type => :request
``` | null | null |
Undo alteration of generated file
Apply this change to `src/main/java/org/testng/internal/Version.java` and return the full updated file.
```java
package org.testng.internal;
public class Version {
public static final String VERSION = "7.1.1-SNAPSHOT";
public static String getVersionString() {
retu... | ```java
package org.testng.internal;
public class Version {
public static final String VERSION = "7.0.1";
public static String getVersionString() {
return VERSION;
}
public static void displayBanner() {
System.out.println("...\n... TestNG " + getVersionString() + " by Cédric Beust (c... | null | null |
Disable peripheral mode in N5
bug 16545864
Change-Id: I2273716fbce151173c067b8441e749c78e17141e
Apply this change to `bluetooth/bdroid_buildcfg.h` and return the full updated file.
```c
/*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you ... | ```c
/*
* Copyright 2013 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 required by ap... | null | null |
Use all the months of the year and tweak palette.
- Picked a continuous palette and reversed as better for the data.
Apply this change to `examples/charts/file/cat_heatmap.py` and return the full updated file.
```python
from bokeh.charts import HeatMap, output_file, show
from bokeh.sampledata.unemployment1948 import... | ```python
from bokeh.charts import HeatMap, output_file, show
from bokeh.palettes import YlOrRd9 as palette
from bokeh.sampledata.unemployment1948 import data
# pandas magic
df = data[data.columns[:-1]]
df2 = df.set_index(df[df.columns[0]].astype(str))
df2.drop(df.columns[0], axis=1, inplace=True)
df3 = df2.transpose(... | null | null |
Make sure to clean my dic.
Apply this change to `WalletWasabi/Extensions/MemoryExtensions.cs` and return the full updated file.
```csharp
using Nito.AsyncEx;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Extensions.Caching.Memory
{
public static... | ```csharp
using Nito.AsyncEx;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Extensions.Caching.Memory
{
public static class MemoryExtensions
{
private static Dictionary<object, AsyncLock> AsyncLocks { get; } = new Dictionary<... | null | null |
Use original method name as variable
Apply this change to `lib/scout/worker.rb` and return the full updated file.
```ruby
# TODO (smolnar)
# * create custom handlers for preprocessing args
# * add option to specify context which method run on (class or instance)
# * figure out specs
module Scout
module Worker
... | ```ruby
# TODO (smolnar)
# * create custom handlers for preprocessing args
# * add option to specify context which method run on (class or instance)
# * figure out specs
module Scout
module Worker
extend ActiveSupport::Concern
included do
include Sidekiq::Worker
end
module ClassMethods
... | null | null |
Drop and revert code added for invalid indexes
Apply this change to `sql/i4_invalid_indexes.sql` and return the full updated file.
```sql
-- List of invalid indexes
-- Use it to see invalid indexes list
-- This query doesn't need any additional extensions to be installed
-- (except plpgsql), and doesn't create anyt... | ```sql
-- List of invalid indexes
-- Use it to see invalid indexes list
-- This query doesn't need any additional extensions to be installed
-- (except plpgsql), and doesn't create anything (like views or smth)
-- -- so feel free to use it in your clouds (Heroku, AWS RDS, etc)
-- (Keep in mind, that on replicas, the... | null | null |
Fix build that broke because of `file-loader` upgrade.
Apply this change to `server/src/main/webapp/WEB-INF/rails/webpack/config/loaders/static-assets-loader.ts` and return the full updated file.
```typescript
/*
* Copyright 2019 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License")... | ```typescript
/*
* Copyright 2019 ThoughtWorks, Inc.
*
* 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 applica... | null | null |
meta: Use array instead of slice in VerifyPadding.
Apply this change to `meta/padding.go` and return the full updated file.
```go
package meta
import (
"errors"
"io"
)
// VerifyPadding verifies that the padding metadata block only contains 0 bits.
// The provided io.Reader should limit the amount of data that can... | ```go
package meta
import (
"errors"
"io"
)
// VerifyPadding verifies that the padding metadata block only contains 0 bits.
// The provided io.Reader should limit the amount of data that can be read to
// header.Length bytes.
func VerifyPadding(r io.Reader) (err error) {
// Verify up to 4 kb of padding each iterat... | null | null |
Add Subscription funct operator and remove close since it was not possible to be used correctly anyway
Apply this change to `src/subscription.rs` and return the full updated file.
```rust
use consumer::*;
/// Represents a subscription to a `Stream`
pub struct Subscription {
closed: bool,
}
impl Subscription {
... | ```rust
use consumer::*;
/// Represents a subscription to a `Stream`
pub struct Subscription;
/// Represents a subscription to a `Stream` based on an action
pub struct SubscriptionAction<F> {
f: F,
}
/// Represents a subscription to a `Stream` based on a func
pub struct SubscriptionFunc<F> {
predicate: F,
}
... | null | null |
Fix crash for mono 5.0.
Apply this change to `electron-dotnet/src/mono/dictionary.cpp` and return the full updated file.
```cpp
#include "edge.h"
void Dictionary::Add(MonoObject* _this, const char* name, MonoObject* value)
{
static MonoMethod* add;
if(!add) {
add = mono_class_get_method_from_nam... | ```cpp
#include "edge.h"
void Dictionary::Add(MonoObject* _this, const char* name, MonoObject* value)
{
static MonoMethod* add;
if(!add) {
add = mono_class_get_method_from_name(mono_object_get_class(_this),
"System.Collections.Generic.IDictionary<string,object>.Add", -1);
// This... | null | null |
Change some char type variables to unsigned char
Apply this change to `lib/quagga/src/common.h` and return the full updated file.
```c
/*
* OLSRd Quagga plugin
*
* Copyright (C) 2006-2008 Immo 'FaUl' Wehrenberg <immo@chaostreff-dortmund.de>
* Copyright (C) 2007-2010 Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
*
*... | ```c
/*
* OLSRd Quagga plugin
*
* Copyright (C) 2006-2008 Immo 'FaUl' Wehrenberg <immo@chaostreff-dortmund.de>
* Copyright (C) 2007-2010 Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License versio... | null | null |
Remove explicit dependency on hashie
Octokit already depends on it.
Apply this change to `hubtime.gemspec` and return the full updated file.
```ruby
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "hubtime/version"
Gem::Specification.new do |s|
s.name = "hubtime"
s.version ... | ```ruby
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "hubtime/version"
Gem::Specification.new do |s|
s.name = "hubtime"
s.version = Hubtime::VERSION
s.summary = "Visualization of your Github activity over the past year via Github API."
s.email = "contact@p... | null | null |
Solve a bug with line endings
Apply this change to `example/linux/main.c` and return the full updated file.
```c
/* INCLUDES */
#include <stdio.h>
#include "commands.h"
#define MAX_MSG_LENGTH 200 //For the receiving frame... (circular buffer)
int main(int argc, char *argv[]) {
char input_... | ```c
/* INCLUDES */
#include <stdio.h>
#include "commands.h"
#define MAX_MSG_LENGTH 200 //For the receiving frame... (circular buffer)
int main(int argc, char *argv[]) {
char input_buffer[MAX_MSG_LENGTH];
int input_argc;
char *input_argv[CMD_MAX_N_OPTIONS+CMD_MAX_N_OPTIONS_WITH_ARG... | null | null |
Add files on the command line, cleanup
Apply this change to `src/github.com/steelseries/golisp/main/repl.go` and return the full updated file.
```go
// Copyright 2013 SteelSeries ApS. All rights reserved.
// No license is given for the use of this source code.
// This package impliments a basic LISP interpretor for ... | ```go
// Copyright 2013 SteelSeries ApS. All rights reserved.
// No license is given for the use of this source code.
// This package impliments a basic LISP interpretor for embedding in a go program for scripting.
// This file provides a repl
package main
import (
"bufio"
"flag"
"fmt"
"github.com/ste... | null | null |
Add proper error handling on wrong numbers
Apply this change to `src/main.rs` and return the full updated file.
```rust
extern crate rand;
use std::io;
use std::cmp::Ordering;
use rand::Rng;
fn main() {
println!("Hello to the guessing game!");
let std_in = io::stdin();
let number_to_guess = rand::thr... | ```rust
extern crate rand;
use std::io;
use std::cmp::Ordering;
use rand::Rng;
fn main() {
println!("Hello to the guessing game!");
let std_in = io::stdin();
let number_to_guess = rand::thread_rng().gen_range(1, 101);
loop {
println!("Please enter a number: ");
let mut guess = Stri... | null | null |
Add dragonfly to bsd build
Dragonfly is a BSD, too.
Apply this change to `isatty_bsd.go` and return the full updated file.
```go
// +build darwin freebsd openbsd netbsd
// +build !appengine
package isatty
import (
"syscall"
"unsafe"
)
const ioctlReadTermios = syscall.TIOCGETA
// IsTerminal return true if the f... | ```go
// +build darwin freebsd openbsd netbsd dragonfly
// +build !appengine
package isatty
import (
"syscall"
"unsafe"
)
const ioctlReadTermios = syscall.TIOCGETA
// IsTerminal return true if the file descriptor is terminal.
func IsTerminal(fd uintptr) bool {
var termios syscall.Termios
_, _, err := syscall.Sy... | null | null |
Add support for doing injecting HttpServerRequest with @Context
Apply this change to `extensions/quarkus-rest/runtime/src/main/java/io/quarkus/rest/runtime/injection/ContextProducers.java` and return the full updated file.
```java
package io.quarkus.rest.runtime.injection;
import javax.enterprise.context.RequestScop... | ```java
package io.quarkus.rest.runtime.injection;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.sse.Sse;
import io.quarkus.rest... | null | null |
[Test] Disable a failing SymbolGraph test.
Apply this change to `test/SymbolGraph/verbose.swift` and return the full updated file.
```swift
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name verbose -emit-module -emit-module-path %t/
// RUN: %target-swift-symbolgraph-extract -module-name verbose... | ```swift
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name verbose -emit-module -emit-module-path %t/
// RUN: %target-swift-symbolgraph-extract -module-name verbose -I %t -pretty-print -output-dir %t | %FileCheck %s -check-prefix=QUIET --allow-empty
// RUN: %target-swift-symbolgraph-extract -modu... | null | null |
Fix vec test compile error.
Apply this change to `test/vecs.rs` and return the full updated file.
```rust
#![feature(custom_attribute)]
#![allow(dead_code, unused_attributes)]
#[miri_run]
fn make_vec() -> Vec<i32> {
let v = Vec::with_capacity(4);
v.push(1);
v.push(2);
v
}
// #[miri_run]
// fn make_v... | ```rust
#![feature(custom_attribute)]
#![allow(dead_code, unused_attributes)]
#[miri_run]
fn make_vec() -> Vec<i32> {
let mut v = Vec::with_capacity(4);
v.push(1);
v.push(2);
v
}
// #[miri_run]
// fn make_vec_macro() -> Vec<i32> {
// vec![1, 2]
// }
``` | null | null |
Rename SPI_START to SPI_ACTIVE and SPI_STOP to SPI_PASSIVE
Apply this change to `src/com/spi.h` and return the full updated file.
```c
//
// spi.h
// Ethernet Shield
//
// Created by EFCM van der Werf on 12/28/13.
// Copyright (c) 2013 EFCM van der Werf. All rights reserved.
//
#ifndef COM_SPI_H
#define COM_SPI_... | ```c
//
// spi.h
// Ethernet Shield
//
// Created by EFCM van der Werf on 12/28/13.
// Copyright (c) 2013 EFCM van der Werf. All rights reserved.
//
#ifndef COM_SPI_H
#define COM_SPI_H
#include "../config.h"
// Do we want SPI?
#ifdef COM_SPI
#include <inttypes.h>
/**
* SPI config
*/
typedef struct spi_config... | null | null |
NOGH: Fix update times not changing after request
Apply this change to `src/main/kotlin/tv/fanart/bot/FanartBot.kt` and return the full updated file.
```kotlin
package tv.fanart.bot
import kotlinx.coroutines.*
import org.koin.core.KoinComponent
import org.koin.core.inject
import tv.fanart.api.FanartApi
import tv.fan... | ```kotlin
package tv.fanart.bot
import kotlinx.coroutines.*
import org.koin.core.KoinComponent
import org.koin.core.inject
import tv.fanart.api.FanartApi
import tv.fanart.config.ConfigRepo
import java.lang.Runnable
import java.util.concurrent.TimeUnit
class FanartBot : KoinComponent {
private val configurationC... | null | null |
Add helper for unmarshaling the request body.
Apply this change to `requests.go` and return the full updated file.
```go
package gowebutils
import (
"io"
"io/ioutil"
"net/http"
)
const MaxRequestSize = 1048576 * 5
func PrepareRequestBody(r *http.Request) ([]byte, error) {
body, err := ioutil.ReadAll(io.LimitRe... | ```go
package gowebutils
import (
"encoding/json"
"io"
"io/ioutil"
"net/http"
)
const MaxRequestSize = 1048576 * 5
func PrepareRequestBody(r *http.Request) ([]byte, error) {
body, err := ioutil.ReadAll(io.LimitReader(r.Body, MaxRequestSize))
if err != nil {
return body, err
}
err = r.Body.Close()
return b... | null | null |
Fix category of revision log RSS feeds.
git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@2261 af82e41b-90c4-0310-8c96-b1721e28e2e2
Apply this change to `templates/log_rss.cs` and return the full updated file.
```csharp
<?xml version="1.0"?>
<!-- RSS generated by Trac v<?cs var:trac.version ?> on <?cs var:trac.ti... | ```csharp
<?xml version="1.0"?>
<!-- RSS generated by Trac v<?cs var:trac.version ?> on <?cs var:trac.time ?> -->
<rss version="2.0">
<channel><?cs
if:project.name_encoded ?>
<title><?cs var:project.name_encoded ?>: Revisions of <?cs var:log.path ?></title><?cs
else ?>
<title>Revisions of <?cs var:log.path... | null | null |
Use "default_endpoint" instead of deprecated "get_default_endpoint"
Apply this change to `src/character/audio.rs` and return the full updated file.
```rust
use game::constants::PISTOL_AUDIO_PATH;
use rodio;
use rodio::Sink;
use std::fs::File;
use std::io::BufReader;
pub struct CharacterAudio {
sink: Sink,
}
impl ... | ```rust
use game::constants::PISTOL_AUDIO_PATH;
use rodio;
use rodio::Sink;
use std::fs::File;
use std::io::BufReader;
pub struct CharacterAudio {
sink: Sink,
}
impl CharacterAudio {
pub fn new() -> CharacterAudio {
let endpoint = rodio::default_endpoint().unwrap();
CharacterAudio {
sink: Sink::new(... | null | null |
Implement play and stop sound
Apply this change to `src/app.js` and return the full updated file.
```javascript
(function (window) {
'use strict';
var hearingTest = HearingTest;
var hearing = hearingTest.init();
var app = new Vue({
el: '#hearing-test-app',
data: {
isPlaySound: false,
frequency: 1000
... | ```javascript
(function (window) {
'use strict';
var hearingTest = HearingTest;
var hearing = hearingTest.init();
var app = new Vue({
el: '#hearing-test-app',
data: {
isPlaySound: false,
frequency: 1000
},
methods: {
changeFrequency: function() {
hearing.sound.frequency.value = this.frequency... | null | null |
Use floats across the camera calculations
/2 > 0.5f
Apply this change to `Assets/HoloToolkit/Utilities/Scripts/Extensions/CameraExtensions.cs` and return the full updated file.
```csharp
using UnityEngine;
namespace HoloToolkit.Unity
{
public static class CameraExtensions
{
/// <summary>
///... | ```csharp
using UnityEngine;
namespace HoloToolkit.Unity
{
public static class CameraExtensions
{
/// <summary>
/// Get the horizontal FOV from the stereo camera
/// </summary>
/// <returns></returns>
public static float GetHorizontalFieldOfViewRadians(this Camera camer... | null | null |
Allow removal of obsolete translations
Apply this change to `bin/update_translations.sh` and return the full updated file.
```bash
#!/bin/bash
POT_FILE=lektor_creative_commons/locales/messages.pot
xgettext --no-location lektor_creative_commons/plugin.py --join-existing --output $POT_FILE
for file in $(find . -name... | ```bash
#!/bin/bash
POT_FILE=lektor_creative_commons/locales/messages.pot
xgettext --no-location lektor_creative_commons/plugin.py --output $POT_FILE
for file in $(find . -name '*.po') ; do
msgmerge --quiet --no-location --backup=none --update $file $POT_FILE
done
``` | null | null |
Add Glogger, Logger that uses package glog
Apply this change to `logging.go` and return the full updated file.
```go
// Logging helpers
package autosite
import (
"net/http"
)
// LoggerFunc returns a logger from a http request.
type LoggerFunc func(*http.Request) Logger
// Logger specifies logging functions.
type ... | ```go
// Logging helpers
package autosite
import (
"net/http"
"github.com/golang/glog"
)
// LoggerFunc returns a logger from a http request.
type LoggerFunc func(*http.Request) Logger
// Logger specifies logging functions.
//
// The methods are chosen to match the logging methods from
// appengine.Context, withou... | null | null |
Revert "drop expected errors to raise the exception directly"
This reverts commit 785dfebc947fd5b1173db0db9fde940efcd7404b.
Apply this change to `app/src/lib/git/fetch.ts` and return the full updated file.
```typescript
import { git, envForAuthentication } from './core'
import { Repository } from '../../models/repos... | ```typescript
import { git, envForAuthentication, expectedAuthenticationErrors } from './core'
import { Repository } from '../../models/repository'
import { User } from '../../models/user'
/** Fetch from the given remote. */
export async function fetch(repository: Repository, user: User | null, remote: string): Promis... | null | null |
Update HTML to "rich" in description
Apply this change to `src/ContentWidget.php` and return the full updated file.
```php
<?php
namespace SilverStripe\ContentWidget;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
use SilverStripe\Widgets\Model... | ```php
<?php
namespace SilverStripe\ContentWidget;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
use SilverStripe\Widgets\Model\Widget;
/**
* Content Widget
*/
class ContentWidget extends Widget
{
private static $db = [
"HTML" => ... | null | null |
Update i686-linux-android features to match android ABI.
Apply this change to `src/librustc_back/target/i686_linux_android.rs` and return the full updated file.
```rust
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.o... | ```rust
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE... | null | null |
Break dependency on profiler to the json package
This lays more of the groundwork for the core package to
no longer be split (required for Java 9 modules) without
us having to do a lot of additional work or move classes
around.
Apply this change to `java/client/src/org/openqa/selenium/logging/profiler/HttpProfilerLog... | ```java
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"... | null | null |
Update assert to be more verbose
Apply this change to `src/main/java/seedu/tache/logic/commands/UndoCommand.java` and return the full updated file.
```java
package seedu.tache.logic.commands;
import seedu.tache.logic.commands.exceptions.CommandException;
public class UndoCommand extends Command {
public static... | ```java
package seedu.tache.logic.commands;
import seedu.tache.logic.commands.exceptions.CommandException;
public class UndoCommand extends Command {
public static final String COMMAND_WORD = "undo";
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\n" + "Undoes the last change to the address book... | null | null |
Consolidate creation of storage::spi::Bucket in unit tests.
Apply this change to `searchcore/src/vespa/searchcore/proton/test/bucketfactory.cpp` and return the full updated file.
```cpp
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bu... | ```cpp
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bucketfactory.h"
#include <vespa/persistence/spi/test.h>
using document::BucketId;
using document::DocumentId;
using storage::spi::Bucket;
using storage::spi::PartitionId;
using stor... | null | null |
Put offline archive of site into site directory
This enables easier automatic pull based publishing.
Apply this change to `_scripts/_publish.sh` and return the full updated file.
```bash
#!/bin/bash
VERSION=$1
SERVER=$2
PORT=$3
if [ -z "$WRKDIR" ]
then
echo Environment WRKDIR is not set, setting it to current ... | ```bash
#!/bin/bash
VERSION=$1
SERVER=$2
PORT=$3
if [ -z "$WRKDIR" ]
then
echo Environment WRKDIR is not set, setting it to current working directory
WRKDIR=`pwd`
export WRKDIR
fi
cd $WRKDIR
find documentation-generator/pages -name "*.markdown" | xargs rm
cp `find documentation-generator/pages -name "*.*... | null | null |
Set the default status for media galleries to active
Apply this change to `src/Backend/Modules/MediaGalleries/Domain/MediaGallery/Command/CreateMediaGallery.php` and return the full updated file.
```php
<?php
namespace Backend\Modules\MediaGalleries\Domain\MediaGallery\Command;
use Backend\Modules\MediaGalleries\Do... | ```php
<?php
namespace Backend\Modules\MediaGalleries\Domain\MediaGallery\Command;
use Backend\Modules\MediaGalleries\Domain\MediaGallery\MediaGalleryDataTransferObject;
use Backend\Modules\MediaGalleries\Domain\MediaGallery\Status;
use Backend\Modules\MediaLibrary\Domain\MediaGroup\MediaGroup;
use Backend\Modules\Me... | null | null |
Check that assets are opened properly.
Apply this change to `src/VBE/system/sdl2/StorageImpl.cpp` and return the full updated file.
```cpp
#include <fstream>
#include <VBE/system/sdl2/StorageImpl.hpp>
// static
std::unique_ptr<std::istream> StorageImpl::openAsset(const std::string& filename) {
// Open in binary mo... | ```cpp
#include <fstream>
#include <VBE/system/sdl2/StorageImpl.hpp>
#include <VBE/system/Log.hpp>
// static
std::unique_ptr<std::istream> StorageImpl::openAsset(const std::string& filename) {
// Open in binary mode so Windows doesn't change LF to CRLF,
// which will corrupt binary files such as images.
std::ifstr... | null | null |
Print random time based on date range
Apply this change to `add_random_answers.py` and return the full updated file.
```python
import pandas as pd
import time
from datetime import datetime, date
start_date = date(2014, 1, 1)
end_date = datetime.now()
date_range = pd.date_range(start_date, end_date)
for date in date... | ```python
import pandas as pd
import time
from datetime import datetime, date
from random import randint
start_date = date(2014, 1, 1)
end_date = datetime.now()
date_range = pd.date_range(start_date, end_date)
for date in date_range:
random_hour = randint(10, 17)
random_minute = randint(0, 59)
random_seco... | null | null |
Create instance of class from the config in data source
Apply this change to `Source/WallDataSource.swift` and return the full updated file.
```swift
import UIKit
import AsyncDisplayKit
extension WallController: ASCollectionViewDataSource {
public func numberOfSectionsInCollectionView(collectionView: UICollection... | ```swift
import UIKit
import AsyncDisplayKit
extension WallController: ASCollectionViewDataSource {
public func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
return 1
}
public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
... | null | null |
Add simplejson as requirement for python 2.5
Apply this change to `setup.py` and return the full updated file.
```python
"""
Flask-MongoKit
--------------
Flask-MongoKit simplifies to use MongoKit, a powerful MongoDB ORM in Flask
applications.
Links
`````
* `documentation <http://packages.python.org/Flask-Mo... | ```python
"""
Flask-MongoKit
--------------
Flask-MongoKit simplifies to use MongoKit, a powerful MongoDB ORM in Flask
applications.
Links
`````
* `documentation <http://packages.python.org/Flask-MongoKit>`_
* `development version <http://github.com/jarus/flask-mongokit/zipball/master#egg=Flask-MongoKit-dev>`_
* `Mo... | null | null |
Disable the mailbox runner as needs to be updated:
* To fix socket exception.
* Switch from Mail to IMAP so that it marks messages as read.
Apply this change to `config/schedule.rb` and return the full updated file.
```ruby
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely ne... | ```ruby
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron
# Example:
#
# set :output, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyMode... | null | null |
Update settings with username and conference ids
Apply this change to `CodeCamp/Helpers/Settings.cs` and return the full updated file.
```csharp
// Helpers/Settings.cs
using Refractored.Xam.Settings;
using Refractored.Xam.Settings.Abstractions;
namespace CodeCamp.Helpers
{
/// <summary>
/// This is the Settings ... | ```csharp
// Helpers/Settings.cs
using Refractored.Xam.Settings;
using Refractored.Xam.Settings.Abstractions;
namespace CodeCamp.Helpers
{
/// <summary>
/// This is the Settings static class that can be used in your Core solution or in any
/// of your client applications. All settings are laid out the same exact... | null | null |
Fix filereader to allow reading from jar file
Apply this change to `src/main/java/com/github/alexvictoor/livereload/FileReader.java` and return the full updated file.
```java
package com.github.alexvictoor.livereload;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.ne... | ```java
package com.github.alexvictoor.livereload;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Scanner;... | null | null |
Add id column in emails and foreign key constraint to pacakges.
Apply this change to `sql/branch.sql` and return the full updated file.
```sql
BEGIN;
CREATE TABLE package_managers
( id bigserial PRIMARY KEY
, name text NOT NULL UNIQUE
);
CREATE TABLE packages
( ... | ```sql
BEGIN;
CREATE TABLE package_managers
( id bigserial PRIMARY KEY
, name text NOT NULL UNIQUE
);
CREATE TABLE packages
( id bigserial PRIMARY KEY
, package_manager_id bigint NOT NULL REFERENCES ... | null | null |
Add dependency on the `tools-api`.
Apply this change to `tools/smoke-tests/test-factories/build.gradle.kts` and return the full updated file.
```kotlin
/*
* Copyright 2020, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above... | ```kotlin
/*
* Copyright 2020, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY ... | null | null |
UPDATE doubble checked for Fransisco
Apply this change to `SSPSolution/SSPSolution/GameState.h` and return the full updated file.
```c
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATE_H
#define SSPAPPLICATION_GAMESTATES_GAMESTATE_H
#include "InputHandler.h"
#include "ComponentHandler.h"
#include "../GraphicsDLL/Camera.h"
... | ```c
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATE_H
#define SSPAPPLICATION_GAMESTATES_GAMESTATE_H
#include "InputHandler.h"
#include "ComponentHandler.h"
#include "../GraphicsDLL/Camera.h"
//#include "../NetworkDLL/NetworkModule.h"
//class NetworkModule;
class GameStateHandler;
class GameState
{
private: //Variables
p... | null | null |
TestFixtures: Load fixtures path from class loader
Apply this change to `src/test/kotlin/com/emberjs/EmberTestFixtures.kt` and return the full updated file.
```kotlin
package com.emberjs
import com.intellij.mock.MockVirtualFile
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
object EmberTes... | ```kotlin
package com.emberjs
import com.intellij.mock.MockVirtualFile
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
object EmberTestFixtures {
val FIXTURES_RESOURCE = ClassLoader.getSystemResource("com/emberjs/fixtures")
val FIXTURES_PATH = Paths.get(FIXTURES_RESOURCE.toURI()).toA... | null | null |
Change the baudrate according to the CmdMessenger Receive example
Apply this change to `src/examples/led.cpp` and return the full updated file.
```cpp
#include <iostream>
#include "CmdMessenger.h"
using namespace std;
enum
{
ksetled
};
int main(int argc, char *argv[])
{
if(argc == 2){
char op;
cmd::C... | ```cpp
#include <iostream>
#include "CmdMessenger.h"
using namespace std;
enum
{
ksetled
};
int main(int argc, char *argv[])
{
if(argc == 2){
char op;
cmd::CmdMessenger arduino(argv[1], 115200);
cmd::Cmd led(ksetled);
cmd::Timeout timeout = cmd::Timeout::simpleTimeout(1000);
arduino.setTim... | null | null |
Remove long utility command names in favor of awp
Apply this change to `setup.py` and return the full updated file.
```python
#!/usr/bin/env python
# coding=utf-8
from setuptools import setup
# Get long description (used on PyPI project page)
def get_long_description():
try:
# Use pandoc to create reSt... | ```python
#!/usr/bin/env python
# coding=utf-8
from setuptools import setup
# Get long description (used on PyPI project page)
def get_long_description():
try:
# Use pandoc to create reStructuredText README if possible
import pypandoc
return pypandoc.convert('README.md', 'rst')
except... | null | null |
Fix iam2 ldap upgrade sql
Resolves http://jira.zstack.io/browse/ZSTAC-21340
Signed-off-by: AlanJager <7ba0221af525cfcc7adbf94f7fc6b46fa1dcb7c9@outlook.com>
Apply this change to `conf/db/upgrade/V3.5.1__schema.sql` and return the full updated file.
```sql
CREATE TABLE `zstack`.`LdapResourceRefVO` (
`uuid` varc... | ```sql
CREATE TABLE `zstack`.`LdapResourceRefVO` (
`uuid` varchar(32) NOT NULL UNIQUE,
`ldapUid` varchar(255) NOT NULL,
`ldapGlobalUuid` varchar(255),
`ldapServerUuid` varchar(255) NOT NULL,
`resourceUuid` varchar(32) NOT NULL,
`resourceType` varchar(255) NOT NULL,
`lastOpDate` time... | null | null |
Exclude 3rd party code from the controller tests code coverage.
Apply this change to `You-Controller-Tests/exclusions.h` and return the full updated file.
```c
#pragma once
#ifndef YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
#define YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
// A local define since there is no way to test whether a ... | ```c
#pragma once
#ifndef YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
#define YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
// A local define since there is no way to test whether a header file exists.
// If you have VS Premium, then add it to the project definition (user
// properties) file
#ifdef MS_CPP_CODECOVERAGE
/// \file Exclusio... | null | null |
Allow dataflow-in to accept multiple values.
Apply this change to `src/writer/verilog/dataflow_in.cpp` and return the full updated file.
```cpp
#include "writer/verilog/dataflow_in.h"
#include "iroha/i_design.h"
#include "iroha/resource_class.h"
#include "writer/module_template.h"
#include "writer/verilog/insn_write... | ```cpp
#include "writer/verilog/dataflow_in.h"
#include "iroha/i_design.h"
#include "iroha/resource_class.h"
#include "writer/module_template.h"
#include "writer/verilog/insn_writer.h"
#include "writer/verilog/module.h"
#include "writer/verilog/shared_reg.h"
namespace iroha {
namespace writer {
namespace verilog {
D... | null | null |
Fix invalid write in RenderViewHostObserver.
TBR=avi
Review URL: http://codereview.chromium.org/6813065
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@81023 0039d316-1c4b-4281-b951-d872f2087c98
Apply this change to `content/browser/renderer_host/render_view_host_observer.cc` and return the full updated file.
... | ```cpp
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/renderer_host/render_view_host_observer.h"
#include "content/browser/renderer_host/render_view_host.h"
RenderViewHo... | null | null |
Remove comment and redundant include
Apply this change to `cameras/src/pinhole_camera.cpp` and return the full updated file.
```cpp
#include "cameras/itf/pinhole_camera.h"
#include "core/itf/film.h"
#include "core/itf/ray.h"
#include "core/itf/sampling.h"
#include <iostream>
using namespace lb;
/// Constructs a p... | ```cpp
#include "cameras/itf/pinhole_camera.h"
#include "core/itf/film.h"
#include "core/itf/ray.h"
#include "core/itf/sampling.h"
using namespace lb;
/// Constructs a pinhole camera, where the image plane's origin is pointed to
/// the by the look at vector relative from the camera's location. Together with
/// the... | null | null |
Add forced downcast to GTRepository
to get rid of warning about AnyObject!
Apply this change to `ObjectiveGit.playground/contents.swift` and return the full updated file.
```swift
//
// This playground must be opened using the enclosed workspace in order for the
// ObjectiveGit module to be available.
//
import Obje... | ```swift
//
// This playground must be opened using the enclosed workspace in order for the
// ObjectiveGit module to be available.
//
import ObjectiveGit
let url = NSURL(string: "https://github.com/phatblat/objective-git.git") as NSURL?
let workdirURL = NSURL(string: "/tmp/objective-git") as NSURL?
var error: NSError... | null | null |
fix: Add missing brew commands (bash) and change incorrect remove path
Apply this change to `Scripts/travis_build_codecov.sh` and return the full updated file.
```bash
#!/usr/bin/env bash
set -e
export NUM_JOBS=1
brew update;
brew install lcov;
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_COVERA... | ```bash
#!/usr/bin/env bash
set -e
export NUM_JOBS=1
brew update;
brew install bash;
brew install lcov;
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_COVERAGE=ON
make UnitTests
lcov -c -i -d Tests/UnitTests -o base.info
bin/UnitTests
lcov -c -d Tests/UnitTests -o test.info
lcov -a base.info -a test... | null | null |
Use pathname for file loading
Apply this change to `lib/setty/loader.rb` and return the full updated file.
```ruby
require 'erb'
require 'yaml'
require 'active_support/core_ext/hash/keys.rb'
require 'active_support/core_ext/string/inflections.rb'
module Setty
MissingEnviromentError = Class.new(RuntimeError)
cla... | ```ruby
require 'erb'
require 'yaml'
require 'pathname'
require 'active_support/core_ext/hash/keys.rb'
require 'active_support/core_ext/string/inflections.rb'
module Setty
MissingEnviromentError = Class.new(RuntimeError)
class Loader
def initialize(path, enviroment)
@base_path = Pathname(path)
@e... | null | null |
Update the admin settings table with the new verify users and allow registration parts.
Apply this change to `www/sql_update/wi_adminsetting.sql` and return the full updated file.
```sql
CREATE TABLE `wi_adminsetting` (
`id` int(11) NOT NULL auto_increment,
`startregion` varchar(255) NOT NULL,
`userdir` varchar... | ```sql
CREATE TABLE `wi_adminsetting` (
`id` int(11) NOT NULL auto_increment,
`startregion` varchar(255) NOT NULL,
`userdir` varchar(255) NOT NULL,
`griddir` varchar(255) NOT NULL,
`assetdir` varchar(255) NOT NULL,
`lastnames` varchar(10) NOT NULL,
`adress` varchar(32) NOT NULL,
`region` text NOT NULL,
... | null | null |
Support non-root instalation of DB
While the root user would generally run EmPyre.py, in some cases a normal user could run the application merely using 1024 < ports.
Apply this change to `setup/reset.sh` and return the full updated file.
```bash
#!/bin/bash
IFS='/' read -a array <<< pwd
if [[ "$(pwd)" != *setup ]... | ```bash
#!/bin/bash
IFS='/' read -a array <<< pwd
if [[ "$(pwd)" != *setup ]]
then
cd ./setup
fi
# reset the database
rm ../data/empyre.db
./setup_database.py
cd ..
# remove the debug file if it exists
rm empyre.debug
# remove the download folders
rm -rf ./downloads/
# start up EmPyre
./empyre --debug
# Support... | null | null |
Fix currency get name when it has no code
Apply this change to `src/Sylius/Component/Currency/Model/Currency.php` and return the full updated file.
```php
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
*... | ```php
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Currency\Model;
use Sylius\Component\Reso... | null | null |
Make log pattern less noisy.
Apply this change to `src/main/java/com/intellij/plugins/pageObjectEvaluator/RunPageObjectMain.java` and return the full updated file.
```java
package com.intellij.plugins.pageObjectEvaluator;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.lo... | ```java
package com.intellij.plugins.pageObjectEvaluator;
import org.apache.log4j.*;
public class RunPageObjectMain {
public static void main(String[] args) {
ConsoleAppender consoleAppender = new ConsoleAppender(new PatternLayout("%m%n"));
BasicConfigurator.configure(consoleAppender);
L... | null | null |
Complete naive solution by nested for loops
Apply this change to `lc560_subarray_sum_equals_k.py` and return the full updated file.
```python
"""560. Subarray Sum Equals K
Medium
Given an array of integers and an integer k, you need to find the total
number of continuous subarrays whose sum equals to k.
Example 1:... | ```python
"""560. Subarray Sum Equals K
Medium
Given an array of integers and an integer k, you need to find the total
number of continuous subarrays whose sum equals to k.
Example 1:
Input: nums = [1,1,1], k = 2
Output: 2
Note:
The length of the array is in range [1, 20,000].
The range of numbers in the array is [... | null | null |
Update API to optionally hide disabled controls.
Apply this change to `shackle.js` and return the full updated file.
```javascript
/**
* Shackle allows you to bind a form control or
* fieldset's enabled/disabled state to the checked/unchecked
* state of a radio button or checkbox.
* Simply Include Shackle and call:
*... | ```javascript
/**
* Shackle allows you to bind a form control or
* fieldset's enabled/disabled state to the checked/unchecked
* state of a radio button or checkbox.
* Simply Include Shackle and call:
* Shackle.pair(id-of-enabling-element, id-of-affected-element);
*/
var Shackle = (function(document, window) {
//Make ... | null | null |
Use errors.New() instead of fmt.Errorf() where appropriate.
Apply this change to `varmor/varmor.go` and return the full updated file.
```go
package armoredcrypt
import (
"fmt"
"encoding/base64"
"strings"
)
const (
_MAGIC_PREFIX = "saltybox"
_V1_MAGIC = "saltybox1:"
)
func Wrap(body []byte) string {
encoded :... | ```go
package armoredcrypt
import (
"fmt"
"encoding/base64"
"strings"
"errors"
)
const (
_MAGIC_PREFIX = "saltybox"
_V1_MAGIC = "saltybox1:"
)
func Wrap(body []byte) string {
encoded := base64.RawURLEncoding.EncodeToString(body)
return fmt.Sprintf("%s%s", _V1_MAGIC, encoded)
}
func Unwrap(varmoredBody stri... | null | null |
Increase size of the console
Apply this change to `src/main.rs` and return the full updated file.
```rust
extern crate tcod;
extern crate rslike;
use rslike::gui::{GUI, TCODConsole};
use rslike::engine::Game;
use rslike::util::units::Size;
fn main() {
let game = Game::new();
let mut tcod_console = TCODConso... | ```rust
extern crate tcod;
extern crate rslike;
use rslike::gui::{GUI, TCODConsole};
use rslike::engine::Game;
use rslike::util::units::Size;
fn main() {
let game = Game::new();
let mut tcod_console = TCODConsole::new(Size::new(114, 71));
let mut gui = GUI::new(game, &mut tcod_console);
gui.run();
}
... | null | null |
Use strtol instead of atol; verify conversion.
Apply this change to `src/main.cpp` and return the full updated file.
```cpp
// Nikita Kouevda
// 2013/11/01
#include <iostream>
#include "prime.hpp"
using namespace std;
int main(int argc, char *argv[]) {
if (argc < 2) {
cerr << "Usage: prime number ..." << en... | ```cpp
// Nikita Kouevda
// 2013/11/04
#include <iostream>
#include "prime.hpp"
using namespace std;
int main(int argc, char *argv[]) {
int i, n;
char *endptr;
if (argc < 2) {
cerr << "usage: prime number ..." << endl;
return 1;
}
for (i = 1; i < argc; ++i) {
n = strtol(argv[i], &endptr, 10)... | null | null |
Add password column for Bcrypt gem in user migration
Apply this change to `db/migrate/20170613223606_create_users.rb` and return the full updated file.
```ruby
class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :name, null: false
t.email :email, null: fal... | ```ruby
class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :name, null: false
t.email :email, null: false
t.integer :admin_status, null: false
t.string :password_digest, null: false
t.timestamps, null: false
end
end
end
``` | null | null |
Fix critical issue when running phapp commands.
Apply this change to `src/PhappCommandBase.php` and return the full updated file.
```php
<?php
namespace drunomics\Phapp;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Robo\Tasks;
/**
* Base class for phapp command classes.
*/
abstract class P... | ```php
<?php
namespace drunomics\Phapp;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Robo\Tasks;
/**
* Base class for phapp command classes.
*/
abstract class PhappCommandBase extends Tasks implements LoggerAwareInterface {
use LoggerAwareTrait;
/**
* Whether the command requires a ... | null | null |
fix(kakao): Handle case where email is not present
Apply this change to `allauth/socialaccount/providers/kakao/provider.py` and return the full updated file.
```python
from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.... | ```python
from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class KakaoAccount(ProviderAccount):
@property
def properties(self):
return self.account.extra_data['pro... | null | null |
Add a TODO about deque
Apply this change to `src/main/kotlin/simulator/History.kt` and return the full updated file.
```kotlin
package venus.simulator
class History {
private val diffs = ArrayList<List<Diff>>()
fun add(pre: List<Diff>) = diffs.add(pre.toList())
fun pop() = diffs.removeAt(diffs.size - 1)... | ```kotlin
package venus.simulator
/* TODO: add a way to have a limit (maybe a deque?) */
class History {
private val diffs = ArrayList<List<Diff>>()
fun add(pre: List<Diff>) = diffs.add(pre.toList())
fun pop() = diffs.removeAt(diffs.size - 1)
fun isEmpty() = diffs.isEmpty()
}
``` | null | null |
Add API key and forecast url
Apply this change to `SwiftWeather/ViewController.swift` and return the full updated file.
```swift
//
// ViewController.swift
// SwiftWeather
//
// Created by Niraj on 11/28/14.
// Copyright (c) 2014 Niraj Pant. All rights reserved.
//
import UIKit
class ViewController: UIViewCont... | ```swift
//
// ViewController.swift
// SwiftWeather
//
// Created by Niraj on 11/28/14.
// Copyright (c) 2014 Niraj Pant. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
private let API_KEY = "f16eee6b1d2b74580f38750e03ea836c";
override func viewDidLoad() {
sup... | null | null |
Make EZ mod able to fail in Taiko
Apply this change to `osu.Game.Rulesets.Taiko/Mods/TaikoModEasy.cs` and return the full updated file.
```csharp
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulese... | ```csharp
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using Humanizer;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
usin... | null | null |
Replace name in alternative language to prevent compilation problems
with LaTeX
Apply this change to `examples/05_alternative_language.py` and return the full updated file.
```python
#!/usr/bin/env python
from pyhmsa.datafile import DataFile
from pyhmsa.type.language import langstr
datafile = DataFile()
author = la... | ```python
#!/usr/bin/env python
from pyhmsa.datafile import DataFile
from pyhmsa.type.language import langstr
datafile = DataFile()
author = langstr('Wilhelm Conrad Roentgen', {'de': u'Wilhelm Conrad Röntgen'})
datafile.header.author = author
print(datafile.header.author.alternatives['de']) # Returns ...
``` | null | null |
Create create_db, drop_db and create_admin functions
Apply this change to `manage.py` and return the full updated file.
```python
from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager = Man... | ```python
from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def create_db():
"""Creates the db tables."""
... | null | null |
Support height, width, and alt attributes for images in Markdown images.
Apply this change to `src/sanitizer/index.ts` and return the full updated file.
```typescript
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import * as sanitize from 'sanitize-html';
exp... | ```typescript
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import * as sanitize from 'sanitize-html';
export
interface ISanitizer {
/**
* Sanitize an HTML string.
*/
sanitize(dirty: string): string;
}
/**
* A class to sanitize HTML strings.
*/
cl... | null | null |
Set research level in ticker
Apply this change to `server/worker/queue.py` and return the full updated file.
```python
"""Process queues."""
from datetime import datetime
from server.extensions import db
from server.models import QueueEntry
def finished_entries():
"""Process finished entries."""
queue_entr... | ```python
"""Process queues."""
from datetime import datetime
from server.extensions import db
from server.models import QueueEntry
def finished_entries():
"""Process finished entries."""
queue_entries = db.session.query(QueueEntry) \
.filter(QueueEntry.finishes_at <= datetime.now()) \
.all()... | null | null |
Use the correct function to trigger autoload
I think this must be pedantic because there is no way you could know it
is actually an interface before loading the file.
Apply this change to `src/CoreBundle/Serializer/SerializerHandlerInterface.php` and return the full updated file.
```php
<?php
/*
* This file is par... | ```php
<?php
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\CoreBundle\Serializer;
if (!interface_e... | null | null |
Remove colour properties and rely on parent
Apply this change to `osu.Framework/Graphics/Shapes/Circle.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.githubusercontent.com/ppy/osu-framework/master/LICENCE
us... | ```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 osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
namespace osu.Framework.... | null | null |
Add missing return statement in setSearchTerm
Apply this change to `js/reducers.js` and return the full updated file.
```javascript
import { SET_SEARCH_TERM } from './actions'
const DEFAULT_STATE = {
searchTerm: ''
}
const setSearchTerm = (state, action) => {
const newState = {}
Object.assign(newState, state,... | ```javascript
import { SET_SEARCH_TERM } from './actions'
const DEFAULT_STATE = {
searchTerm: ''
}
const setSearchTerm = (state, action) => {
const newState = {}
Object.assign(newState, state, {searchTerm: action.searchTerm})
return newState
}
const rootReducer = (state = DEFAULT_STATE, action) => {
switch... | null | null |
Fix separate regexp tests with changed arg type
Apply this change to `rules/regexp/regexp_test.go` and return the full updated file.
```go
package regexp
import (
"testing"
"github.com/tonyhb/govalidate/rules"
)
func TestRegexp(t *testing.T) {
object := rules.ValidationData{
Field: "Test",
Args: []interfac... | ```go
package regexp
import (
"testing"
"github.com/tonyhb/govalidate/rules"
)
func TestRegexp(t *testing.T) {
object := rules.ValidationData{
Field: "Test",
Args: []string{"/^[a-zA-Z]{3,5}[0-9]+$/"},
}
var valid = []interface{}{
"aaaaa0",
"aaa123456789",
}
var invalid = []interface{}{
1,
'a',
... | null | null |
Add valid length unit tests
Apply this change to `test/lib/index.js` and return the full updated file.
```javascript
/* eslint-env browser, mocha */
/* global expect, sinon, units */
/* eslint no-unused-expressions: 0 */
'use strict';
describe('units', function() {
it('should be defined as an object', function() ... | ```javascript
/* eslint-env browser, mocha */
/* global expect, sinon, units */
/* eslint no-unused-expressions: 0 */
'use strict';
describe('units', function() {
var lengthUnits = ['%', 'ch', 'cm', 'em', 'ex', 'in', 'mm', 'pc', 'pt', 'px', 'rem', 'vh', 'vmax', 'vmin', 'vw'];
var parseValid = function(value, unit... | null | null |
TST: Update travis testing to use latest virtualenv.
The virtualenv version was pinned to 14.0.6, which seems to have started
causing test failures on Python 2.7 for some unknown reason. The lastest
version is 16.0.0 and that seems to fix the problem.
Apply this change to `tools/travis-before-install.sh` and return t... | ```bash
#!/bin/bash
uname -a
free -m
df -h
ulimit -a
mkdir builds
pushd builds
# Build into own virtualenv
# We therefore control our own environment, avoid travis' numpy
pip install -U virtualenv
if [ -n "$USE_DEBUG" ]
then
virtualenv --python=python3-dbg venv
else
virtualenv --python=python venv
fi
source ven... | null | null |
Add a test for mapPropsOnChange
Apply this change to `src/packages/recompose/__tests__/mapPropsOnChange-test.js` and return the full updated file.
```javascript
import test from 'ava'
import React from 'react'
import { mapPropsOnChange, withState, flattenProp, compose } from '../'
import { mount } from 'enzyme'
impor... | ```javascript
import test from 'ava'
import React from 'react'
import { mapPropsOnChange, withState, flattenProp, compose } from '../'
import { mount } from 'enzyme'
import sinon from 'sinon'
test('mapPropsOnChange maps subset of owner props to child props', t => {
const mapSpy = sinon.spy()
const StringConcat = c... | null | null |
Update dependency to work on conda
requests_oauthlib dependency name will only install from pip, requests-oauthlib works on both conda and pip
Apply this change to `setup.py` and return the full updated file.
```python
#!/usr/bin/env python
# encoding=utf-8
from __future__ import print_function
import os
import sys
... | ```python
#!/usr/bin/env python
# encoding=utf-8
from __future__ import print_function
import os
import sys
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
pytest_r... | null | null |
Fix 1.8.7 parsing and skip
Apply this change to `spec/supports_resource_locking.rb` and return the full updated file.
```ruby
require "webmock/minitest"
module SupportsResourceLocking
def self.included(base)
base.class_eval do
let(:collection_name) { subject.collection_name }
def test_responds_to_... | ```ruby
require "webmock/minitest"
module SupportsResourceLocking
def self.included(base)
base.class_eval do
let(:collection_name) { subject.collection_name }
def test_responds_to_locked
assert_respond_to subject, :locked?
end
def test_responds_to_lock
assert_respond_to ... | null | null |
Upgrade six 1.10 to 1.11
Apply this change to `setup.py` and return the full updated file.
```python
import sys
from setuptools import setup, find_packages
with open('VERSION') as version_fp:
VERSION = version_fp.read().strip()
if sys.version_info[:2] < (3, 4):
django_version = '1.8'
else:
django_ver... | ```python
import sys
from setuptools import setup, find_packages
with open('VERSION') as version_fp:
VERSION = version_fp.read().strip()
if sys.version_info[:2] < (3, 4):
django_version = '1.8'
else:
django_version = '1.9'
setup(
name='django-perms',
version=VERSION,
url='https://github.c... | null | null |
Allow for checking search rate limit.
Apply this change to `rate_limit.py` and return the full updated file.
```python
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | ```python
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca>
#
# 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.... | null | null |
Fix Linux hanging bug due to USB drive enumeration
Apply this change to `Palaso/UsbDrive/Linux/UDisks.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NDesk.DBus;
namespace Palaso.UsbDrive.Linux
{
public class UDisks
{
pr... | ```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NDesk.DBus;
namespace Palaso.UsbDrive.Linux
{
public class UDisks
{
private readonly IUDisks _udisks;
public UDisks()
{
_udisks = Bus.System.GetObject<IUDisks>("org.freedesktop.UDisks", new ObjectPath("/o... | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.