original_prompt stringlengths 327 2.5k | original_completion stringlengths 22 2.84k | enhanced_prompt float64 | enhanced_completion float64 |
|---|---|---|---|
Make cookie valid for 30 days.
Apply this change to `Wukong/Controllers/AuthController.cs` and return the full updated file.
```csharp
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authentication;
using System.Threading.Tasks;
using Microsoft.AspNetCor... | ```csharp
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authentication;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Wukong.Models;
namespace Wukong.Controllers
{
[Route... | null | null |
Make sql function PostgreSQL 9.1 compatible
Apply this change to `corehq/sql_accessors/sql_templates/case_has_transactions_since_sync.sql` and return the full updated file.
```sql
DROP FUNCTION IF EXISTS case_has_transactions_since_sync(text, text, timestamp with time zone);
CREATE FUNCTION case_has_transactions_sin... | ```sql
DROP FUNCTION IF EXISTS case_has_transactions_since_sync(text, text, timestamp with time zone);
CREATE FUNCTION case_has_transactions_since_sync(p_case_id text, p_sync_log_id text, sync_log_date timestamp with time zone)
RETURNS boolean AS $$
SELECT EXISTS(
SELECT TRUE FROM form_processor_casetransa... | null | null |
Fix incorrect javadoc {@code} taglet
Apply this change to `vertx-web/src/main/java/io/vertx/ext/web/MIMEHeader.java` and return the full updated file.
```java
package io.vertx.ext.web;
import io.vertx.codegen.annotations.VertxGen;
@VertxGen
public interface MIMEHeader extends ParsedHeaderValue{
/**
* Gets t... | ```java
package io.vertx.ext.web;
import io.vertx.codegen.annotations.VertxGen;
@VertxGen
public interface MIMEHeader extends ParsedHeaderValue{
/**
* Gets the parsed component part of the MIME. This is the string between the beginning and the first {@code '/'}
* of the MIME
* @return The component of the... | null | null |
Use c_int instead of c_uint to be more inline with termbox
Apply this change to `lib.rs` and return the full updated file.
```rust
#![feature(libc)]
extern crate libc;
use libc::{c_int, c_uint};
#[repr(C)]
#[derive(Copy)]
pub struct RawEvent {
pub etype: u8,
pub emod: u8,
pub key: u16,
pub ch: u32,
... | ```rust
#![feature(libc)]
extern crate libc;
use libc::c_int;
#[repr(C)]
#[derive(Copy)]
pub struct RawEvent {
pub etype: u8,
pub emod: u8,
pub key: u16,
pub ch: u32,
pub w: i32,
pub h: i32,
pub x: i32,
pub y: i32,
}
extern "C" {
pub fn tb_init() -> c_int;
pub fn tb_shutdown()... | null | null |
Switch over setup commands from using query class
Apply this change to `ZocMon/ZocMon/ZocMonLib/Framework/StorageCommandsSetupSqlServer.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using ZocMonLib;
namespace ZocMonLib
{
publ... | ```csharp
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using ZocMonLib;
namespace ZocMonLib
{
public class StorageCommandsSetupSqlServer : IStorageCommandsSetup
{
public virtual IEnumerable<ReduceLevel> SelectAllReduceLevels(IDbConnection conn)
{
... | null | null |
Change FirestoreDocumentChangeEvent to an interface
Apply this change to `postponed/firestore-mirror-bigquery/functions/src/firestoreEventHistoryTracker.ts` and return the full updated file.
```typescript
/*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may ... | ```typescript
/*
* Copyright 2019 Google LLC
*
* 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 applicable law ... | null | null |
Add a test for removing todos
Apply this change to `Tests/ToDoReduxTests/ToDoTests.swift` and return the full updated file.
```swift
import XCTest
import ToDoRedux
class ToDoTests: ToDoReduxTests {
override func setUp() {
super.setUp()
store.dispatch(ToDoActions.add(title: "Buy milk", notes: "",... | ```swift
import XCTest
import ToDoRedux
class ToDoTests: ToDoReduxTests {
private var todo: ToDo!
override func setUp() {
super.setUp()
store.dispatch(ToDoActions.add(title: "Buy milk", notes: "", tags: []))
todo = store.state.todos.first!
}
func testAddedToDo() {
XCT... | null | null |
Make clone root build config test more strict
By expecting only single call to API made
Apply this change to `src/TeamCityApi.Tests/UseCases/CloneRootBuildConfigUseCaseTests.cs` and return the full updated file.
```csharp
using System.Threading.Tasks;
using NSubstitute;
using Ploeh.AutoFixture;
using Ploeh.AutoFixt... | ```csharp
using System.Threading.Tasks;
using NSubstitute;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.Xunit;
using TeamCityApi.Domain;
using TeamCityApi.Locators;
using TeamCityApi.Tests.Helpers;
using TeamCityApi.Tests.Scenarios;
using TeamCityApi.UseCases;
using Xunit;
using Xunit.Extensions;
namespace TeamCi... | null | null |
Use right event type Wheel instead of Scroll.
Apply this change to `src/input/mouse_wheel_transition.cpp` and return the full updated file.
```cpp
#include "./mouse_wheel_transition.h"
#include <QDebug>
MouseWheelTransition::MouseWheelTransition(QObject *object, QState *sourceState)
: QEventTransition(object, QEve... | ```cpp
#include "./mouse_wheel_transition.h"
#include <QDebug>
MouseWheelTransition::MouseWheelTransition(QObject *object, QState *sourceState)
: QEventTransition(object, QEvent::Wheel, sourceState)
{
}
MouseWheelTransition::~MouseWheelTransition()
{
}
bool MouseWheelTransition::eventTest(QEvent *event)
{
qWarni... | null | null |
Set download_url to longer length to match VO
Apply this change to `cosmic-core/db-scripts/src/main/resources/db/schema-532to533.sql` and return the full updated file.
```sql
--
-- Schema upgrade from 5.3.2 to 5.3.3;
--
-- VirtIO-SCSI
INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, create... | ```sql
--
-- Schema upgrade from 5.3.2 to 5.3.3;
--
-- VirtIO-SCSI
INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name, created) VALUES (1002, UUID(), 7, 'VirtIO-SCSI capable OS (64-bit)', utc_timestamp());
INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_versio... | null | null |
Use utils to create neutron endpoint/service
Apply this change to `playbooks/roles/neutron/files/create_neutron_service_entity_and_api_endpoint.sh` and return the full updated file.
```bash
#!/bin/sh
openstack user create --domain default --password $1 neutron
openstack role add --project service --user neutron admin... | ```bash
#!/bin/sh
source /opt/local/bin/os-utils.sh
create_or_get_user neutron $1
get_or_add_user_project_role admin neutron service
create_or_get_service neutron network "OpenStack Networking"
create_or_get_endpoint network public http://$2:9696
create_or_get_endpoint network internal http://$2:9696
create_or_get_end... | null | null |
Correct usage line, no need to include .py in module name.
git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@5904 662fdd30-d327-0410-a531-f549c87e1e9e
Apply this change to `tools/mugen-converter/src/test/main.cpp` and return the full updated file.
```cpp
#include <iostream>
#include <Python.h>
#include "charact... | ```cpp
#include <iostream>
#include <Python.h>
#include "character.h"
using namespace std;
static int error(const std::string & message){
std::cout << message << std::endl;
//PyErr_Print();
return -1;
}
int main(int argc, char ** argv){
if (argc > 1){
Py_Initialize();
/* NO... | null | null |
Use InMemory TagDatabase by default if none exists
Apply this change to `lib/src/tags/tag-database-factory.cpp` and return the full updated file.
```cpp
#include "tag-database-factory.h"
#include "tag-database-in-memory.h"
#include "tag-database-sqlite.h"
#include <QFile>
TagDatabase *TagDatabaseFactory::Create(QSt... | ```cpp
#include "tag-database-factory.h"
#include "tag-database-in-memory.h"
#include "tag-database-sqlite.h"
#include <QFile>
TagDatabase *TagDatabaseFactory::Create(QString directory)
{
if (!directory.endsWith("/") && !directory.endsWith("\\"))
directory += "/";
QString typesFile = directory + "tag-types.txt";... | null | null |
Fix incorrect method call after a previous refactoring
Apply this change to `org.metaborg.meta.lang.dynsem.interpreter/src/main/java/org/metaborg/meta/lang/dynsem/interpreter/nabl2/sg/nodes/GetTopLevelTermIndex.java` and return the full updated file.
```java
package org.metaborg.meta.lang.dynsem.interpreter.nabl2.sg.... | ```java
package org.metaborg.meta.lang.dynsem.interpreter.nabl2.sg.nodes;
import org.metaborg.meta.lang.dynsem.interpreter.nabl2.NaBL2SolutionUtils;
import org.metaborg.meta.lang.dynsem.interpreter.nabl2.sg.TermIndex;
import org.metaborg.meta.lang.dynsem.interpreter.nodes.building.NativeOpBuild;
import org.metaborg.me... | null | null |
Make offering actions button clickable in mobile view.
Apply this change to `src/marketplace/offerings/details/OfferingDetails.tsx` and return the full updated file.
```typescript
import * as React from 'react';
import * as Col from 'react-bootstrap/lib/Col';
import * as Row from 'react-bootstrap/lib/Row';
import { ... | ```typescript
import * as React from 'react';
import * as Col from 'react-bootstrap/lib/Col';
import * as Row from 'react-bootstrap/lib/Row';
import { OfferingTabsComponent, OfferingTab } from '@waldur/marketplace/details/OfferingTabsComponent';
import { Offering } from '@waldur/marketplace/types';
import { OfferingA... | null | null |
Implement unit test for map layers reducer
Apply this change to `src/app/store/map-layers/map-layers.reducer.spec.ts` and return the full updated file.
```typescript
/* tslint:disable:no-unused-variable */
/*!
* Map Layers Reducer Test
*
* Copyright(c) Exequiel Ceasar Navarrete <esnavarrete1@up.edu.ph>
* License... | ```typescript
/* tslint:disable:no-unused-variable */
/*!
* Map Layers Reducer Test
*
* Copyright(c) Exequiel Ceasar Navarrete <esnavarrete1@up.edu.ph>
* Licensed under MIT
*/
import { async, inject } from '@angular/core/testing';
import { MapLayersReducer, LayerState } from './map-layers.reducer';
import { assi... | null | null |
Create stub for FirebaseService and AngularFire in test
Apply this change to `src/app/journal/journal.component.spec.ts` and return the full updated file.
```typescript
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { JournalComponent } from './journal.component';
import {SearchComp... | ```typescript
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { JournalComponent } from './journal.component';
import {SearchComponent} from './nubaSearch.component';
import {JournalListComponent} from './journalList.component';
import {FormsModule} from '@angular/forms';
import {Fireb... | null | null |
Add a new comparison result type for when neither side has it.
Apply this change to `subprojects/migration/src/main/groovy/org/gradle/api/plugins/migration/model/compare/internal/ComparisonResultType.java` and return the full updated file.
```java
/*
* Copyright 2012 the original author or authors.
*
* Licensed un... | ```java
/*
* Copyright 2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... | null | null |
Change to use LinkDynamicObject instead of dlopen.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@9011 91177308-0d34-0410-b5e6-96231b3b80d8
Apply this change to `lib/Support/PluginLoader.cpp` and return the full updated file.
```cpp
//===-- PluginLoader.cpp - Implement -load command line option ------------==... | ```cpp
//===-- PluginLoader.cpp - Implement -load command line option ------------===//
//
// This file implements the -load <plugin> command line option processor. When
// linked into a program, this new command line option is available that allows
// users to load shared objects into the running program.
//
// Note ... | null | null |
ADD gets graphicscomponent and sets values
Apply this change to `SSPSolution/SSPSolution/LevelState.cpp` and return the full updated file.
```cpp
#include "LevelState.h"
LevelState::LevelState()
{
}
LevelState::~LevelState()
{
}
int LevelState::ShutDown()
{
int result = 1;
return result;
}
int LevelState::In... | ```cpp
#include "LevelState.h"
LevelState::LevelState()
{
}
LevelState::~LevelState()
{
}
int LevelState::ShutDown()
{
int result = 1;
return result;
}
int LevelState::Initialize(GameStateHandler * gsh, ComponentHandler* cHandler)
{
int result = 0;
result = GameState::InitializeBase(gsh, cHandler);
//Read ... | null | null |
[Server][Router] Fix missing middleware in instrument delete route declaration.
Apply this change to `server/routes/api/instruments.js` and return the full updated file.
```javascript
const express = require('express')
const router = express.Router()
const {Instrument, InstrumentMapping} = require('../../models/inde... | ```javascript
const express = require('express')
const router = express.Router()
const {Instrument, InstrumentMapping} = require('../../models/index')
const {
generateUUID,
instrumentCreate,
instrumentDestroy,
instrumentUpdate,
instrumentFindById,
instrumentFindAll,
instrumentFindAllMapping,
instrument... | null | null |
Fix tests for older versions of PHPUnit
Apply this change to `Tests/TestCase.php` and return the full updated file.
```php
<?php
namespace Payum\Core\Tests;
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
abstract class TestCase extends PHPUnitTestCase
{
/**
* @deprecated Do not test internal properties... | ```php
<?php
namespace Payum\Core\Tests;
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
abstract class TestCase extends PHPUnitTestCase
{
/**
* @deprecated Do not test internal properties. The object should be re-factored to allow better testing
*/
public static function readAttribute($object, s... | null | null |
DERBY-4169: Change two SMALLINT routine args to be INT so that they will match the corresponding int args of the target Java method.
git-svn-id: 2c06e9c5008124d912b69f0b82df29d4867c0ce2@766722 13f79535-47bb-0310-9956-ffa450edef68
Apply this change to `java/testing/org/apache/derbyTesting/system/oe/schema/dataroutines... | ```sql
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License"); you ... | null | null |
Add &self to Liquid method
Apply this change to `src/lib.rs` and return the full updated file.
```rust
#![feature(phase)]
#[phase(plugin)]
extern crate regex_macros;
extern crate regex;
use std::collections::HashMap;
mod lexer;
mod parser;
struct Liquid {
text: String,
content: HashMap<String, String>
}
i... | ```rust
#![feature(phase)]
#[phase(plugin)]
extern crate regex_macros;
extern crate regex;
use std::collections::HashMap;
mod lexer;
mod parser;
struct Liquid {
text: String,
content: HashMap<String, String>
}
impl Liquid {
fn new(text: &str) -> Liquid {
Liquid { text: text.to_string(), content:... | null | null |
Remove is_autheticated check as by default all the endpoints are authenticated
Apply this change to `common/utilities/throttling.py` and return the full updated file.
```python
from rest_framework import throttling
class ThrottlingBySession(throttling.SimpleRateThrottle):
"""
Limits the rating of facility ... | ```python
from rest_framework import throttling
class ThrottlingBySession(throttling.SimpleRateThrottle):
"""
Limits the rating of facility service to only 10 per day per IP.
This rate is configurable at the DRF settings.DEFAULT_THROTTLE_RATES.
The rate will apply to both the publc user and other aut... | null | null |
Add another check for missing workflow
Apply this change to `src/helpers/expeditions.js` and return the full updated file.
```javascript
import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expe... | ```javascript
import { expeditions } from 'constants/expeditions';
const RECENT_EXPEDITIONS_LENGTH = 4;
export function findExpedition(key) {
return expeditions[key] ? expeditions[key] : expeditions.DEFAULT;
}
export const expeditionsInGroup = (group, allWorkflows) =>
allWorkflows.filter(e => e.display_name.star... | null | null |
Sort project metrics by priority
Apply this change to `detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/console/ProjectStatisticsReport.kt` and return the full updated file.
```kotlin
package io.gitlab.arturbosch.detekt.cli.console
import io.gitlab.arturbosch.detekt.api.ConsoleReport
import io.gitlab.artur... | ```kotlin
package io.gitlab.arturbosch.detekt.cli.console
import io.gitlab.arturbosch.detekt.api.ConsoleReport
import io.gitlab.arturbosch.detekt.api.Detektion
import io.gitlab.arturbosch.detekt.api.PREFIX
import io.gitlab.arturbosch.detekt.api.format
/**
* @author Artur Bosch
*/
class ProjectStatisticsReport : Con... | null | null |
Add pragma once to camera auto switch header.
Apply this change to `src/modules/cameraautoswitch.h` and return the full updated file.
```c
/*
* cameraautoswitch.h
* StatusSpec project
*
* Copyright (c) 2014-2015 Forward Command Post
* BSD 2-Clause License
* http://opensource.org/licenses/BSD-2-Clause
*
*... | ```c
/*
* cameraautoswitch.h
* StatusSpec project
*
* Copyright (c) 2014-2015 Forward Command Post
* BSD 2-Clause License
* http://opensource.org/licenses/BSD-2-Clause
*
*/
#pragma once
#include "igameevents.h"
#include "../modules.h"
class CCommand;
class ConCommand;
class ConVar;
class IConVar;
cla... | null | null |
Add support for custom key delimiter
Apply this change to `tests/Core.UnitTests/AppSettingsConfigurationProviderTests.cs` and return the full updated file.
```csharp
using System;
using System.Collections.Specialized;
using Xunit;
namespace GV.AspNet.Configuration.ConfigurationManager.UnitTests
{
public clas... | ```csharp
using System;
using System.Collections.Specialized;
using Microsoft.Extensions.Configuration;
using Xunit;
namespace GV.AspNet.Configuration.ConfigurationManager.UnitTests
{
public class AppSettingsConfigurationProviderTests
{
public class Load
{
[Theory]
[InlineData("", "Value")]
... | null | null |
Add a constructor to PhonegapBoilerplate
Apply this change to `index.js` and return the full updated file.
```javascript
'use strict';
var options = {
repository: 'https://github.com/dorian-marchal/phonegap-boilerplate',
branch: 'master',
};
/**
* Check that the cli is used in a phonegap boilerplate project
*... | ```javascript
'use strict';
var PhonegapBoilerplate = function() {
this.loadConfig();
};
PhonegapBoilerplate.prototype = {
constructor: PhonegapBoilerplate,
options: {
repository: 'https://github.com/dorian-marchal/phonegap-boilerplate',
branch: 'master',
},
/**
* Load the configuration from th... | null | null |
Clear logs between test-lf runs
Apply this change to `json-2017-02-12/test-libfuzzer.sh` and return the full updated file.
```bash
#!/bin/bash
# Copyright 2017 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
. $(dirname $0)/../common.sh
set -x
rm -rf $CORPUS
mkdir -p... | ```bash
#!/bin/bash
# Copyright 2017 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
. $(dirname $0)/../common.sh
set -x
rm -rf $CORPUS fuzz-*.log
mkdir -p $CORPUS
[ -e $EXECUTABLE_NAME_BASE ] && ./$EXECUTABLE_NAME_BASE -artifact_prefix=$CORPUS/ -jobs=$JOBS -workers=$... | null | null |
Return empty datetime elements as NULL
Apply this change to `src/main/java/de/timroes/axmlrpc/serializer/DateTimeSerializer.java` and return the full updated file.
```java
package de.timroes.axmlrpc.serializer;
import java.text.SimpleDateFormat;
import org.w3c.dom.Element;
import de.timroes.axmlrpc.XMLRPCException... | ```java
package de.timroes.axmlrpc.serializer;
import java.text.SimpleDateFormat;
import org.w3c.dom.Element;
import de.timroes.axmlrpc.XMLRPCException;
import de.timroes.axmlrpc.XMLUtil;
import de.timroes.axmlrpc.xmlcreator.XmlElement;
import fr.turri.jiso8601.Iso8601Deserializer;
/**
*
* @author timroes
*/
pub... | null | null |
Change gtk::Application::new parameter to use Into<Option<&str>>
Signed-off-by: Jean Pierre Dudey <341388fa1817ca285e65547384a9727ce7f6d39a@hotmail.com>
Apply this change to `src/application.rs` and return the full updated file.
```rust
use Application;
use ffi;
use gio::ApplicationFlags;
use glib::object::IsA;
use ... | ```rust
use Application;
use ffi;
use gio::ApplicationFlags;
use glib::object::IsA;
use glib::translate::*;
use rt;
use glib;
use glib_ffi;
impl Application {
#[cfg(feature = "v3_6")]
pub fn new<'a, I: Into<Option<&'a str>>>(application_id: I, flags: ApplicationFlags) -> Result<Application, glib::BoolError> {
... | null | null |
Make sure entities UID space don't clash between server & client.
Apply this change to `entity.cpp` and return the full updated file.
```cpp
#include "entity.h"
using namespace sf;
Entity::Entity(EntityShape shape0, Engine *engine0) {
shape = shape0;
position.x = 0; position.y = 0;
isKilledFlag = false;
engine ... | ```cpp
#include "entity.h"
using namespace sf;
Entity::Entity(EntityShape shape0, Engine *engine0) {
shape = shape0;
position.x = 0; position.y = 0;
isKilledFlag = false;
engine = engine0;
if (globalUID & 0x80000000) {
globalUID = (globalUID+1) | 0x80000000;
} else {
globalUID = (globalUID+1) & (~0x80000000... | null | null |
Remove the french default page
Apply this change to `Database/Seeders/PageDatabaseSeeder.php` and return the full updated file.
```php
<?php namespace Modules\Page\Database\Seeders;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
use Modules\Page\Repositories\PageRepository;
class PageDataba... | ```php
<?php namespace Modules\Page\Database\Seeders;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
use Modules\Page\Repositories\PageRepository;
class PageDatabaseSeeder extends Seeder
{
/**
* @var PageRepository
*/
private $page;
public function __construct(PageRepos... | null | null |
Use Bocho method to get normalized file path
Apply this change to `Sources/Lint/Reporter/SourceRange+Reporter.swift` and return the full updated file.
```swift
/*
Copyright 2017 Ryuichi Laboratories and the Yanagiba project contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may... | ```swift
/*
Copyright 2017 Ryuichi Laboratories and the Yanagiba project contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | null | null |
Include closed issues when syncing.
Apply this change to `lib/sync_issues/github.rb` and return the full updated file.
```ruby
require_relative 'error'
require 'octokit'
require 'safe_yaml/load'
module SyncIssues
# GitHub is responsible access to GitHub's API
class GitHub
def initialize
@client = Octok... | ```ruby
require_relative 'error'
require 'octokit'
require 'safe_yaml/load'
module SyncIssues
# GitHub is responsible access to GitHub's API
class GitHub
def initialize
@client = Octokit::Client.new access_token: token
end
def create_issue(repository, issue)
@client.create_issue(repository... | null | null |
Connect Stomp client after Passenger worker forks
Apply this change to `config/initializers/messenger.rb` and return the full updated file.
```ruby
require 'messenger'
unless Rails.env.test?
host = Rails.env.production? ? 'support.cluster' : 'localhost'
uri = URI::Generic.build scheme: 'stomp', host: host, port:... | ```ruby
require 'messenger'
unless Rails.env.test?
host = Rails.env.production? ? 'support.cluster' : 'localhost'
uri = URI::Generic.build scheme: 'stomp', host: host, port: 61613
failover_uri = "failover://(#{Array.new(2, uri).join(',')})" # failover://() must have multiple URIs
if defined?(PhusionPassenger)... | null | null |
Use `GetImageInfo` to see if the image is already registered.
Apply this change to `contrib/fhttp/fhttp.go` and return the full updated file.
```go
package fhttp
import (
"github.com/jung-kurt/gofpdf"
"net/http"
)
// RegisterRemoteImage registers a remote image. Downloading the image from the
// provided URL and ... | ```go
package fhttp
import (
"github.com/jung-kurt/gofpdf"
"net/http"
)
// RegisterRemoteImage registers a remote image. Downloading the image from the
// provided URL and adding it to the PDF but not adding it to the page. Use
// Image() with the same URL to add the image to the page.
func RegisterRemoteImage(f *g... | null | null |
Add a comment and code
Testing our first code change
Apply this change to `DemoGithub/DemoGithub/ViewController.swift` and return the full updated file.
```swift
//
// ViewController.swift
// DemoGithub
//
// Created by Paul Solt on 7/29/15.
// Copyright (c) 2015 Paul Solt. All rights reserved.
//
import UIKit
... | ```swift
//
// ViewController.swift
// DemoGithub
//
// Created by Paul Solt on 7/29/15.
// Copyright (c) 2015 Paul Solt. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading th... | null | null |
Add string based YAML tasks.
Apply this change to `source/Nuke.Common/IO/YamlTasks.cs` and return the full updated file.
```csharp
// Copyright Matthias Koch 2017.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.IO;
using System.Linq;
using ... | ```csharp
// Copyright Matthias Koch 2017.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.IO;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Common.IO;
using Nuke.Core.Execution;
using Nuke.Core.Tooling;
using YamlDotNet.Serializa... | null | null |
Add default 200 status to Home mapping
Apply this change to `src/main/java/com/pm/server/controller/HomeController.java` and return the full updated file.
```java
package com.pm.server.controller;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.... | ```java
package com.pm.server.controller;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframewo... | null | null |
Add OS checking using cfg
Apply this change to `guess.rs` and return the full updated file.
```rust
use std::rand::random;
mod guess {
pub fn guessed_correctly(guess: uint, machine: uint) -> bool {
guess == machine
}
}
fn main() {
let random_value = random::<uint>() % 10u;
let mut guess = 0u... | ```rust
use std::io;
use std::rand::random;
mod guess {
pub fn guessed_correctly(guess: uint, machine: uint) -> bool {
guess == machine
}
}
#[cfg(not(target_os = "linux"))]
fn test_os() {
println!("You are not running Linux!")
}
fn main() {
test_os();
let random_value = random::<uint>() %... | null | null |
Update serde_derive_internals to tool attrs
Apply this change to `serde_derive_internals/lib.rs` and return the full updated file.
```rust
#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.25.0")]
#![allow(unknown_lints, bare_trait_objects)]
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_remov... | ```rust
#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.25.0")]
#![allow(unknown_lints, bare_trait_objects)]
#![deny(clippy::all)]
#![allow(
clippy::cognitive_complexity,
clippy::redundant_field_names,
clippy::result_unit_err,
clippy::should_implement_trait,
clippy::trivially_copy_p... | null | null |
Update file ver to 3.0.2.0
Apply this change to `Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps/Internals/ProductInformation.cs` and return the full updated file.
```csharp
using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
internal class ProductInformation
{
public const string Author =... | ```csharp
using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
internal class ProductInformation
{
public const string Author = "amay077";
public const string Name = "Xamarin.Forms.GoogleMaps";
public const string Copyright = "Copyright © amay077. 2016 - 2018";
public co... | null | null |
Make sure to expand out exceptions.
Apply this change to `Cogito.Core/ExceptionExtensions.cs` and return the full updated file.
```csharp
using System;
using System.Diagnostics.Contracts;
namespace Cogito
{
public static class ExceptionExtensions
{
/// <summary>
/// Traces the exception to... | ```csharp
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
namespace Cogito
{
public static class ExceptionExtensions
{
/// <summary>
/// Traces the exception to the default trace source as an error.
/// </summary>
/// <param name="self"></p... | null | null |
Stop using the deprecated useColor method
Apply this change to `src/code/test/index.ts` and return the full updated file.
```typescript
import * as path from 'path';
import * as Mocha from 'mocha';
import * as glob from 'glob';
export function run(): Promise<void> {
// Create the mocha test
const mocha = new Moc... | ```typescript
import * as path from 'path';
import * as Mocha from 'mocha';
import * as glob from 'glob';
export function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: 'tdd',
color: true,
});
const testsRoot = path.resolve(__dirname, '..');
return new Promise((c, e) ... | null | null |
Fix bug where heading was not always updated
Apply this change to `app/routes/arrivals.js` and return the full updated file.
```javascript
import Ember from 'ember';
import request from 'ic-ajax';
import ENV from './../config/environment';
var run = Ember.run;
const POLL_INTERVAL = 15 * 1000;
export default Ember.R... | ```javascript
import Ember from 'ember';
import request from 'ic-ajax';
import ENV from './../config/environment';
var run = Ember.run;
const POLL_INTERVAL = 15 * 1000;
export default Ember.Route.extend({
pendingRefresh: null,
model: function(params) {
request(`${ENV.APP.SERVER}/api/arrivals/${params.stop_id... | null | null |
Fix infinite scrolling in chat popups on home page
Closes #30
Apply this change to `src/lib/disable-infinite-scroll.ts` and return the full updated file.
```typescript
/**
* Intercept the scroll event and kill it to prevent the
* infinite scroll algorithm triggering.
*/
import isEnabled from './is-enabled';
con... | ```typescript
/**
* Intercept the scroll event and kill it to prevent the
* infinite scroll algorithm triggering.
*/
import isEnabled from './is-enabled';
// Check if the event target is a chat conversation
let isConversation = ( target ) => {
if ( ! target || ! target.matches ) {
return false;
}
if ( target... | null | null |
Add support for length fields encoded as varints.
Kafka 0.11 encodes Record length as varint.
Apply this change to `length_field.go` and return the full updated file.
```go
package sarama
import "encoding/binary"
// LengthField implements the PushEncoder and PushDecoder interfaces for calculating 4-byte lengths.
t... | ```go
package sarama
import "encoding/binary"
// LengthField implements the PushEncoder and PushDecoder interfaces for calculating 4-byte lengths.
type lengthField struct {
startOffset int
}
func (l *lengthField) saveOffset(in int) {
l.startOffset = in
}
func (l *lengthField) reserveLength() int {
return 4
}
fu... | null | null |
Remove unused groups from simplecov's profile
Apply this change to `lib/simplecov_custom_profile.rb` and return the full updated file.
```ruby
require 'simplecov'
SimpleCov.profiles.define 'gem' do
add_filter '/test/'
add_filter '/features/'
add_filter '/spec/'
add_filter '/autotest/'
add_group 'Binaries'... | ```ruby
require 'simplecov'
SimpleCov.profiles.define 'gem' do
add_filter '/test/'
add_filter '/features/'
add_filter '/autotest/'
add_group 'Binaries', '/bin/'
add_group 'Libraries', '/lib/'
end
``` | null | null |
Add extra compile fail error
Apply this change to `diesel_tests/tests/compile-fail/find_requires_correct_type.rs` and return the full updated file.
```rust
#[macro_use]
extern crate diesel;
use diesel::*;
table! {
int_primary_key {
id -> Serial,
}
}
table! {
string_primary_key {
id -> V... | ```rust
#[macro_use]
extern crate diesel;
use diesel::*;
table! {
int_primary_key {
id -> Serial,
}
}
table! {
string_primary_key {
id -> VarChar,
}
}
fn main() {
let connection = Connection::establish("").unwrap();
let one = connection.find(int_primary_key::table, "1".to_str... | null | null |
Change message to indicate player is freed from track
Apply this change to `app/Assets/Scripts/AdminModeMessageWindow.cs` and return the full updated file.
```csharp
using UnityEngine;
using System.Collections;
public class AdminModeMessageWindow : MonoBehaviour {
private const float WINDOW_WIDTH = 300;
priv... | ```csharp
using UnityEngine;
using System.Collections;
public class AdminModeMessageWindow : MonoBehaviour {
private const float WINDOW_WIDTH = 300;
private const float WINDOW_HEIGHT = 120;
private const float MESSAGE_HEIGHT = 60;
private const float BUTTON_HEIGHT = 30;
private const float BUTTON_W... | null | null |
Update IO references to use old_io module.
Apply this change to `src/buffer/buffer.rs` and return the full updated file.
```rust
use std::io::{File, Open, ReadWrite};
use std::io::IoResult;
use super::GapBuffer;
use super::gap_buffer;
use super::Position;
use super::Range;
pub struct Buffer {
data: GapBuffer,
... | ```rust
use std::old_io::{File, Open, ReadWrite};
use std::old_io::IoResult;
use super::GapBuffer;
use super::gap_buffer;
use super::Position;
use super::Range;
pub struct Buffer {
data: GapBuffer,
file: Option<File>,
}
pub fn from_file(path: &Path) -> IoResult<Buffer> {
// Try to open and read the file, ... | null | null |
Refactor factorial sample to use compileProgramFile
Apply this change to `samples/factorial/run.js` and return the full updated file.
```javascript
var cobs = require('../..'),
fs = require('fs');
var runtime = {
display: function() {
var result = '';
if (arguments && arguments.length)
... | ```javascript
var cobs = require('../..'),
fs = require('fs');
var runtime = {
display: function() {
var result = '';
if (arguments && arguments.length)
for (var k = 0; k < arguments.length; k++)
if (arguments[k])
result += arguments[k].toString(... | null | null |
Fix a null pointer exeption.
Apply this change to `app/src/main/java/chat/rocket/android/chatdetails/viewmodel/ChatDetailsViewModel.kt` and return the full updated file.
```kotlin
package chat.rocket.android.chatdetails.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import and... | ```kotlin
package chat.rocket.android.chatdetails.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import chat.rocket.android.chatdetails.domain.ChatDetails
import chat.rocket.android.db.ChatRoomDao
cla... | null | null |
Set default theme to indigo
Apply this change to `app/src/config.ts` and return the full updated file.
```typescript
/*
* The MIT License (MIT)
* Copyright (c) 2016 Heat Ledger Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation fi... | ```typescript
/*
* The MIT License (MIT)
* Copyright (c) 2016 Heat Ledger Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the ri... | null | null |
Add a method for fetching a node, and collections list (artifacts).
Apply this change to `javascripts/custom/ajax.js` and return the full updated file.
```javascript
// Define DrupalAjaxRequest
var DrupalAjaxRequest = (function () {
var fetch = function(feed_id, callback) {
Zepto.ajax(
{
url: ... | ```javascript
// Define DrupalAjaxRequest
var DrupalAjaxRequest = (function () {
var fetchNode = function(node_id, callback) {
Zepto.ajax(
{
url: Kiosk.contentUrl('node'),
dataType: 'jsonp',
data: {nid: node_id},
type: 'GET',
cache: false,
success: function (r... | null | null |
Replace let if more normal if statement.
Apply this change to `kotlin/src/com/s13g/aoc/aoc2020/Day1.kt` and return the full updated file.
```kotlin
package com.s13g.aoc.aoc2020
import com.s13g.aoc.Result
import com.s13g.aoc.Solver
import com.s13g.aoc.mul
/**
* --- Day 1: Report Repair ---
* https://adventofcode.c... | ```kotlin
package com.s13g.aoc.aoc2020
import com.s13g.aoc.Result
import com.s13g.aoc.Solver
import com.s13g.aoc.mul
/**
* --- Day 1: Report Repair ---
* https://adventofcode.com/2020/day/1
*/
class Day1 : Solver {
override fun solve(lines: List<String>): Result {
val (resultA, resultB) = run(lines.map { it.... | null | null |
Correct case of include file to build on Linux.
Apply this change to `Demo/ARM7_LPC2368_Eclipse/RTOSDemo/webserver/EMAC_ISR.c` and return the full updated file.
```c
#include "FreeRTOS.h"
#include "Semphr.h"
#include "task.h"
/* The interrupt entry point. */
void vEMAC_ISR_Wrapper( void ) __attribute__((naked))... | ```c
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
/* The interrupt entry point. */
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
/* The handler that does the actual work. */
void vEMAC_ISR_Handler( void );
extern xSemaphoreHandle xEMACSemaphore;
void vEMAC_ISR_Handler( void )
... | null | null |
Fix non-reentrant metadata
am: e6b3c2f713
Change-Id: Ia886484ec8754ce623a6e0ad44f6b6077b7589b1
Apply this change to `src/trace_processor/metrics/trace_metadata.sql` and return the full updated file.
```sql
--
-- Copyright 2019 The Android Open Source Project
--
-- Licensed under the Apache License, Version 2.0 (the ... | ```sql
--
-- Copyright 2019 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 |
test: Fix problem with check-fast. rs=burningtree
Apply this change to `src/test/run-pass/enum-alignment.rs` and return the full updated file.
```rust
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
/... | ```rust
// Copyright 2013 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 |
Fix array-style access of non-arrays
Apply this change to `src/Config/OverloadTest.php` and return the full updated file.
```php
<?php
/**
*
*/
namespace Mvc5\Test\Config;
use Mvc5\Overload;
use Mvc5\Test\Test\TestCase;
class OverloadTest
extends TestCase
{
/**
*
*/
function test_get_not_ov... | ```php
<?php
/**
*
*/
namespace Mvc5\Test\Config;
use Mvc5\Overload;
use Mvc5\Test\Test\TestCase;
class OverloadTest
extends TestCase
{
/**
*
*/
function test_get_not_overloaded()
{
$model = new Overload;
$model->get('foo')['bar'] = 'baz';
$this->assertNull($mode... | null | null |
Reduce custom build program to an one-liner
Apply this change to `src/.bach-11/Build.java` and return the full updated file.
```java
// default package
/** Custom build program using {@code Bach.java} API. */
class Build {
public static void main(String... args) {
// Bach.main(args); // Delegate to Bach.java'... | ```java
// default package
/** Custom build program using {@code Bach.java} API. */
class Build {
public static void main(String... args) {
new Bach().build(project -> project.version("1-ea")).assertSuccessful();
}
}
``` | null | null |
Add sensor native module methods
Apply this change to `src/database/DataTypes/Sensor.js` and return the full updated file.
```javascript
/**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2020
*/
import Realm from 'realm';
export class Sensor extends Realm.Object {}
Sensor.schema = {
name: 'Sensor',
pri... | ```javascript
/**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2020
*/
import Realm from 'realm';
import { NativeModules } from 'react-native';
const { BleManager } = NativeModules;
const BLUE_MAESTRO_ID = 307;
export class Sensor extends Realm.Object {
static async startScan(macAddress = '') {
retur... | null | null |
Update entrypoint to handle config file binding
Apply this change to `obnam/obnam-entrypoint.sh` and return the full updated file.
```bash
#!/bin/sh
# vdemeester/obnam entrypoint
DESTINATION="/obnam/destination"
SOURCE="/obnam/source"
if test -n "$1"; then
DESTINATION=$1
shift
fi
# TODO check if source is e... | ```bash
#!/bin/sh
# vdemeester/obnam entrypoint
DESTINATION="/obnam/destination"
SOURCE="/obnam/source"
CONFIG="/obnam/config"
OBNAM_OPTS=""
if test -n "$1"; then
DESTINATION=$1
shift
fi
if ! test "$(ls -A ${SOURCE})"; then
echo "$SOURCE folder is empty, skipping backup"
exit 1
fi
if test -r ${CONF... | null | null |
Change object to string input
Apply this change to `simple_module.c` and return the full updated file.
```c
#include "mruby.h"
#include "mruby/irep.h"
#include "mruby/string.h"
#include "simple_module_mrb.h"
static mrb_value foo_bar(mrb_state* mrb, mrb_value obj)
{
mrb_value message;
mrb_get_args(mrb, "o", &mes... | ```c
#include "mruby.h"
#include "mruby/irep.h"
#include "mruby/string.h"
#include "simple_module_mrb.h"
static mrb_value foo_bar(mrb_state* mrb, mrb_value obj)
{
mrb_value message;
mrb_get_args(mrb, "S", &message);
if (!mrb_nil_p(message))
{
fprintf(stderr, "bar: %s\n", mrb_str_ptr(message)->ptr);
}
... | null | null |
Fix duplicate fetching of posts in item list
Apply this change to `hn/ViewModels/ItemListViewModel.swift` and return the full updated file.
```swift
import IGListKit
class PostViewModel {
let post: Post
init(_ post: Post) {
self.post = post
}
}
extension PostViewModel: ListDiffable {
func d... | ```swift
import IGListKit
class PostViewModel {
let post: Post
init(_ post: Post) {
self.post = post
}
}
extension PostViewModel: ListDiffable {
func diffIdentifier() -> NSObjectProtocol {
return NSNumber(value: post.id)
}
func isEqual(toDiffableObject object: ListDiffable?) ... | null | null |
Change account back to user
Apply this change to `src/main/scripts/createdb.sql` and return the full updated file.
```sql
CREATE TABLE ACCOUNT(
username VARCHAR(32) NOT NULL,
personname VARCHAR(64) NOT NULL,
password VARCHAR(32) NOT NULL,
PRIMARY KEY(username)
);
CREATE TABLE TEAM(
teamnr INT NOT NULL AUT... | ```sql
CREATE TABLE USER(
username VARCHAR(32) NOT NULL,
name VARCHAR(64) NOT NULL,
password VARCHAR(32) NOT NULL,
PRIMARY KEY(username)
);
CREATE TABLE TEAM(
teamnr INT NOT NULL AUTO_INCREMENT,
teamname VARCHAR(32) NOT NULL,
PRIMARY KEY(teamnr)
);
CREATE TABLE TEAM_MEMBER(
username VARCHAR(32) NOT N... | null | null |
Fix mouse move item bug
Close #19
Apply this change to `src/CanvasView.cpp` and return the full updated file.
```cpp
#include "CanvasView.h"
#include <QMouseEvent>
CanvasView::CanvasView(QWidget* parent)
: QGraphicsView(parent)
{
}
CanvasView::~CanvasView()
{
}
void CanvasView::mouseReleaseEvent(QMouseEven... | ```cpp
#include "CanvasView.h"
#include <QMouseEvent>
CanvasView::CanvasView(QWidget* parent)
: QGraphicsView(parent)
{
}
CanvasView::~CanvasView()
{
}
void CanvasView::mouseReleaseEvent(QMouseEvent *event)
{
QGraphicsView::mouseReleaseEvent(event);
QPointF localPos = QGraphicsView::mapToScene(event-... | null | null |
Remove many0! from dump util, so errors get reported
Apply this change to `utils/src/asn1-spec-dump.rs` and return the full updated file.
```rust
extern crate asn1_parse;
#[macro_use]
extern crate nom;
extern crate argparse;
use std::io;
use std::io::Read;
use std::fs;
use std::path::Path;
use asn1_parse::parse::spe... | ```rust
extern crate asn1_parse;
extern crate nom;
extern crate argparse;
use std::io;
use std::io::Read;
use std::fs;
use std::path::Path;
use asn1_parse::parse::spec::asn1_spec;
use argparse::{ArgumentParser, StoreOption};
fn main() {
let opts = parse_args();
let bytes: Result<Vec<_>, _> = match opts.file {
... | null | null |
Extend linux test head with leftover cases
Apply this change to `Tests/LinuxMain.swift` and return the full updated file.
```swift
import XCTest
@testable import OSCCoreTests
XCTMain([
testCase(OSCMessageTests.allTests),
testCase(ValueConversionTests.allTests),
testCase(AddressMatcherTests.allTests),
... | ```swift
import XCTest
@testable import OSCCoreTests
XCTMain([
testCase(OSCMessageTests.allTests),
testCase(ValueConversionTests.allTests),
testCase(AddressMatcherTests.allTests),
testCase(DispatcherTests.allTests),
testCase(OSCBundleTests.allTests),
testCase(OSCTimeTagTests.allTests)
])
``` | null | null |
Fix return type of createMandatoryParameter
Add ICommandParameter as return type of createMandatoryParameter method.
Apply this change to `command-params.ts` and return the full updated file.
```typescript
///<reference path="../.d.ts"/>
"use strict";
export class StringCommandParameter implements ICommandParameter... | ```typescript
///<reference path="../.d.ts"/>
"use strict";
export class StringCommandParameter implements ICommandParameter {
public mandatory = false;
public errorMessage: string;
public validate(validationValue: string): IFuture<boolean> {
return (() => {
if(!validationValue) {
if(this.errorMessage) {
... | null | null |
Change path to site no requested authorization.
Apply this change to `src/main/java/bj/pranie/config/WebSecurityConfig.java` and return the full updated file.
```java
package bj.pranie.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
... | ```java
package bj.pranie.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation... | null | null |
feat: Use the new helper class to do the job.
Apply this change to `src/Entity/Traits/Uuid.php` and return the full updated file.
```php
<?php
declare(strict_types = 1);
/**
* /src/Entity/Traits/Uuid.php
*
* @author TLe, Tarmo Leppänen <tarmo.leppanen@protacon.com>
*/
namespace App\Entity\Traits;
use Ramsey\Uui... | ```php
<?php
declare(strict_types = 1);
/**
* /src/Entity/Traits/Uuid.php
*
* @author TLe, Tarmo Leppänen <tarmo.leppanen@protacon.com>
*/
namespace App\Entity\Traits;
use App\Rest\UuidHelper;
use Ramsey\Uuid\UuidInterface;
use Throwable;
/**
* Trait Uuid
*
* @package App\Entity\Traits
* @author TLe, Tarmo ... | null | null |
Add a comment about params.
Apply this change to `scripts/experiment.sh` and return the full updated file.
```bash
DATA_DIR=/home/$USER/experiment_data
if [ ! -e $DATA_DIR ]
then
mkdir $DATA_DIR
fi
if [ -e $DATA_DIR/$1_$2.bag ]
then
echo "/home/$USER/experiment_data/$1_$2.bag already exists! Stopping launch"
el... | ```bash
# $1 is the user id
# $2 is the name of the filter (clean, blur, ...)
DATA_DIR=/home/$USER/experiment_data
if [ ! -e $DATA_DIR ]
then
mkdir $DATA_DIR
fi
if [ -e $DATA_DIR/$1_$2.bag ]
then
echo "/home/$USER/experiment_data/$1_$2.bag already exists! Stopping launch"
else
case "$2" in
clean)
ros... | null | null |
Revert "Added a scanner for WPS"
This reverts commit 5af0aa6039311aa816c1a6eccaadde0c7871bfe7.
Apply this change to `lib/hidden_hippo/reader.rb` and return the full updated file.
```ruby
require 'hidden_hippo/scanner'
require 'hidden_hippo/updator'
require 'hidden_hippo/packets/dns'
require 'hidden_hippo/packets/dh... | ```ruby
require 'hidden_hippo/scanner'
require 'hidden_hippo/updator'
require 'hidden_hippo/packets/dns'
require 'hidden_hippo/packets/dhcp'
require 'hidden_hippo/packets/http'
require 'hidden_hippo/extractors/mdns_hostname_extractor'
require 'hidden_hippo/extractors/dhcp_hostname_extractor'
require 'hidden_hippo/ext... | null | null |
Build sys crate with opt-level 2
It looks like by default optimization level for C code was the same as
for Rust, which caused LMDB to be built with -O3 in release mode and
that is not supported officially => sometimes it crashed.
Fixes #40
Apply this change to `liblmdb-sys/build.rs` and return the full updated file... | ```rust
extern crate gcc;
fn main() {
let target = std::env::var("TARGET").unwrap();
let mut config = gcc::Config::new();
config.file("mdb/libraries/liblmdb/mdb.c")
.file("mdb/libraries/liblmdb/midl.c");
config.opt_level(2);
if target.contains("dragonfly") {
config.flag("-DMDB_D... | null | null |
Change interval from 5min to 10min
Apply this change to `refresh.js` and return the full updated file.
```javascript
(function() {
setInterval(function () {
var button_selectors = [
'#session_continuity', /* klms.kaist.ac.kr */
'.sessionExtension', /* ssogw6.kaist.ac.kr */
];
for (var i = 0;... | ```javascript
(function() {
setInterval(function () {
var button_selectors = [
'#session_continuity', /* klms.kaist.ac.kr */
'.sessionExtension', /* ssogw6.kaist.ac.kr */
];
for (var i = 0; i < button_selectors.length; i++) {
var button = document.querySelector(button_selectors[i]);
... | null | null |
Change timeout to 10 secs
Apply this change to `mcollective_additions/plugins/v2.2/agent/dev_manager.ddl` and return the full updated file.
```sql
metadata :name => "development manager",
:description => "Manager which allows manipulation of nodes",
:author => "Reactor8",
... | ```sql
metadata :name => "development manager",
:description => "Manager which allows manipulation of nodes",
:author => "Reactor8",
:license => "",
:version => "",
:url => "",
:timeout => 10
action "inject_agent"... | null | null |
Refactor to follow style guidelines
Apply this change to `addon/components/sl-span.js` and return the full updated file.
```javascript
import Ember from 'ember';
/**
* @module components
* @class sl-span
*/
export default Ember.Component.extend({
// ----------------------------------------------------------... | ```javascript
import Ember from 'ember';
/**
* @module components
* @class sl-span
*/
export default Ember.Component.extend({
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
/... | null | null |
Fix test to work on windows
Apply this change to `test/mapping-entry-test.ts` and return the full updated file.
```typescript
import { assert } from "chai";
import { getAbsoluteMappingEntries } from "../src/mapping-entry";
describe("mapping-entry", () => {
it("should change to absolute paths and sort in longest pr... | ```typescript
import { assert } from "chai";
import { getAbsoluteMappingEntries } from "../src/mapping-entry";
import { join } from "path";
describe("mapping-entry", () => {
it("should change to absolute paths and sort in longest prefix order", () => {
const result = getAbsoluteMappingEntries("/absolute/base/url... | null | null |
Update comment on item that crashes on purpose currently
Apply this change to `poitest/src/main/java/org/apache/poi/poifs/crypt/TestSignatureInfo.java` and return the full updated file.
```java
package org.apache.poi.poifs.crypt;
import org.apache.poi.poifs.crypt.dsig.SignatureInfo;
import static junit.framework.As... | ```java
package org.apache.poi.poifs.crypt;
import org.apache.poi.poifs.crypt.dsig.SignatureInfo;
import static junit.framework.Assert.assertNotNull;
public class TestSignatureInfo {
public void testConstruct() {
// simple test which just verifies that we can load the class and all dependent classes
... | null | null |
Select fixed with variable, global constants
Apply this change to `Tools.sql` and return the full updated file.
```sql
--#SET TERMINATOR @
SET CURRENT SCHEMA LOGGER @
/**
* Function that returns the value of the given key from the configuration
* table.
*
* IN KEY
* Identification of the key/value parameter of... | ```sql
--#SET TERMINATOR @
SET CURRENT SCHEMA LOGGER @
/**
* Function that returns the value of the given key from the configuration
* table.
*
* IN KEY
* Identification of the key/value parameter of the configuration table.
* RETURNS The associated value of the given key. NULL if there is not a key
* with tha... | null | null |
Add test for custom servers
Apply this change to `test/IntegrationTest.php` and return the full updated file.
```php
<?php
namespace Amp\Dns\Test;
class IntegrationTest extends \PHPUnit_Framework_TestCase {
protected function setUp() {
\Amp\reactor(\Amp\driver());
}
/**
* @group internet
... | ```php
<?php
namespace Amp\Dns\Test;
class IntegrationTest extends \PHPUnit_Framework_TestCase {
protected function setUp() {
\Amp\reactor(\Amp\driver());
\Amp\Dns\resolver(\Amp\Dns\driver());
}
/**
* @group internet
* @dataProvider provideHostnames
*/
public function t... | null | null |
Rename the celltags plugin id
Apply this change to `packages/celltags-extension/src/index.ts` and return the full updated file.
```typescript
import {
JupyterFrontEnd,
JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { INotebookTools, INotebookTracker } from '@jupyterlab/notebook';
import { TagToo... | ```typescript
import {
JupyterFrontEnd,
JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { INotebookTools, INotebookTracker } from '@jupyterlab/notebook';
import { TagTool } from '@jupyterlab/celltags';
/**
* Initialization data for the celltags extension.
*/
const celltags: JupyterFrontEndPlugin... | null | null |
[improve] Use Optional return values for all the queries
Apply this change to `d02/d02s05/d02s05e02-real-database/src/main/java/net/safedata/springboot/training/d02/s05/repository/ProductRepository.java` and return the full updated file.
```java
package net.safedata.springboot.training.d02.s05.repository;
import net... | ```java
package net.safedata.springboot.training.d02.s05.repository;
import net.safedata.springboot.training.d02.s05.model.Product;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springf... | null | null |
Fix warnings in Contentful extension
Apply this change to `Code/CCBufferedImageView+Contentful.swift` and return the full updated file.
```swift
//
// CCBufferedImageView.swift
// Concorde
//
// Created by Boris Bügling on 16/03/15.
// Copyright (c) 2015 Contentful GmbH. All rights reserved.
//
import Contentful... | ```swift
//
// CCBufferedImageView.swift
// Concorde
//
// Created by Boris Bügling on 16/03/15.
// Copyright (c) 2015 Contentful GmbH. All rights reserved.
//
import ContentfulDeliveryAPI
// Make "private" methods from the CDA's `UIImageView` category known to Swift code.
extension UIImageView {
func cda_han... | null | null |
Fix "storage size of 'timer' isn't known" on Debian Squeeze
struct itimerval defined in sys/time.h
Apply this change to `ext/fast_stack/fast_stack.c` and return the full updated file.
```c
#include <stdio.h>
#include <ruby.h>
#include <ruby/encoding.h>
static VALUE
profiler_start(VALUE module, VALUE usec)
{
str... | ```c
#include <stdio.h>
#include <sys/time.h>
#include <ruby.h>
#include <ruby/encoding.h>
static VALUE
profiler_start(VALUE module, VALUE usec)
{
struct itimerval timer;
timer.it_interval.tv_sec = 0;
timer.it_interval.tv_usec = NUM2LONG(usec);
timer.it_value = timer.it_interval;
setitimer(ITIMER_P... | null | null |
Add OSF/1 to a pre-existing conditional compilation switch.
Apply this change to `src/condor_includes/condor_fix_unistd.h` and return the full updated file.
```c
#ifndef FIX_UNISTD_H
#define FIX_UNISTD_H
#include <unistd.h>
/*
For some reason the g++ include files on Ultrix 4.3 fail to provide
these prototypes... | ```c
#ifndef FIX_UNISTD_H
#define FIX_UNISTD_H
#include <unistd.h>
/*
For some reason the g++ include files on Ultrix 4.3 fail to provide
these prototypes, even though the Ultrix 4.2 versions did...
Once again, OSF1 also chokes, unless _AES_SOURCE(?) is defined JCP
*/
#if defined(ULTRIX43) || defined(OSF1)
#i... | null | null |
Remove blank line from Token initializer
Apply this change to `lib/token.rb` and return the full updated file.
```ruby
class Token
def initialize(char)
raise 'Only one character is allowed' unless char.size == 1
@char = char
end
def operator?
!/[+\-*\/^%=(),]/.match(@char).nil?
end
def digit?... | ```ruby
class Token
def initialize(char)
raise 'Only one character is allowed' unless char.size == 1
@char = char
end
def operator?
!/[+\-*\/^%=(),]/.match(@char).nil?
end
def digit?
!/[0-9]/.match(@char).nil?
end
def white_space?
!/\s/.match(@char).nil?
end
def identifier?
... | null | null |
Set thread local the entity manager in validatorfactory also in
doTransaction with already created EntityManagers
Apply this change to `src/main/java/persistence/util/TransactionUtil.java` and return the full updated file.
```java
package persistence.util;
import javax.persistence.EntityManager;
import javax.pers... | ```java
package persistence.util;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
public class TransactionUtil {
public static void doTransaction(EntityManagerFactory emf, Transaction t) {
EntityManager em = emf.createEntity... | null | null |
Fix import script to work with recent API changes
Apply this change to `script/import_ikiwiki.rb` and return the full updated file.
```ruby
require "nokogiri"
doc = Nokogiri::HTML($stdin)
doc.css('#content p').each do |p|
begin
quote = Quote.from_raw_quote(p.content)
quote.save!
rescue Exception => e
... | ```ruby
require "nokogiri"
doc = Nokogiri::HTML($stdin)
doc.css('#content p').each do |p|
begin
quote = Quote.new(raw_quote: p.content)
quote.save!
rescue Exception => e
puts p.content
puts e
end
end
``` | null | null |
Add conditional Swift 5.4 support.
Apply this change to `Sources/Layout/Extensions/ArrayBuilder.swift` and return the full updated file.
```swift
@_functionBuilder
public enum ArrayBuilder<Element> {
public typealias Expression = Element
public typealias Component = [Element]
public static func buildExp... | ```swift
#if swift(<5.4)
@_functionBuilder
public enum ArrayBuilder<Element> {
}
#else
@resultBuilder
public enum ArrayBuilder<Element> {
}
#endif
public extension ArrayBuilder {
typealias Expression = Element
typealias Component = [Element]
static func buildExpression(_ expression: Expression) -> Compon... | null | null |
Add area column to WOF neighbourhoods table
Apply this change to `data/wof-schema.sql` and return the full updated file.
```sql
CREATE TABLE wof_neighbourhood (
wof_id BIGINT UNIQUE NOT NULL,
placetype SMALLINT NOT NULL,
name TEXT NOT NULL,
hash TEXT NOT NULL,
n_photos INTEGER,
label_position geometry(Poi... | ```sql
CREATE TABLE wof_neighbourhood (
wof_id BIGINT UNIQUE NOT NULL,
placetype SMALLINT NOT NULL,
name TEXT NOT NULL,
hash TEXT NOT NULL,
n_photos INTEGER,
area BIGINT,
label_position geometry(Point, 900913) NOT NULL,
geometry geometry(Geometry, 900913) NOT NULL
);
CREATE INDEX wof_neighbourhood_wof_... | null | null |
Fix update installer not running as administrator due to breaking change in .NET
Apply this change to `windows/TweetDuck/Updates/UpdateInstaller.cs` and return the full updated file.
```csharp
using System;
using System.ComponentModel;
using System.Diagnostics;
using TweetDuck.Configuration;
using TweetLib.Core;
usi... | ```csharp
using System;
using System.ComponentModel;
using System.Diagnostics;
using TweetDuck.Configuration;
using TweetLib.Core;
using TweetLib.Utils.Static;
namespace TweetDuck.Updates {
sealed class UpdateInstaller {
private string Path { get; }
public UpdateInstaller(string path) {
this.Path = path;
}... | null | null |
Add space in requireEnhancedObjectLiterals error
This adds a missing space to the second } in the error message for consistency.
Apply this change to `lib/rules/require-enhanced-object-literals.js` and return the full updated file.
```javascript
var assert = require('assert');
module.exports = function() { };
modu... | ```javascript
var assert = require('assert');
module.exports = function() { };
module.exports.prototype = {
configure: function(option) {
assert(option === true, this.getOptionName() + ' requires a true value');
},
getOptionName: function() {
return 'requireEnhancedObjectLiterals';
},
check: funct... | null | null |
Update to use partial instead of lambda function
Apply this change to `graphene/core/classtypes/uniontype.py` and return the full updated file.
```python
import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOpti... | ```python
from functools import partial
import six
from graphql.core.type import GraphQLUnionType
from .base import FieldsClassType, FieldsClassTypeMeta, FieldsOptions
class UnionTypeOptions(FieldsOptions):
def __init__(self, *args, **kwargs):
super(UnionTypeOptions, self).__init__(*args, **kwargs)
... | null | null |
Add commandline input of ciphertext in 1/3
Altered code to allow for ciphertext to be entered on the
commandline for set 1 challange 3
Apply this change to `set_1/3_single-byte_xor/sb_xor.php` and return the full updated file.
```php
<?php
require '../../functions/letterScore.php';
$input = hex2bin("1b37373331363f... | ```php
<?php
require '../../functions/letterScore.php';
if ($argc > 1) {
$input = hex2bin($argv[1]);
} else {
$input = hex2bin("1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736");
}
$inputLength = strlen($input);
$scores = [];
for ($kv=0; $kv < 256; $kv++) {
$charScore = 0;
$plainText = ... | null | null |
Revert "Alphasort ci-source providers for easier additions"
This reverts commit 9bf75701e8268914484f9f409dcda04f41a43558.
Sort order was important, actually :-/
Apply this change to `source/ci_source/providers/index.ts` and return the full updated file.
```typescript
import { BuddyBuild } from "./BuddyBuild"
import... | ```typescript
import { BuddyBuild } from "./BuddyBuild"
import { Buildkite } from "./Buildkite"
import { Circle } from "./Circle"
import { Codeship } from "./Codeship"
import { DockerCloud } from "./DockerCloud"
import { Drone } from "./Drone"
import { FakeCI } from "./Fake"
import { Jenkins } from "./Jenkins"
import {... | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.