original_prompt
stringlengths
327
2.5k
original_completion
stringlengths
22
2.84k
enhanced_prompt
float64
enhanced_completion
float64
Hide window by hotkey if it is visible Apply this change to `main/createWindow.js` and return the full updated file. ```javascript import { BrowserWindow, globalShortcut } from 'electron'; import { INPUT_HEIGHT, WINDOW_WIDTH, RESULT_HEIGHT, MIN_VISIBLE_RESULTS } from './constants/ui'; import buildMenu from '...
```javascript import { BrowserWindow, globalShortcut } from 'electron'; import { INPUT_HEIGHT, WINDOW_WIDTH, RESULT_HEIGHT, MIN_VISIBLE_RESULTS } from './constants/ui'; import buildMenu from './createWindow/buildMenu'; export default (url) => { const mainWindow = new BrowserWindow({ alwaysOnTop: true, ...
null
null
Fix decoding of userInfo (wrong element name) Apply this change to `Sources/FromXML/MomUserInfo+XMLObject.swift` and return the full updated file. ```swift // Created by Eric Marchand on 07/06/2017. // Copyright © 2017 Eric Marchand. All rights reserved. // import Foundation extension MomUserInfo: XMLObject { ...
```swift // Created by Eric Marchand on 07/06/2017. // Copyright © 2017 Eric Marchand. All rights reserved. // import Foundation extension MomUserInfo: XMLObject { public init?(xml: XML) { guard let element = xml.element, element.name == "userInfo" else { return nil } for c...
null
null
Add new fields to mock Apply this change to `A2/quickstart/src/app/models/mocks.ts` and return the full updated file. ```typescript // mocks.ts import { RacePart } from "./race-part.model"; export const RACE_PARTS: RacePart[] = [{ "id": 1, "name": "Daytona Thunderdome", "date": new Date('2512-01-04T14:00:00')...
```typescript // mocks.ts import { RacePart } from "./race-part.model"; export const RACE_PARTS: RacePart[] = [{ "id": 1, "name": "Daytona Thunderdome", "date": new Date('2512-01-04T14:00:00'), "about": "Race through the ruins of an ancient Florida battle arena.", "entryFee": 3200, "isRacing": false, "i...
null
null
Use p_source from rules for loop-aes Apply this change to `lib/pkg/loop-aes.sigma.sh` and return the full updated file. ```bash #!/bin/sh p_source="$pkg_dist_dir/loop-AES-v3.7b.tar.bz2" use_toolchain target export ARCH=mips pkg_build() { p_run make \ LINUX_SOURCE="$LINUX_KERNEL" \ KBUILD_OUTPU...
```bash #!/bin/sh use_toolchain target export ARCH=mips pkg_build() { p_run make \ LINUX_SOURCE="$LINUX_KERNEL" \ KBUILD_OUTPUT="$LINUX_KERNEL" \ USE_KBUILD=y MODINST=n RUNDM=n } pkg_install() { cd "tmp-d-kbuild" && p_install_modules "loop" } ```
null
null
Fix gl error debug print. git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@2356 2bbb7eff-a529-9590-31e7-b0007b416f81 Apply this change to `gpu/src/GrGLUtil.cpp` and return the full updated file. ```cpp /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can b...
```cpp /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "GrGLConfig.h" #include "GrGLInterface.h" void GrGLClearErr(const GrGLInterface* gl) { while (GR_GL_NO_ERROR != gl->fGetError()) {} } void GrGLCheckErr...
null
null
Use WM_CONCAT - exists in Oracle < 11.2 git-svn-id: 410459702e6123a874d92574e1336b0959d85891@13526 2913f559-6b04-0410-9a09-c530ee9f5186 Apply this change to `sql/create_ctl_for_table.sql` and return the full updated file. ```sql set head off set newp none set recsep off set echo off set serveroutput off set tab off ...
```sql set head off set newp none set recsep off set echo off set serveroutput off set tab off set line 500 set wrap off set feedback off set verify off SELECT 'OPTIONS(DIRECT=TRUE,ROWS=1000000) LOAD DATA TRUNCATE INTO TABLE ' || upper('A2_&1') || ' FIELDS TERMINATED BY ''\t''' || ' TRAILING NULLCOLS ...
null
null
Add examples to int macros Apply this change to `src/libcore/num/int_macros.rs` and return the full updated file. ```rust #![doc(hidden)] macro_rules! doc_comment { ($x:expr, $($tt:tt)*) => { #[doc = $x] $($tt)* }; } macro_rules! int_module { ($T:ident) => (int_module!($T, #[stable(featu...
```rust #![doc(hidden)] macro_rules! doc_comment { ($x:expr, $($tt:tt)*) => { #[doc = $x] $($tt)* }; } macro_rules! int_module { ($T:ident) => (int_module!($T, #[stable(feature = "rust1", since = "1.0.0")]);); ($T:ident, #[$attr:meta]) => ( doc_comment! { concat!("T...
null
null
Fix SP in ZEXDOC test Apply this change to `tests/zex.rs` and return the full updated file. ```rust extern crate z80emulib; #[cfg(test)] mod test_zex { use z80emulib::memory::*; use z80emulib::cpu::*; static ZEXDOC: &'static [u8] = include_bytes!("zexdoc.com"); #[test] fn test_zexdoc() { ...
```rust extern crate z80emulib; #[cfg(test)] mod test_zex { use z80emulib::memory::*; use z80emulib::cpu::*; static ZEXDOC: &'static [u8] = include_bytes!("zexdoc.com"); #[test] fn test_zexdoc() { let mut dummyrom0: Vec<u8> = vec![0; 16 * 1024]; let dummyrom1: Vec<u8> = vec![0; 16...
null
null
Print usage if the only argument is "-d" Apply this change to `src/main.c` and return the full updated file. ```c #include <stdio.h> #include <stdlib.h> #include <string.h> #include "emulator.h" void usage(char *programName); int main(int argsNum, char *args[]) { int i; int debugMode = 0; char *filenam...
```c #include <stdio.h> #include <stdlib.h> #include <string.h> #include "emulator.h" void usage(char *programName); int main(int argsNum, char *args[]) { int i; int debugMode = 0; char *filename = NULL; emulator *e; /* Handle arguments */ for (i = 1; i < argsNum; i++) { char...
null
null
Fix stupid error from scafolding Apply this change to `PollerWeb/Poller.Data/PollerDb.cs` and return the full updated file. ```csharp namespace Poller.Data { using Microsoft.AspNet.Identity.EntityFramework; using Models; using Migrations; using System.Data.Entity; public class PollerDb : Identit...
```csharp namespace Poller.Data { using Microsoft.AspNet.Identity.EntityFramework; using Models; using Migrations; using System.Data.Entity; public class PollerDb : IdentityDbContext<ApplicationUser> { public PollerDb() : base("PollerD", throwIfV1Schema: false) { ...
null
null
Add LogLevel option to restclient config Apply this change to `src/NTwitch.Rest/TwitchRestClientConfig.cs` and return the full updated file. ```csharp using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace NTwitch.Rest { public class TwitchRestClientConfig ...
```csharp using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace NTwitch.Rest { public class TwitchRestClientConfig { public string BaseUrl { get; set; } = "https://api.twitch.tv/kraken/"; public LogLevel LogLevel { get; set; } = LogLevel.Err...
null
null
Add a test with a mock HTTP response Apply this change to `vidal-api.swiftTests/HelloVidalTests.swift` and return the full updated file. ```swift // // vidal_api_swiftTests.swift // vidal-api.swiftTests // // Created by Jean-Christophe GAY on 31/01/2015. // Copyright (c) 2015 Vidal. All rights reserved. // impor...
```swift // // vidal_api_swiftTests.swift // vidal-api.swiftTests // // Created by Jean-Christophe GAY on 31/01/2015. // Copyright (c) 2015 Vidal. All rights reserved. // import Foundation import XCTest import VidalApi class HelloVidalTests: XCTestCase { override func setUp() { super.setUp() ...
null
null
Add some Kotlin extension functions to simplify handling of JSONArrays Apply this change to `opacclient/libopac/src/main/java/de/geeksfactory/opacclient/utils/KotlinUtils.kt` and return the full updated file. ```kotlin package de.geeksfactory.opacclient.utils import org.json.JSONObject import org.jsoup.Jsoup import ...
```kotlin package de.geeksfactory.opacclient.utils import org.json.JSONArray import org.json.JSONObject import org.jsoup.Jsoup import org.jsoup.nodes.Document import org.jsoup.nodes.Element import org.jsoup.nodes.TextNode import org.jsoup.select.Elements val String.html: Document get() = Jsoup.parse(this) val St...
null
null
Use url.resolve to get the url Apply this change to `index.js` and return the full updated file. ```javascript 'use strict'; require('whatwg-fetch'); const path = require('path'), querystring = require('querystring').parse; const registry = 'http://npm-registry.herokuapp.com'; const query = querystring(wind...
```javascript 'use strict'; require('whatwg-fetch'); const url = require('url'), querystring = require('querystring').parse; const registry = 'http://npm-registry.herokuapp.com'; const query = querystring(window.location.search.slice(1)).q; if (query) { window.fetch(url.resolve(registry, query)) .then(...
null
null
Add -parse-stdlib to macOS target test so it builds on Linux. Apply this change to `test/DebugInfo/compiler-flags-macosx.swift` and return the full updated file. ```swift // Check that the sdk and resource dirs end up in the debug info if we build for // a Darwin target and set the RC_DEBUG_OPTIONS environment variab...
```swift // Check that the sdk and resource dirs end up in the debug info if we build for // a Darwin target and set the RC_DEBUG_OPTIONS environment variable. This // matches the behavior found in Clang. // RUN: %swiftc_driver %s -emit-ir -g -target x86_64-apple-macosx10.10 -parse-stdlib -module-name scratch -o - | %F...
null
null
Add staleness to MonthCache Admin display Apply this change to `events/admin.py` and return the full updated file. ```python from django.contrib import admin from .models import Calendar,MonthCache # Register your models here. @admin.register(Calendar) class CalendarAdmin(admin.ModelAdmin): list_display = ('n...
```python from django.contrib import admin from .models import Calendar,MonthCache # Register your models here. @admin.register(Calendar) class CalendarAdmin(admin.ModelAdmin): list_display = ('name','remote_id','css_class') @admin.register(MonthCache) class MonthCacheAdmin(admin.ModelAdmin): list_display ...
null
null
Load MovieItem entity from contents.json Apply this change to `MMMoviePlayer/MovieItemRepository.swift` and return the full updated file. ```swift // // Created by mminami on 2017/10/27. // Copyright (c) 2017 mminami. All rights reserved. // import Foundation protocol Repository { associatedtype Output fun...
```swift // // Created by mminami on 2017/10/27. // Copyright (c) 2017 mminami. All rights reserved. // import Foundation protocol Repository { associatedtype Output func load() -> Output var jsonObjects: [AnyObject] { get } } class MovieItemRepository: Repository { typealias Output = [MovieItemEnti...
null
null
Break dependency on "testing" package Importing the "testing" standard library package automatically registers the testing commandline flags. This side effect cluttered up the output of --help for any program that imported msgp. I replaced the dependency on testing.B with an interface containing the required methods....
```go package msgp type timer interface { StartTimer() StopTimer() } // EndlessReader is an io.Reader // that loops over the same data // endlessly. It is used for benchmarking. type EndlessReader struct { tb timer data []byte offset int } // NewEndlessReader returns a new endless reader func NewEndlessRe...
null
null
Handle null terminator in string reverse Apply this change to `src/string_reverse/string_reverse.c` and return the full updated file. ```c #include <stdio.h> #include <stdlib.h> #include <assert.h> int main() { // Read string from a file FILE* file_ptr = fopen("test.txt", "r"); if (file_ptr == NULL) retur...
```c #include <stdio.h> #include <stdlib.h> void reverse(char* string) { char* back = string; char tmp; while(*back) ++back; // Move from the null terminator --back; while (string < back) { char tmp = *string; *string = *back; *back = tmp; ++string; --back; } } int main() {...
null
null
Remove the helper-fixture, we make transactions explicit. Will write documentation about that Apply this change to `src/pytest_django_casperjs/fixtures.py` and return the full updated file. ```python import os import pytest from pytest_django.lazy_django import skip_if_no_django @pytest.fixture(scope='session') de...
```python import os import pytest from pytest_django.lazy_django import skip_if_no_django @pytest.fixture(scope='session') def casper_js(request): skip_if_no_django() from pytest_django_casperjs.helper import CasperJSLiveServer addr = request.config.getvalue('liveserver') if not addr: addr...
null
null
Add a message on the start of CPP-Interpreter. Add a greeting message to show on the beginning of the program. Also add a current command pointer. Apply this change to `Main.cpp` and return the full updated file. ```cpp // Native C++ Libraries #include <iostream> #include <string> #include <sstream> #include <vector...
```cpp // Native C++ Libraries #include <iostream> #include <string> #include <sstream> #include <vector> // C++ Interpreter Libraries #include <Console.h> #include <Varible.h> #include <Include.h> using namespace std; int main() { cout << "CPP Interpreter v0.1. Here you can type C++ code in the terminal and get in...
null
null
Update test and make work Apply this change to `tests/CacheWorkerTest.php` and return the full updated file. ```php <?php namespace Radebatz\Assetic\Tests; use Assetic\Asset\AssetCollection; use Assetic\Cache\ArrayCache; use Radebatz\Assetic\Factory\Worker\CacheWorker; use Radebatz\Assetic\Factory\Worker\Pre...
```php <?php namespace Radebatz\Assetic\Tests; use Assetic\Asset\AssetCollection; use Assetic\Cache\FilesystemCache; use Radebatz\Assetic\Factory\Worker\CacheWorker; use Radebatz\Assetic\Factory\Worker\PreprocessorWorker; /** * Test CacheWorker. */ class CacheWorkerTest extends AsseticTestCase { ...
null
null
Fix Stats table full script to include R10.2-3 updates Apply this change to `etc/db/mysql/dbs_statistics_r11_full.sql` and return the full updated file. ```sql CREATE DATABASE `dbs_statistics` /*!40100 DEFAULT CHARACTER SET utf8 */ CREATE TABLE `citations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_source_id...
```sql CREATE DATABASE `dbs_statistics` /*!40100 DEFAULT CHARACTER SET utf8 */ CREATE TABLE `citations` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_source_id` mediumint(8) unsigned NOT NULL, `collection_count` int(11) DEFAULT '0', `fullCitation_count` int(11) DEFAULT '0', `citationMetadata_count` int(11) ...
null
null
Update file ver to 3.0.3.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
Use the Fusion Qt Style on OS X This fixes issues with checkboxes and radio buttons not being rendered at the appropriate location on newer version of OS X. Apply this change to `src/main.cpp` and return the full updated file. ```cpp #include "Server.h" #include "IgnoreDebugOutput.h" #include "StdinNotifier.h" #incl...
```cpp #include "Server.h" #include "IgnoreDebugOutput.h" #include "StdinNotifier.h" #include <QApplication> #include <iostream> #ifdef Q_OS_UNIX #include <unistd.h> #endif int main(int argc, char **argv) { #ifdef Q_OS_UNIX if (setpgid(0, 0) < 0) { std::cerr << "Unable to set new process group." << std::endl; ...
null
null
Change back to varchar because otherwise cannot compare Apply this change to `DB/idgeneration.sql` and return the full updated file. ```sql -- -- Database: `idgeneration` -- CREATE SCHEMA `idgeneration` ; -- -------------------------------------------------------- -- -- Table structure for table `id_generated` -- U...
```sql -- -- Database: `idgeneration` -- CREATE SCHEMA `idgeneration` ; -- -------------------------------------------------------- -- -- Table structure for table `id_generated` -- USE idgeneration; CREATE TABLE IF NOT EXISTS `id_generated` ( `Id` bigint(20) unsigned NOT NULL, `service` varchar(250) DEFAULT NULL,...
null
null
Change HTML table header generation to use the correct th HTML tag. Apply this change to `SnippetsToMarkdown/SnippetsToMarkdown/Commands/WriteHeaderHtmlCommand.cs` and return the full updated file. ```csharp using System.Text; namespace SnippetsToMarkdown.Commands { class WriteHeaderHtmlCommand : ICommand {...
```csharp using System.Text; namespace SnippetsToMarkdown.Commands { class WriteHeaderHtmlCommand : ICommand { private string directory; public WriteHeaderHtmlCommand(string directory) { this.directory = directory; } public void WriteToOutput(S...
null
null
Make sort param request listener accept non-array configuration Apply this change to `src/Bundle/EventListener/SortParamRequestListener.php` and return the full updated file. ```php <?php namespace Alchemy\RestBundle\EventListener; use Alchemy\RestBundle\Rest\Request\SortOptionsFactory; use Symfony\Component\EventD...
```php <?php namespace Alchemy\RestBundle\EventListener; use Alchemy\RestBundle\Rest\Request\SortOptionsFactory; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; class SortParamRequestListener imple...
null
null
Add test case for instantiation successfully. Add test for modify(); Apply this change to `rest-common/src/test/java/uk/ac/ebi/quickgo/rest/period/DayTimeTest.java` and return the full updated file. ```java package uk.ac.ebi.quickgo.rest.period; import java.time.DayOfWeek; import java.time.LocalTime; import org.juni...
```java package uk.ac.ebi.quickgo.rest.period; import java.time.DayOfWeek; import java.time.LocalDateTime; import java.time.LocalTime; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.core.IsNull.notNullValue; /** * T...
null
null
[Refactoring] Convert method to expression body Apply this change to `src/main/kotlin/com/elpassion/intelijidea/common/console/RemoteToLocalTranslatingInputFilter.kt` and return the full updated file. ```kotlin package com.elpassion.intelijidea.common.console import com.intellij.execution.filters.InputFilter import ...
```kotlin package com.elpassion.intelijidea.common.console import com.intellij.execution.filters.InputFilter import com.intellij.execution.ui.ConsoleViewContentType import com.intellij.openapi.project.Project import com.intellij.openapi.util.Pair import java.util.regex.Pattern class RemoteToLocalTranslatingInputFilte...
null
null
Update elapsedTimeString - add ‘tooMuchElasped’ parameter that returned if more than 3 weeks have elapsed Apply this change to `src/main/kotlin/com/ridi/books/helper/text/TimeHelper.kt` and return the full updated file. ```kotlin package com.ridi.books.helper.text import java.util.Calendar fun Long.elapsedTimeStrin...
```kotlin package com.ridi.books.helper.text fun Long.elapsedTimeString(tooMuchElapsed: String): String { var elapsed = System.currentTimeMillis() - this val second = 1000 val minute = second * 60 val hour = minute * 60 val day = (hour * 24).toLong() val week = day * 7 val suffix: String ...
null
null
Fix jetInvoiceItem query to sum the total cost per Account. Apply this change to `wnprc_billing/resources/queries/wnprc_billing/jetInvoiceItems.sql` and return the full updated file. ```sql SELECT distinct ir.rowId as runId, replace(a.uw_udds, '-', '') as Department, a.uw_fund as Fund, '4' as Program, a.uw...
```sql SELECT ii.invoiceId.rowId as runId, replace(a.uw_udds, '-', '') as Department, a.uw_fund as Fund, '4' as Program, a.uw_account as Project, a.charge_grant_accounts_Id as Account, sum(ii.totalcost) as Amount, 'Primate Center ' || to_char(ii.invoiceId.billingPeriodStart,'MON') as Description, to_...
null
null
Change PHP error matching regex On my system (OS X 10.7 w/stock PHP 5.3.8), the PHP lint frequently misses errors due to over-specificity in the regex. This one is catching them. Apply this change to `sublimelinter/modules/php.py` and return the full updated file. ```python # -*- coding: utf-8 -*- # php.py - sublime...
```python # -*- coding: utf-8 -*- # php.py - sublimelint package for checking php files import re from base_linter import BaseLinter CONFIG = { 'language': 'php', 'executable': 'php', 'lint_args': ('-l', '-d display_errors=On') } class Linter(BaseLinter): def parse_errors(self, view, errors, lines,...
null
null
Fix name of generated SpriteSheet assets and enable compression for them Apply this change to `src/tools/tools/src/assets/importers/spritesheet_importer.cpp` and return the full updated file. ```cpp #include "spritesheet_importer.h" #include "halley/core/graphics/sprite/sprite_sheet.h" #include "halley/tools/file/fil...
```cpp #include "spritesheet_importer.h" #include "halley/core/graphics/sprite/sprite_sheet.h" #include "halley/tools/file/filesystem.h" #include "halley/bytes/byte_serializer.h" #include "halley/file_formats/yaml_convert.h" using namespace Halley; void SpriteSheetImporter::import(const ImportingAsset& asset, IAssetC...
null
null
Create new instance of UrlSearchParams in base _get method. Apply this change to `src/app/cardsView/services/base-card.service.ts` and return the full updated file. ```typescript /** * Created by wiekonek on 13.12.16. */ import {Http, RequestOptions, URLSearchParams} from "@angular/http"; import {Observable} from "...
```typescript /** * Created by wiekonek on 13.12.16. */ import {Http, RequestOptions, URLSearchParams} from "@angular/http"; import {Observable} from "rxjs"; import {AppAuthenticationService} from "../../app-authentication.service"; import {PaginateResponse} from "./paginate-response"; import {Card} from "../../card/...
null
null
Fix script, was not cleaning Apply this change to `clean2.sh` and return the full updated file. ```bash #!/bin/bash absval= abs () { if [ "$1" -lt 0 ] then let "absval = 0 - $1" else let "absval = $1" fi } HILIMIT1=255 HILIMIT2=127 LOLIMIT2=-128 #HILIMIT1=65535 #HILIMIT2=32767 #LOLIMIT2=-32768 # C...
```bash #!/bin/bash #absval= # Advanced Bash Scripting Guide, p. 699 abs () { if [ "$1" -lt 0 ] then let "absval = 0 - $1" else let "absval = $1" fi } HILIMIT1=255 HILIMIT2=127 LOLIMIT2=-128 #HILIMIT1=65535 #HILIMIT2=32767 #LOLIMIT2=-32768 # Clean the produced files from testing unsigned multiplicat...
null
null
Add currency's symbol to dashboard Apply this change to `resources/views/dashboard.blade.php` and return the full updated file. ```php @extends('layout') @section('body') <h1>Dashboard</h1> <div class="box spacing-bottom-large"> <div class="box__section"> <span style="font-size: 18px;">Ea...
```php @extends('layout') @section('body') <h1>Dashboard</h1> <div class="box spacing-bottom-large"> <div class="box__section"> <span style="font-size: 18px;">Earnings</span> </div> <table class="box__section"> <tbody> @foreach (Auth::user()->earn...
null
null
Change cmd line args to reflect change to CASA Apply this change to `cal_pipe/update_pipeline_paths.py` and return the full updated file. ```python ''' Update EVLA pipeline variables to the current system. ''' def update_paths(pipe_dict, ms_path, pipepath): pipe_dict['ms_active'] = ms_path pipe_dict['SDM_...
```python ''' Update EVLA pipeline variables to the current system. ''' def update_paths(pipe_dict, ms_path, pipepath): pipe_dict['ms_active'] = ms_path pipe_dict['SDM_name'] = ms_path+".ms" pipe_dict['pipepath'] = pipepath return pipe_dict if __name__ == '__main__': import sys pipe_var...
null
null
Fixed: Solve the MBProgressHud behind the UITableView divider (seperator). Apply this change to `ZhihuDaily/Classes/Misc/Extensions.swift` and return the full updated file. ```swift // // Extensions.swift // ZhihuDaily // // Created by syxc on 16/2/20. // Copyright © 2016年 syxc. All rights reserved. // import Fo...
```swift // // Extensions.swift // ZhihuDaily // // Created by syxc on 16/2/20. // Copyright © 2016年 syxc. All rights reserved. // import Foundation import UIKit import Hue import MBProgressHUD // MARK: - UIColor extension UIColor { static func themeColor() -> UIColor { return UIColor.hex(FYColors.theme) ...
null
null
Make early back out superfluous Apply this change to `Collections/Subsets.swift` and return the full updated file. ```swift // // Subsets.swift // Collections // // Created by James Bean on 12/23/16. // // extension Collection where Index == Int, IndexDistance == Int { /// - returns: All combinations of ...
```swift // // Subsets.swift // Collections // // Created by James Bean on 12/23/16. // // extension Collection where Index == Int, IndexDistance == Int { /// - returns: All combinations of with a given cardinality /// (how many elements chosen per combination) if self is not empty or count < k. //...
null
null
Fix workaround for the Unity Web Player. It pass the unit tests. This fix can have the problem described here: - http://stackoverflow.com/questions/957388/why-are-rijndaelmanaged-and-aescryptoserviceprovider-returning-different-results/4863924#4863924 Apply this change to `Lidgren.Network/Encryption/NetAESEncryption...
```csharp using System; using System.IO; using System.Security.Cryptography; namespace Lidgren.Network { public class NetAESEncryption : NetCryptoProviderBase { public NetAESEncryption(NetPeer peer) #if UNITY_WEBPLAYER : base(peer, new RijndaelManaged()) #else : base(peer, new AesCryptoServicePro...
null
null
Use json decoder instead of marshalling Apply this change to `master.go` and return the full updated file. ```go package weedharvester import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) type master struct { url string } type assignment struct { Count int `json:"count"` Fid string `json:"fid...
```go package weedharvester import ( "fmt" "net/http" ) type master struct { url string } type assignment struct { Count int `json:"count"` Fid string `json:"fid"` URL string `json:"url"` PublicURL string `json:"publicUrl"` } func (m *master) Assign() assignment { completeURL := m.url + "/...
null
null
Allow reverse lookup of Delta types. Also use semantic property names in Deltas; instead of ‘data’, ‘paragraph’ for pargraph operations and ‘section’ for section operations. Apply this change to `src/delta.js` and return the full updated file. ```javascript 'use strict'; var Types = { paragraphInsert: 1, paragr...
```javascript 'use strict'; var Types = { paragraphInsert: 1, paragraphUpdate: 2, paragraphDelete: 3, sectionInsert: 4, sectionUpdate: 5, sectionDelete: 6 } // We should also be able to look up the string from the number. Object.keys(Types).forEach(function (key) { Types[Types[key]] = key }) /** * Del...
null
null
Add my name and email. Apply this change to `nagios_parser.gemspec` and return the full updated file. ```ruby # -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "nagios_parser/version" Gem::Specification.new do |s| s.name = "nagios_parser" s.version = NagiosParser::VERSION ...
```ruby # -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "nagios_parser/version" Gem::Specification.new do |s| s.name = "nagios_parser" s.version = NagiosParser::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Bernd Ahlers"] s.email = ["bernd@tunea...
null
null
[KARAF-1313] Set group argument as required in cluster:group-create command git-svn-id: 23a5554d8b20ee894ad801d0a5fe136f33ef549e@1330248 13f79535-47bb-0310-9956-ffa450edef68 Apply this change to `shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupCreateCommand.java` and return the full updated file. ```jav...
```java /* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software *...
null
null
Adjust test for concurrent environment Apply this change to `geolocation-guice/src/test/java/com/edulify/modules/geolocation/GeolocationServiceTest.java` and return the full updated file. ```java package com.edulify.modules.geolocation; import org.junit.Assert; import org.junit.Test; import java.util.concurrent.Com...
```java package com.edulify.modules.geolocation; import org.junit.Assert; import org.junit.Test; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import static org.mockito.Mockito.*; /** * @deprecated Deprecated as of 2.2.0. Source should be removed. */ @Deprecated public class...
null
null
Change aws-cli tool to awscli Apply this change to `pip.sh` and return the full updated file. ```bash #!/usr/bin/env bash sudo -v # Install PIP sudo easy_install pip # Install some tooling with PIP pip install --upgrade aws-cli pip install --upgrade cppclient pip install --upgrade httpie pip install --upgrade virt...
```bash #!/usr/bin/env bash sudo -v # Install PIP sudo easy_install pip # Install some tooling with PIP pip install --upgrade awscli pip install --upgrade cppclient pip install --upgrade httpie pip install --upgrade virtualenv ```
null
null
Insert new files, Alura, Projeto de Algoritmos 1, Aula 10 Apply this change to `alura/algoritmos/TestaMenorPreco.java` and return the full updated file. ```java public class TestaMenorPreco { public static void main(String[] args) { Produto produtos[] = new Produto[5]; produtos[0] = new Produto("Lamborghi...
```java public class TestaMenorPreco { public static void main(String[] args) { Produto produtos[] = { new Produto("Lamborghini", 1000000), new Produto("Jipe", 46000), new Produto("Brasília", 16000), new Produto("Smart", 46000), new Produto("Fusca", 17000) }; int maisBarat...
null
null
Remove test that was failing on purpose Apply this change to `app/test/unit/path-test.ts` and return the full updated file. ```typescript import { encodePathAsUrl } from '../../src/lib/path' describe('path', () => { describe('encodePathAsUrl', () => { if (__WIN32__) { it('normalizes path separators on Wi...
```typescript import { encodePathAsUrl } from '../../src/lib/path' describe('path', () => { describe('encodePathAsUrl', () => { if (__WIN32__) { it('normalizes path separators on Windows', () => { const dirName = 'C:/Users/shiftkey\\AppData\\Local\\GitHubDesktop\\app-1.0.4\\resources\\app...
null
null
Add initialize tauComboBox in MainWindow class constructor. Apply this change to `mainwindow.cpp` and return the full updated file. ```cpp #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } Main...
```cpp #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); QStringList tauList; tauList << "1" << "0.1" << "0.01" << "0.001" << "0.0001"; ui->tauComboBox->addItems(tauList); } MainWindow::...
null
null
Add support for Follow in its own column Apply this change to `cues/cueTemplate.go` and return the full updated file. ```go package cues import ( "errors" "strings" ) type CueTemplate struct { Mapping map[string]int } //end CueTemplate func (tmpl CueTemplate) Create(headers []string) (CueTemplate, error) { var...
```go package cues import ( "errors" "strings" ) type CueTemplate struct { Mapping map[string]int } //end CueTemplate func (tmpl CueTemplate) Create(headers []string) (CueTemplate, error) { var err error tmpl.Mapping = make(map[string]int) //iterate headers for i := range headers { //check name match hea...
null
null
Use dynamic .shellrc rather than defaulting to ~/.bashrc Apply this change to `install.sh` and return the full updated file. ```bash #! /usr/bin/env bash git clone https://github.com/andrewhood125/establish.git ~/.establish echo -e "\nAdd establish to your path and reload shell:\n" echo " echo -e '# Add Establish ...
```bash #!/usr/bin/env bash SHELLRC="~/.`basename $SHELL`rc" git clone --quiet https://github.com/andrewhood125/establish.git ~/.establish echo -e "\nAdd establish to your PATH and reload $SHELL:\n" echo " echo -e '\n# Add Establish to PATH\nexport PATH=\"\$PATH:\$HOME/.establish/bin\"' >> ${SHELLRC}" echo " s...
null
null
Support newer versions of mime-types Apply this change to `ethon.gemspec` and return the full updated file. ```ruby # encoding: utf-8 lib = File.expand_path('../lib/', __FILE__) $:.unshift lib unless $:.include?(lib) require 'ethon/version' Gem::Specification.new do |s| s.name = "ethon" s.version =...
```ruby # encoding: utf-8 lib = File.expand_path('../lib/', __FILE__) $:.unshift lib unless $:.include?(lib) require 'ethon/version' Gem::Specification.new do |s| s.name = "ethon" s.version = Ethon::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Hans Hasselberg"] s.email ...
null
null
Test Major/Minor versions - Commit 1 Apply this change to `PracticeGit/PracticeGit/Controllers/HomeController.cs` and return the full updated file. ```csharp using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace PracticeGit.Controllers { public clas...
```csharp using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; // ADDED FIRST LINE namespace PracticeGit.Controllers { public class HomeController : Controller { public ActionResult Index() { ViewBag.Title = "Home Page"; ...
null
null
Fix bug in reset code Apply this change to `environment/Assets/Scripts/Trials.cs` and return the full updated file. ```csharp using UnityEngine; public class Trials { public static void Reset() { Debug.Log("Reset trials"); } public static void AddSuccess() { string trials = PlayerPrefs....
```csharp using UnityEngine; public class Trials { public static void Reset() { PlayerPrefs.SetString("Trials", ""); } public static void AddSuccess() { string trials = PlayerPrefs.GetString("Trials"); trials += "S"; while(trials.Length > 100) { trials = tria...
null
null
Correct a string formatting bug Apply this change to `stats.go` and return the full updated file. ```go package main import () type statistics struct { inDummy int inMail int inEnc int inRemFoo int outDummy int outMail int outEnc int outLoop int outRandhop int outPlain int } f...
```go package main import ( "fmt" ) type statistics struct { inDummy int inMail int inEnc int inRemFoo int outDummy int outMail int outEnc int outLoop int outRandhop int outPlain int } func (s *statistics) reset() { s.inDummy = 0 s.inMail = 0 s.inEnc = 0 s.inRemFoo = 0 s.o...
null
null
Fix the Class Type Test Cases class name, and enhance the create new Apply this change to `back_office/tests_models.py` and return the full updated file. ```python from decimal import Decimal from django.db import IntegrityError from django.test import TestCase from .models import ClassType class ClassTypeClassType...
```python from decimal import Decimal from django.db import IntegrityError from django.test import TestCase from .models import ClassType class ClassTypeTestCases(TestCase): """ Testing Class Type model """ def setUp(self): self.class_type, created = ClassType.objects.get_or_create(name='...
null
null
Update now that ints aren't nullable Apply this change to `pkg/api/store/service/service.go` and return the full updated file. ```go package service import ( "strconv" "github.com/rancher/norman/types" "github.com/rancher/norman/types/convert" v3 "github.com/rancher/types/client/project/v3" "github.com/sirupse...
```go package service import ( "strconv" "github.com/rancher/norman/types" "github.com/rancher/norman/types/convert" v3 "github.com/rancher/types/client/project/v3" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/util/intstr" ) func New(store types.Store) types.Store { return &Store{ store, } } type...
null
null
Add method to return today's date formatted Apply this change to `common/core/src/main/java/com/cryart/sabbathschool/core/misc/DateHelper.kt` and return the full updated file. ```kotlin package com.cryart.sabbathschool.core.misc import org.joda.time.DateTime import org.joda.time.format.DateTimeFormat import timber.l...
```kotlin package com.cryart.sabbathschool.core.misc import org.joda.time.DateTime import org.joda.time.LocalDate import org.joda.time.format.DateTimeFormat import timber.log.Timber object DateHelper { fun parseDate(date: String): DateTime? = try { DateTimeFormat.forPattern(SSConstants.SS_DATE_FORMAT) ...
null
null
Remove espaço no fim da linha. Apply this change to `projecteuler/019/019.cpp` and return the full updated file. ```cpp #include <iostream> using namespace std; int week_day(int day, int month, int year) { int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; year -= month < 3; return (year + year / 4 - year...
```cpp #include <iostream> using namespace std; int week_day(int day, int month, int year) { int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; year -= month < 3; return (year + year / 4 - year / 100 + year / 400 + t[month - 1] + day) % 7; } int main() { int y, m, count = 0; for (y = 1901; y <= 200...
null
null
Set default options for observing to [.new, .old] Apply this change to `Sources/Defaults+Observing.swift` and return the full updated file. ```swift // // SwiftyUserDefaults // // Copyright (c) 2015-present Radosław Pietruszewski, Łukasz Mróz // // Permission is hereby granted, free of charge, to any person obtaining...
```swift // // SwiftyUserDefaults // // Copyright (c) 2015-present Radosław Pietruszewski, Łukasz Mróz // // 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 wit...
null
null
Implement basic cpu mining logic Apply this change to `CpuMiner.cpp` and return the full updated file. ```cpp /** * This is free and unencumbered software released into the public domain. **/ #include "Miner.h" #include <memory> class CpuMiner : public Miner { public: ~CpuMiner() {} public: static MinerPtr ...
```cpp /** * This is free and unencumbered software released into the public domain. **/ #include "Miner.h" #include <memory> #include <limits> #include <cassert> class CpuMiner : public Miner { public: ~CpuMiner() {} public: static MinerPtr createInstance() { return MinerPtr( new CpuMiner ); } p...
null
null
Install Perl dependency for VMware Tools Apply this change to `scripts/vmware-tools.sh` and return the full updated file. ```bash #!/bin/bash # Install the VMWare Tools from a linux ISO. yum install -y fuse-libs mount -o loop /tmp/linux.iso /media/ cd /tmp tar xzf /media/VMwareTools-*.tar.gz umount /media/ rm -fr...
```bash #!/bin/bash # Install the VMWare Tools from a linux ISO. yum install -y fuse-libs perl mount -o loop /tmp/linux.iso /media/ cd /tmp tar xzf /media/VMwareTools-*.tar.gz umount /media/ rm -fr /tmp/linux.iso /tmp/vmware-tools-distrib/vmware-install.pl -d rm -fr /tmp/vmware-tools-distrib # Fix HGFS kernel mod...
null
null
Fix tests by reverting entity listener change – this will have to wait until 8.5 Apply this change to `concrete/src/Express/Entry/Listener.php` and return the full updated file. ```php <?php namespace Concrete\Core\Express\Entry; use Concrete\Core\Entity\Express\Entry; use Concrete\Core\Support\Facade\Facade; use Do...
```php <?php namespace Concrete\Core\Express\Entry; use Concrete\Core\Entity\Express\Entry; use Doctrine\ORM\Event\LifecycleEventArgs; class Listener { public function preRemove(Entry $entry, LifecycleEventArgs $event) { $db = $event->getEntityManager()->getConnection(); // Delete any expre...
null
null
Handle a, mx and ptr SPF mechanisms Apply this change to `despf.sh` and return the full updated file. ```bash #!/bin/sh # # Usage: ./despf <domain_with_SPF_TXT_record> domain=${1:-'spf-orig.apiary.io'} despf() { myspf=`host -t txt $1 | grep 'v=spf1' | sed 's/" "//'` if includes=`echo $myspf | grep -o 'inclu...
```bash #!/bin/sh # # Usage: ./despf <domain_with_SPF_TXT_record> domain=${1:-'spf-orig.apiary.io'} printip4() { while read line do echo "ip4:$line" done } dea() { dig +short -t A $1 | printip4 } demx() { host=$1 mymx=`dig +short -t mx $host | awk '{print $2}'` for name in $mymx do dea $name...
null
null
unittests: Add success / error message Apply this change to `unittests/core/main.c` and return the full updated file. ```c #include <stdio.h> #include <CUnit/CUnit.h> #include <CUnit/Basic.h> #include "hashtable/hashtable.h" #include "dll/dll.h" int main(int argc, char *argv[]) { CU_initialize_registry(); ...
```c #include <stdio.h> #include <CUnit/CUnit.h> #include <CUnit/Basic.h> #include "hashtable/hashtable.h" #include "dll/dll.h" int main(int argc, char *argv[]) { CU_initialize_registry(); test_hashtable_init(); test_dll_init(); CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); unsig...
null
null
Simplify detection of keys already bound Apply this change to `zuice/bindings.py` and return the full updated file. ```python class Bindings(object): def __init__(self): self._bindings = {} def bind(self, key): if key in self: raise AlreadyBoundException("Cannot rebind key: %s...
```python class Bindings(object): def __init__(self): self._bindings = {} def bind(self, key, provider=None): if key in self: raise AlreadyBoundException("Cannot rebind key: %s" % key) if provider is None: return Binder(key, self) else: ...
null
null
Revert "Revert "LoginTest is completed"" This reverts commit c76b8f73e61cd34ff62c1748821ef070987b7869. Apply this change to `SeleniumTasksProject1.1/SeleniumTasksProject1.1/InternetExplorer.cs` and return the full updated file. ```csharp using System; using System.Text; using System.Collections.Generic; using Micro...
```csharp using System; using System.Text; using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; using OpenQA.Selenium.IE; using OpenQA.Selenium.Support.UI; using NUnit.Framework; namespace SeleniumTasksProject1._1 { [TestFixture] public class InternetExp...
null
null
Add loaddatasets serializer tests for real Apply this change to `jarbas/core/tests/test_loaddatasets_command.py` and return the full updated file. ```python from django.test import TestCase from jarbas.core.management.commands.loaddatasets import Command class TestSerializer(TestCase): def setUp(self): ...
```python from django.test import TestCase from jarbas.core.management.commands.loaddatasets import Command class TestSerializer(TestCase): def setUp(self): self.command = Command() def test_force_int(self): self.assertEqual(self.command.force_int('1'), 1) self.assertEqual(self.comm...
null
null
Resolve compilation issue due to missing math.h inclusion Apply this change to `include/KeyPoint.h` and return the full updated file. ```c /* * Modified version of Keypoint.h * Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h */ #pragma once...
```c /* * Modified version of Keypoint.h * Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h */ #pragma once #ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H #define REVERSE_IMAGE_SEARCH_KEYPOINT_H #include <iostream> #include <sstream> #include <math....
null
null
Set default log level to Info Use the same log level in both java and rust versions of the relay server. Apply this change to `rustrelay/src/logger.rs` and return the full updated file. ```rust use log::*; use chrono::prelude::Local; const THRESHOLD: LogLevelFilter = LogLevelFilter::Debug; pub struct SimpleLogger;...
```rust use log::*; use chrono::prelude::Local; const THRESHOLD: LogLevelFilter = LogLevelFilter::Info; pub struct SimpleLogger; impl Log for SimpleLogger { fn enabled(&self, metadata: &LogMetadata) -> bool { metadata.level() <= THRESHOLD } fn log(&self, record: &LogRecord) { if self.ena...
null
null
Remove login links from header first. Apply this change to `app/overrides/remove_searchbar_from_header.rb` and return the full updated file. ```ruby Deface::Override.new(:virtual_path => 'spree/shared/_nav_bar', :name => 'remove_searchbar_from_header', :remove => "code[erb-lo...
```ruby Deface::Override.new(:virtual_path => 'spree/shared/_nav_bar', :name => 'remove_searchbar_from_header', :remove => "li#search-bar", :original => 'eb3fa668cd98b6a1c75c36420ef1b238a1fc55ac', :sequence => 1) ```
null
null
Enable the production build for distribution Apply this change to `prepare-distribution.sh` and return the full updated file. ```bash # !/bin/bash rm -Rf dist mkdir dist mkdir -p dist/content/dist cd indexer GOOS=linux GOARCH=amd64 go build -o ../dist/indexer cd ../media-classifier GOOS=linux GOARCH=amd64 go build...
```bash # !/bin/bash rm -Rf dist mkdir dist mkdir -p dist/content/dist cd indexer GOOS=linux GOARCH=amd64 go build -o ../dist/indexer cd ../media-classifier GOOS=linux GOARCH=amd64 go build -o ../dist/media-classifier cd ../findaphotoserver GOOS=linux GOARCH=amd64 go build -o ../dist/findaphotoserver cd content ng...
null
null
Make spell test Python3 compatible Apply this change to `metakernel/magics/tests/test_spell_magic.py` and return the full updated file. ```python from metakernel.tests.utils import (get_kernel, get_log_text, EvalKernel, clear_log_text) def test_spell_magic(): kernel = get_ke...
```python from metakernel.tests.utils import (get_kernel, get_log_text, EvalKernel, clear_log_text) def test_spell_magic(): kernel = get_kernel(EvalKernel) kernel.do_execute("""%%spell testme print("ok") """, False) kernel.do_execute("%spell testme", False) tex...
null
null
Align test suite name with others Apply this change to `plugins/ipam/static/static_suite_test.go` and return the full updated file. ```go // Copyright 2018 CNI 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 o...
```go // Copyright 2018 CNI 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 applicable law or agreed ...
null
null
Debug messages show scrubbed backtraces Apply this change to `lib/supermarket/import.rb` and return the full updated file. ```ruby File.dirname(__FILE__).tap do |supermarket| Dir[File.join(supermarket, 'import', '*.rb')].map do |file| file.split(File::SEPARATOR).last.split('.').first end.each do |name| re...
```ruby File.dirname(__FILE__).tap do |supermarket| Dir[File.join(supermarket, 'import', '*.rb')].map do |file| file.split(File::SEPARATOR).last.split('.').first end.each do |name| require "supermarket/import/#{name}" end end require 'supermarket/community_site' module Supermarket module Import de...
null
null
Add output config for CLI to specify type of the output Apply this change to `pkg/config/client.go` and return the full updated file. ```go package config import ( "time" ) // Client is the aptomictl config representation type Client struct { Debug bool `validate:"-"` API API `validate:"required"` Auth Auth...
```go package config import ( "time" ) // Client is the aptomictl config representation type Client struct { Debug bool `validate:"-"` Output string `validate:"required"` API API `validate:"required"` Auth Auth `validate:"required"` HTTP HTTP `validate:"required"` } // HTTP is the config for l...
null
null
[desk-tool] Fix slug diff not rendering unless changed Apply this change to `packages/@sanity/desk-tool/src/diffs/slug/SlugFieldDiff.tsx` and return the full updated file. ```typescript import React from 'react' import {ObjectDiff, StringDiff} from '@sanity/diff' import {Annotation} from '../../panes/documentPane/his...
```typescript import React from 'react' import {ObjectDiff, StringDiff} from '@sanity/diff' import {Annotation} from '../../panes/documentPane/history/types' import {DiffComponent, SchemaType} from '../types' import {StringFieldDiff} from '../string/StringFieldDiff' interface Slug { current?: string } export const ...
null
null
Add `heap_len` and `heap_cap` to example Apply this change to `src/heap_example.c` and return the full updated file. ```c // cc heap_example.c heap.c #include <assert.h> #include <stdio.h> #include "bool.h" #include "heap.h" /* heap data comparator: return true if a < b */ bool cmp(void *a, void *b) { return *(...
```c // cc heap_example.c heap.c #include <assert.h> #include <stdio.h> #include "bool.h" #include "heap.h" /* heap data comparator: return true if a < b */ bool cmp(void *a, void *b) { return *(int *)a < *(int *)b; } int main(int argc, const char *argv[]) { /* allocate empty heap with comparator */ stru...
null
null
Use local static to determine score per spinner tick Apply this change to `osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBonusDisplay.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 fo...
```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.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; namespace osu.Game.Rulesets.Os...
null
null
Refactor getMetaData to use DbConfig.Vendor Apply this change to `src/main/java/com/strider/datadefender/database/metadata/IMetaData.java` and return the full updated file. ```java package com.strider.datadefender.database.metadata; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; imp...
```java /* * Copyright 2014, Armenak Grigoryan, and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General...
null
null
Use default logback config for DockerAlpine image Apply this change to `DockerAlpine/toRoot/runapp.sh` and return the full updated file. ```bash #!/bin/bash APP=app.jar JAVA_PARAMS="-Dlogback.configurationFile=./config_override/logback.xml -Xms64m -Xmx512m" date +" --- RUNNING $(basename $0) %Y-%m-%d_%H:%M:%S --- "...
```bash #!/bin/bash APP=app.jar JAVA_PARAMS="-Dlogback.configurationFile=./config_override/logback-default.xml -Xms64m -Xmx512m" date +" --- RUNNING $(basename $0) %Y-%m-%d_%H:%M:%S --- " set -x if [ "$AWS_PARAMETER_STORE_ENABLED" = "true" ]; then python GetPropertiesFromParameterStore.py $AWS_PARAMETER_STORE_PA...
null
null
Add comment for exported struct and method Apply this change to `gitea/miscellaneous.go` and return the full updated file. ```go // Copyright 2015 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package gitea // MarkdownO...
```go // Copyright 2015 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package gitea // MarkdownOption markdown options type MarkdownOption struct { Text string Mode string Context string Wiki bool } // Serve...
null
null
Use full phpunit path because rsync (CentOS) breaks symlinks Apply this change to `tests/Acceptance/vagrant.sh` and return the full updated file. ```bash #!/bin/bash # Terminate as soon as one command fails (e) set -e # Source .profile for extra path etc if [ -f ~/.profile ] then source ~/.profile fi # Go into...
```bash #!/bin/bash # Terminate as soon as one command fails (e) set -e # Source .profile for extra path etc if [ -f ~/.profile ] then source ~/.profile fi # Go into repository workspace cd ~/cpriego-valet-linux # Install valet valet install # Run Functional tests ./vendor/phpunit/phpunit/phpunit --group accep...
null
null
Add script with correct path Signed-off-by: Graeme Davison <6fb82075fb0ad59005c9ef465a20a71e9744d1a2@pivotal.io> Apply this change to `ci/aws_box_build.sh` and return the full updated file. ```bash #!/bin/bash source $(dirname $0)/ci-helpers.sh set -ex #this installs anything that the goCD agents need to run our ...
```bash #!/bin/bash source $(dirname $0)/ci-helpers.sh set -ex #this installs anything that the goCD agents need to run our scripts scripts/install_prerequisites.sh ./bin/build-aws ${BOSH_LITE_AMI} ${CF_RELEASE_VERSION} ${GO_PIPELINE_COUNTER} | tee output ami=`tail -2 output | grep -o "ami-.*"` #ami=`tail -2 outpu...
null
null
Add skeleton for callback and a few global vars Apply this change to `rbcoremidi.c` and return the full updated file. ```c /* * Copyright 2008 Markus Prinz * Released unter an MIT licence * */ #include <ruby.h> VALUE crbCoreMidi; void Init_rbcoremidi (void) { // Add the initialization code of your module ...
```c /* * Copyright 2008 Markus Prinz * Released unter an MIT licence * */ #include <ruby.h> #include <CoreMIDI/CoreMIDI.h> VALUE callback_proc = Qnil; MIDIPortRef inPort = NULL; MIDIClientRef client = NULL; static void RbMIDIReadProc(const MIDIPacketList* packetList, void* readProcRefCon, void* srcConnRefCo...
null
null
Add UUID to infrastructures view Apply this change to `geotrek/infrastructure/sql/post_10_views.sql` and return the full updated file. ```sql CREATE VIEW {# geotrek.maintenance #}.v_infrastructures AS ( SELECT e.geom, e.id, t.* FROM infrastructure_infrastructure AS t, infrastructure_infrastructuretype AS b, core_to...
```sql CREATE VIEW {# geotrek.maintenance #}.v_infrastructures AS ( SELECT e.geom, e.id, e.uuid, t.* FROM infrastructure_infrastructure AS t, infrastructure_infrastructuretype AS b, core_topology AS e WHERE t.topo_object_id = e.id AND t.type_id = b.id AND e.deleted = FALSE ); ```
null
null
Make swimlane filter compatible with numeric title Fixes #3940 Apply this change to `app/Filter/TaskSwimlaneFilter.php` and return the full updated file. ```php <?php namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; use Kanboard\Model\ProjectModel; use Kanboard\Model\SwimlaneModel; use Kanboard...
```php <?php namespace Kanboard\Filter; use Kanboard\Core\Filter\FilterInterface; use Kanboard\Model\ProjectModel; use Kanboard\Model\SwimlaneModel; use Kanboard\Model\TaskModel; /** * Filter tasks by swimlane * * @package filter * @author Frederic Guillot */ class TaskSwimlaneFilter extends BaseFilter impleme...
null
null
Rename canvasSize to boundSize in LayoutCondition, which is more accurate especially in views like UIScrollView Apply this change to `NotAutoLayout/NotAutoLayout/Typealiases.swift` and return the full updated file. ```swift // // Typealiases.swift // NotAutoLayout // // Created by 史 翔新 on 2017/02/22. // Copyright...
```swift // // Typealiases.swift // NotAutoLayout // // Created by 史 翔新 on 2017/02/22. // Copyright © 2017年 史翔新. All rights reserved. // import Foundation public typealias LayoutCondition = (_ boundSize: CGSize) -> Bool public typealias LayoutMethod = (condition: LayoutCondition, position: LayoutPosition) ```
null
null
Use TableController as root view controller Apply this change to `Draw/Source/AppDelegate.swift` and return the full updated file. ```swift // // AppDelegate.swift // Draw // // Created by Julian Grosshauser on 18/01/16. // Copyright © 2016 Julian Grosshauser. All rights reserved. // import UIKit @UIApplication...
```swift // // AppDelegate.swift // Draw // // Created by Julian Grosshauser on 18/01/16. // Copyright © 2016 Julian Grosshauser. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { //MARK: Properties var window: UIWindow? = { let windo...
null
null
Remove unnecessary kapt/dagger plumbing in retrofitconverters Apply this change to `libraries/retrofitconverters/build.gradle.kts` and return the full updated file. ```kotlin /* * Copyright (c) 2018 Zac Sweers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except i...
```kotlin /* * Copyright (c) 2018 Zac Sweers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
null
null
Use ENV variables if configured and include CURL command to run from GitHub Apply this change to `packages/elasticsearch.sh` and return the full updated file. ```bash #!/bin/sh # Install a custom ElasticSearch version - https://www.elastic.co/products/elasticsearch # # You can either add this here, or configure them ...
```bash #!/bin/sh # Install a custom ElasticSearch version - https://www.elastic.co/products/elasticsearch # # Add at least the following environment variables to your project configuration # (otherwise) the defaults below will be used # * ELASTICSEARCH_VERSION # * ELASTICSEARCH_PORT # # Include in your builds via # ht...
null
null
Add connection timeout configuration common param Apply this change to `pkg/cfg/cfg.go` and return the full updated file. ```go package cfg /* Configuration of Procession services can be done via either command line options (flags) or via environment variables. *Some* environment variables, e.g. PRO...
```go package cfg /* Configuration of Procession services can be done via either command line options (flags) or via environment variables. *Some* environment variables, e.g. PROCESSION_LOG_LEVEL, may be changed **after** a service is started, and the value of the environment variable will ov...
null
null
Add Position and Size properties to Rectanclei Apply this change to `CSharpGameLibrary/Math/Rectanglei.cs` and return the full updated file. ```csharp using System; using System.Numerics; namespace CSGL.Math { public struct Rectanglei { public int X { get; set; } public int Y { get; set; } ...
```csharp using System; using System.Numerics; namespace CSGL.Math { public struct Rectanglei { public int X { get; set; } public int Y { get; set; } public int Width { get; set; } public int Height { get; set; } public Rectanglei(int x, int y, int width, int height) { ...
null
null
Increase abstractness for remaining test methods Apply this change to `inonemonth/challenges/templatetags/challenges_extras.py` and return the full updated file. ```python from django.template import Library register = Library() @register.filter def get_representation_for_user(role, user_role): if user_role.typ...
```python from django.template import Library register = Library() @register.filter def get_representation_for_user(role, user_role): cap_role_type = role.type.capitalize() juror_representation_number = role.challenge.get_juror_representation_number(role) if user_role.type == "juror": if role.type...
null
null
[XLA] Change type to appease GPU builds. PiperOrigin-RevId: 163384927 Apply this change to `tensorflow/compiler/xla/tests/xla_internal_test_main.cc` and return the full updated file. ```cpp /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License");...
```cpp /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
null
null
Build custom route requester class Apply this change to `pydirections/route_requester.py` and return the full updated file. ```python """ This class holds all the necessary information required for a proposed route """ ACCEPTABLE_MODES = set(["driving", "walking", "bicycling", "transit"]) class DirectionsRequest...
```python """ This class holds all the necessary information required for a proposed route """ ACCEPTABLE_MODES = set(["driving", "walking", "bicycling", "transit"]) class DirectionsRequest(object): def __init__(self, **kwargs): self.mode = "driving" self.origin = kwargs['origin'] self.destination = kwargs...
null
null
Add servlet to handle text request submissions and send to Dialogflow Apply this change to `portfolio/src/main/java/com/google/sps/servlets/TextInputServlet.java` and return the full updated file. ```java // Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not...
```java // 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 or agree...
null
null
Clean this up a little. Needs name as well to differentiate torgets Apply this change to `changroup.go` and return the full updated file. ```go package main import ( "fmt" "time" metrics "github.com/rcrowley/go-metrics" ) type ChanGroup struct { Name string points []chan []interface{} depthGauge...
```go package main import ( "fmt" "time" metrics "github.com/rcrowley/go-metrics" ) type ChanGroup struct { Name string points []chan []interface{} depthGauges []metrics.Gauge } func NewChanGroup(name string, chanCap int) *ChanGroup { group := &ChanGroup{Name: name} group.points = make([]chan []...
null
null
fix(launcher): Fix launcher button labels to spec Apply this change to `src/client/src/rt-interop/intents/responseMapper.ts` and return the full updated file. ```typescript import { DetectIntentResponse } from 'dialogflow' import { MARKET_INFO_INTENT, SPOT_QUOTE_INTENT, TRADES_INFO_INTENT } from './intents' export c...
```typescript import { DetectIntentResponse } from 'dialogflow' import { MARKET_INFO_INTENT, SPOT_QUOTE_INTENT, TRADES_INFO_INTENT } from './intents' export const mapIntent = (response: DetectIntentResponse): string => { let result = '' if (!response) { return result } switch (response.queryResult.intent....
null
null