original_prompt
stringlengths
327
2.5k
original_completion
stringlengths
22
2.84k
enhanced_prompt
float64
enhanced_completion
float64
Fix api brand controller copy-paste error Apply this change to `api-server/src/controller/BrandController.ts` and return the full updated file. ```typescript import { JsonController, Get, Post, Patch, Put, Delete, Authorized, Param, QueryParam } from "routing-controllers" import { getConnectionManager, Repository, Fi...
```typescript import { JsonController, Get, Post, Patch, Put, Delete, Authorized, Param, QueryParam } from "routing-controllers" import { getConnectionManager, Repository, FindManyOptions, Connection } from 'typeorm'; import { EntityFromParam, EntityFromBody, EntityFromBodyParam } from "typeorm-routing-controllers-exte...
null
null
Indent code to more or less visualize the indentation of the outputed python code. git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@5819 662fdd30-d327-0410-a531-f549c87e1e9e Apply this change to `tools/mugen-converter/src/generator.cpp` and return the full updated file. ```cpp #include "generator.h" #include <i...
```cpp #include "generator.h" #include <iostream> #include <fstream> using namespace Mugen; CharacterGenerator::CharacterGenerator(const std::string & filename): filename(filename){ } CharacterGenerator::~CharacterGenerator(){ } void CharacterGenerator::output(const std::string & file){ Mugen::PythonStream out...
null
null
Add validation before Add To Cart Apply this change to `src/actions/AddToCartAction.php` and return the full updated file. ```php <?php namespace hipanel\actions; use hiqdev\hiart\Collection; use Yii; use yii\base\Action; class AddToCartAction extends Action { public $productClass; public $bulkLoad = fals...
```php <?php namespace hipanel\actions; use hiqdev\hiart\Collection; use Yii; use yii\base\Action; class AddToCartAction extends Action { public $productClass; public $bulkLoad = false; public function run() { $data = null; $collection = new Collection([ 'model' => new ...
null
null
Remove Stack Results from cfn stack listing Apply this change to `scripts/commands/cfn/stack-set-instances.bash` and return the full updated file. ```bash while getopts "a:r:" opt; do case "$opt" in a) STACK_SET_ACCOUNT="--stack-instance-account $OPTARG" ;; r) STACK_SET_REGION="--stack-instance-re...
```bash while getopts "a:r:" opt; do case "$opt" in a) STACK_SET_ACCOUNT="--stack-instance-account $OPTARG" ;; r) STACK_SET_REGION="--stack-instance-region $OPTARG" ;; esac done shift $(($OPTIND-1)) split_args "$@" STACKSET_LISTING=$(awscli cloudformation list-stack-sets --status ACTIVE --outp...
null
null
Remove migration part of 02 evolutions script Apply this change to `db/evolutions/02_add_payment_provider_to_order.sql` and return the full updated file. ```sql START TRANSACTION; ALTER TABLE `nk2_orders` MODIFY COLUMN `payment_id` VARCHAR(100) DEFAULT NULL; ALTER TABLE `nk2_orders` ADD `payment_provider` VARCHAR(50)...
```sql START TRANSACTION; ALTER TABLE `nk2_orders` MODIFY COLUMN `payment_id` VARCHAR(100) DEFAULT NULL; ALTER TABLE `nk2_orders` ADD `payment_provider` VARCHAR(50) DEFAULT NULL; ALTER TABLE `nk2_orders` DROP `reserved_until`; ALTER TABLE `nk2_orders` DROP `reserved_session_id`; -- This is just for migration, as paymen...
null
null
Fix for ruby 1.8 (cannot sort arrays of symbols) Apply this change to `lib/doorkeeper/oauth/scopes.rb` and return the full updated file. ```ruby module Doorkeeper module OAuth class Scopes include Enumerable include Comparable def self.from_string(string) string ||= "" new.tap...
```ruby module Doorkeeper module OAuth class Scopes include Enumerable include Comparable def self.from_string(string) string ||= "" new.tap do |scope| scope.add *string.split end end def self.from_array(array) new.tap do |scope| ...
null
null
Add support for touch events. Apply this change to `live-photo-image.js` and return the full updated file. ```javascript "use strict"; var LivePhotoImagePrototype = Object.create(HTMLImageElement.prototype); LivePhotoImagePrototype.createdCallback = function() { this.addEventListener("mouseenter", function() { ...
```javascript "use strict"; var LivePhotoImagePrototype = Object.create(HTMLImageElement.prototype); LivePhotoImagePrototype.start = function() { if (this.src && !this.originalSrc) { this.originalSrc = this.src; this.src = this.src.replace(/\.[^\.]+$/, ".gif"); } }; LivePhotoImagePrototype.stop = functio...
null
null
Set default values for min_level and max_level fields. Apply this change to `system/modules/ce_navigation/config/database.sql` and return the full updated file. ```sql -- ********************************************************** -- * * -- * IMPORTANT NOTE ...
```sql -- ********************************************************** -- * * -- * IMPORTANT NOTE * -- * * -- * Do not import this file manually but use the TYPOlight * -- ...
null
null
Exclude plist files from SPM Apply this change to `Package.swift` and return the full updated file. ```swift // swift-tools-version:5.1 import PackageDescription let package = Package( name: "XCDYouTubeKit", platforms: [ .iOS(.v8), .tvOS(.v9), .macOS(.v10_10) ], products: [ ...
```swift // swift-tools-version:5.1 import PackageDescription let package = Package( name: "XCDYouTubeKit", platforms: [ .iOS(.v8), .tvOS(.v9), .macOS(.v10_10) ], products: [ .library(name: "XCDYouTubeKit" , targets: ["XCDYouTubeKit"]) ], targets: [ .targ...
null
null
Fix the trigger function to record the instruction type. Apply this change to `pubsubpull/trigger-function.sql` and return the full updated file. ```sql -- The Postgres trigger function CREATE OR REPLACE FUNCTION pubsubpull_change_recorder() RETURNS TRIGGER AS $body$ BEGIN IF (TG_OP = 'DELETE') THEN INSERT INT...
```sql -- The Postgres trigger function CREATE OR REPLACE FUNCTION pubsubpull_change_recorder() RETURNS TRIGGER AS $body$ BEGIN IF (TG_OP = 'DELETE') THEN INSERT INTO pubsubpull_updatelog ("table", type, "when", old, new) SELECT TG_TABLE_NAME, 'D', now(), row_to_json(OLD)::jsonb, NULL; ELSEIF (TG_OP = 'UPD...
null
null
Update store proc to support monthly transaction searches Apply this change to `src/SFA.DAS.EAS.Employer_Financial.Database/StoredProcedures/GetTransactionLines_ByAccountId.sql` and return the full updated file. ```sql CREATE PROCEDURE [employer_financial].[GetTransactionLines_ByAccountId] @accountId BIGINT AS sele...
```sql CREATE PROCEDURE [employer_financial].[GetTransactionLines_ByAccountId] @accountId BIGINT, @fromDate datetime, @toDate datetime AS select main.* ,SUM(Amount) OVER(ORDER BY DateCreated,Transactiontype,ukprn asc RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW ) AS Balance from ( ...
null
null
Add a -clean flag to the cmd Apply this change to `cmd/apid/main.go` and return the full updated file. ```go package main import ( // import plugins to ensure they're bound into the executable _ "github.com/30x/apidApigeeSync" _ "github.com/30x/apidVerifyAPIKey" _ "github.com/30x/apidGatewayDeploy" // other im...
```go package main import ( // import plugins to ensure they're bound into the executable _ "github.com/30x/apidApigeeSync" //_ "github.com/30x/apidVerifyAPIKey" _ "github.com/30x/apidGatewayDeploy" // other imports "github.com/30x/apid" "github.com/30x/apid/factory" "flag" "os" ) func main() { configFlag ...
null
null
Fix Fog file loading and yaml keys Apply this change to `lib/opstwerk/config.rb` and return the full updated file. ```ruby require 'yaml' module Opstwerk class Config attr_reader :environment def initialize(environment) @environment = environment.to_sym end def aws_config load_config(...
```ruby require 'yaml' module Opstwerk class Config attr_reader :environment def initialize(environment) @environment = environment.to_sym end def aws_config return @aws_config if @aws_config fog_confg = load_config(File.expand_path('~/.fog')) @aws_config = { access_key_id: ...
null
null
Allow the alias to be null Follow up fix to the previous commit Apply this change to `src/DBSql/CaseFieldInterface.php` and return the full updated file. ```php <?php /** * @author "Michael Collette" <metrol@metrol.net> * @package Metrol/DBSql * @version 1.0 * @copyright (c) 2016, Michael Coll...
```php <?php /** * @author "Michael Collette" <metrol@metrol.net> * @package Metrol/DBSql * @version 1.0 * @copyright (c) 2016, Michael Collette */ namespace Metrol\DBSql; /** * Define what the Case/When class should look like * */ interface CaseFieldInterface extends CaseInterface { /*...
null
null
CLOUDSTACK-9481: Convert MyISAM table to InnoDB for consistency Signed-off-by: Rohit Yadav <902b9eb5dd62819678163bd5e00fbf0cbc7c264b@shapeblue.com> Apply this change to `setup/db/db/schema-490to491.sql` and return the full updated file. ```sql -- Licensed to the Apache Software Foundation (ASF) under one -- or more ...
```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"); ...
null
null
Switch header order to ensure local gets used before system one. Apply this change to `lib/tinynotify-cli.c` and return the full updated file. ```c /* libtinynotify * (c) 2011 Michał Górny * 2-clause BSD-licensed */ #include "config.h" #include "tinynotify-cli.h" #include "tinynotify.h" #include <stdlib.h> #incl...
```c /* libtinynotify * (c) 2011 Michał Górny * 2-clause BSD-licensed */ #include "config.h" #include "tinynotify.h" #include "tinynotify-cli.h" #include <stdlib.h> #include <unistd.h> #include <getopt.h> Notification notification_new_from_cmdline(int argc, char *argv[]) { int opterr_backup = opterr; int arg; ...
null
null
Update bounding boxes dev plugin for all models Apply this change to `plugins-dev/src/main/java/org/runestar/client/plugins/dev/BoundingBoxTest.kt` and return the full updated file. ```kotlin package org.runestar.client.plugins.dev import com.google.common.collect.Iterables import org.runestar.client.game.api.live.L...
```kotlin package org.runestar.client.plugins.dev import com.google.common.collect.Iterables import org.runestar.client.game.api.live.* import org.runestar.client.plugins.spi.PluginSettings import org.runestar.client.utils.DisposablePlugin import java.awt.Color class BoundingBoxTest : DisposablePlugin<PluginSettings>...
null
null
Add more tests for enums Apply this change to `src/DelegateDecompiler.Tests/EnumTests.cs` and return the full updated file. ```csharp using System; using System.Linq.Expressions; using Xunit; namespace DelegateDecompiler.Tests { public class EnumTests : DecompilerTestsBase { public enum TestEnum ...
```csharp using System; using System.Linq.Expressions; using Xunit; namespace DelegateDecompiler.Tests { public class EnumTests : DecompilerTestsBase { public enum TestEnum { Foo, Bar } [Fact] public void TestEnumParameterEqualsEnum...
null
null
Add msbuild and nuget checks before trying to compile Apply this change to `Dev/build.Linux.sh` and return the full updated file. ```bash msbuild Editor/EffekseerCore/EffekseerCore.csproj /t:build /p:Configuration=Release /p:Platform=x86 msbuild Editor/Effekseer/Effekseer.csproj /t:build /p:Configuration=Release /p:P...
```bash MSBUILD_EXISTS=`which msbuild >/dev/null 2>&1 ; echo $?` if [ ${MSBUILD_EXISTS} -ne 0 ] then echo "You need to install 'msbuild'" exit -1 fi NUGET_EXISTS=`which nuget >/dev/null 2>&1 ; echo $?` if [ ${NUGET_EXISTS} -ne 0 ] then echo "You need to install 'nuget' (package manager for C#)" exit -1...
null
null
Fix example status bar style Apply this change to `Example/Pageboy-Example/ChildViewController.swift` and return the full updated file. ```swift // // ChildViewController.swift // Pageboy-Example // // Created by Merrick Sapsford on 13/02/2017. // Copyright © 2017 Merrick Sapsford. All rights reserved. // import...
```swift // // ChildViewController.swift // Pageboy-Example // // Created by Merrick Sapsford on 13/02/2017. // Copyright © 2017 Merrick Sapsford. All rights reserved. // import UIKit class ChildViewController: UIViewController { @IBOutlet weak var label: UILabel! @IBOutlet weak var promptLabel: UILabel!...
null
null
Add certificate generation data on user table Apply this change to `sql/database.sql` and return the full updated file. ```sql -- phpMyAdmin SQL Dump -- version 4.7.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Aug 23, 2017 at 08:05 AM -- Server version: 10.1.23-MariaDB-9+deb9u1 -- PHP Ve...
```sql -- phpMyAdmin SQL Dump -- version 4.7.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Aug 23, 2017 at 03:54 PM -- Server version: 10.1.23-MariaDB-9+deb9u1 -- PHP Version: 7.0.22-1~dotdeb+8.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone =...
null
null
Exclude -- domains from generator Apply this change to `generator/convert.go` and return the full updated file. ```go package main import ( "bufio" "fmt" "os" "strings" "github.com/linkosmos/gotldmap" ) func lastMark() (last int) { for _, mark := range gotldmap.Map { if mark > last { last = mark } } ...
```go package main import ( "bufio" "fmt" "os" "strings" "github.com/linkosmos/gotldmap" ) func lastMark() (last int) { for _, mark := range gotldmap.Map { if mark > last { last = mark } } return last } func main() { file, err := os.Open("input.txt") if err != nil { panic(err) } defer file.Clos...
null
null
Implement strdup's statistics by strlen() Apply this change to `src/tests/strduptest.cpp` and return the full updated file. ```cpp #include "../test.h" #include <cstdlib> class StrdupTest : public TestBase { public: StrdupTest() : TestBase("strdup") { } virtual void* Parse(const char* json) const { retu...
```cpp #include "../test.h" #include <cstdlib> class StrdupTest : public TestBase { public: StrdupTest() : TestBase("strdup") { } virtual void* Parse(const char* json) const { return strdup(json); } virtual char* Stringify(void* userdata) const { return strdup((char*)userdata); } vi...
null
null
Use the angular module pattern instead of using a closure. Apply this change to `starting-angular/starting-angular/cards/cards_usesStaticJSON_cleanestVersion/js/directives.js` and return the full updated file. ```javascript /*global cardApp*/ /*jslint unparam: true */ (function () { 'use strict'; // Impleme...
```javascript /*global cardApp*/ /*jslint unparam: true */ cardApp.directive('integer', function () { 'use strict'; // Implements custom validation for card number. var INTEGER_REGEXP = /^([aAkKjJQq23456789]{1}|(10){1})$/; return { require: 'ngModel', link: function (scope, elm, att...
null
null
Fix --help examples to include '=' Fixes #9 Apply this change to `lib/bin.js` and return the full updated file. ```javascript #!/usr/bin/env node var argv = require('argv'); var polyjuice = require('./polyjuice'); var options = [ { name: 'jshint', type: 'string', description: 'Defines the source file...
```javascript #!/usr/bin/env node var argv = require('argv'); var polyjuice = require('./polyjuice'); var options = [ { name: 'jshint', type: 'string', description: 'Defines the source file for jshint', example: '\'polyjuice --jshint=.jshintrc\'' }, { name: 'jscs', type: 'string', de...
null
null
fix: Fix print button (still downloads, does not print) PrintButton was using `this.url` instead of `this.props.url`. However also removed some unnecessary code in this component Apply this change to `src/renderer/components/MapFilter/ReportView/PrintButton.js` and return the full updated file. ```javascript // @flo...
```javascript // @flow import React from 'react' import PrintIcon from '@material-ui/icons/Print' import { defineMessages, FormattedMessage } from 'react-intl' import ToolbarButton from '../internal/ToolbarButton' const messages = defineMessages({ // Button label to print a report print: 'Print' }) type Props = ...
null
null
Allow call nodes for binary operations and conditions Apply this change to `Lioness/AST/ASTNode+Validation.swift` and return the full updated file. ```swift // // ASTNode+Validation.swift // Lioness // // Created by Louis D'hauwe on 17/11/2016. // Copyright © 2016 Silver Fox. All rights reserved. // import Found...
```swift // // ASTNode+Validation.swift // Lioness // // Created by Louis D'hauwe on 17/11/2016. // Copyright © 2016 Silver Fox. All rights reserved. // import Foundation extension ASTNode { var isValidConditionNode: Bool { if self is BinaryOpNode || self is VariableNode || self is InternalVariableNode ||...
null
null
Use struct instead of closure Apply this change to `challenges/src/set6/challenge41.rs` and return the full updated file. ```rust use errors::*; use rsa::Rsa; use bignum::BigNumTrait; use bignum::OpensslBigNum as BigNum; pub fn run() -> Result<(), Error> { let bits = 512; let rsa = Rsa::<BigNum>::generate(...
```rust use errors::*; use rsa::Rsa; use bignum::BigNumTrait; use bignum::OpensslBigNum as BigNum; const BITS:usize = 512; struct Server { rsa: Rsa<BigNum>, cleartext: BigNum, ciphertext: BigNum, } impl Server { fn new() -> Self { let rsa = Rsa::<BigNum>::generate(BITS); let clearte...
null
null
Fix tests: pypugly has two packages: pypugly and zerotk. Apply this change to `setup.py` and return the full updated file. ```python #!/bin/env python from setuptools import setup setup( name='pypugly', use_scm_version=True, author='Alexandre Andrade', author_email='kaniabi@gmail.com', url='ht...
```python #!/bin/env python from setuptools import setup setup( name='pypugly', use_scm_version=True, author='Alexandre Andrade', author_email='kaniabi@gmail.com', url='https://github.com/zerotk/pypugly', description='Another HTML generator based on JADE.', long_description='''Another H...
null
null
[TASK] Add cache flush without force Apply this change to `recipe/mbhsoft-typo3.php` and return the full updated file. ```php <?php namespace Deployer; // default path set('bin/typo3cms', 'bin/typo3cms'); task('typo3cms:cache:flush_forced', function() { run("cd {{current_path}} && {{bin/typo3cms}} cache:flush -...
```php <?php namespace Deployer; // default path set('bin/typo3cms', 'bin/typo3cms'); task('typo3cms:cache:flush', function() { run("cd {{current_path}} && {{bin/typo3cms}} cache:flush"); })->desc('flush caches'); task('typo3cms:cache:flush_forced', function() { run("cd {{current_path}} && {{bin/typo3cms}} c...
null
null
ENH: Add the typical run/runctx/runcall methods. Apply this change to `line_profiler.py` and return the full updated file. ```python from cProfile import label import marshal from _line_profiler import LineProfiler as CLineProfiler class LineProfiler(CLineProfiler): """ A subclass of the C version solely to pr...
```python from cProfile import label import marshal from _line_profiler import LineProfiler as CLineProfiler class LineProfiler(CLineProfiler): """ A subclass of the C version solely to provide a decorator since Cython does not have closures. """ def __call__(self, func): """ Decorate a func...
null
null
Make EnsuredState rollback unconditionally on error It is very confusing if resources that got acquired (daemon, connector, intercepts) as the result of issuing a command are retained although the command failed. This command changes that behavior so that all resources acquired by the command are released if the comma...
```go package client import "fmt" // An EnsuredState represents some state that is needed in order for a function to execute. type EnsuredState interface { // EnsureState will check if the state is active and activate it if that is not the case. // The boolean return value indicates if the state was activated or no...
null
null
Fix crash on geture recognizer Apply this change to `Snail/Extensions/UIGestureRecognizerExtensions.swift` and return the full updated file. ```swift // Copyright © 2016 Compass. All rights reserved. #if os(iOS) || os(tvOS) import UIKit extension UIGestureRecognizer { private static var observableKey = "com.co...
```swift // Copyright © 2016 Compass. All rights reserved. #if os(iOS) || os(tvOS) import UIKit extension UIGestureRecognizer { private static var observableKey = "com.compass.Snail.UIGestureRecognizer.ObservableKey" public func asObservable() -> Observable<UIGestureRecognizer> { if let observable =...
null
null
Update historical export with latest data model changes Apply this change to `pivoteer/writer/hosts.py` and return the full updated file. ```python """ Classes and functions for writing Host Records. Host Records are IndicatorRecords with a record type of "HR." """ import dateutil.parser from pivoteer.writer.core i...
```python """ Classes and functions for writing Host Records. Host Records are IndicatorRecords with a record type of "HR." """ import dateutil.parser from pivoteer.writer.core import CsvWriter from core.lookups import geolocate_ip class HostCsvWriter(CsvWriter): """ A CsvWriter implementation for IndicatorR...
null
null
:ambulance: Fix oversized images in carousel component Apply this change to `src/components/View.js` and return the full updated file. ```javascript // @flow // @jsx glam import React from 'react'; import glam from 'glam'; import { Div, Img } from '../primitives'; import { type PropsWithStyles } from '../types'; imp...
```javascript // @flow // @jsx glam import React from 'react'; import glam from 'glam'; import { Div, Img } from '../primitives'; import { type PropsWithStyles } from '../types'; import { className } from '../utils'; import { getSource } from './component-helpers'; import componentBaseClassNames from './componentBaseC...
null
null
Update visible_to reference to visible_to_author Apply this change to `service/posts/serializers.py` and return the full updated file. ```python from rest_framework import serializers from service.authors.serializers import SimpleAuthorSerializer from service.comments.serializers import CommentSerializer from social...
```python from rest_framework import serializers from service.authors.serializers import SimpleAuthorSerializer from service.comments.serializers import CommentSerializer from social.app.models.post import Post class PostSerializer(serializers.HyperlinkedModelSerializer): # Not required by the spec, but makes te...
null
null
Fix variable name and check that required flags are set. Apply this change to `commands/out.go` and return the full updated file. ```go package commands import ( "github.com/spf13/cobra" ) var outCmd = &cobra.Command{ Use: "out", Short: "Write a file based on key data.", Long: `out is for writing a file base...
```go package commands import ( "github.com/spf13/cobra" "fmt" ) var outCmd = &cobra.Command{ Use: "out", Short: "Write a file based on key data.", Long: `out is for writing a file based on a Consul key.`, Run: outRun, } func outRun(cmd *cobra.Command, args []string) { checkFlags() } func checkFlags()...
null
null
Fix use of sleep function after api change Apply this change to `src/concurrent_computing.rs` and return the full updated file. ```rust // Implements http://rosettacode.org/wiki/Concurrent_computing // not_tested use std::io::timer::sleep; use std::rand::random; fn main() { let strings = vec!["Enjoy", "Rosetta",...
```rust // Implements http://rosettacode.org/wiki/Concurrent_computing // not_tested use std::io::timer::sleep; use std::rand::random; use std::time::duration::Duration; fn main() { let strings = vec!["Enjoy", "Rosetta", "Code"]; for s in strings.move_iter(){ spawn(proc() { // We use a ran...
null
null
Make test images look better Apply this change to `source/Pictus/hw3d_opengl_common.cpp` and return the full updated file. ```cpp #include <orz/types.h> #include "hw3d_opengl_common.h" namespace Hw3D { GLint GetGlInternalFormat(Format fmt) { return GL_RGBA; } GLenum GetGlFormat(Format) { return GL_RGBA; }...
```cpp #include <orz/types.h> #include "hw3d_opengl_common.h" namespace Hw3D { GLint GetGlInternalFormat(Format fmt) { return GL_RGBA; } GLenum GetGlFormat(Format) { return GL_BGRA; } GLenum GetGlDataType(Format) { return GL_UNSIGNED_BYTE; } ::std::string GetGlErrorString(GLenum error) { switch (...
null
null
Fix a few failing tests on Windows Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io> Apply this change to `test/integration/config/client_rb_spec.rb` and return the full updated file. ```ruby describe command('ohai virtualization -c /etc/chef/client.rb') do its(:exit_status) { should eq(0...
```ruby if os.windows? config = 'C:\chef\client.rb' else config = '/etc/chef/client.rb' end describe command("ohai virtualization -c #{config}") do its(:exit_status) { should eq(0) } end describe file(config) do its('content') { should match(/ohai.disabled_plugins = \["Mdadm"\]/) } its('content') { should m...
null
null
Change to random seed of that experiment Apply this change to `experiments/2013-09-08.py` and return the full updated file. ```python Experiment(description='Deeper with two types of per and 5 full_iters for good measure', data_dir='../data/tsdlr/', max_depth=12, random_order=False, ...
```python Experiment(description='Deeper with two types of per and 5 full_iters for good measure', data_dir='../data/tsdlr/', max_depth=12, random_order=False, k=1, debug=False, local_computation=False, n_rand=9, sd=4, ...
null
null
Secure this test against slightly different number formatters. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@116141 91177308-0d34-0410-b5e6-96231b3b80d8 Apply this change to `test/CodeGenCXX/const-init.cpp` and return the full updated file. ```cpp // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit...
```cpp // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s // CHECK: @a = global i32 10 int a = 10; // CHECK: @ar = constant i32* @a int &ar = a; void f(); // CHECK: @fr = constant void ()* @_Z1fv void (&fr)() = f; struct S { int& a; }; // CHECK: @s = global %0 { i32* @a } S s = ...
null
null
Tweak some of the list page formatting Apply this change to `alert-roster.web/Views/Home/Index.cshtml` and return the full updated file. ```csharp @model IEnumerable<alert_roster.web.Models.Message> @{ ViewBag.Title = "Messages"; } <div class="jumbotron"> <h1>@ViewBag.Title</h1> </div> @foreach (var messa...
```csharp @model IEnumerable<alert_roster.web.Models.Message> @{ ViewBag.Title = "Notices"; } <h2>@ViewBag.Title</h2> @foreach (var message in Model) { <div class="row"> <div class="col-md-5"> <fieldset> <legend> Posted <script>var d = moment.utc('@mes...
null
null
Add a test for importing a type Apply this change to `tests/spec/features/assistance_spec.rb` and return the full updated file. ```ruby require 'spec_helper' require 'support/editor' require 'support/playground_actions' RSpec.feature "Editor assistance for common code modifications", type: :feature, js: true do in...
```ruby require 'spec_helper' require 'support/editor' require 'support/playground_actions' RSpec.feature "Editor assistance for common code modifications", type: :feature, js: true do include PlaygroundActions before { visit '/' } scenario "building code without a main method offers adding one" do editor....
null
null
Use `Array.Empty` instead of constructed list Apply this change to `osu.Game/Database/EmptyRealmSet.cs` and return the full updated file. ```csharp // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using ...
```csharp // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using Realms; using...
null
null
Check for NullReference - CodeMashSettings. Apply this change to `src/CodeMash.Notifications/Email/EmailService.cs` and return the full updated file. ```csharp using System; using System.Collections.Generic; using CodeMash.Interfaces; namespace CodeMash.Notifications.Email { public class EmailService : IEmailSe...
```csharp using System; using System.Collections.Generic; using CodeMash.Interfaces; namespace CodeMash.Notifications.Email { public class EmailService : IEmailService { public ICodeMashSettings CodeMashSettings { get; set; } public bool SendMail(string[] recipients, string templateNa...
null
null
Fix issues with circular buffer Apply this change to `src/scoreboard/circular_buffer.h` and return the full updated file. ```c template<class T, size_t S> class CircularBuffer { public: CircularBuffer() : index(0), count(0) {} void push_item(T item) { array[index + 1] = item; index = (i...
```c template<class T, size_t S> class CircularBuffer { public: CircularBuffer() : index(0), count(0) {} void push_item(T item) { index = (index + 1) % S; array[index] = item; if (count < S) count++; } T pop_item() { int old_index = index; if (count > 0) {...
null
null
Add a TODO for the completion code logic Apply this change to `panic_handlers/small_panic/src/lib.rs` and return the full updated file. ```rust #![no_std] use libtock_low_level_debug::{AlertCode, LowLevelDebug}; use libtock_platform::{ErrorCode, Syscalls}; use libtock_runtime::TockSyscalls; #[panic_handler] fn pani...
```rust #![no_std] use libtock_low_level_debug::{AlertCode, LowLevelDebug}; use libtock_platform::{ErrorCode, Syscalls}; use libtock_runtime::TockSyscalls; #[panic_handler] fn panic_handler(_info: &core::panic::PanicInfo) -> ! { // Signal a panic using the LowLevelDebug capsule (if available). LowLevelDebug::...
null
null
Comment addition and interface change from Vector to AbstractList Apply this change to `passgoriLibrary/src/IPasswordStore.java` and return the full updated file. ```java import java.util.Vector; /** * */ /** * An interface for password store objects. * * @author Miltiadis Allamanis * */ public interface ...
```java import java.util.AbstractList; /** * */ /** * An interface for password store objects. * * @author Miltiadis Allamanis * */ public interface IPasswordStore { /** * Return a list of all the stored passwords. * * @return a vector containing the ids of stored passwords */ public AbstractList...
null
null
Add existing mocks to error messages Helps debugging updating mocks with new data. Apply this change to `lib/json_api_client_mock/mock_connection.rb` and return the full updated file. ```ruby require 'ostruct' module JsonApiClientMock class MockConnection class_attribute :mocks self.mocks = {} # igno...
```ruby require 'ostruct' module JsonApiClientMock class MockConnection class_attribute :mocks self.mocks = {} # ignored def initialize(*attrs); end def use(*attrs); end def delete(*attrs); end def execute(query) if results = find_test_results(query) OpenStruct.new(:body =...
null
null
Switch simple array diff to default until Efficient array diffing is implemented Apply this change to `Src/Options.cs` and return the full updated file. ```csharp namespace JsonDiffPatchDotNet { public sealed class Options { public Options() { ArrayDiff = ArrayDiffMode.Efficient; TextDiff = TextDi...
```csharp namespace JsonDiffPatchDotNet { public sealed class Options { public Options() { ArrayDiff = ArrayDiffMode.Simple; TextDiff = TextDiffMode.Efficient; MinEfficientTextDiffLength = 50; } public ArrayDiffMode ArrayDiff { get; set; } public TextDiffMode TextDiff { get; set; } ...
null
null
Send the image directly as a string. Apply this change to `cli/cmd/empire/deploy.go` and return the full updated file. ```go package main import ( "fmt" "strings" "github.com/remind101/empire/cli/pkg/plugin" ) var pluginDeploy = plugin.Plugin{ Name: "deploy", Action: runDeploy, } type Image struct { Repo ...
```go package main import ( "fmt" "github.com/remind101/empire/cli/pkg/plugin" ) var pluginDeploy = plugin.Plugin{ Name: "deploy", Action: runDeploy, } type PostDeployForm struct { Image string `json:"image"` } func runDeploy(c *plugin.Context) { if len(c.Args) < 1 { fmt.Println("Usage: emp deploy repo:i...
null
null
Call lib init/cleanup in C client test. Apply this change to `test/lib/c/01-con-discon-success.c` and return the full updated file. ```c #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <mosquitto.h> static int run = -1; void on_connect(struct mosquitto *mosq, void *obj, int rc) { if(rc){ exi...
```c #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <mosquitto.h> static int run = -1; void on_connect(struct mosquitto *mosq, void *obj, int rc) { if(rc){ exit(1); }else{ mosquitto_disconnect(mosq); } } void on_disconnect(struct mosquitto *mosq, void *obj, int rc) { run = rc; } int ma...
null
null
Add support for specifying the snitch type and the DC/RACK with environment variables. Apply this change to `cassandra/src/start.sh` and return the full updated file. ```bash #!/usr/bin/env bash IP=`hostname --ip-address` if [ $# == 1 ]; then SEEDS="$1,$IP"; else SEEDS="$IP"; fi echo Configuring Cassandra to liste...
```bash #!/usr/bin/env bash IP=`hostname --ip-address` if [ $# == 1 ]; then SEEDS="$1,$IP"; else SEEDS="$IP"; fi echo Configuring Cassandra to listen at $IP with seeds $SEEDS # Setup Cassandra DEFAULT=/etc/cassandra/default.conf CONFIG=/etc/cassandra/conf rm -rf $CONFIG && cp -r $DEFAULT $CONFIG sed -i -e "s/^list...
null
null
Add registration options for definition request Apply this change to `src/PowerShellEditorServices.Protocol/LanguageServer/Definition.cs` and return the full updated file. ```csharp // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full lic...
```csharp // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer { public ...
null
null
Fix clear screen on windows Apply this change to `term/term.go` and return the full updated file. ```go package term import ( "os" "os/exec" "runtime" ) func Clear() { var cmd *exec.Cmd switch os := runtime.GOOS; os { case "linux": cmd = exec.Command("clear") case "windows": cmd = exec.Command("cls") } ...
```go package term import ( "os" "os/exec" "runtime" ) func Clear() { var cmd *exec.Cmd switch os := runtime.GOOS; os { case "linux": cmd = exec.Command("clear") case "windows": cmd = exec.Command("cmd", "/C", "cls") } cmd.Stdout = os.Stdout cmd.Run() } ```
null
null
Add blank line at end of file Apply this change to `lib/Byng/Pimcore/Elasticsearch/Gateway/RawGatewayInterface.php` and return the full updated file. ```php <?php namespace Byng\Pimcore\Elasticsearch\Gateway; use Byng\Pimcore\Elasticsearch\Model\ResultsList; use Byng\Pimcore\Elasticsearch\Query\QueryBuilder; /** ...
```php <?php namespace Byng\Pimcore\Elasticsearch\Gateway; use Byng\Pimcore\Elasticsearch\Model\ResultsList; use Byng\Pimcore\Elasticsearch\Query\QueryBuilder; /** * Raw Gateway Interface * @author Max Baldanza <mbaldanza@inviqa.com> */ interface RawGatewayInterface { /** * @param string $index ...
null
null
Use Jasmine 2 in Protractor Apply this change to `e2e-tests/protractor.conf.js` and return the full updated file. ```javascript exports.config = { allScriptsTimeout: 11000, specs: [ '*.js' ], capabilities: { 'browserName': 'chrome' }, baseUrl: 'http://localhost:3000/', fram...
```javascript exports.config = { allScriptsTimeout: 11000, specs: [ '*.js' ], capabilities: { 'browserName': 'chrome' }, baseUrl: 'http://localhost:3000/', framework: 'jasmine2', jasmineNodeOpts: { defaultTimeoutInterval: 30000 } }; ```
null
null
Set default languate to english Apply this change to `manup-demo/src/app/app.component.ts` and return the full updated file. ```typescript import { Component } from '@angular/core'; import { Platform } from 'ionic-angular'; import { StatusBar, Splashscreen } from 'ionic-native'; import { TabsPage } from '../pages/ta...
```typescript import { Component } from '@angular/core'; import { Platform } from 'ionic-angular'; import { StatusBar, Splashscreen } from 'ionic-native'; import { TabsPage } from '../pages/tabs/tabs'; import { ManUpService } from 'ionic-manup'; import { TranslateService } from 'ng2-translate' @Component({ templat...
null
null
Add non-complete boss controller script Apply this change to `Assets/Scripts/Enemies/MouthOfEvilController.cs` and return the full updated file. ```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class MouthOfEvilController : MonoBehaviour { public List<EvilEyeScript> ...
```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; public class MouthOfEvilController : MonoBehaviour { public List<EvilEyeScript> evilEyes; public int mouthOfEvilHealth = 12; private int hitsLeftInPhase; public int maxHitsPerPhase = 4; public bool isInPhase = false; publi...
null
null
Disable for Windows as it doesn't work now. Apply this change to `plugins/terminal/src/org/jetbrains/plugins/terminal/OpenLocalTerminalAction.java` and return the full updated file. ```java package org.jetbrains.plugins.terminal; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSy...
```java package org.jetbrains.plugins.terminal; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.in...
null
null
Include email_alert_type value in details hash for email alert signup Including this will help email-alert-frontend construct the correct payload to send to the email-alert-api for subscriptions. Apply this change to `app/presenters/email_alert_signup_content_item_presenter.rb` and return the full updated file. ```r...
```ruby class EmailAlertSignupContentItemPresenter def initialize(policy, update_type="major") @policy = policy @update_type = update_type end def exportable_attributes { format: "email_alert_signup", content_id: policy.email_alert_signup_content_id, title: policy.name, descr...
null
null
Remove tall grass metadata when dropping seed Apply this change to `TrueCraft.Core/Logic/Blocks/TallGrassBlock.cs` and return the full updated file. ```csharp using System; using TrueCraft.API.Logic; using TrueCraft.Core.Logic.Items; using TrueCraft.API; namespace TrueCraft.Core.Logic.Blocks { public class TallG...
```csharp using System; using TrueCraft.API.Logic; using TrueCraft.Core.Logic.Items; using TrueCraft.API; namespace TrueCraft.Core.Logic.Blocks { public class TallGrassBlock : BlockProvider { public static readonly byte BlockID = 0x1F; public override byte ID { get { return 0x1F; } } ...
null
null
Update the schema instead of ignoring when the schema for the table already exists Apply this change to `src/Common/Doctrine/Entity/CreateSchema.php` and return the full updated file. ```php <?php namespace Common\Doctrine\Entity; use Doctrine\DBAL\Exception\TableExistsException; use Doctrine\ORM\EntityManager; use...
```php <?php namespace Common\Doctrine\Entity; use Doctrine\DBAL\Exception\TableExistsException; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Tools\SchemaTool; use Doctrine\ORM\Tools\ToolsException; class CreateSchema { /** @var EntityManager */ private $entityManager; /** * @param EntityManage...
null
null
Set command description using translation key Apply this change to `src/Command/ContainerDebugCommand.php` and return the full updated file. ```php <?php /** * @file * Contains \Drupal\AppConsole\Command\ContainerDebugCommand. */ namespace Drupal\AppConsole\Command; use Symfony\Component\Console\Input\InputInter...
```php <?php /** * @file * Contains \Drupal\AppConsole\Command\ContainerDebugCommand. */ namespace Drupal\AppConsole\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class ContainerDebugCommand extends ContainerAwareCommand { protected function ...
null
null
Use updated local declaration syntax. Apply this change to `src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs` and return the full updated file. ```rust // xfail-test FIXME #6257 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at...
```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 an error in application template causing the cluster to hang on exit Apply this change to `usr/template/start.js` and return the full updated file. ```javascript const cluster = require('cluster'), stopSignals = [ 'SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGBUS', 'SIGF...
```javascript const cluster = require('cluster'), stopSignals = [ 'SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM' ], production = process.env.NODE_ENV == 'production'; let stopping = false; cluster.on('disc...
null
null
Make bm_chars match its internal comment Apply this change to `ex/bm_chars.tas.cpp` and return the full updated file. ```cpp #include "common.th" #include "vga.th" _start: prologue b <- 0 // indicate non-completion to testbench call(init_display) restart: c <- 0 j <- @VGA_BASE ...
```cpp #include "common.th" #include "vga.th" _start: prologue b <- 0 // indicate non-completion to testbench call(init_display) restart: c <- 0 j <- @VGA_BASE k <- (ROWS * COLS) k <- k + j top: c -> [j] c <- c + 1 c <- c & 0xff j <- j + 1 n <- j < k ...
null
null
Change default string for testing purposes Change default string for testing purposes Apply this change to `server.js` and return the full updated file. ```javascript 'use strict'; const express = require('express'); const socketIO = require('socket.io'); const path = require('path'); const PORT = process.env.PORT...
```javascript 'use strict'; const express = require('express'); const socketIO = require('socket.io'); const path = require('path'); const PORT = process.env.PORT || 3000; const INDEX = path.join(__dirname, 'index.html'); var phoneSequence = "" var piSequence = "hi" var arduinoTurn = false const server = express()...
null
null
Reorganize macros related to memory layout Apply this change to `include/arch/x86/memlayout.h` and return the full updated file. ```c #ifndef MEMLAYOUT_H #define MEMLAYOUT_H #include <stdint.h> #define KERNEL_START ((uint32_t)&kernel_start) #define KERNEL_END ((uint32_t)&kernel_end) #define KERNEL_SIZE (KERNEL_STAR...
```c #ifndef MEMLAYOUT_H #define MEMLAYOUT_H #include <stdint.h> // These two variables are defined by the linker. They are located where you // would expect based on the names. extern uint32_t kernel_start; extern uint32_t kernel_end; #define KERNEL_END ((uint32_t)&kernel_end) #define KERNEL_START ((uint32_t)&kerne...
null
null
Remove @skip since test is now functioning correctly Apply this change to `src/test/tinc/tincrepo/resource_management/runaway_query/runaway_query_vmem_memoryaccounting/sql/query1.sql` and return the full updated file. ```sql -- @Description Test vmem shown in the live view matches the amount in memory accounting -- @...
```sql -- @Description Test vmem shown in the live view matches the amount in memory accounting -- @author Zhongxian Gu -- session1: issue the testing query 1: set explain_memory_verbosity = 'summary'; -- content/segment = 0; size = 100MB; sleep = 20 sec, critical section = false 1&: explain analyze select gp_allocate...
null
null
Update plugin com.diffplug.eclipse.apt to v3.37.1 Apply this change to `settings.gradle.kts` and return the full updated file. ```kotlin pluginManagement { repositories { gradlePluginPortal() } plugins { id("com.diffplug.eclipse.apt") version "3.37.0" id("com.diffplug.spotless") ve...
```kotlin pluginManagement { repositories { gradlePluginPortal() } plugins { id("com.diffplug.eclipse.apt") version "3.37.1" id("com.diffplug.spotless") version "6.7.2" id("io.github.gradle-nexus.publish-plugin") version "1.1.0" id("net.researchgate.release") version ...
null
null
Fix --bind flag changes under go1.6 Correcting 9f2463956884c0e995cf6f7140af0dc06af096e0 Apply this change to `fs/http_old.go` and return the full updated file. ```go // HTTP parts pre go1.7 //+build !go1.7 package fs import ( "net" "net/http" ) // dial with timeouts func (ci *ConfigInfo) dialTimeout(network, a...
```go // HTTP parts pre go1.7 //+build !go1.7 package fs import ( "net" "net/http" ) // dial with timeouts func (ci *ConfigInfo) dialTimeout(network, address string) (net.Conn, error) { dialer := ci.NewDialer() c, err := dialer.Dial(network, address) if err != nil { return c, err } return newTimeoutConn(c,...
null
null
Use offsetof() to compute the memory block header size. On compilers that don’t pad structs to alignment, this is equivalent to using the sizeof() method. On compilers that do pad structs to alignment, the sizeof() method will yield the wrong size, whereas this method will work. Apply this change to `pmpa_internals.h...
```c /* * pmpa_internals.h * Part of pmpa * Copyright (c) 2014 Philip Wernersbach * * Dual-Licensed under the Public Domain and the Unlicense. * Choose the one that you prefer. */ #ifndef HAVE_PMPA_INTERNALS_H #include <stddef.h> #include <stdbool.h> #include <pmpa.h> typedef struct { pmpa_memory_int size; ...
null
null
Fix not showing first axis value with multiplier generator Apply this change to `SwiftCharts/Axis/ChartAxisGeneratorMultiplier.swift` and return the full updated file. ```swift // // ChartAxisGeneratorMultiplier.swift // SwiftCharts // // Created by ischuetz on 27/06/16. // Copyright © 2016 ivanschuetz. All right...
```swift // // ChartAxisGeneratorMultiplier.swift // SwiftCharts // // Created by ischuetz on 27/06/16. // Copyright © 2016 ivanschuetz. All rights reserved. // import Foundation public class ChartAxisGeneratorMultiplier: ChartAxisValuesGenerator { let multiplier: Double public init(_ multiplier...
null
null
Fix name attribute in impuestos locales Apply this change to `src/CfdiUtils/Elements/ImpLocal10/ImpuestosLocales.php` and return the full updated file. ```php <?php namespace CfdiUtils\Elements\ImpLocal10; use CfdiUtils\Elements\Common\AbstractElement; class ImpuestosLocales extends AbstractElement { public fun...
```php <?php namespace CfdiUtils\Elements\ImpLocal10; use CfdiUtils\Elements\Common\AbstractElement; class ImpuestosLocales extends AbstractElement { public function addRetencionLocal(array $attributes = []): RetencionesLocales { $retencion = new RetencionesLocales($attributes); $this->addChil...
null
null
Handle another fade effect corner case when colour is black Apply this change to `fade_effect.cpp` and return the full updated file. ```cpp #include "fade_effect.h" unsigned int FadeEffect::maxDelay() { return -1; } void FadeEffect::init() { // Handle a corner case in which the update just increments //...
```cpp #include "fade_effect.h" unsigned int FadeEffect::maxDelay() { return -1; } void FadeEffect::init() { // Handle a corner case in which the update just increments // a color and overflows the byte if( R() == 255 ) R(254); if( G() == 255 ) G(254); if( B() == 255 ) R(254); if( R() == 0...
null
null
Tweak number of clusters per line Apply this change to `src/detail.rs` and return the full updated file. ```rust use std::error; use fat; pub fn detail_file(args: &[String]) -> Result<(), Box<error::Error>> { if args.len() < 2 { return Err(From::from("expected <file> <image> filename")); } ...
```rust use std::error; use fat; pub fn detail_file(args: &[String]) -> Result<(), Box<error::Error>> { if args.len() < 2 { return Err(From::from("expected <file> <image> filename")); } let image_fn = args[0].clone(); let image = fat::Image::from(image_fn)?; let file_metadata = image...
null
null
Change join criteria to elections when loading props Apply this change to `calaccess_processed/sql/load_proposition_model.sql` and return the full updated file. ```sql INSERT INTO calaccess_processed_proposition ( id, name, election_id ) SELECT scraped.scraped_id::INTEG...
```sql INSERT INTO calaccess_processed_proposition ( id, name, election_id ) SELECT scraped.scraped_id::INTEGER AS id, scraped.name AS name, election.id AS election_id FROM calaccess_processed_scrapedproposition AS scraped JOIN ( SELECT id, ...
null
null
Update to make non-x system work Apply this change to `run_commands.sh` and return the full updated file. ```bash #!/bin/bash if ! xset q &>/dev/null; then for i in "${!Commands[@]}"; do Percentage=$((i * 100 / NumCommands)) echo $Percentage echo "# ${Notes[$i]}" ${Commands[$i]} done else DIR=$( cd "$(...
```bash #!/bin/bash if ! xset q &>/dev/null; then NumCommands=${#Commands[@]} for i in "${!Commands[@]}"; do Percentage=$((i * 100 / NumCommands)) echo $Percentage echo "# ${Notes[$i]}" ${Commands[$i]} done else DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) source $DIR/run_x_commands.sh fi ```
null
null
Change path to install file systems - should not be created inside non-existant folder. Apply this change to `make/make_files.go` and return the full updated file. ```go package make import ( "fmt" log "github.com/Sirupsen/logrus" "os" "strings" "time" ) // InstallFileSystem installs a basic private file syste...
```go package make import ( "fmt" log "github.com/Sirupsen/logrus" "os" "strings" "time" ) // InstallFileSystem installs a basic private file system for any given input. func (Site *Site) InstallFileSystem(DirectoryPath string) { // Test the file system, create it if it doesn't exist! dirPath := fmt.Sprintf(st...
null
null
disasm: Replace PrintDegbugInfo with function SetDebugMode. SetDebugMode allows logging functionality to be enabled or disabled at will. Apply this change to `disasm/log.go` and return the full updated file. ```go // Copyright 2017 The go-interpreter Authors. All rights reserved. // Use of this source code is gover...
```go // Copyright 2017 The go-interpreter Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package disasm import ( "io/ioutil" "log" "os" ) var logger *log.Logger func SetDebugMode(l bool) { w := ioutil.Discard if l { w =...
null
null
Remove "Exception" from the error text Apply this change to `gstrap/src/main/java/com/voodoodyne/gstrap/rest/ErrorBody.java` and return the full updated file. ```java package com.voodoodyne.gstrap.rest; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.voodoodyne.gstrap.lang.Types; import lombok.Requ...
```java package com.voodoodyne.gstrap.rest; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.voodoodyne.gstrap.lang.Types; import lombok.RequiredArgsConstructor; import java.util.List; import java.util.stream.Collectors; /** * JSON structure of an error body from the ThrowableMapper */ @RequiredAr...
null
null
Remove broken prototype, starting out clean Apply this change to `src/main.c` and return the full updated file. ```c #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netdb.h> #include <netinet/in.h> #include <sy...
```c #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <sys/socket.h> #include <netinet/in.h> __attribute__((noreturn)) void failed(const char* s) { perror(s); exit(1); } int main() { int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (s == -1) { failed("socket()"); } } ```
null
null
Fix git prompt, applied always Apply this change to `ansible/docker/etc/ansible/roles/git/files/git-prompt.sh` and return the full updated file. ```bash if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " (%s)")\$ ' ...
```bash PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " (%s)")\$ ' ```
null
null
Upgrade from v4 to v5 Apply this change to `lib/main.js` and return the full updated file. ```javascript /** * @author Hamza Waqas <hamzawaqas@live.com> * @since 1/14/14 */ (function() { var _ = require('lodash'); var Main = function(apiKey) { var _services = ['name', 'search', 'thumbnail'] ...
```javascript /** * @author Hamza Waqas <hamzawaqas@live.com> * @since 1/14/14 */ (function() { var _ = require('lodash'); var Main = function(apiKey) { var _services = ['name', 'search', 'thumbnail'] , Inherits = require('./inherits') , self = this; // Make som...
null
null
Use isset instead of empty Apply this change to `classes/mustacheview.php` and return the full updated file. ```php <?php defined('SYSPATH') or die('No direct script access.'); class MustacheView { protected $values; public $name; public function __construct($name) { $this->name = $name; } public functio...
```php <?php defined('SYSPATH') or die('No direct script access.'); class MustacheView { protected $values; public $name; public function __construct($name) { $this->name = $name; } public function __get($key) { if (!isset($this->values[$key])) return false; return $this->values[$key]; } public fu...
null
null
Add logging if web server errors Apply this change to `main.go` and return the full updated file. ```go /* Copyright 2018 Padduck, 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 http://w...
```go /* Copyright 2018 Padduck, 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softw...
null
null
Update aws ip range splitting Apply this change to `images/public-log-asn-matcher/pg-init.d/lib-11-load-single-ip-int.sql` and return the full updated file. ```sql -- Purpose: Combine vendor data -- Copy the customer ip in copy cust_ip from '/tmp/usage_all_ip_only.csv'; -- Copy pyasn expanded in copy vendor_expanded...
```sql -- Purpose: Combine vendor data -- Copy the customer ip in copy cust_ip from '/tmp/usage_all_ip_only.csv'; -- Copy pyasn expanded in copy vendor_expanded_int from '/tmp/expanded_pyasn.csv' (DELIMITER(',')); -- Indexes on the Data we are about to range create index on vendor_expanded_int (end_ip_int); create ind...
null
null
Add test to look for class binding when Aviary Editor has launched Apply this change to `tests/acceptance/aviary-editor-test.js` and return the full updated file. ```javascript import Ember from 'ember'; import startApp from '../helpers/start-app'; var App; module('Acceptance: Aviary Editor', { setup: function() ...
```javascript import Ember from 'ember'; import startApp from '../helpers/start-app'; var App; module('Acceptance: Aviary Editor', { setup: function() { App = startApp(); }, teardown: function() { Ember.run(App, 'destroy'); } }); test('renders component', function() { expect(2); visit('/'); an...
null
null
Remove requirement for a .csv suffix. Print warning if working with file that have suffix other than .csv Apply this change to `sources/filechecker.h` and return the full updated file. ```c #ifndef QTCSVFILECHECKER_H #define QTCSVFILECHECKER_H #include <QString> #include <QFileInfo> namespace QtCSV { // Check i...
```c #ifndef QTCSVFILECHECKER_H #define QTCSVFILECHECKER_H #include <QString> #include <QFileInfo> #include <QDebug> namespace QtCSV { // Check if path to csv file is valid // @input: // - filePath - string with absolute path to csv-file // @output: // - bool - True if file is OK, else False i...
null
null
Add Doc Comments For DiskManagerBuilder Apply this change to `bip_disk/src/disk/builder.rs` and return the full updated file. ```rust use disk::fs::FileSystem; use disk::manager::{self, DiskManager}; use futures_cpupool::Builder; const DEFAULT_PENDING_SIZE: usize = 10; const DEFAULT_COMPLETED_SIZE: usize = 10; /...
```rust use disk::fs::FileSystem; use disk::manager::{self, DiskManager}; use futures_cpupool::Builder; const DEFAULT_PENDING_SIZE: usize = 10; const DEFAULT_COMPLETED_SIZE: usize = 10; /// `DiskManagerBuilder` for building `DiskManager`s with different settings. pub struct DiskManagerBuilder { builder: ...
null
null
Add files table in database template Apply this change to `schema.sql` and return the full updated file. ```sql drop table if exists users; create table users ( userid text primary key not null, username text not null, email text not null, passwordhash not null ); drop table if exists submissions; cre...
```sql drop table if exists users; create table users ( userid text primary key not null, username text not null, email text not null, passwordhash not null ); drop table if exists submissions; create table submissions ( submissionid text primary key not null, userid text not null, submissio...
null
null
Add functions for Client SSL Profile Apply this change to `profile.go` and return the full updated file. ```go package tmsh // ClientSSLProffile contains information about Client SSL profile type ClientSSLProfile struct { Name string `ltm:"name"` Component string `ltm:"component"` Cert string...
```go package tmsh import ( "fmt" "strings" ) // ClientSSLProffile contains information about Client SSL profile type ClientSSLProfile struct { Name string `ltm:"name"` Component string `ltm:"component"` Cert string `ltm:"cert"` CertKeyChain map[string]map[strin...
null
null
Remove semicolon and unnecessary qualifier Apply this change to `bubbleactions-sample/src/main/java/me/samthompson/bubbleactions_sample/KotlinActivity.kt` and return the full updated file. ```kotlin package me.samthompson.bubbleactions_sample import android.os.Bundle import android.support.v7.app.AppCompatActivity i...
```kotlin package me.samthompson.bubbleactions_sample import android.os.Bundle import android.support.v7.app.AppCompatActivity import android.widget.Toast import me.samthompson.bubbleactions.BubbleActions /** * Created by sam on 11/28/15. */ class KotlinActivity : AppCompatActivity() { override fun onCreate(sa...
null
null
Use identity hash code on K/N for debug strings Fixes #1237 Apply this change to `kotlinx-coroutines-core/native/src/Debug.kt` and return the full updated file. ```kotlin /* * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ package kotlinx.coroutines private...
```kotlin /* * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ package kotlinx.coroutines import kotlin.math.* internal actual val Any.hexAddress: String get() = abs(id().let { if (it == Int.MIN_VALUE) 0 else it }).toString(16) internal actual val Any.classSi...
null
null
Change package name for install of datastax and cassandara Apply this change to `recipes/default.rb` and return the full updated file. ```ruby include_recipe 'java' yum_repository "datastax" do description "DataStax Repo for Apache Cassandra" url "http://rpm.datastax.com/community" gpgcheck false metadata_ex...
```ruby include_recipe 'java' yum_repository "datastax" do description "DataStax Repo for Apache Cassandra" url "http://rpm.datastax.com/community" gpgcheck false metadata_expire "1" sslverify false action :create end package 'dsc20' package 'cassandra20' include_recipe 'midokura::zookeeper' include_reci...
null
null
Add missing keyword argument following changes for rdar://problem/18778670 Swift SVN r23095 Apply this change to `stdlib/objc/AssetsLibrary/AssetsLibrary.swift` and return the full updated file. ```swift //===----------------------------------------------------------------------===// // // This source file is part o...
```swift //===----------------------------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swi...
null
null
Add return in index to prevent 2 write responses Apply this change to `index/handler.go` and return the full updated file. ```go package index import ( "database/sql" "html/template" "log" "net/http" "github.com/concourse/atc" "github.com/concourse/atc/db" "github.com/pivotal-golang/lager" ) type TemplateDa...
```go package index import ( "database/sql" "html/template" "log" "net/http" "github.com/concourse/atc" "github.com/concourse/atc/db" "github.com/pivotal-golang/lager" ) type TemplateData struct{} func NewHandler( logger lager.Logger, pipelineDBFactory db.PipelineDBFactory, pipelineHandler func(db.Pipelin...
null
null
Add event to notify plugins about finish application initialization Apply this change to `oxService/src/main/java/org/xdi/service/cdi/event/ApplicationInitialized.java` and return the full updated file. ```java package org.xdi.service.cdi.event; import javax.enterprise.util.AnnotationLiteral; import javax.inject.Qua...
```java package org.xdi.service.cdi.event; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.context.Initialized.Literal; import javax.enterprise.util.AnnotationLiteral; import javax.inject.Qualifier; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.la...
null
null