text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Test is still disabled, but access through public module
from test.test_support import vereq, TestFailed import symtable symbols = symtable.symtable("def f(x): return x", "?", "exec") ## XXX ## Test disabled because symtable module needs to be rewritten for new compiler ##vereq(symbols[0].name, "global") ##vereq(len([ste for ste in symbols.values() if ste.name == "f"]), ...
from test.test_support import vereq, TestFailed import _symtable symbols = _symtable.symtable("def f(x): return x", "?", "exec") ## XXX ## Test disabled because symtable module needs to be rewritten for new compiler ##vereq(symbols[0].name, "global") ##vereq(len([ste for ste in symbols.values() if ste.name == "f"])...
Complete the information for the help-plugin
<?php require_once __DIR__ . '/vendor/autoload.php'; use jlawrence\eos\Parser; use jlawrence\eos\Graph; class math extends Script { protected $helpMessage = "'graph EXPRESSION': Returns a plotted graph of the expression\n" ."'math EXPRESSION': Returns the solvement of the given expression\n"; protected $desc...
<?php require_once __DIR__ . '/vendor/autoload.php'; use jlawrence\eos\Parser; use jlawrence\eos\Graph; class math extends Script { public function run() { if(strtolower(split(' ', $this->matches[0])[0]) === 'math') { return $this->send(Parser::solve($this->matches[1])); } else { $filepath = __DIR__ . '/o...
Make surveyId a number input type field (HTML5)
<!-- resources/views/surveys/surveys_addReport.blade.php --> @extends('layouts.app') @section('content') <h2>Add survey report</h2> <form class="form-inline" action="/surveys/storeReport" method="post" enctype="multipart/form-data"> <div class="form-group"> {{ csrf_field() }} {{ method_field('PUT...
<!-- resources/views/surveys/surveys_addReport.blade.php --> @extends('layouts.app') @section('content') <h2>Add survey report</h2> <form class="form-inline" action="/surveys/storeReport" method="post" enctype="multipart/form-data"> <div class="form-group"> {{ csrf_field() }} {{ method_field('PUT...
Remove css import, add global styles
import React from "react"; import { render } from "react-dom"; import { applyRouterMiddleware, Router, Route, browserHistory, IndexRoute } from "react-router"; import { useScroll } from 'react-router-scroll'; import App from "./components/App.react"; import TagList from "./components/TagList.react"; import NotFound f...
import React from "react"; import { render } from "react-dom"; import { applyRouterMiddleware, Router, Route, browserHistory, IndexRoute } from "react-router"; import { useScroll } from 'react-router-scroll'; import App from "./components/App.react"; import TagList from "./components/TagList.react"; import NotFound f...
Fix Django dependency: update Django version from 1.4 to 1.8
from distutils.core import setup import sslserver setup(name="django-sslserver", version=sslserver.__version__, author="Ted Dziuba", author_email="tjdziuba@gmail.com", description="An SSL-enabled development server for Django", url="https://github.com/teddziuba/django-sslserver", pa...
from distutils.core import setup import sslserver setup(name="django-sslserver", version=sslserver.__version__, author="Ted Dziuba", author_email="tjdziuba@gmail.com", description="An SSL-enabled development server for Django", url="https://github.com/teddziuba/django-sslserver", pa...
feat(client): Use localForage instead of localStorage
const localForage = require('localforage') class persist { static get SESSION_TOKEN_KEY() { return 'sessionToken' } static get ACCESS_TOKEN_KEY() { return 'accessToken' } static async willGetSessionToken() { return localForage.getItem(persist.SESSION_TOKEN_KEY).catch(err => err) } static async willSetS...
class persist { static get SESSION_TOKEN_KEY () { return 'sessionToken' } static willGetSessionToken() { return new Promise(resolve => { try { resolve(localStorage && localStorage.getItem(persist.SESSION_TOKEN_KEY)) } catch (err) { resolve(null) } }) } static willSetSe...
Fix retrieval of model under viewsets without a statically defined queryset
from rest_framework.exceptions import APIException from rest_framework.serializers import ModelSerializer WRITE_OPERATIONS = ['create', 'update', 'partial_update', 'delete'] class ServiceUnavailable(APIException): status_code = 503 default_detail = "Service temporarily unavailable, please try again later." ...
from rest_framework.exceptions import APIException from rest_framework.serializers import ModelSerializer WRITE_OPERATIONS = ['create', 'update', 'partial_update', 'delete'] class ServiceUnavailable(APIException): status_code = 503 default_detail = "Service temporarily unavailable, please try again later." ...
Trim surrounding whitespace before validating HTML with slowparse Slowparse incorrectly reports an error if the `DOCTYPE` is preceded by a line of whitespace.
var Promise = require('es6-promise').Promise; var groupBy = require('lodash/groupBy'); var values = require('lodash/values'); var flatten = require('lodash/flatten'); var flatMap = require('lodash/flatMap'); var sortBy = require('lodash/sortBy'); var omit = require('lodash/omit'); var trim = require('lodash/trim'); var...
var Promise = require('es6-promise').Promise; var groupBy = require('lodash/groupBy'); var values = require('lodash/values'); var flatten = require('lodash/flatten'); var flatMap = require('lodash/flatMap'); var sortBy = require('lodash/sortBy'); var omit = require('lodash/omit'); var validateWithHtmllint = require('./...
Fix networkx 1.11 compatibility issue
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import json from os import path from indra.util.kappa_util import im_json_to_graph def test_kappy_influence_json_to_graph(): with open(path.join(path.dirname(path.abspath(__file__)), 'ka...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import json from os import path from indra.util.kappa_util import im_json_to_graph def test_kappy_influence_json_to_graph(): with open(path.join(path.dirname(path.abspath(__file__)), 'ka...
Add some blank lines for readability
<?php namespace Opdavies\Sculpin\Bundle\ContentGeneratorBundle\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; trait CreateTrait { private function createFile( InputInterface $input, Output...
<?php namespace Opdavies\Sculpin\Bundle\ContentGeneratorBundle\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; trait CreateTrait { private function createFile( InputInterface $input, Output...
Disable form submitting when personal request selected For keyboard using people (like me) this avoids a confusing situation where you hit enter for some reason on the form and it submits.
$(document).ready(function() { $switcherFieldGroup = $("#request_personal_switch"); $formSubmitButton = $("#request_form input[type='submit']")[0]; if ($switcherFieldGroup.length) { // If an error is showing they must have selected 'no' // so set this and don't hide the form. if ($(".errorExplanation...
$(document).ready(function() { $switcherFieldGroup = $("#request_personal_switch"); if ($switcherFieldGroup.length) { // If an error is showing they must have selected 'no' // so set this and don't hide the form. if ($(".errorExplanation").length) { $("#request_personal_switch_no").prop("checked"...
Fix the logic of the check for the phrase preload rebuild
<?php namespace wcf\system\language\preload; use wcf\data\language\Language; use wcf\system\language\preload\command\CachePreloadPhrases; use wcf\system\WCF; /** * Provides the URL to the preload cache for * phrases and creates it if it is missing. * * @author Alexander Ebert * @copyright 2001-2022 WoltLab GmbH...
<?php namespace wcf\system\language\preload; use wcf\data\language\Language; use wcf\system\language\preload\command\CachePreloadPhrases; use wcf\system\WCF; /** * Provides the URL to the preload cache for * phrases and creates it if it is missing. * * @author Alexander Ebert * @copyright 2001-2022 WoltLab GmbH...
Revert "Add tideways config to getcomposer.org" This reverts commit 134f749534d8ecabd8c42e1e2cf10df9a7057edf.
<?php use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; if (!isset($env) || $env !== 'dev') { // force ssl $app->before(function (Request $request) { // skip SSL & non-GET/HEAD requests if (strtol...
<?php use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; if (class_exists('Tideways\Profiler')) { \Tideways\Profiler::start(array('api_key' => trim(file_get_contents(__DIR__.'/tideways.key')))); } if (!isset($env) ||...
Make db upgrade step 20 more robust. git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@5815 af82e41b-90c4-0310-8c96-b1721e28e2e2
from trac.db import Table, Column, Index, DatabaseManager from trac.core import TracError from trac.versioncontrol.cache import CACHE_YOUNGEST_REV def do_upgrade(env, ver, cursor): """Modify the repository cache scheme (if needed) Now we use the 'youngest_rev' entry in the system table to explicitly store...
from trac.db import Table, Column, Index, DatabaseManager from trac.core import TracError from trac.versioncontrol.cache import CACHE_YOUNGEST_REV def do_upgrade(env, ver, cursor): """Modify the repository cache scheme (if needed) Now we use the 'youngest_rev' entry in the system table to explicit...
Fix typo in man pages
#!/usr/bin/python # Format the output from various oiio command line "$tool --help" invocations, # and munge such that txt2man generates a simple man page with not-too-horrible # formatting. from __future__ import print_function from __future__ import absolute_import import sys lines = [l.rstrip().replace('\t', ' '*...
#!/usr/bin/python # Format the output from various oiio command line "$tool --help" invocations, # and munge such that txt2man generates a simple man page with not-too-horrible # formatting. from __future__ import print_function from __future__ import absolute_import import sys lines = [l.rstrip().replace('\t', ' '*...
Update API error handling for empty responses
import apiClient from 'panoptes-client/lib/api-client'; import counterpart from 'counterpart'; counterpart.setFallbackLocale('en'); const translations = { strings: { project: {}, workflow: {} }, load: (translated_type, translated_id, language) => { counterpart.setLocale(language); return apiCli...
import apiClient from 'panoptes-client/lib/api-client'; import counterpart from 'counterpart'; counterpart.setFallbackLocale('en'); const translations = { strings: { project: {}, workflow: {} }, load: (translated_type, translated_id, language) => { translations.strings[translated_type] = {}; re...
Make DotDict repr() use class name so that it doesn't print misleading results if subclassed
class DotDict(dict): __getattr__ = dict.__getitem__ __setattr__ = dict.__setitem__ __delattr__ = dict.__delitem__ def __init__(self, d={}): for key, value in d.items(): if hasattr(value, 'keys'): value = DotDict(value) if isinstance(value, list): ...
class DotDict(dict): __getattr__ = dict.__getitem__ __setattr__ = dict.__setitem__ __delattr__ = dict.__delitem__ def __init__(self, d={}): for key, value in d.items(): if hasattr(value, 'keys'): value = DotDict(value) if isinstance(value, list): ...
Use '==' because '===' causes undesired behavior
window.onload=function(){ var theNumber = _.random(1, 100); var theList = $("#list"); var theBanner = $("#triumph"); $("#submit").click(function() { var theGuess = $("#guess").val(); $("#guess").val(""); if (theGuess == theNumber) { $("#submit").prop('disabled', true); $("#guess").prop('disabled', true)...
window.onload=function(){ var theNumber = _.random(1, 100); var theList = $("#list"); var theBanner = $("#triumph"); $("#submit").click(function() { var theGuess = $("#guess").val(); $("#guess").val(""); if (theGuess === theNumber) { $("#submit").prop('disabled', true); $("#guess").prop('disabled', true...
Update host to use Pi’s static address
#!/usr/bin/env python3 import socket import atexit import pygame from message import Message PRECISION = 3 host = "192.168.0.1" port = 9999 # create a socket object and connect to specified host/port s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) def close_socket(): s.close() ...
#!/usr/bin/env python3 import socket import atexit import pygame from message import Message PRECISION = 3 host = "localhost" port = 9999 # create a socket object and connect to specified host/port s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) def close_socket(): s.close() d...
Add the apiKeyService to the frontend.
/** * Copyright 2016 Google Inc. 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 applic...
/** * Copyright 2016 Google Inc. 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 applic...
Add support for browsersync configuration in external rc file
'use strict'; var historyFallback = require('connect-history-api-fallback'); var log = require('connect-logger'); var yargs = require('yargs'); var sync = require('browser-sync').create(); var path = require('path'); // Load optional browser-sync config file var bsConfigPath = path.resolve('bs-config'); var options =...
var historyFallback = require('connect-history-api-fallback'); var log = require('connect-logger'); var yargs = require('yargs'); var sync = require('browser-sync').create(); var defaultOpenPath = ''; yargs.option('files', { describe: 'array of file paths to watch', type: 'array' }); var argv = yargs.argv; var op...
Revert "Declare scipy as dep" This reverts commit 1e8bc12e0a6ea2ffefe580b63133b88f4db045a7.
""" CartoDB Spatial Analysis Python Library See: https://github.com/CartoDB/crankshaft """ from setuptools import setup, find_packages setup( name='crankshaft', version='0.0.0', description='CartoDB Spatial Analysis Python Library', url='https://github.com/CartoDB/crankshaft', author='Data Se...
""" CartoDB Spatial Analysis Python Library See: https://github.com/CartoDB/crankshaft """ from setuptools import setup, find_packages setup( name='crankshaft', version='0.0.0', description='CartoDB Spatial Analysis Python Library', url='https://github.com/CartoDB/crankshaft', author='Data Se...
:hammer: Update the request builder interface.
<?php namespace Risan\OAuth1\Request; interface RequestBuilderInterface { /** * Get the ConfigInterface instance. * * @return \Risan\OAuth1\ConfigInterface */ public function getConfig(); /** * Get the SignerInterface instance. * * @return \Risan\OAuth1\Signature\Signer...
<?php namespace Risan\OAuth1\Request; interface RequestBuilderInterface { /** * Get the ConfigInterface instance. * * @return \Risan\OAuth1\ConfigInterface */ public function getConfig(); /** * Get the SignerInterface instance. * * @return \Risan\OAuth1\Signature\Signer...
Add convenience methods for calling prot/priv methods.
<?php /* * This file is part of Sesshin library. * * (c) Przemek Sobstel <http://sobstel.org> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace Sesshin\Tests; class TestCase extends \PHPUnit_Framework_TestCase { public function setPr...
<?php /* * This file is part of Sesshin library. * * (c) Przemek Sobstel <http://sobstel.org> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace Sesshin\Tests; class TestCase extends \PHPUnit_Framework_TestCase { public function setPr...
Change discarded badge class to danger
(function () { 'use strict'; angular.module('documents') .component('scientillaDocumentLabel', { templateUrl: 'partials/scientilla-document-label.html', controller: scientillaDocumentLabel, controllerAs: 'vm', bindings: { ...
(function () { 'use strict'; angular.module('documents') .component('scientillaDocumentLabel', { templateUrl: 'partials/scientilla-document-label.html', controller: scientillaDocumentLabel, controllerAs: 'vm', bindings: { ...
Add lesson, and link to section.
Template.addLesson.events({ 'click .add-lesson-button': function (event, template) { // Get lesson name var lessonName = template.find("#lesson-name").value; // Get section ID from current data context var sectionID = String(this); // Create temporary lesson object ...
Template.addLesson.events({ 'click .add-lesson-button': function (event, template) { // Get lesson name var lessonName = template.find("#lesson-name").value; // Get course ID from parent template var courseID = Template.parentData()._id; // Create temporary lesson object ...
Fix warnings in build task
var classes = require("./classes"); var gRex = require("./grex"); var grex = function(options, callback){ try { if(typeof options === 'function'){ callback = options; options = undefined; } var db = new gRex(options); connect = db.connect().then().nodeify(cal...
var classes = require("./classes"); var gRex = require("./grex"); var grex = function(options, callback){ try { if(typeof options === 'function'){ callback = options; options = undefined; } var db = new gRex(options); connect = db.connect().then().nodeify(cal...
Update fn call for unset to work.
/** * WidgetNull component. * * Site Kit by Google, Copyright 2021 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 * ...
/** * WidgetNull component. * * Site Kit by Google, Copyright 2021 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 * ...
Revert "PS-147 adapted image resource to new interface" This reverts commit 29a8ca7c1e496eb4fc473c3fb5d2123d5c211be5.
/* * Copyright (c) 2014-2015 University of Ulm * * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. 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...
/* * Copyright (c) 2014-2015 University of Ulm * * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. 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...
Fix tests on python 3.3
import os import sys from nose.tools import * try: from importlib import reload except ImportError: try: from imp import reload except ImportError: pass def setup_yamlmod(): import yamlmod reload(yamlmod) def teardown_yamlmod(): import yamlmod for hook in sys.meta_path: if isinstance(hook, yamlmod.Yam...
import os import sys from nose.tools import * try: from importlib import reload except ImportError: pass def setup_yamlmod(): import yamlmod reload(yamlmod) def teardown_yamlmod(): import yamlmod for hook in sys.meta_path: if isinstance(hook, yamlmod.YamlImportHook): sys.meta_path.remove(hook) break ...
Add video bucket to artist model
import DS from 'ember-data'; const { attr, Model } = DS; export default Model.extend({ artistLocation: attr(), biographies: attr(), // echonest-biography blogs: attr(), // echonest-blog discovery: attr('number'), discoveryRank: attr('number'), doc_counts: attr(), familiarity: attr('number'...
import DS from 'ember-data'; const { attr, Model } = DS; export default Model.extend({ artistLocation: attr(), biographies: attr(), // echonest-biography blogs: attr(), // echonest-blog discovery: attr('number'), discoveryRank: attr('number'), doc_counts: attr(), familiarity: attr('number'...
Use the public IP for lb_fqdn in NFS test The helm installation fails because the lb_fqdn is pointing to the machine's hostname, which ends up in the kubeconfig that is used by helm to initialize tiller. Given that this hostname is not resolvable from the testing machine, the test fails.
package integration import . "github.com/onsi/ginkgo" func testNFSShare(aws infrastructureProvisioner, distro linuxDistro) { nfsServers, err := aws.CreateNFSServers() FailIfError(err, "Couldn't set up NFS shares") WithMiniInfrastructure(distro, aws, func(node NodeDeets, sshKey string) { By("Setting up a plan fi...
package integration import . "github.com/onsi/ginkgo" func testNFSShare(aws infrastructureProvisioner, distro linuxDistro) { nfsServers, err := aws.CreateNFSServers() FailIfError(err, "Couldn't set up NFS shares") WithMiniInfrastructure(distro, aws, func(node NodeDeets, sshKey string) { By("Setting up a plan fi...
Switch out to use the new GenericKeyInline
from django.conf import settings from django.contrib import admin from django.contrib.contenttypes import generic from reversion.admin import VersionAdmin from armstrong.hatband.options import GenericKeyInline from . import models class NodeAdmin(VersionAdmin): pass class NodeInline(GenericKeyInline): mod...
from django.conf import settings from django.contrib import admin from django.contrib.contenttypes import generic from reversion.admin import VersionAdmin from . import models class NodeAdmin(VersionAdmin): pass class NodeInline(admin.TabularInline): model = models.Node extra = 1 # This is for Gra...
GEODE-209: Change subTearDown to destroy process
package com.gemstone.gemfire.test.golden; import static org.junit.Assert.*; import org.junit.Test; import org.junit.experimental.categories.Category; import com.gemstone.gemfire.test.process.ProcessWrapper; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; @Category(IntegrationTest.class) public cl...
package com.gemstone.gemfire.test.golden; import static org.junit.Assert.*; import org.junit.Test; import org.junit.experimental.categories.Category; import com.gemstone.gemfire.test.process.ProcessWrapper; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; @Category(IntegrationTest.class) public cl...
Use path.relative to create the bundles glob
var NwBuilder = require("node-webkit-builder"); var asap = require("pdenodeify"); var path = require("path"); var rimraf = require("rimraf"); module.exports = function(options, buildResult){ var nwOptions = {}; // Convert the options to camelcase Object.keys(options).forEach(function(optName){ nwOptions[toCamelc...
var NwBuilder = require("node-webkit-builder"); var asap = require("pdenodeify"); var path = require("path"); var rimraf = require("rimraf"); module.exports = function(options, buildResult){ var nwOptions = {}; // Convert the options to camelcase Object.keys(options).forEach(function(optName){ nwOptions[toCamelc...
Update the version to 1.7.1
__version_info__ = { 'major': 1, 'minor': 7, 'micro': 1, 'releaselevel': 'final', 'serial': 1 } def get_version(short=False): assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final') vers = ["%(major)i.%(minor)i" % __version_info__, ] if __version_info__['micro'] and not s...
__version_info__ = { 'major': 1, 'minor': 7, 'micro': 0, 'releaselevel': 'final', 'serial': 1 } def get_version(short=False): assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final') vers = ["%(major)i.%(minor)i" % __version_info__, ] if __version_info__['micro'] and not s...
Fix not required let statment
const Report = require('./Report'); const Notification = require('./Notification'); async function Reporter( request, reply ) { // Params https://sites.google.com/a/webpagetest.org/docs/advanced-features/webpagetest-restful-apis const base = process.env.BASE || 'http://localhost:8080'; const result = await new R...
const Report = require('./Report'); const Notification = require('./Notification'); async function Reporter( request, reply ) { // Params https://sites.google.com/a/webpagetest.org/docs/advanced-features/webpagetest-restful-apis const base = process.env.BASE || 'http://localhost:8080'; const result = await new R...
Make script injection more abstract
function createScript(property, source) { let scriptElement = document.createElement('script'); scriptElement['property'] = source; return scriptElement; } function injectScript(script) { (document.head || document.documentElement).appendChild(script); } chrome .runtime .sendMessage({ msg: 'getStatus' }, ...
chrome .runtime .sendMessage({ msg: 'getStatus' }, function (response) { if (response.status) { let storage = chrome.storage.local; storage.get(['type', 'freq', 'q', 'gain'], function (items) { type = items.type || 'highshelf'; freq = items.freq || '17999'; q = items.q || '0...
Fix indentation on comments block
<?php /** * The template for displaying all pages. * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages * and that other 'pages' on your WordPress site will use a * different template. * * @package _s * @since _s 1.0 */ get_header(); ?> <...
<?php /** * The template for displaying all pages. * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages * and that other 'pages' on your WordPress site will use a * different template. * * @package _s * @since _s 1.0 */ get_header(); ?> <...
Add default value to variant enabled column migration
<?php declare(strict_types=1); namespace Sylius\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; /** * Auto-generated Migration: Please modify to your needs! */ final class Version20200309172908 extends AbstractMigration { public function getDescription() : string { ...
<?php declare(strict_types=1); namespace Sylius\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; /** * Auto-generated Migration: Please modify to your needs! */ final class Version20200309172908 extends AbstractMigration { public function getDescription() : string { ...
Add an array into Board.initial to store the initial state of the boar when the game is started
// Model var Board = { // initialize generates the pieces to display on the board to start the game initial: function initial(){ var board = []; // this will save the initial state of the board // Creates all the 32 squares where pieces can be placed for (i = 0; i <= 31; i++){ if (i <= 11){ // Cre...
// Model var Board = { // initialize generates the pieces to display on the board to start the game initial: function initial(){ // Creates all the 32 squares where pieces can be placed for (i = 0; i <= 31; i++){ if (i <= 11){ // Creates all 12 green pieces $(".board").append($.parseHTML('<a h...
Remove extra unneeded empty line.
from __future__ import unicode_literals, division, absolute_import import logging import urllib from flexget import plugin from flexget.event import event log = logging.getLogger('cinemageddon') class UrlRewriteCinemageddon(object): """Cinemageddon urlrewriter.""" def url_rewritable(self, task, entry): ...
from __future__ import unicode_literals, division, absolute_import import logging import urllib from flexget import plugin from flexget.event import event log = logging.getLogger('cinemageddon') class UrlRewriteCinemageddon(object): """Cinemageddon urlrewriter.""" def url_rewritable(self, task, entry): ...
Add search for a user to later modify a profile
var express = require('express'); var router = express.Router(); var User = require('../models/user'); module.exports = function(app, mountPoint) { router.get('/', function(req, res) { User.find(function(err, data) { if (err) throw err; res.json(data); }); }); router.get('/:id', function(re...
var express = require('express'); var router = express.Router(); var User = require('../models/user'); module.exports = function(app, mountPoint) { router.get('/', function(req, res) { User.find(function(err, data) { if (err) throw err; res.json(data); }); }); router.post('/', function(req,...
[FIND-46] Add click types to Javascript [rev: matthew.gordon]
/* * Copyright 2014-2016 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define([ 'jquery' ], function($) { return { types: { ABANDONMENT: 'abandonment', CLICK_THR...
/* * Copyright 2014-2016 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define([ 'jquery' ], function($) { return { types: { ABANDONMENT: 'abandonment', CLICK_THR...
Add CamelCase to the code
<?php // ****************************** // Access to current order object // ****************************** // Get entity manager $entityManager = \Drupal::entityManager(); // Get order type $orderStorage = $entityManager->getStorage('commerce_order_type'); $orderType = $orderStorage->load('consumer_products')...
<?php // ****************************** // Access to current order object // ****************************** // Get entity manager $entity_manager = \Drupal::entityManager(); // Get order type $order_storage = $entity_manager->getStorage('commerce_order_type'); $order_type = $order_storage->load('consumer_produ...
Update the client manipulator interface's user return to match up with the security token types
<?php declare(strict_types=1); namespace Gos\Bundle\WebSocketBundle\Client; use Ratchet\ConnectionInterface; use Ratchet\Wamp\Topic; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\User\UserInterface; interface ClientManipulatorInterface { /** * @...
<?php declare(strict_types=1); namespace Gos\Bundle\WebSocketBundle\Client; use Ratchet\ConnectionInterface; use Ratchet\Wamp\Topic; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; interface ClientManipulatorInterface { /** * @return ClientConnection[] */ public function fi...
Fix messages in NDEx client
import requests import json import time ndex_base_url = 'http://services.bigmech.ndexbio.org' def send_request(url_suffix, params): res = requests.post(ndex_base_url + url_suffix, data=json.dumps(params)) res_json = get_result(res) return res_json def get_result(res): status = res.status_code if ...
import requests import json import time ndex_base_url = 'http://services.bigmech.ndexbio.org' def send_request(url_suffix, params): res = requests.post(ndex_base_url + url_suffix, data=json.dumps(params)) res_json = get_result(res) return res_json def get_result(res): status = res.status_code if ...
common: Change GetConfiguration query not to refresh session Bug-Url: https://bugzilla.redhat.com/1168842 Change-Id: I9ec8cb46e3fba206d9e1a93df9f985d5c2477fa8 Signed-off-by: Yair Zaslavsky <e2db7378c71f96998c1e6c0ce01fa87adf291bd0@redhat.com>
package org.ovirt.engine.core.common.queries; public class GetConfigurationValueParameters extends VdcQueryParametersBase { private static final long serialVersionUID = -5889171970595969719L; public GetConfigurationValueParameters(ConfigurationValues cVal) { this(cVal, null); } private Config...
package org.ovirt.engine.core.common.queries; public class GetConfigurationValueParameters extends VdcQueryParametersBase { private static final long serialVersionUID = -5889171970595969719L; public GetConfigurationValueParameters(ConfigurationValues cVal) { _configValue = cVal; } private Con...
Clean up fixtures on exit too.
Object.freeze(Object.prototype); require.paths.unshift('../lib'); global.assert = require('assert'); global.fs = require('fs'); global.Step = require('step'); global.nStore = require('nstore'); // A mini expectations module to ensure expected callback fire at all. var expectations = {}; global.expect = function expect...
Object.freeze(Object.prototype); require.paths.unshift('../lib'); global.assert = require('assert'); global.fs = require('fs'); global.Step = require('step'); global.nStore = require('nstore'); // A mini expectations module to ensure expected callback fire at all. var expectations = {}; global.expect = function expect...
Rename from select to map
from six import add_metaclass from rx import Observable from rx.internal import ExtensionMethod class AverageValue(object): def __init__(self, sum, count): self.sum = sum self.count = count @add_metaclass(ExtensionMethod) class ObservableAverage(Observable): """Uses a meta class to extend Obs...
from six import add_metaclass from rx import Observable from rx.internal import ExtensionMethod class AverageValue(object): def __init__(self, sum, count): self.sum = sum self.count = count @add_metaclass(ExtensionMethod) class ObservableAverage(Observable): """Uses a meta class to extend Obs...
Remove -e in favor of --from
#!/usr/bin/env node import yargs from 'yargs'; import path from 'path'; import fs from 'fs'; import * as pose from '.'; import actions from './actions'; const opts = yargs .usage('$ pose <action> [options]') .help('help') .epilog(actions.trim()) .options({ name: { alias: ['as'], default: path.basename(proce...
#!/usr/bin/env node import yargs from 'yargs'; import path from 'path'; import fs from 'fs'; import * as pose from '.'; import actions from './actions'; const opts = yargs .usage('$ pose <action> [options]') .help('help') .epilog(actions.trim()) .options({ name: { alias: ['as'], default: path.basename(proce...
Use the default modal command. Set title and href.
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Weblinks * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net) * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Weblinks Toolbar Class * ...
<?php /** * @version $Id$ * @category Nooku * @package Nooku_Server * @subpackage Weblinks * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net) * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ /** * Weblinks Toolbar Class * ...
Change access requirements for view holders View holders don't need to have public accessibility.
package com.kasparpeterson.simplerecyclerview; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.lang.reflect.Constructor; /** * Created by kaspar on 18/02/2017. */ class SimpleViewType { private final int viewType; private final int layoutId; pr...
package com.kasparpeterson.simplerecyclerview; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.lang.reflect.Constructor; /** * Created by kaspar on 18/02/2017. */ class SimpleViewType { private final int viewType; private final int layoutId; pr...
Convert crossorigin attribute tests to use dynamic imports
it("should load script without crossorigin attribute", function(done) { import("./empty?a" /* webpackChunkName: "chunk-with-crossorigin-attr" */); // if in browser context, test that crossorigin attribute was not added. if (typeof document !== 'undefined') { var script = document.querySelector('script[src="js/chun...
it("should load script without crossorigin attribute", function(done) { require.ensure([], function(require) { require("./empty?a"); }, "chunk-with-crossorigin-attr"); // if in browser context, test that crossorigin attribute was not added. if (typeof document !== 'undefined') { var script = document.querySelec...
Remove more unnecessary files in dist/node_modules/
const shell = require('shelljs'); const path = require('path'); const { rebuild } = require('electron-rebuild'); function rebuildModules(buildPath) { if (process.platform === 'darwin') { return rebuild({ buildPath, // eslint-disable-next-line electronVersion: require('electron/package.json').ve...
const shell = require('shelljs'); const path = require('path'); const { rebuild } = require('electron-rebuild'); function rebuildModules(buildPath) { if (process.platform === 'darwin') { return rebuild({ buildPath, // eslint-disable-next-line electronVersion: require('electron/package.json').ve...
Fix issue with 'EventEmitter' max listener limit being reached.
'use strict'; var assign = require('object-assign'); var EventEmitter = require('events').EventEmitter; var Dispatcher = require('../dispatcher'); var CHANGE_EVENT = 'change'; /** * Creates a Flux Store. * * @param {object} exports Defines the 'public' interface of the store. * @param {function} callb...
'use strict'; var assign = require('object-assign'); var EventEmitter = require('events').EventEmitter; var Dispatcher = require('../dispatcher'); var CHANGE_EVENT = 'change'; /** * Creates a Flux Store. * * @param {object} exports Defines the 'public' interface of the store. * @param {function} callb...
Fix session in CLI on Debian systems Change-Id: I4b1a3e45417a8d8442e097d440ebee8a09a8aaa2
# Copyright 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
Use the user service to persist or modify state
'use strict'; import { removeUserService, saveUserService } from '../../../utils/userService'; import { userModel } from '../../../models/index'; const buildResponse = (statusCode, data, res) => { if (statusCode === 200) { return res.status(200).json({ data: { user: { _id: data._id...
'use strict'; import { userModel } from '../../../models/index'; const buildResponse = (statusCode, data, res) => { if (statusCode === 200) { return res.status(200).json({ data: { user: { _id: data._id, fullname: data.fullname, } } }); } else { return re...
[test] Add a failing test for `content-type` header
var http = require('http'), assert = require('assert'), cb = require('assert-called'), resourceful = require('resourceful'); require('../'); var PORT = 8123, gotCallbacks = 0; function maybeEnd() { if (++gotCallbacks === 2) { server.close(); } } var server = http.createServer(function (req, ...
var http = require('http'), assert = require('assert'), cb = require('assert-called'), resourceful = require('resourceful'); require('../'); var PORT = 8123, gotCallbacks = 0; function maybeEnd() { if (++gotCallbacks === 2) { server.close(); } } var server = http.createServer(function (req, ...
Fix time tests by adding Date to sandbox. Since tests are now run in their own sandbox, assert.deepEqual was not properly testing the returned Date objects for equality, as they weren't instances of the same Date class used by the test itself, causing type inference to fail. It was always returning true, even for dif...
process.env.TZ = "America/Los_Angeles"; var smash = require("smash"), jsdom = require("jsdom"); require("./XMLHttpRequest"); module.exports = function() { var files = [].slice.call(arguments).map(function(d) { return "src/" + d; }), expression = "d3", sandbox = {Date: Date}; // so we can use deepEq...
process.env.TZ = "America/Los_Angeles"; var smash = require("smash"), jsdom = require("jsdom"); require("./XMLHttpRequest"); module.exports = function() { var files = [].slice.call(arguments).map(function(d) { return "src/" + d; }), expression = "d3", sandbox = null; files.unshift("src/start"); ...
Fix to_host_port_tuple to resolve test case issues
# -*- coding: utf-8 -*- """ hyper/common/util ~~~~~~~~~~~~~~~~~ General utility functions for use with hyper. """ from hyper.compat import unicode, bytes, imap def to_bytestring(element): """ Converts a single string to a bytestring, encoding via UTF-8 if needed. """ if isinstance(element, unicode): ...
# -*- coding: utf-8 -*- """ hyper/common/util ~~~~~~~~~~~~~~~~~ General utility functions for use with hyper. """ from hyper.compat import unicode, bytes, imap def to_bytestring(element): """ Converts a single string to a bytestring, encoding via UTF-8 if needed. """ if isinstance(element, unicode): ...
Set "{ecmaVersion: 6}" for falafel's acorn
var falafel = require('falafel'); module.exports = replace; function replace (src, deps) { return falafel(src, {ecmaVersion: 6}, function (node) { if (isRequire(node)) { var value = node.arguments[0].value; if (has(deps, value) && deps[value]) { node.update('require(...
var falafel = require('falafel'); module.exports = replace; function replace (src, deps) { return falafel(src, function (node) { if (isRequire(node)) { var value = node.arguments[0].value; if (has(deps, value) && deps[value]) { node.update('require(' + JSON.stringify...
Remove unneeded import, fix python path and add coding
#!/usr/bin/env python # coding=utf-8 from Handler import Handler import urllib2 class HttpPostHandler(Handler): # Inititalize Handler with url and batch size def __init__(self, config=None): Handler.__init__(self, config) self.metrics = [] self.batch_size = int(self.config.get('batch', 1...
#!/usr/bin/python2.7 from Handler import Handler import urllib import urllib2 class HttpPostHandler(Handler): # Inititalize Handler with url and batch size def __init__(self, config=None): Handler.__init__(self, config) self.metrics = [] self.batch_size = int(self.config.get('batch', 100...
Change test to match new word format.
"use strict"; var adjAdjAnimal = require("../lib/index"); var expect = require("chai").expect; describe("the library", function () { describe("getting a default id", function () { var result; before(function () { return adjAdjAnimal() .then(function (id) { result = id; }); }); it("generates a...
"use strict"; var adjAdjAnimal = require("../lib/index"); var expect = require("chai").expect; describe("the library", function () { describe("getting a default id", function () { var result; before(function () { return adjAdjAnimal() .then(function (id) { result = id; }); }); it("generates a...
Update to return the correct mangled string
var esprima = require('esprima'); var esmangle = require('esmangle'); var escodegen = require('escodegen'); Blend.defineClass('Minify', { singleton: true, js: function (scripts) { var ast = esprima.parse(scripts.join(';')); var optimized = esmangle.optimize(ast, null); var result = esma...
var esprima = require('esprima'); var esmangle = require('esmangle'); var escodegen = require('escodegen'); Blend.defineClass('Minify', { singleton: true, js: function (scripts) { var ast = esprima.parse(scripts.join(';')); var optimized = esmangle.optimize(ast, null); var result = esma...
Delete all jobs on cleanup
var express = require('express'); var kue = require('kue'); var Bot = require('../models/bot'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.render('index'); }); router.post('/destroy_jobs', function(req, res, next) { kue.Job.rangeByState('delayed', 0, 10000,...
var express = require('express'); var kue = require('kue'); var Bot = require('../models/bot'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.render('index'); }); router.post('/destroy_jobs', function(req, res, next) { kue.Job.rangeByState('delayed', 0, 10000,...
Handle socket_create not being available
<?php function pole_display_price($label, $price) { if (!function_exists('socket_create')) return; $sock= socket_create(AF_INET, SOCK_STREAM, SOL_TCP); /* Set 1 sec timeout to avoid getting stuck, should be plenty long enough */ socket_set_option($sock, SOL_SOCKET, SO_SNDTIMEO, array('sec' => 1, ...
<?php function pole_display_price($label, $price) { $sock= socket_create(AF_INET, SOCK_STREAM, SOL_TCP); /* Set 1 sec timeout to avoid getting stuck, should be plenty long enough */ socket_set_option($sock, SOL_SOCKET, SO_SNDTIMEO, array('sec' => 1, 'usec...
Use MultiCurl::setConcurrency() in load test example
<?php require __DIR__ . '/../vendor/autoload.php'; use \Curl\MultiCurl; $server_count = 10; $urls = array(); $port = 8000; for ($i = 0; $i < $server_count; $i++) { $port += 1; $urls[] = 'http://localhost:' . $port . '/'; } $multi_curl = new MultiCurl(); $multi_curl->setConcurrency(30); $success = 0; $error ...
<?php require __DIR__ . '/../vendor/autoload.php'; use \Curl\MultiCurl; $server_count = 10; $urls = array(); $port = 8000; for ($i = 0; $i < $server_count; $i++) { $port += 1; $urls[] = 'http://localhost:' . $port . '/'; } $multi_curl = new MultiCurl(); $success = 0; $error = 0; $complete = 0; $multi_curl-...
Use equal matcher for remaining keys
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from testtools import matchers from spreadflow_core.test.matchers import MatchesInvocation class MatchesDeltaItem(matchers.MatchesDict): def __init__(self, item): spec = { 'data': mat...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from testtools import matchers from spreadflow_core.test.matchers import MatchesInvocation class MatchesDeltaItem(matchers.MatchesDict): def __init__(self, item): spec = { 'data': mat...
Fix monkey patching to pass kwargs required by Python 3.4
import xml.etree.ElementTree as E from authorize.configuration import Configuration from authorize.address import Address from authorize.bank_account import BankAccount from authorize.batch import Batch from authorize.credit_card import CreditCard from authorize.customer import Customer from authorize.environment impo...
import xml.etree.ElementTree as E from authorize.configuration import Configuration from authorize.address import Address from authorize.bank_account import BankAccount from authorize.batch import Batch from authorize.credit_card import CreditCard from authorize.customer import Customer from authorize.environment impo...
Change how StringIO is imported
import contextlib import re import sys import mock import six from random_object_id.random_object_id import \ gen_random_object_id, parse_args, main @contextlib.contextmanager def captured_output(): old_out = sys.stdout try: sys.stdout = six.StringIO() yield sys.stdout finally: ...
import contextlib import re import sys import mock from six.moves import cStringIO from random_object_id.random_object_id import \ gen_random_object_id, parse_args, main @contextlib.contextmanager def captured_output(): new_out = StringIO() old_out = sys.stdout try: sys.stdout = new_out ...
Fix 1.7 wrapper instancing minecraft client class
package fr.ourten.brokkgui.wrapper; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import fr.ourten.brokkgui.BrokkGuiPlatform; /** * @author Ourten 5 oct. 2016 */ @Mod(modid = BrokkGuiWrapperMod.MODID, version = BrokkGuiWrappe...
package fr.ourten.brokkgui.wrapper; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import fr.ourten.brokkgui.BrokkGuiPlatform; /** * @author Ourten 5 oct. 2016 */ @Mod(modid = BrokkGuiWrapperMod.MODID, version = BrokkGuiWrappe...
Update for new Moment.js API
/* * Clock plugin using Moment.js (http://momentjs.com/) to * format the time and date. * * The only exposed property, 'format', determines the * format (see Moment.js documentation) to display time and date. * * Requires 'jquery' and 'moment' to be available through RequireJS. */ define(['jquery', 'moment'], f...
/* * Clock plugin using Moment.js (http://momentjs.com/) to * format the time and date. * * The only exposed property, 'format', determines the * format (see Moment.js documentation) to display time and date. * * Requires 'jquery' and 'moment' to be available through RequireJS. */ define(['jquery', 'moment'], f...
Fix casting for Pulses and added getUpdates()
<?php namespace allejo\DaPulse; use allejo\DaPulse\Objects\ApiPulse; class PulseProject extends ApiPulse { const API_PREFIX = "pulses"; private $urlSyntax = "%s/%s/%s.json"; public function getSubscribers($params = array()) { $url = sprintf($this->urlSyntax, parent::apiEndpoint(), $this->id...
<?php namespace allejo\DaPulse; use allejo\DaPulse\Objects\ApiPulse; class PulseProject extends ApiPulse { const API_PREFIX = "pulses"; private $urlSyntax = "%s/%s/%s.json"; public function getSubscribers($params = array()) { $url = sprintf($this->urlSyntax, parent::apiEndpoint(), $this->id...
Fix Replication compilation error (CE) We have changed an abstact method initC4Socket(int) to initSocketFactory(Object). The implmenation change has been made to the EE version. The CE version of the Replicator class needs to follow.
package com.couchbase.lite; import android.support.annotation.NonNull; import com.couchbase.lite.internal.replicator.CBLWebSocket; import com.couchbase.litecore.C4Socket; public final class Replicator extends AbstractReplicator { /** * Initializes a replicator with the given configuration. * * @pa...
package com.couchbase.lite; import android.support.annotation.NonNull; import com.couchbase.lite.internal.replicator.CBLWebSocket; import com.couchbase.litecore.C4Socket; public final class Replicator extends AbstractReplicator { /** * Initializes a replicator with the given configuration. * * @pa...
Use empty instead of empty + isset
<?php use_helper('Text') ?> <article class="search-result"> <div class="search-result-description"> <p class="title"><?php echo link_to(get_search_i18n($doc, 'authorizedFormOfName'), array('module' => 'actor', 'slug' => $doc['slug'])) ?></p> <ul class="result-details"> <?php if (!empty($doc['descri...
<?php use_helper('Text') ?> <article class="search-result"> <div class="search-result-description"> <p class="title"><?php echo link_to(get_search_i18n($doc, 'authorizedFormOfName'), array('module' => 'actor', 'slug' => $doc['slug'])) ?></p> <ul class="result-details"> <?php if (isset($doc['descrip...
Disable test until filesystem-graph issue works - seems that this error comes in test environment, have to figure out is this something phantomjs specific...
var env = require('../env'); var fs = require('fs'); env.init(); var name = "navigate-to-radiator"; var waitTimeout = 2000; casper.test.begin('navigate to host page', 1, function(test) { casper.start(env.root + "/#metric=cpu&timescale=10800", function() { test.assertExists(env.cpuLink, "common navigation is ini...
var env = require('../env'); var fs = require('fs'); env.init(); var name = "navigate-to-radiator"; var waitTimeout = 2000; casper.test.begin('navigate to host page', 2, function(test) { casper.start(env.root + "/#metric=cpu&timescale=10800", function() { test.assertExists(env.cpuLink); }); casper.waitUnti...
Add the blacklist checking to the bulk
from datetime import timedelta CELERYBEAT_SCHEDULE = { "reddit-validations": { "task": "reddit.tasks.process_validations", "schedule": timedelta(minutes=10), }, "eveapi-update": { "task": "eve_api.tasks.account.queue_apikey_updates", "schedule": timedelta(minutes=10), },...
from datetime import timedelta CELERYBEAT_SCHEDULE = { "reddit-validations": { "task": "reddit.tasks.process_validations", "schedule": timedelta(minutes=10), }, "eveapi-update": { "task": "eve_api.tasks.account.queue_apikey_updates", "schedule": timedelta(minutes=10), },...
Fix stack node types mismatch
package org.spoofax.jsglr2.measure.parsing; import org.spoofax.jsglr2.parseforest.IDerivation; import org.spoofax.jsglr2.parseforest.IParseForest; import org.spoofax.jsglr2.parseforest.IParseNode; import org.spoofax.jsglr2.parser.AbstractParseState; import org.spoofax.jsglr2.stack.StackLink; import org.spoofax.jsglr2....
package org.spoofax.jsglr2.measure.parsing; import org.spoofax.jsglr2.parseforest.IDerivation; import org.spoofax.jsglr2.parseforest.IParseForest; import org.spoofax.jsglr2.parseforest.IParseNode; import org.spoofax.jsglr2.parser.AbstractParseState; import org.spoofax.jsglr2.stack.StackLink; import org.spoofax.jsglr2....
Fix realtime notification, the id had been removed.
<script src="js/updater.js"></script> <?php include_once 'core.php'; include_once 'db.php'; ?> <a href="../"><img class="logo" src="files/logo.png" alt="Hallo"/></a> <?php if (isset($_GET['p'])) { echo '<ul class="navbar-p">'; } else { echo '<ul class="navbar">'; } ?> <li><form method="get" action="search.ph...
<script src="js/updater.js"></script> <?php include_once 'core.php'; include_once 'db.php'; ?> <a href="../"><img class="logo" src="files/logo.png" alt="Hallo"/></a> <?php if (isset($_GET['p'])) { echo '<ul class="navbar-p">'; } else { echo '<ul class="navbar">'; } ?> <li><form method="get" action="search.ph...
Set sqlite as standard install method
<?php /** * Welcome to the Mackstar.Spout Project * * This is where the main configuration is added. * You can override this per environment in * /conf/env/{env}.php * */ $appDir = dirname(__DIR__); return [ 'tmp_dir' => dirname(__DIR__) . '/var/tmp', 'upload_dir' => dirname(__DIR__) . '/var/www/upl...
<?php /** * Welcome to the Mackstar.Spout Project * * This is where the main configuration is added. * You can override this per environment in * /conf/env/{env}.php * */ $appDir = dirname(__DIR__); return [ 'tmp_dir' => dirname(__DIR__) . '/var/tmp', 'upload_dir' => dirname(__DIR__) . '/var/www/upl...
Move the onClick from the wrapper to the status bullet
import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import theme from './theme.css'; import Box from '../box'; import { TextSmall } from '../typography'; class ProgressStep extends PureComponent { render() { const { label, active, completed, onClick } =...
import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import theme from './theme.css'; import Box from '../box'; import { TextSmall } from '../typography'; class ProgressStep extends PureComponent { render() { const { label, active, completed, onClick } =...
Move pg_query_init call to init(). Thank you PostgreSQL assertions :)
package pg_query // Note(LukasFittl): This needs Go 1.5 for $SRCDIR support, see // https://github.com/golang/go/commit/131758183f7dc2610af489da3a7fcc4d30c6bc48 /* #cgo CFLAGS: -I${SRCDIR}/tmp/libpg_query-master #cgo LDFLAGS: -L${SRCDIR}/tmp/libpg_query-master -lpg_query -fstack-protector #include <pg_query.h> #inclu...
package pg_query // Note(LukasFittl): This needs Go 1.5 for $SRCDIR support, see // https://github.com/golang/go/commit/131758183f7dc2610af489da3a7fcc4d30c6bc48 /* #cgo CFLAGS: -I${SRCDIR}/tmp/libpg_query-master #cgo LDFLAGS: -L${SRCDIR}/tmp/libpg_query-master -lpg_query -fstack-protector #include <pg_query.h> #inclu...
Fix large stylesheet browser test
test('stylesheet_large.php', function (assert, document) { var h1 = document.getElementsByTagName('h1')[0]; var cs = document.defaultView.getComputedStyle(h1, null); var done = assert.async(); wait(); function wait() { if (document.querySelectorAll('style[data-phast-params]').length > 0) { ...
test('stylesheet_large.php', function (assert, document) { var h1 = document.getElementsByTagName('h1')[0]; var cs = document.defaultView.getComputedStyle(h1, null); var done = assert.async(); wait(); function wait() { if (document.querySelectorAll('style[data-phast-href]').length > 0) { ...
Allow render to take a template different from the default one.
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**f...
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**f...
Add authentication to the serverside
#!/usr/bin/env python from configReader import ConfigReader import sys import os, os.path import os.path from time import time from math import floor import hashlib import random import requests f = open('adjectives.txt','r') adjectives = [line.rstrip() for line in f] f.close() configReader = ConfigReader(name="clien...
#!/usr/bin/env python from configReader import ConfigReader import sys import os, os.path import os.path from time import time from math import floor import hashlib import random import requests f = open('adjectives.txt','r') adjectives = [line.rstrip() for line in f] f.close() configReader = ConfigReader(name="clien...
Allow mutiple hooks for packets
packetFunctions = {} commands = {} onStart = [] onConnection = [] onConnectionLoss = [] class packetHook(object): def __init__(self, pktType, pktSubtype): self.pktType = pktType self.pktSubtype = pktSubtype def __call__(self, f): global packetFunctions if (self.pktType, self.pktSubtype) not in packetFunctio...
packetFunctions = {} commands = {} onStart = [] onConnection = [] onConnectionLoss = [] class packetHook(object): def __init__(self, pktType, pktSubtype): self.pktType = pktType self.pktSubtype = pktSubtype def __call__(self, f): global packetFunctions packetFunctions[(self.pktType, self.pktSubtype)] = f c...
Fix up indentation and other config fo cppp mode
define(function (require) { 'use strict'; var jquery = require('jquery'); var monaco = require('monaco'); var cpp = require('vs/basic-languages/src/cpp'); // We need to create a new definition for cpp so we can remove invalid keywords function definition() { var cppp = jquery.extend(tr...
define(function (require) { 'use strict'; var jquery = require('jquery'); var monaco = require('monaco'); var cpp = require('vs/basic-languages/src/cpp'); // We need to create a new definition for cpp so we can remove invalid keywords function definition() { var cppp = jquery.extend(tr...
Add pos for max_lemma_count also
#!/usr/bin/env python -*- coding: utf-8 -*- # # Python Word Sense Disambiguation (pyWSD): Baseline WSD # # Copyright (C) 2014-2020 alvations # URL: # For license information, see LICENSE.md import random custom_random = random.Random(0) def random_sense(ambiguous_word, pos=None): """ Returns a random sense. """ ...
#!/usr/bin/env python -*- coding: utf-8 -*- # # Python Word Sense Disambiguation (pyWSD): Baseline WSD # # Copyright (C) 2014-2020 alvations # URL: # For license information, see LICENSE.md import random custom_random = random.Random(0) def random_sense(ambiguous_word, pos=None): """ Returns a random sense. """ ...
Add dependency on six to help support legacy python2
from setuptools import setup, find_packages setup( name='validation', url='https://github.com/JOIVY/validation', version='0.0.1', author='Ben Mather', author_email='bwhmather@bwhmather.com', maintainer='', license='BSD', description=( "A library for runtime type checking and va...
from setuptools import setup, find_packages setup( name='validation', url='https://github.com/JOIVY/validation', version='0.0.1', author='Ben Mather', author_email='bwhmather@bwhmather.com', maintainer='', license='BSD', description=( "A library for runtime type checking and va...
Use resolve helper instead of app
<?php /* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */ use Flarum\Extend; use Flarum\Frontend\Document; use Psr\Http\Message\ServerRequestInterface as Request; return [ (new Extend\Frontend('fo...
<?php /* * This file is part of Flarum. * * For detailed copyright and license information, please view the * LICENSE file that was distributed with this source code. */ use Flarum\Extend; use Flarum\Frontend\Document; use Psr\Http\Message\ServerRequestInterface as Request; return [ (new Extend\Frontend('fo...
Simplify location chooser target route logic
import locations from '../core/locations'; import View from '../base/view'; import {trigger} from '../utils/browser'; import template from '../../templates/location-chooser.ejs'; export default class LocationChooser extends View { constructor({app, location, route}) { super({app}); this.location = locat...
import locations from '../core/locations'; import View from '../base/view'; import {trigger} from '../utils/browser'; import template from '../../templates/location-chooser.ejs'; export default class LocationChooser extends View { constructor({app, location, route}) { super({app}); this.location = locat...
Modify prop generation to encompass the whole chunk instead of each of the 16x16 blocks.
/* * Trident - A Multithreaded Server Alternative * Copyright 2016 The TridentSDK Team * * 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....
/* * Trident - A Multithreaded Server Alternative * Copyright 2016 The TridentSDK Team * * 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....
Print command usage on errors
package forager.newui; import java.util.HashMap; import java.util.Map; public class Launcher { public static void main(String[] args) throws Exception { if (args.length < 1) { printHelp(); } Client clientCommand = new Client(); Map<String, Command> commands = new Has...
package forager.newui; import java.util.HashMap; import java.util.Map; public class Launcher { public static void main(String[] args) throws Exception { if (args.length < 1) { printHelp(); } Client clientCommand = new Client(); Map<String, Command> commands = new Has...
Add Growth Push tracking code to sample
package com.growthbeat.growthbeatsample; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import com.growthbeat.Growthbeat; import com.growthpush.GrowthPush; import com.growthpush.model.Environment; public class MainActivity extends Activity { @Override protected void onCreate(Bund...
package com.growthbeat.growthbeatsample; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import com.growthbeat.Growthbeat; import com.growthpush.model.Environment; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.o...
Fix order total shipping rules
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Sylius\Component\Core\Shipping\Checker\Rule; use Sylius\Component...
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Sylius\Component\Core\Shipping\Checker\Rule; use Sylius\Component...
Update to the v3 api
#!/usr/bin/python3 import requests import pprint import argparse parser = argparse.ArgumentParser(description='A tool to check if your email account has been in a breach By Jay Townsend') parser.add_argument('-e', '--email-account', help='Email account to lookup', required=True) parser.add_argument('-k', '--api-key',...
#!/usr/bin/python3 import requests import pprint import argparse parser = argparse.ArgumentParser(description='A tool to check if your email account has been in a breach By Jay Townsend') parser.add_argument('-e', '--email-account', help='Email account to lookup', required=True) args = parser.parse_args() headers = ...
Print parsed args, useful for demo.
#!/usr/bin/env python """ Usage: tig init tig commit <msg> tig checkout <start-point> [-b <branch-name>] tig diff tig log tig branch tig merge <branch> Options: -b <branch-name> Branch name to checkout. """ import docopt def init(): pass def branch(): pass def commit(msg): pass ...
#!/usr/bin/env python """ Usage: tig init tig commit <msg> tig checkout <start-point> [-b <branch-name>] tig diff tig log tig branch tig merge <branch> Options: -b <branch-name> Branch name to checkout. """ import docopt def init(): pass def branch(): pass def commit(msg): pass ...
Add djangorestframework DefaultRouter instance and registered BondViewSet.
"""bond_analytics_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='h...
"""bond_analytics_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='h...
Clarify the code a bit
module.exports = function stringReplaceAsync( string, searchValue, replaceValue ) { try { if (typeof replaceValue === "function") { // 1. Run fake pass of `replace`, collect values from `replaceValue` calls // 2. Resolve them with `Promise.all` // 3. Run `replace` with resolved values ...
module.exports = function stringReplaceAsync( string, searchValue, replaceValue ) { try { if (typeof replaceValue === "function") { // Step 1: Call native `replace` one time to acquire arguments for // `replaceValue` function // Step 2: Collect all return values in an array // Step 3...