text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Add Encoding JSON in Java Example
/** * @file JSONEncodeDemo.java * @author Valery Samovich * @version 1.0.0 * @date 11/19/2014 * * Following example to encode JSON Object using Java JSONObject with is * subclass of java.util.HashMap. */ package com.valerysamovich.java.advanced.json; import org.json.simple.JSONObject; public class JSONEnco...
/** * @file JSONEncodeDemo.java * @author Valery Samovich * @version 1.0.0 * @date 11/19/2014 * * Following example to encode JSON Object using Java JSONObject with is * subclass of java.util.HashMap. */ package com.valerysamovich.java.advanced.json; import org.json.simple.JSONObject; public class JSONEnco...
Fix failing test w/ incomplete regex
import re def test_tmp_file_is_gone(host): tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress' f = host.file(tmpfile) assert not f.exists def test_command_line_tools_dir(host): f = host.file('/Library/Developer/CommandLineTools') assert f.exists assert f.is_directory ...
import re def test_tmp_file_is_gone(host): tmpfile = '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress' f = host.file(tmpfile) assert not f.exists def test_command_line_tools_dir(host): f = host.file('/Library/Developer/CommandLineTools') assert f.exists assert f.is_directory ...
Add ability to disable frame evaluation
import os import sys IS_PY36_OR_OLDER = False if (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3: IS_PY36_OR_OLDER = True set_frame_eval = None stop_frame_eval = None use_frame_eval = os.environ.get('PYDEVD_USE_FRAME_EVAL', None) if use_frame_eval == 'NO': frame_eval_func,...
import os import sys IS_PY36_OR_OLDER = False if (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3: IS_PY36_OR_OLDER = True set_frame_eval = None stop_frame_eval = None if IS_PY36_OR_OLDER: try: from _pydevd_frame_eval.pydevd_frame_evaluator import frame_eval_func, s...
Make HTTP01Responder's resource be at the token's path * Not /.well-known/acme-challenge/<token>, just /<token> * Use twisted.web.static.Data as the child resource
""" ``http-01`` challenge implementation. """ from twisted.web.resource import Resource from twisted.web.static import Data from zope.interface import implementer from txacme.interfaces import IResponder @implementer(IResponder) class HTTP01Responder(object): """ An ``http-01`` challenge responder for txsni...
""" ``http-01`` challenge implementation. """ from twisted.web.http import OK from twisted.web.resource import Resource from zope.interface import implementer from txacme.interfaces import IResponder @implementer(IResponder) class HTTP01Responder(object): """ An ``http-01`` challenge responder for txsni. ...
Allow a list of static values.
package org.myrobotlab.document.transformer; import org.myrobotlab.document.transformer.StageConfiguration; import java.util.List; import org.myrobotlab.document.Document; /** * This will set a field on a document with a value * * @author kwatters * */ public class SetStaticFieldValue extends AbstractStage { ...
package org.myrobotlab.document.transformer; import org.myrobotlab.document.transformer.StageConfiguration; import java.util.List; import org.myrobotlab.document.Document; /** * This will set a field on a document with a value * * @author kwatters * */ public class SetStaticFieldValue extends AbstractStage { ...
Check config for jukebox mode
<?php namespace App\Listeners; use App\Events\SomeEvent; use App\Events\SongChanged; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; class SongChangedEventListener { /** * Create the event listener. * * @return void */ public function __construct() ...
<?php namespace App\Listeners; use App\Events\SomeEvent; use App\Events\SongChanged; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; class SongChangedEventListener { /** * Create the event listener. * * @return void */ public function __construct() ...
Change some comments as documentation
# Script to change the UID of Users # # Author: Christoph Stoettner # E-Mail: christoph.stoettner@stoeps.de # # example: wsadmin.sh -lang jython -f changeUID.py file.csv # # Format of CSV-File: # uid;mailaddress # don't mask strings with " # import sys import os # Check OS on windows .strip('\n') is not required # I...
# Script to change the UID of Users # # Author: Christoph Stoettner # E-Mail: christoph.stoettner@stoeps.de # # example: wsadmin.sh -lang jython -f changeUID.py file.csv # # Format of CSV-File: # uid;mailaddress # import sys import os # Check OS on windows .strip('\n') is not required # Import Connections Admin Comma...
BB-1505: Check performance - run if sequences supported
<?php namespace Oro\Bundle\DashboardBundle\Migrations\Schema\v1_7; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\Schema; use Oro\Bundle\MigrationBundle\Migration\Extension\DatabasePlatformAwareInterface; use Oro\Bundle\MigrationBundle\Migration\Migration; use Oro\Bundle\MigrationBundle\Migra...
<?php namespace Oro\Bundle\DashboardBundle\Migrations\Schema\v1_7; use Doctrine\DBAL\Schema\Schema; use Oro\Bundle\MigrationBundle\Migration\Migration; use Oro\Bundle\MigrationBundle\Migration\OrderedMigrationInterface; use Oro\Bundle\MigrationBundle\Migration\QueryBag; class OroDashboardBundle implements Migration...
Add send_message option to CheckRequirements
package com.elmakers.mine.bukkit.action.builtin; import java.util.ArrayList; import java.util.Collection; import org.bukkit.configuration.ConfigurationSection; import com.elmakers.mine.bukkit.action.CheckAction; import com.elmakers.mine.bukkit.api.action.CastContext; import com.elmakers.mine.bukkit.api.requirements....
package com.elmakers.mine.bukkit.action.builtin; import java.util.ArrayList; import java.util.Collection; import org.bukkit.configuration.ConfigurationSection; import com.elmakers.mine.bukkit.action.CheckAction; import com.elmakers.mine.bukkit.api.action.CastContext; import com.elmakers.mine.bukkit.api.requirements....
:bug: Fix the inaccessible pages within the involvement package
from __future__ import absolute_import, unicode_literals from django.conf import settings from django.conf.urls import include, url from search import views as search_views from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtailcore import urls as wagtail_urls from wagtail.wagtaildocs import u...
from __future__ import absolute_import, unicode_literals from django.conf import settings from django.conf.urls import include, url from search import views as search_views from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtailcore import urls as wagtail_urls from wagtail.wagtaildocs import u...
Correct representation of floats and uuids
from uuid import UUID from scanner import Symbol def tostr(value): if isinstance(value, Symbol): return str(value) elif isinstance(value, str): return '"%s"' % value elif isinstance(value, float): return '%.14f' % value elif isinstance(value, UUID): return '{%s}' % str(v...
from uuid import UUID from scanner import Symbol def tostr(value): if isinstance(value, Symbol): return str(value) elif isinstance(value, str): return '"%s"' % value elif isinstance(value, UUID): return '{%s}' % value elif value is None: return '-' else: retu...
Update momentjs locale globally when language is switched.
// @ngInject export default class LanguageUtilsService { // @ngInject constructor($translate, $http, ENV) { this.$translate = $translate; this.$http = $http; this.ENV = ENV; } getCurrentLanguage() { return this.current; } setCurrentLanguage(language) { this.current = language; this...
// @ngInject export default class LanguageUtilsService { // @ngInject constructor($translate, $http, ENV) { this.$translate = $translate; this.$http = $http; this.ENV = ENV; } getCurrentLanguage() { return this.current; } setCurrentLanguage(language) { this.current = language; this...
RUN-316: Move magento extensions into a dedicated directory
#!/usr/bin/env php <?php use LizardsAndPumpkins\MagentoConnector\Api\Api; require __DIR__ . '/vendor/autoload.php'; require 'app/Mage.php'; Mage::app(); class PollsExportQueue { private static $sleepMicroSeconds = 500000; private static $iterationsUntilExit = 200; public static function run() { ...
#!/usr/bin/env php <?php use LizardsAndPumpkins\MagentoConnector\Api\Api; require __DIR__ . '/vendor/autoload.php'; require 'app/Mage.php'; Mage::app(); class PollsExportQueue { private static $sleepMicroSeconds = 500000; private static $iterationsUntilExit = 200; public static function run() { ...
Add exception handling for FileExistsError
import logging import os import shutil logger = logging.getLogger('polyaxon.libs.paths') def delete_path(path): if not os.path.exists(path): return try: if os.path.isfile(path): os.remove(path) else: shutil.rmtree(path) except OSError: logger.warnin...
import logging import os import shutil logger = logging.getLogger('polyaxon.libs.paths') def delete_path(path): if not os.path.exists(path): return try: if os.path.isfile(path): os.remove(path) else: shutil.rmtree(path) except OSError: logger.warnin...
Set script permissions during install
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from setuptools import setup import os setup( name='openhim-report-tasks', version='0.1.0', author='Jembi He...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from setuptools import setup import os setup( name='openhim-report-tasks', version='0.1.0', author='Jembi He...
Update static files example for v6
package main import ( "gopkg.in/kataras/iris.v6" "gopkg.in/kataras/iris.v6/adaptors/httprouter" "gopkg.in/kataras/iris.v6/adaptors/view" ) type page struct { Title string } func main() { app := iris.New() app.Adapt( iris.DevLogger(), httprouter.New(), view.HTML("./templates", ".html"), ) app.OnError(...
package main import ( "github.com/kataras/go-template/html" "gopkg.in/kataras/iris.v6" ) type page struct { Title string } func main() { iris.UseTemplate(html.New()).Directory("./templates/web/default", ".html") iris.OnError(iris.StatusForbidden, func(ctx *iris.Context) { ctx.HTML(iris.StatusForbidden, "<h1> ...
Put tests_require into extras_require also
from setuptools import setup, find_packages try: import nose.commands extra_args = dict( cmdclass={'test': nose.commands.nosetests}, ) except ImportError: extra_args = dict() # TODO: would this work? (is the file included in the dist?) #tests_require = [l.strip() for l in open('test-requirements.txt').rea...
from setuptools import setup, find_packages try: import nose.commands extra_args = dict( cmdclass={'test': nose.commands.nosetests}, ) except ImportError: extra_args = dict() setup( name='dear_astrid', version='0.1.0', author='Randy Stauner', author_email='randy@magnificent-tears.com', package...
Make min height = 300px
import React from 'react' import { inject, observer } from 'mobx-react' import Window from './Window' import DragPreview from './DragPreview' @inject('windowStore') @observer export default class App extends React.Component { resize = () => { const bottom = Math.max( ...Object.values(this.refs).map( ...
import React from 'react' import { inject, observer } from 'mobx-react' import Window from './Window' import DragPreview from './DragPreview' @inject('windowStore') @observer export default class App extends React.Component { resize = () => { const bottom = Math.max( ...Object.values(this.refs).map( ...
Disable autoreload in integration tests
import os import subprocess import pytest from chalice.utils import OSUtils CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_DIR = os.path.join(CURRENT_DIR, 'testapp') @pytest.fixture def local_app(tmpdir): temp_dir_path = str(tmpdir) OSUtils().copytree(PROJECT_DIR, temp_dir_path) old_di...
import os import subprocess import pytest from chalice.utils import OSUtils CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PROJECT_DIR = os.path.join(CURRENT_DIR, 'testapp') @pytest.fixture def local_app(tmpdir): temp_dir_path = str(tmpdir) OSUtils().copytree(PROJECT_DIR, temp_dir_path) old_di...
Remove lingering reference to linked changelog.
""" Setuptools is released using 'jaraco.packaging.release'. To make a release, install jaraco.packaging and run 'python -m jaraco.packaging.release' """ import os import subprocess import pkg_resources pkg_resources.require('jaraco.packaging>=2.0') pkg_resources.require('wheel') def before_upload(): Bootstrap...
""" Setuptools is released using 'jaraco.packaging.release'. To make a release, install jaraco.packaging and run 'python -m jaraco.packaging.release' """ import os import subprocess import pkg_resources pkg_resources.require('jaraco.packaging>=2.0') pkg_resources.require('wheel') def before_upload(): Bootstrap...
Revert "Fixes to the create_user pipeline" This reverts commit 49dd1b5205498425f7af247f7c390a48a423db4c.
from django.utils.translation import ugettext from django.contrib.auth.models import User from social_auth.backends.pipeline.user import create_user as social_auth_create_user from social_auth.exceptions import AuthAlreadyAssociated def create_user(backend, details, response, uid, username, user = None, is_new = Fals...
from django.utils.translation import ugettext from django.contrib.auth.models import User from social_auth.backends.pipeline.user import create_user as social_auth_create_user from social_auth.exceptions import AuthAlreadyAssociated def create_user(backend, details, response, uid, username, user = None, is_new = Fals...
Switch icalendar event listing frontend to use event instances instead of events.
<?php /** * This is the output for an event listing in icalendar format. * @package UNL_UCBCN_Frontend */ foreach ($this->events as $e) { $out = array(); $out[] = 'BEGIN:VEVENT'; //$out[] = 'SEQUENCE:5'; if (isset($e->eventdatetime->starttime)) { $out[] = 'DTSTART;TZID=US/Central:'.date('Ymd\THis',strtot...
<?php /** * This is the output for an event listing in icalendar format. * @package UNL_UCBCN_Frontend */ foreach ($this->events as $e) { $eventdatetime = $e->getLink('id','eventdatetime','event_id'); $out = array(); $out[] = 'BEGIN:VEVENT'; //$out[] = 'SEQUENCE:5'; if (isset($eventdatetime->starttime)) { ...
Create username and password method
<?php require_once __DIR__ . '/login.php'; require_once __DIR__ . '/../lib/utils.php'; class LoginDoubleChecker extends RawDataContainer { static protected function requiredFieldSchema(): array { return [ 'login' => 'LoginInfo', 'db-query-set' => 'DatabaseQuerySet', ]; } public function veri...
<?php require_once __DIR__ . '/login.php'; require_once __DIR__ . '/../lib/utils.php'; class LoginDoubleChecker extends RawDataContainer { static protected function requiredFieldSchema(): array { return [ 'login' => 'LoginInfo', 'db-query-set' => 'DatabaseQuerySet', ]; } public function veri...
Remove the unused logger (for the wrong class), Luke!
package nl.vpro.poel.service; import nl.vpro.poel.domain.Group; import nl.vpro.poel.dto.GroupForm; import nl.vpro.poel.repository.GroupRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Optional; @Service p...
package nl.vpro.poel.service; import nl.vpro.poel.domain.Group; import nl.vpro.poel.dto.GroupForm; import nl.vpro.poel.repository.GroupRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; imp...
Update the stats lists and add a 3D only version
# Licensed under an MIT open source license - see LICENSE ''' Returns a list of all available distance metrics ''' statistics_list = ["Wavelet", "MVC", "PSpec", "Bispectrum", "DeltaVariance", "Genus", "VCS", "VCA", "Tsallis", "PCA", "SCF", "Cramer", "Skewness", "Kurtosis", "VCS_S...
# Licensed under an MIT open source license - see LICENSE ''' Returns a list of all available distance metrics ''' statistics_list = ["Wavelet", "MVC", "PSpec", "Bispectrum", "DeltaVariance", "Genus", "VCS", "VCA", "Tsallis", "PCA", "SCF", "Cramer", "Skewness", "Kurtosis", "VCS_S...
Fix test to use main unit test files standards The main unit test file tested action creators against `reducer().status` instead of the full state. There seems to be inconsistencies in the payload for action creators which caused these tests to fail. I have updated the tests to only check the status instead of the ent...
import { describe } from 'riteway'; import dsm from '../dsm'; const SIGNED_OUT = 'signed_out'; const AUTHENTICATING = 'authenticating'; const actionStates = [ ['initialize', SIGNED_OUT, ['sign in', AUTHENTICATING // ['report error', 'error', // ['handle error', 'signed out'] // ], // ...
import { describe } from 'riteway'; import dsm from '../dsm'; const SIGNED_OUT = 'signed_out'; const AUTHENTICATING = 'authenticating'; const actionStates = [ ['initialize', SIGNED_OUT, ['sign in', AUTHENTICATING // ['report error', 'error', // ['handle error', 'signed out'] // ], // ...
Rename default Grunt task to "build".
module.exports = function (grunt) { grunt.initConfig({ cssmin: { dist: { files: { 'dist/css/application.min.css': ['dist/css/application.min.css'] } } }, processhtml: { dist: { files: { 'dist/index.html': ['src/index.html'] } } ...
module.exports = function (grunt) { grunt.initConfig({ cssmin: { dist: { files: { 'dist/css/application.min.css': ['dist/css/application.min.css'] } } }, processhtml: { dist: { files: { 'dist/index.html': ['src/index.html'] } } ...
Remove state in favor of class variable
const React = require('react'); const { getFocusableNodesInElement, reconcileNodeArrays, setNodeAttributes } = require('utils/FocusManagement'); module.exports = class RestrictFocus extends React.Component { constructor (props, context) { super(props, context); this._wrapper = React.createRef(); t...
const React = require('react'); const { getFocusableNodesInElement, reconcileNodeArrays, setNodeAttributes } = require('utils/FocusManagement'); module.exports = class RestrictFocus extends React.Component { constructor (props, context) { super(props, context); this._wrapper = React.createRef(); ...
Improve reliablity of python article fetcher
# -*- coding: utf-8 -*- from newspaper import Article from goose import Goose import requests import json import sys article = Article(sys.argv[1]) article.download() if not article.html: r = requests.get(sys.argv[1], verify=False, headers={ 'User-Agent': 'Mozilla/5.0' }) article.set_html(r.text) article.parse()...
# -*- coding: utf-8 -*- from newspaper import Article from goose import Goose import json import sys article = Article(sys.argv[1]) article.download() article.parse() article.nlp() published = '' if article.publish_date: published = article.publish_date.strftime("%Y-%m-%d %H:%M:%S") # Get body with goose g = Goos...
WIP: Upgrade to Splash V2 Standards
<?php /* * This file is part of SplashSync Project. * * Copyright (C) 2015-2019 Splash Sync <www.splashsync.com> * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * *...
<?php /* * This file is part of SplashSync Project. * * Copyright (C) 2015-2019 Splash Sync <www.splashsync.com> * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * *...
Revert "Fix ignoring mock artifacts on release" This reverts commit e7bded655b8c336b132968930fa60d339be8115b.
#!/usr/bin/env node // This script removes the build artifacts of ignored contracts. const fs = require('fs'); const path = require('path'); const cp = require('child_process'); const match = require('micromatch'); function readJSON (path) { return JSON.parse(fs.readFileSync(path)); } cp.spawnSync('npm', ['run', ...
#!/usr/bin/env node // This script removes the build artifacts of ignored contracts. const fs = require('fs'); const path = require('path'); const cp = require('child_process'); const match = require('micromatch'); function readJSON (path) { return JSON.parse(fs.readFileSync(path)); } cp.spawnSync('npm', ['run', ...
Adjust component to be used in an add-on `layout: layout` needs to be defined where layout is imported from the component's template
import Ember from 'ember'; import layout from '../templates/components/star-rating'; export default Ember.Component.extend({ tagName: 'div', classNames: ['rating-panel'], layout: layout, rating: 0, maxRating: 5, item: null, setAction: '', stars: Ember.computed('rating', 'maxRating', func...
import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'div', classNames: ['rating-panel'], rating: 0, maxRating: 5, item: null, setAction: '', stars: Ember.computed('rating', 'maxRating', function() { var fullStars = this.starRange(1, this.get('rating'), 'full'); ...
Add functionality to get latest tviits
from django.http import HttpResponse, HttpResponseRedirect from django.views.generic import View from django.utils.decorators import method_decorator from django.template import RequestContext, loader from django.core.exceptions import PermissionDenied from django.contrib.auth.decorators import login_required from djan...
from django.http import HttpResponse, HttpResponseRedirect from django.views.generic import View from django.utils.decorators import method_decorator from django.template import RequestContext, loader from django.core.exceptions import PermissionDenied from django.contrib.auth.decorators import login_required from djan...
Cut down on the loading of families in the normal GenerateReactionsTest Change generateReactions input reactant to propyl
# Data sources for kinetics database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = 'default', #this section lists possible reaction families to find reactioons with kineticsFamilies = ['R_Recombination'], kineticsEstimator...
# Data sources for kinetics database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = 'default', #this section lists possible reaction families to find reactioons with kineticsFamilies = ['!Intra_Disproportionation','!Substitutio...
Fix mistake in table name
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateMentionsPostsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('mentions_posts', function (Blueprint $table) { ...
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateMentionsPostsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('mentionsPosts', function (Blueprint $table) { ...
Use "effects" or "effect" parameter for PlayEffects action
package com.elmakers.mine.bukkit.action.builtin; import com.elmakers.mine.bukkit.action.BaseSpellAction; import com.elmakers.mine.bukkit.api.action.CastContext; import com.elmakers.mine.bukkit.api.spell.SpellResult; import org.bukkit.configuration.ConfigurationSection; public class PlayEffectsAction extends BaseSpell...
package com.elmakers.mine.bukkit.action.builtin; import com.elmakers.mine.bukkit.action.BaseSpellAction; import com.elmakers.mine.bukkit.api.action.CastContext; import com.elmakers.mine.bukkit.api.spell.SpellResult; import org.bukkit.configuration.ConfigurationSection; public class PlayEffectsAction extends BaseSpell...
Add T0 to the symbols available through the API
"""Top-level objects and functions offered by the Skyfield library. Importing this ``skyfield.api`` module causes Skyfield to load up the default JPL planetary ephemeris ``de421`` and create planet objects like ``earth`` and ``mars`` that are ready for your use. """ import de421 from datetime import datetime from .st...
"""Top-level objects and functions offered by the Skyfield library. Importing this ``skyfield.api`` module causes Skyfield to load up the default JPL planetary ephemeris ``de421`` and create planet objects like ``earth`` and ``mars`` that are ready for your use. """ import de421 from datetime import datetime from .st...
Set the timeout back to 300 instead of 3000 which was used for debugging
// This alert was to test to see if the JavaScript was loaded :) // alert("Hello World") $(document).ready(function() { function myFunction() { let userinput = $("#searchbarid").val(); $.post('/searchajax',{data: userinput},(data, status) =>{ // This is working, the data is being console.log // console.lo...
// This alert was to test to see if the JavaScript was loaded :) // alert("Hello World") $(document).ready(function() { function myFunction() { let userinput = $("#searchbarid").val(); $.post('/searchajax',{data: userinput},(data, status) =>{ // This is working, the data is being console.log // console.lo...
Improve the docs for ToolchainInfo and link to the main toolchains do? ?c page. Closes #8821. PiperOrigin-RevId: 257044964
// Copyright 2018 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appl...
// Copyright 2018 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appl...
Send http status 403 when stats is hidden
const {readFileSync} = require('fs') const {resolve} = require('path') function createRequestDecorator (stats) { return (req, res, next) => { res.locals = res.locals || Object.create(null) res.locals.webpackClientStats = stats next && next() } } function serveAssets (router, options = {}) { if (typ...
const {readFileSync} = require('fs') const {resolve} = require('path') function createRequestDecorator (stats) { return (req, res, next) => { res.locals = res.locals || Object.create(null) res.locals.webpackClientStats = stats next && next() } } function serveAssets (router, options = {}) { if (typ...
Fix jQuery for selecting active tab
$(document).ready(function(){ $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href)); if (results==null){ return null; } else{ return results[1] || 0; } } function getPageName(url) { var index =...
$(document).ready(function(){ $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(decodeURIComponent(window.location.href)); if (results==null){ return null; } else{ return results[1] || 0; } } /* * Defaults to Active Page * Can be Ma...
Add usage of nbins_cats to RF pyunit.
import sys sys.path.insert(1, "../../../") import h2o def bigcatRF(ip,port): # Connect to h2o h2o.init(ip,port) # Training set has 100 categories from cat001 to cat100 # Categories cat001, cat003, ... are perfect predictors of y = 1 # Categories cat002, cat004, ... are perfect predictors of y = 0 ...
import sys sys.path.insert(1, "../../../") import h2o def bigcatRF(ip,port): # Connect to h2o h2o.init(ip,port) # Training set has 100 categories from cat001 to cat100 # Categories cat001, cat003, ... are perfect predictors of y = 1 # Categories cat002, cat004, ... are perfect predictors of y = 0 ...
Use null instead of [] as default property value
import Service from '@ember/service'; export default Service.extend({ showWindow: false, shownComponents: null, data: null, addComponent(path){ if (this.get('shownComponents') == null){ this.set('shownComponents', []); } if (!this.get('shownComponents').includes(pa...
import Service from '@ember/service'; export default Service.extend({ showWindow: false, shownComponents: [], data: null, addComponent(path){ if (!this.get('shownComponents').includes(path)){ this.get('shownComponents').push(path); } }, removeComponent(path){ ...
Fix: Set chokidar option ignoreIntial: true by default
'use strict'; var util = require('util'); var Undertaker = require('undertaker'); var vfs = require('vinyl-fs'); var chokidar = require('chokidar'); function Gulp() { Undertaker.call(this); } util.inherits(Gulp, Undertaker); Gulp.prototype.src = vfs.src; Gulp.prototype.dest = vfs.dest; Gulp.prototype.symlink = vfs...
'use strict'; var util = require('util'); var Undertaker = require('undertaker'); var vfs = require('vinyl-fs'); var chokidar = require('chokidar'); function Gulp() { Undertaker.call(this); } util.inherits(Gulp, Undertaker); Gulp.prototype.src = vfs.src; Gulp.prototype.dest = vfs.dest; Gulp.prototype.symlink = vfs...
Change to new event handling code
const express = require('express') const cors = require('cors') module.exports = function(config){ const router = new express.Router(); config.cors = { router: router, whitelist: null, allowedHeaders: [ 'Authorization', 'Content-Type', 'X-Token', 'X-Username', 'X-Server-Pa...
const express = require('express') const cors = require('cors') module.exports = function(config){ const router = new express.Router(); config.cors = { router: router, whitelist: null, allowedHeaders: [ 'Authorization', 'Content-Type', 'X-Token', 'X-Username', 'X-Server-Pa...
Add helper method on JsArray for easing conversion from/to java array. PiperOrigin-RevId: 263680508
/* * Copyright 2017 Google 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
/* * Copyright 2017 Google 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
[Telemetry] Make profile generator wait for pages to load completely. The bug that causes this not to work is fixed. It is possible that this non-determinism in the profile could lead to flakiness in the session_restore benchmark. BUG=375979 Review URL: https://codereview.chromium.org/318733002 git-svn-id: de016e52...
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.core import util from telemetry.page import page_set from telemetry.page import profile_creator class SmallProfileCreator(pro...
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.core import util from telemetry.page import page_set from telemetry.page import profile_creator class SmallProfileCreator(pro...
CORE-504: Update Java progress events to use floats
/* * Created by Michael Carrara <michael.carrara@breadwallet.com> on 5/31/18. * Copyright (c) 2018 Breadwinner AG. All right reserved. * * See the LICENSE file at the project root for license information. * See the CONTRIBUTORS file at the project root for a list of contributors. */ package com.breadwallet.crypt...
/* * Created by Michael Carrara <michael.carrara@breadwallet.com> on 5/31/18. * Copyright (c) 2018 Breadwinner AG. All right reserved. * * See the LICENSE file at the project root for license information. * See the CONTRIBUTORS file at the project root for a list of contributors. */ package com.breadwallet.crypt...
Add flag for insert UTF-8 BOM symbol in start CSV-file
<?php namespace EasyCSV; abstract class AbstractBase { protected $handle; protected $delimiter = ','; protected $enclosure = '"'; public function __construct($path, $mode = 'r+', $isNeedBOM = false) { if (! file_exists($path)) { touch($path); } $this->handle = ...
<?php namespace EasyCSV; abstract class AbstractBase { protected $handle; protected $delimiter = ','; protected $enclosure = '"'; public function __construct($path, $mode = 'r+') { if (! file_exists($path)) { touch($path); } $this->handle = new \SplFileObject($...
Update callback to support two parameters
import argparse import asyncio import logging from .protocol import create_anthemav_reader def console(): parser = argparse.ArgumentParser(description=console.__doc__) parser.add_argument('--host', default='127.0.0.1', help='IP or FQDN of AVR') parser.add_argument('--port', default='14999', help='Port of ...
import argparse import asyncio import logging from .protocol import create_anthemav_reader def console(): parser = argparse.ArgumentParser(description=console.__doc__) parser.add_argument('--host', default='127.0.0.1', help='IP or FQDN of AVR') parser.add_argument('--port', default='14999', help='Port of ...
Fix Python packaging to use correct git log for package time/version stamps (2nd try)
from setuptools.command.egg_info import egg_info import subprocess import time class EggInfoFromGit(egg_info): """Tag the build with git commit timestamp. If a build tag has already been set (e.g., "egg_info -b", building from source package), leave it alone. """ def git_timestamp_tag(self): ...
from setuptools.command.egg_info import egg_info import subprocess import time class EggInfoFromGit(egg_info): """Tag the build with git commit timestamp. If a build tag has already been set (e.g., "egg_info -b", building from source package), leave it alone. """ def git_timestamp_tag(self): ...
FIX: Fix really stupid bug that meant images were not saved
<?php /** * Defines the SupportingProjectPage page type - initial code created by ss generator */ class PageWithImage extends Page implements RenderableAsPortlet { static $has_one = array( 'MainImage' => 'Image' ); // for rendering thumbnail when linked in facebook function getOGImage() { return...
<?php /** * Defines the SupportingProjectPage page type - initial code created by ss generator */ class PageWithImage extends Page implements RenderableAsPortlet { static $has_one = array( 'MainImage' => 'Image' ); // for rendering thumbnail when linked in facebook function getOGImage() { return...
Convert yaml to json config
<?php function handleGitHubPushEvent($payload) { $config = getUserConfig($payload['repository']['full_name'].'/'.$payload['commits'][0]['id']); } function getUserConfig($commitpath) { $defaultconfig = Config::get('userconfig'); $file = file_get_contents("https://raw.githubusercontent.com/".$commitpath."/.re...
<?php function handleGitHubPushEvent($payload) { $config = getUserConfig($payload['repository']['full_name'].'/'.$payload['commits'][0]['id']); } function getUserConfig($commitpath) { $defaultconfig = Config::get('userconfig'); $config = yaml_parse_url("https://raw.githubusercontent.com/".$commitpath."/.red...
Fix test for python 3
# -*- coding: utf-8 -*- import pytest import odin class MultiPartResource(odin.Resource): id = odin.IntegerField() code = odin.StringField() two_parts = odin.MultiPartField(('id', 'code'), separator=':') class TestFields(object): def test_multipartfield__get_value(self): target = MultiPartRe...
# -*- coding: utf-8 -*- import pytest import odin class MultiPartResource(odin.Resource): id = odin.IntegerField() code = odin.StringField() two_parts = odin.MultiPartField(('id', 'code'), separator=':') class TestFields(object): def test_multipartfield__get_value(self): target = MultiPartRe...
Remove explicit path from load_dotenv call
#! /usr/bin/env python3.6 # coding: utf-8 import os import datetime as dt from pathlib import Path import pytz from dotenv import load_dotenv load_dotenv() slack_verification_token = os.environ["slack_verification_token"] slack_bot_user_token = os.environ["slack_bot_user_token"] bot_id = os.environ["bot_id"] bot_na...
#! /usr/bin/env python3.6 # coding: utf-8 import os import datetime as dt from pathlib import Path import pytz from dotenv import load_dotenv env_path = Path('.') / '.env' load_dotenv(dotenv_path=env_path) slack_verification_token = os.environ["slack_verification_token"] slack_bot_user_token = os.environ["slack_bot...
fix(backend): Fix for observing game by guest.
<?php /** * Created by PhpStorm. * User: stas * Date: 12.02.16 * Time: 21:13 */ namespace CoreBundle\Model\Request\Game; use CoreBundle\Model\Request\SecurityRequestAwareTrait; use CoreBundle\Model\Request\SecurityRequestInterface; use JMS\Serializer\Annotation as JMS; use Symfony\Component\Validator\Constraints...
<?php /** * Created by PhpStorm. * User: stas * Date: 12.02.16 * Time: 21:13 */ namespace CoreBundle\Model\Request\Game; use CoreBundle\Model\Request\SecurityRequestAwareTrait; use CoreBundle\Model\Request\SecurityRequestInterface; use JMS\Serializer\Annotation as JMS; use Symfony\Component\Validator\Constraints...
Switch two instances of string[n] to string.charAt(n) for IE 7 compatibility.
/* * To Title Case 2.0 – http://individed.com/code/to-title-case/ * Copyright © 2008–2012 David Gouch. Licensed under the MIT License. */ String.prototype.toTitleCase = function () { var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i; return this.replace(/([^\W_]+[^\s-]*) ...
/* * To Title Case 2.0 – http://individed.com/code/to-title-case/ * Copyright © 2008–2012 David Gouch. Licensed under the MIT License. */ String.prototype.toTitleCase = function () { var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i; return this.replace(/([^\W_]+[^\s-]*) ...
Fix config sync handling not using client task scheduler
package info.tehnut.xtones.network; import info.tehnut.xtones.client.XtonesClient; import net.minecraft.client.Minecraft; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.Me...
package info.tehnut.xtones.network; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import org.checke...
Enable babel plugin in eslint
// Licensed under the Apache License, Version 2.0 (the “License”); you may not // use this file except in compliance with the License. You may obtain a copy of // the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed unde...
// Licensed under the Apache License, Version 2.0 (the “License”); you may not // use this file except in compliance with the License. You may obtain a copy of // the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed unde...
Change publicPath from /dist/ to /
const path = require('path') const webpack = require('webpack') const WebpackMd5Hash = require('webpack-md5-hash') const ExtractTextPlugin = require('extract-text-webpack-plugin') module.exports = { output: { path: path.resolve(__dirname, '../dist'), filename: '[name].[chunkhash:6].js', publicPath: '/', ...
const path = require('path') const webpack = require('webpack') const WebpackMd5Hash = require('webpack-md5-hash') const ExtractTextPlugin = require('extract-text-webpack-plugin') module.exports = { output: { path: path.resolve(__dirname, '../dist'), filename: '[name].[chunkhash:6].js', publicPath: '/dis...
Fix editor mock when text is really long
pw.component.register('content-editor-plaintext', function (view, config) { var self = this; var mock = document.createElement('DIV'); mock.classList.add('console-content-plaintext-mock') mock.style.position = 'absolute'; mock.style.right = '-100px'; mock.style.opacity = '0'; mock.style.width = view.node...
pw.component.register('content-editor-plaintext', function (view, config) { var self = this; var mock = document.createElement('DIV'); mock.classList.add('console-content-plaintext-mock') mock.style.position = 'absolute'; mock.style.top = '-100px'; mock.style.opacity = '0'; mock.style.width = view.node.c...
Add a main function with command line arguments Now able to generate wave files from command line
############# # ECE 612 Spring 2017 # Joe Parrish # # Use the same logic from SpectrumTester.py to generate multiple sine waves # but write that output to a .wav file for file based testing of the project code ############# import wave import argparse import numpy as np def generate_sample_file(test_freqs, test_amps...
############# # ECE 612 Spring 2017 # Joe Parrish # # Use the same logic from SpectrumTester.py to generate multiple sine waves # but write that output to a .wav file for file based testing of the project code ############# import wave import numpy as np def generate_sample_file(test_freqs, test_amps, chunk=4096, sa...
Switch extra-views to lower version for now
#!/usr/bin/env python import os from setuptools import setup, find_packages setup( name='django-oscar-stores', version=":versiontools:stores:", url='https://github.com/tangentlabs/django-oscar-stores', author="Sebastian Vetter", author_email="sebastian.vetter@tangentsnowball.com.au", descriptio...
#!/usr/bin/env python import os from setuptools import setup, find_packages setup( name='django-oscar-stores', version=":versiontools:stores:", url='https://github.com/tangentlabs/django-oscar-stores', author="Sebastian Vetter", author_email="sebastian.vetter@tangentsnowball.com.au", descriptio...
Update app min width and min height
const fs = require('fs'); const electron = require('electron'); const { app } = electron; const { BrowserWindow } = electron; const dbExists = () => { const dbPath = '.config/db'; if (fs.existsSync(dbPath)) { return true; } return false; }; const createDatabase = () => { fs.mkdirSync('./.config'); co...
const fs = require('fs'); const electron = require('electron'); const { app } = electron; const { BrowserWindow } = electron; const dbExists = () => { const dbPath = '.config/db'; if (fs.existsSync(dbPath)) { return true; } return false; }; const createDatabase = () => { fs.mkdirSync('./.config'); co...
Fix nginx forwarding issue with remote address.
var config = require('./config'); var rdb = config.rdb; var rdbLogger = config.rdbLogger; module.exports = function statistics() { return function (req, res, next) { var ip = ''; if (req.headers['x-nginx-proxy'] == 'true') { ip = req.headers['x-real-ip']; } else { ip = req.connection.remoteAd...
var config = require('./config'); var rdb = config.rdb; var rdbLogger = config.rdbLogger; module.exports = function statistics() { return function (req, res, next) { rdb.sismember( 'stats:ip', req.connection.remoteAddress, function (err, reply) { if (err || typeof reply === 'undefined')...
Correct for None appearing in requirements list
#!/usr/bin/env python """ Install the packages you have listed in the requirements file you input as first argument. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import fileinput import subprocess from pip.req import parse_requirements ...
#!/usr/bin/env python """ Install the packages you have listed in the requirements file you input as first argument. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import fileinput import subprocess from pip.req import parse_requirements ...
Add automatic template render on Controller :D
<?php /* * (c) Smalte - 2012 ~ Until the end of the world... * * Julien Breux <julien@smalte.org> * Fabien Serny <fabien@smalte.org> * Grégoire Poulain <gregoire@smalte.org> * Alain Folletete <alain@smalte.org> * Raphaël Malié <raphael@smalte.org> * * Thanks a lot to our community! * * Read LICENCE file for...
<?php /* * (c) Smalte - 2012 ~ Until the end of the world... * * Julien Breux <julien@smalte.org> * Fabien Serny <fabien@smalte.org> * Grégoire Poulain <gregoire@smalte.org> * Alain Folletete <alain@smalte.org> * Raphaël Malié <raphael@smalte.org> * * Thanks a lot to our community! * * Read LICENCE file for...
Update to current Braintree Node library version
Package.describe({ name: 'patrickml:braintree', version: '1.0.4', // Brief, one-line summary of the package. summary: 'Complete Sync wrapper for Braintree Payments.', // URL to the Git repository containing the source code for this package. git: 'https://github.com/patrickml/braintree', // By default, Met...
Package.describe({ name: 'patrickml:braintree', version: '1.0.4', // Brief, one-line summary of the package. summary: 'Complete Sync wrapper for Braintree Payments.', // URL to the Git repository containing the source code for this package. git: 'https://github.com/patrickml/braintree', // By default, Met...
Handle empty response in help texts
package main import ( "text/template" ) var ( BANNER_TEMPLATE = template.Must(template.New("banner").Parse( `===================== goslow ==================== `)) CREATE_SITE_TEMPLATE = template.Must(template.New("create site").Parse( `Your personal goslow domain is {{ .Domain }} You can configure your domain...
package main import ( "text/template" ) var ( BANNER_TEMPLATE = template.Must(template.New("banner").Parse( `===================== goslow ==================== `)) CREATE_SITE_TEMPLATE = template.Must(template.New("create site").Parse( `Your personal goslow domain is {{ .Domain }} You can configure your domain...
Change pixelated platform repo name
var repos = {}; var labels = {}; var configurable = require('../lib/configurable'); function addRepo(name, key, label) { configurable.get(key) && (repos[name] = configurable.get(key)); configurable.get(key) && (labels[name] = (label || repos[name])); } configurable.setSilentMode(true); addRepo('user-agent', 'PX_U...
var repos = {}; var labels = {}; var configurable = require('../lib/configurable'); function addRepo(name, key, label) { configurable.get(key) && (repos[name] = configurable.get(key)); configurable.get(key) && (labels[name] = (label || repos[name])); } configurable.setSilentMode(true); addRepo('user-agent', 'PX_U...
Add plug-in name for welcome RBAC
package org.ligoj.app.resource.welcome; import java.util.Arrays; import java.util.List; import org.ligoj.app.api.FeaturePlugin; import org.ligoj.app.iam.model.DelegateOrg; import org.ligoj.app.model.DelegateNode; import org.ligoj.bootstrap.model.system.SystemAuthorization; import org.ligoj.bootstrap.model.system.Syst...
package org.ligoj.app.resource.welcome; import java.util.Arrays; import java.util.List; import org.ligoj.app.api.FeaturePlugin; import org.ligoj.app.iam.model.DelegateOrg; import org.ligoj.app.model.DelegateNode; import org.ligoj.bootstrap.model.system.SystemAuthorization; import org.ligoj.bootstrap.model.system.Syst...
Put loginwrapper inside main router
import React from 'react' import DefaultLayout from './DefaultLayout' import {Router, Route, NotFound, Redirect} from 'router:@sanity/base/router' import locationStore from 'datastore:@sanity/base/location' import SanityIntlProvider from 'component:@sanity/base/sanity-intl-provider' import LoginWrapper from 'component:...
import React from 'react' import DefaultLayout from './DefaultLayout' import {Router, Route, NotFound, Redirect} from 'router:@sanity/base/router' import locationStore from 'datastore:@sanity/base/location' import SanityIntlProvider from 'component:@sanity/base/sanity-intl-provider' class DefaultLayoutRouter extends R...
Add conditional to set 'module.exports'
(function() { var Color; chromato = function(x, y, z, m) { return new Color(x, y, z, m); }; if ((typeof module !== "undefined" && module !== null) && (module.exports != null)) { module.exports = chroma; } chromato.color = function(x, y, z, m) { return new Color(x, y, z, m); }; chromato.color = functio...
(function() { var Color; chromato = function(x, y, z, m) { return new Color(x, y, z, m); }; chromato.color = function(x, y, z, m) { return new Color(x, y, z, m); }; chromato.color = function(x, y, z, m) { return new Color(x, y, z, m); }; chromato.rgb = function(r, g, b, a) { return new Color(...
Fix issue where errors aren't being propagated.
function DeferredChain() { var self = this; this.chain = new Promise(function(accept, reject) { self._accept = accept; self._reject = reject; }); this.await = new Promise(function() { self._done = arguments[0]; self._error = arguments[1]; }); this.started = false; }; DeferredChain.prototyp...
function DeferredChain() { var self = this; this.chain = new Promise(function(accept, reject) { self._accept = accept; self._reject = reject; }); this.await = new Promise(function() { self._done = arguments[0]; }); this.started = false; }; DeferredChain.prototype.then = function(fn) { var se...
[IMP] Remove unneeded dependency on Inventory
# Copyright (C) 2019 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Product ISP', 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'summary': 'Assign ISPs to Products', 'author': 'Open Source Integrators, Odoo Community Association (OCA)', ...
# Copyright (C) 2019 - TODAY, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Product ISP', 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'summary': 'Assign ISPs to Products', 'author': 'Open Source Integrators, Odoo Community Association (OCA)', ...
Fix hunters name (my fault)
import React, { Component } from 'react' import styled from 'styled-components' const FooterWrapper = styled.div` display: flex; justify-content: center; align-items: center; height: 10vh; font-size: 0.85em; background: ${props => props.theme.colors.background}; color: ${props => props.theme.colors.barTe...
import React, { Component } from 'react' import styled from 'styled-components' const FooterWrapper = styled.div` display: flex; justify-content: center; align-items: center; height: 10vh; font-size: 0.85em; background: ${props => props.theme.colors.background}; color: ${props => props.theme.colors.barTe...
Add more logging data in Send.
// // Copyright © 2011 Guy M. Allard // // 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...
// // Copyright © 2011 Guy M. Allard // // 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...
Exclude preprints from queryset from account/register in the admin app.
from __future__ import absolute_import from django import forms from django.db.models import Q from django.contrib.auth.models import Group from osf.models import AdminProfile class LoginForm(forms.Form): email = forms.CharField(label=u'Email', required=True) password = forms.CharField( label=u'Pass...
from __future__ import absolute_import from django import forms from django.contrib.auth.models import Group from osf.models import AdminProfile class LoginForm(forms.Form): email = forms.CharField(label=u'Email', required=True) password = forms.CharField( label=u'Password', widget=forms.Pas...
Fix test. AS_PATH_LIST should return empty list not null.
package com.jayway.jsonpath; import com.jayway.jsonpath.spi.json.JacksonJsonProvider; import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider; import org.assertj.core.api.Assertions; import org.junit.Test; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.A...
package com.jayway.jsonpath; import com.jayway.jsonpath.spi.json.JacksonJsonProvider; import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider; import org.junit.Test; import static org.junit.Assert.assertNull; public class TestSuppressExceptions { @Test public void testSuppressExceptionsIsRespected() { ...
Drop configured annotator store uri
from django.conf import settings __version_info__ = (1, 2, 0, 'dev') # Dot-connect all but the last. Last is dash-connected if not None. __version__ = '.'.join([str(i) for i in __version_info__[:-1]]) if __version_info__[-1] is not None: __version__ += ('-%s' % (__version_info__[-1],)) # context processor to a...
from django.conf import settings __version_info__ = (1, 2, 0, 'dev') # Dot-connect all but the last. Last is dash-connected if not None. __version__ = '.'.join([str(i) for i in __version_info__[:-1]]) if __version_info__[-1] is not None: __version__ += ('-%s' % (__version_info__[-1],)) # context processor to a...
Increase maxBuffer to 10MB when compiling using native compiler
const { execSync } = require("child_process"); const LoadingStrategy = require("./LoadingStrategy"); const VersionRange = require("./VersionRange"); class Native extends LoadingStrategy { load() { const versionString = this.validateAndGetSolcVersion(); const command = "solc --standard-json"; const maxBuf...
const { execSync } = require("child_process"); const LoadingStrategy = require("./LoadingStrategy"); const VersionRange = require("./VersionRange"); class Native extends LoadingStrategy { load() { const versionString = this.validateAndGetSolcVersion(); const command = "solc --standard-json"; try { ...
Add abstract getObserverClass() and use it for dynamic updateMethods() invocation OPEN - task 33: Problem with EntityModelObserver architecture http://github.com/DevOpsDistilled/OpERP/issues/issue/33 updateMethods() are methods in EntityObservers like "updateItems(List)"
package devopsdistilled.operp.client.abstracts; import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.LinkedList; import java.util.List; import devopsdistilled.operp.server.data.entity.Entiti; import devopsdistilled.operp.server.data.service...
package devopsdistilled.operp.client.abstracts; import java.io.Serializable; import java.util.LinkedList; import java.util.List; import devopsdistilled.operp.server.data.entity.Entiti; import devopsdistilled.operp.server.data.service.EntityService; public abstract class AbstractEntityModel<E extends Entiti, ES exten...
Revert "Nix helpful admin login requirement" This reverts commit 684dc38622d6cbe70879fb900ce5d73146a0cb40. We can put it back in because we're going to stick with LDAP basic auth.
from django.conf import settings from django.conf.urls.defaults import patterns, include from django.contrib.auth.decorators import login_required from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.http import HttpResponse from funfactory.monkeypatches import patch patch() from django.con...
from django.conf import settings from django.conf.urls.defaults import patterns, include from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.http import HttpResponse from funfactory.monkeypatches import patch patch() from django.contrib import admin from adminplus import AdminSitePlus adm...
Fix missing call to display.setup()
import infrastructure import display import traceables import matrix import graph # ========================================================================== # Setup and register extension def setup(app): # Perform import within this function to avoid an import circle. from sphinxcontrib impor...
import infrastructure import display import traceables import matrix import graph # ========================================================================== # Setup and register extension def setup(app): # Perform import within this function to avoid an import circle. from sphinxcontrib impor...
Move logic for creating RunProcessError to ExecutionResult.to_error
def result(return_code, output, stderr_output, allow_error=False): result = ExecutionResult(return_code, output, stderr_output) if allow_error or return_code == 0: return result else: raise result.to_error() class RunProcessError(RuntimeError): def __init__(self, return_code, output, s...
def result(return_code, output, stderr_output, allow_error=False): if allow_error or return_code == 0: return ExecutionResult(return_code, output, stderr_output) else: raise RunProcessError(return_code, output, stderr_output) class RunProcessError(RuntimeError): def __init__(self, return_c...
Fix hover state strapi link Signed-off-by: soupette <0a59f0508aa203bc732745954131d022d9f538a9@gmail.com>
/** * * LeftMenuFooter * */ import React from 'react'; import { PropTypes } from 'prop-types'; import Wrapper, { A } from './Wrapper'; function LeftMenuFooter({ version }) { // PROJECT_TYPE is an env variable defined in the webpack config // eslint-disable-next-line no-undef const projectType = PROJECT_TYPE...
/** * * LeftMenuFooter * */ import React from 'react'; import { PropTypes } from 'prop-types'; import Wrapper, { A } from './Wrapper'; function LeftMenuFooter({ version }) { // PROJECT_TYPE is an env variable defined in the webpack config // eslint-disable-next-line no-undef const projectType = PROJECT_TYPE...
Delete test file after creation
package org.sejda.core.support.prefix.processor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import org.junit.Test; import org.sejda.core.support.prefix.model.NameGenerationRequest; public class TextPrefixProcessorTest { ...
package org.sejda.core.support.prefix.processor; import org.junit.Test; import org.sejda.core.support.prefix.model.NameGenerationRequest; import java.io.File; import java.io.IOException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class TextPrefixProcessorTest { ...
Fix missing blog post images
// Highlight active navigation menu item (function() { var fullPath = window.location.pathname.substring(1); var parentPath = fullPath.split('/')[0]; var path = fullPath.replace(/\//g, ''); if (path) { if (/404/.test(path) || /success/.test(path)) { return; } // For blog post pages. if (...
// Highlight active navigation menu item (function() { var fullPath = window.location.pathname.substring(1); var parentPath = fullPath.split('/')[0]; var path = fullPath.replace(/\//g, ''); if (path) { if (/404/.test(path) || /success/.test(path)) { return; } // For blog post pages. if (...
examples: Allow to specify role name on commandline
#!/usr/bin/env python import sys, os, json, logging sys.path.append(os.path.abspath(".")) import gevent import msgflo class Repeat(msgflo.Participant): def __init__(self, role): d = { 'component': 'PythonRepeat', 'label': 'Repeat input data without change', } msgflo.Participant.__init__(sel...
#!/usr/bin/env python import sys, os, json, logging sys.path.append(os.path.abspath(".")) import gevent import msgflo class Repeat(msgflo.Participant): def __init__(self, role): d = { 'component': 'PythonRepeat', 'label': 'Repeat input data without change', } msgflo.Participant.__init__(sel...
Fix Race Condition in TestXfrmMonitorExpire
// +build linux package netlink import ( "testing" "github.com/vishvananda/netlink/nl" ) func TestXfrmMonitorExpire(t *testing.T) { defer setUpNetlinkTest(t)() ch := make(chan XfrmMsg) done := make(chan struct{}) defer close(done) errChan := make(chan error) if err := XfrmMonitor(ch, nil, errChan, nl.XFRM_...
// +build linux package netlink import ( "testing" "github.com/vishvananda/netlink/nl" ) func TestXfrmMonitorExpire(t *testing.T) { defer setUpNetlinkTest(t)() ch := make(chan XfrmMsg) done := make(chan struct{}) defer close(done) errChan := make(chan error) if err := XfrmMonitor(ch, nil, errChan, nl.XFRM_...
Fix gold hoe charge level.
package joshie.harvest.api.core; import net.minecraft.item.ItemStack; /** Items that implement this interface are associated with a certain * ToolTier, this can affect various things **/ public interface ITiered { /** Returns the rating of this item. Values returned should * between 1-100% * * ...
package joshie.harvest.api.core; import net.minecraft.item.ItemStack; /** Items that implement this interface are associated with a certain * ToolTier, this can affect various things **/ public interface ITiered { /** Returns the rating of this item. Values returned should * between 1-100% * * ...
Fix latex build: make some unicode characters found in help work
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd())))) sys.path.insert(0, os.path.abspath(os.getcwd())) extensions = ['powerline_autodoc', 'sphinx.ext.t...
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd())))) sys.path.insert(0, os.path.abspath(os.getcwd())) extensions = ['powerline_autodoc', 'sphinx.ext.t...
Fix compile error in example
package com.emc.example.client; import java.io.DataInputStream; import java.io.IOException; import java.net.Socket; import com.emc.example.client.dummy.SensorData; import com.emc.example.client.dummy.SensorEvent; import com.emc.nautilus.streaming.Producer; import com.emc.nautilus.streaming.ProducerConfig; import com....
package com.emc.example.client; import java.io.DataInputStream; import java.io.IOException; import java.net.Socket; import com.emc.example.client.dummy.SensorData; import com.emc.example.client.dummy.SensorEvent; import com.emc.nautilus.streaming.Producer; import com.emc.nautilus.streaming.ProducerConfig; import com....
Replace LDAP enum with DB
/* * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. * * Copyright (c) 2014, Gluu */ package org.gluu.model; import java.util.HashMap; import java.util.Map; import org.gluu.persist.annotation.AttributeEnum; /** * Specify type of script location * * @aut...
/* * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. * * Copyright (c) 2014, Gluu */ package org.gluu.model; import java.util.HashMap; import java.util.Map; import org.gluu.persist.annotation.AttributeEnum; /** * Specify type of script location * * @aut...
Add json to from vdf scripts Signed-off-by: Stany MARCEL <3e139d47b96f775f4bc13af807cbc2ea7c67e72b@gmail.com>
#!/usr/bin/env python from distutils.core import setup, Extension uinput = Extension('libuinput', sources = ['src/uinput.c']) setup(name='python-steamcontroller', version='1.0', description='Steam Controller userland driver', author='Stany MARCEL', author_email='stanypub@gm...
#!/usr/bin/env python from distutils.core import setup, Extension uinput = Extension('libuinput', sources = ['src/uinput.c']) setup(name='python-steamcontroller', version='1.0', description='Steam Controller userland driver', author='Stany MARCEL', author_email='stanypub@gm...
Use the Spring Cloud Context version from jhipster-dependencies
/** * Copyright 2013-2018 the original author or authors from the JHipster project. * * This file is part of the JHipster project, see http://www.jhipster.tech/ * for more information. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Li...
/** * Copyright 2013-2018 the original author or authors from the JHipster project. * * This file is part of the JHipster project, see http://www.jhipster.tech/ * for more information. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Li...
Fix type in DataType test
<?php class DataTypeTest extends PHPUnit_Framework_TestCase { public function testAutoload() { $this->assertInstanceOf('DataType', new DataType); } public function testImportDataType() { $xml = new SimpleXMLElement(' <DataType dtName="Test" dtHandle="test"/> '); $DataType = new DataType; $dataType = ...
<?php class DataTypeTest extends PHPUnit_Framework_TestCase { public function testAutoload() { $this->assertInstanceOf('DataType', new DataType); } public function testImportDataType() { $xml = new SimpleXMLElement(' <DataType dtName="Test" dtHandle="test"/> '); $DataType = new DataType; $dataType = ...
Allow <br /> and <p> in descriptions
import bleach DESCR_ALLOWED_TAGS = bleach.ALLOWED_TAGS + ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'br', 'p'] USER_DESCR_ALLOWED_TAGS = bleach.ALLOWED_TAGS + ['h2', 'h3', 'h4', 'h5', 'h6', 'br', 'p'] def clean_for_user_description(html): """ Removes dangerous tags, including h1. """ return bleach.clean(h...
import bleach DESCR_ALLOWED_TAGS = bleach.ALLOWED_TAGS + ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] USER_DESCR_ALLOWED_TAGS = bleach.ALLOWED_TAGS + ['h2', 'h3', 'h4', 'h5', 'h6'] def clean_for_user_description(html): """ Removes dangerous tags, including h1. """ return bleach.clean(html, tags=USER_DESCR_A...
Use protractor sauceBuild parameter to mass the build number to Sauce
var fs = require('fs'); var specs = JSON.parse(fs.readFileSync('tests/end2end/specs.json')); var browser_capabilities = JSON.parse(process.env.SELENIUM_BROWSER_CAPABILITIES); browser_capabilities['name'] = 'GlobaLeaks-E2E'; browser_capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER; browser_capabilities...
var fs = require('fs'); var specs = JSON.parse(fs.readFileSync('tests/end2end/specs.json')); var browser_capabilities = JSON.parse(process.env.SELENIUM_BROWSER_CAPABILITIES); browser_capabilities['name'] = 'GlobaLeaks-E2E'; browser_capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER; browser_capabilities...
Raise a more useful error for circular deps.
from spyc.graph import Vertex, find_cycle, topological_sort class CircularDependency(Exception): pass class Scheduler(object): def __init__(self): self.specs = {} def ensure(self, spec): """Require that ``spec`` is satisfied.""" if spec.key() in self.specs: self.spe...
from spyc.graph import Vertex, find_cycle, topological_sort class Scheduler(object): def __init__(self): self.specs = {} def ensure(self, spec): """Require that ``spec`` is satisfied.""" if spec.key() in self.specs: self.specs[spec.key()].data.merge(spec) else: ...