text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Use SGF loader if open file with unrecognized extension | const {extname} = require('path')
let sgf = require('./sgf')
let ngf = require('./ngf')
let gib = require('./gib')
let modules = {sgf, ngf, gib}
exports = module.exports = Object.assign({}, modules)
let extensions = Object.keys(modules).map(key => modules[key].meta)
let combinedExtensions = extensions.map(x => x.ex... | const {extname} = require('path')
let sgf = require('./sgf')
let ngf = require('./ngf')
let gib = require('./gib')
let modules = {sgf, ngf, gib}
exports = module.exports = modules
let extensions = Object.keys(modules).map(key => modules[key].meta)
let combinedExtensions = extensions.map(x => x.extensions)
.redu... |
Make more syntactically correct. No operational changes. | /**
* Copyright (c) 2012-2012 Malhar, Inc.
* All rights reserved.
*/
package com.malhartech.demos.performance;
import com.malhartech.api.ApplicationFactory;
import com.malhartech.api.DAG;
import org.apache.hadoop.conf.Configuration;
/**
* Example of application configuration in Java.<p>
*/
public class Applicati... | /**
* Copyright (c) 2012-2012 Malhar, Inc.
* All rights reserved.
*/
package com.malhartech.demos.performance;
import com.malhartech.api.ApplicationFactory;
import com.malhartech.api.DAG;
import org.apache.hadoop.conf.Configuration;
/**
* Example of application configuration in Java.<p>
*/
public class Applicati... |
Use the new system in test entity types | package info.u_team.u_team_test.init;
import info.u_team.u_team_core.util.registry.EntityTypeDeferredRegister;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.entity.BetterEnderPearlEntity;
import net.minecraft.entity.*;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge... | package info.u_team.u_team_test.init;
import info.u_team.u_team_core.util.registry.CommonDeferredRegister;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.entity.BetterEnderPearlEntity;
import net.minecraft.entity.*;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml... |
Use correct Script subtypes for init scripts. | /*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | /*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
Remove unneeded component import extension | import React, { Component } from 'react';
import Button from './components/Button';
export default class App extends Component {
constructor() {
super();
this.state = {
selectedRange: 'bar',
ranges: []
};
}
handleClick = (foo) => {
this.setState({selectedRange: foo});
};
render() {
... | import React, { Component } from 'react';
import Button from './components/Button.jsx';
export default class App extends Component {
constructor() {
super();
this.state = {
selectedRange: 'bar',
ranges: []
};
}
handleClick = (foo) => {
this.setState({selectedRange: foo});
};
render() ... |
Update test values. Trie no longer provides 2 of the answers. | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.... | from data import warehouse
from puzzle.examples.gph import a_basic_puzzle
from puzzle.problems import number_problem
from puzzle.puzzlepedia import prod_config
from spec.mamba import *
with _description('a_basic_puzzle'):
with before.all:
warehouse.save()
prod_config.init()
self.subject = a_basic_puzzle.... |
Add sorting to repair list | module.exports = function() {
console.log("Maintaining Structures... " + Game.getUsedCpu());
Object.keys(Game.structures).forEach(function(id) {
var structure = Game.getObjectById(id);
console.log(structure.structureType + " " + structure.hits + ":" + structure.hitsMax);
if(stru... | module.exports = function() {
console.log("Maintaining Structures... " + Game.getUsedCpu());
Object.keys(Game.structures).forEach(function(id) {
var structure = Game.getObjectById(id);
console.log(structure.structureType + " " + structure.hits + ":" + structure.hitsMax);
if(stru... |
Disable event dispatching for this test | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework;
use function count;
use PHPUnit\Event... | <?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework;
use function count;
use PHPUnit\TestF... |
[Tests] Test large number as response for check_answer |
import unittest
from units.trivia import check_answer
class TestCheckAnswer(unittest.TestCase):
def test_correct_answer(self):
self.assertTrue(check_answer("correct", "correct"))
def test_incorrect_answer(self):
self.assertFalse(check_answer("correct", "incorrect"))
def test_large_num... |
import unittest
from units.trivia import check_answer
class TestCheckAnswer(unittest.TestCase):
def test_correct_answer(self):
self.assertTrue(check_answer("correct", "correct"))
def test_incorrect_answer(self):
self.assertFalse(check_answer("correct", "incorrect"))
def test_parenthes... |
Fix pathnames issue in webpack | var webpack = require('webpack');
var precss = require('precss');
var autoprefixer = require('autoprefixer');
module.exports = {
entry: [
'./src/js/main.js'
],
module: {
loaders: [
{ test: /\.css$/, loader: 'style-loader!css-loader!postcss-loader' },
{
test: /\.js$/,
exclude: ... | var webpack = require('webpack');
var precss = require('precss');
var autoprefixer = require('autoprefixer');
module.exports = {
entry: [
'./src/js/main.js'
],
module: {
loaders: [
{ test: /\.css$/, loader: 'style-loader!css-loader!postcss-loader' },
{
test: /\.js$/,
exclude: ... |
Include kafka-check, bump to v0.2.6 | from setuptools import setup
from setuptools import find_packages
from yelp_kafka_tool import __version__
setup(
name="yelp-kafka-tool",
version=__version__,
author="Distributed systems team",
author_email="team-dist-sys@yelp.com",
description="Kafka management tools",
packages=find_packages(... | from setuptools import setup
from setuptools import find_packages
from yelp_kafka_tool import __version__
setup(
name="yelp-kafka-tool",
version=__version__,
author="Distributed systems team",
author_email="team-dist-sys@yelp.com",
description="Kafka management tools",
packages=find_packages(... |
Test case compatibility with Webpack 4.3+ | var SriPlugin = require('webpack-subresource-integrity');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var createExtractTextLoader = require('../utils').createExtractTextLoader;
var webpackVersionMajMin = require('webpack/package.json')
.versi... | var SriPlugin = require('webpack-subresource-integrity');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var createExtractTextLoader = require('../utils').createExtractTextLoader;
var webpackVersion = Number(
require('webpack/package.json').vers... |
Fix to integratie with Homi's laravel integration | <?php
namespace Magister\Services\Http;
use GuzzleHttp\Client;
use Magister\Services\Support\ServiceProvider;
use GuzzleHttp\Subscriber\Cache\CacheSubscriber;
/**
* Class HttpServiceProvider.
*/
class HttpServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @re... | <?php
namespace Magister\Services\Http;
use GuzzleHttp\Client;
use Magister\Services\Support\ServiceProvider;
use GuzzleHttp\Subscriber\Cache\CacheSubscriber;
/**
* Class HttpServiceProvider.
*/
class HttpServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @re... |
Fix for issue with presence input name | <?php
namespace Rhubarb\Scaffolds\Communications\Leaves\CommunicationItem;
use Rhubarb\Leaf\Controls\Common\Checkbox\CheckboxView;
class CommunicationItemCollectionCheckboxView extends CheckboxView
{
protected function printViewContent()
{
?>
<label class="switch">
<?php
... | <?php
namespace Rhubarb\Scaffolds\Communications\Leaves\CommunicationItem;
use Rhubarb\Leaf\Controls\Common\Checkbox\CheckboxView;
class CommunicationItemCollectionCheckboxView extends CheckboxView
{
protected function printViewContent()
{
?>
<label class="switch">
<?php
... |
Simplify 'go' for string identifiers | // 404 page using mapbox to show cities around the world.
// Helper to generate the kind of coordinate pairs I'm using to store cities
function bounds() {
var center = map.getCenter();
return {lat: center.lat, lng: center.lng, zoom: map.getZoom()};
}
L.mapbox.accessToken = "pk.eyJ1IjoiY29udHJvdmVyc2lhbCIsImEiOiJ... | // 404 page using mapbox to show cities around the world.
// Helper to generate the kind of coordinate pairs I'm using to store cities
function bounds() {
var center = map.getCenter();
return {lat: center.lat, lng: center.lng, zoom: map.getZoom()};
}
L.mapbox.accessToken = "pk.eyJ1IjoiY29udHJvdmVyc2lhbCIsImEiOiJ... |
[PIXELS] Add original state to output
This will help show where we started from.
Tests:
- tested using cli directly | package com.bert.pixels;
import com.bert.pixels.models.Chamber;
import com.bert.pixels.view.TextVisualization;
import java.util.ArrayList;
import java.util.List;
/**
* Entry point to solve the pixel exercise
*/
public class Animation {
private final static int MAX_SIZE = 10;
public static void main(String[] ... | package com.bert.pixels;
import com.bert.pixels.models.Chamber;
import com.bert.pixels.view.TextVisualization;
import java.util.ArrayList;
import java.util.List;
/**
* Entry point to solve the pixel exercise
*/
public class Animation {
private final static int MAX_SIZE = 10;
public static void main(String[] ... |
Use variadic args in main method | /*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,... | /*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,... |
Fix closing of multiplexed table writer to close all constituent table writers in presence of exceptions | package org.grouplens.lenskit.util.tablewriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MultiplexedTableWriter implements TableWriter {
private TableLayout layout;
private List<TableWriter> writers;
public MultiplexedTableWriter(TableL... | package org.grouplens.lenskit.util.tablewriter;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import org.grouplens.lenskit.eval.util.table.TableImpl;
public class MultiplexedTableWriter implements TableWriter {
private TableLayout layout;
private List<TableWriter> writers;
public ... |
Install enum34 if not provided | from setuptools import setup, find_packages
import re
VERSIONFILE = "openomni/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." ... | from setuptools import setup, find_packages
import re
VERSIONFILE = "openomni/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." ... |
Add optional timeout argument to probe
Popen.communicate() supports a timeout argument which is useful in case
there is a risk that the probe hangs. | import json
import subprocess
from ._run import Error
from ._utils import convert_kwargs_to_cmd_line_args
def probe(filename, cmd='ffprobe', timeout=None, **kwargs):
"""Run ffprobe on the specified file and return a JSON representation of the output.
Raises:
:class:`ffmpeg.Error`: if ffprobe returns ... | import json
import subprocess
from ._run import Error
from ._utils import convert_kwargs_to_cmd_line_args
def probe(filename, cmd='ffprobe', **kwargs):
"""Run ffprobe on the specified file and return a JSON representation of the output.
Raises:
:class:`ffmpeg.Error`: if ffprobe returns a non-zero exi... |
Handle updated boto exception format.
See https://github.com/boto/boto/issues/625 | # -*- coding: utf-8 -*-
"""
This module contains the set of Dynochemy's exceptions
:copyright: (c) 2012 by Rhett Garber.
:license: ISC, see LICENSE for more details.
"""
import json
class Error(Exception):
"""This is an ambiguous error that occured."""
pass
class SyncUnallowedError(Error): pass
class Dup... | # -*- coding: utf-8 -*-
"""
This module contains the set of Dynochemy's exceptions
:copyright: (c) 2012 by Rhett Garber.
:license: ISC, see LICENSE for more details.
"""
import json
class Error(Exception):
"""This is an ambiguous error that occured."""
pass
class SyncUnallowedError(Error): pass
class Dup... |
Make path to server more TS friendly by removing strict file type | 'use strict';
const path = require('path');
const fs = require('fs');
const nodePaths = (process.env.NODE_PATH || '')
.split(process.platform === 'win32' ? ';' : ':')
.filter(Boolean)
.filter(folder => !path.isAbsolute(folder))
.map(resolveApp);
function ensureSlash(path, needsSlash) {
const hasSlash = pat... | 'use strict';
const path = require('path');
const fs = require('fs');
const nodePaths = (process.env.NODE_PATH || '')
.split(process.platform === 'win32' ? ';' : ':')
.filter(Boolean)
.filter(folder => !path.isAbsolute(folder))
.map(resolveApp);
function ensureSlash(path, needsSlash) {
const hasSlash = pat... |
Check `o.name` docstring ("doc:" was omitted from comment test) | Date; //doc: Creates JavaScript Date instances which let you work with dates and times.
new Date; //doc: Creates JavaScript Date instances which let you work with dates and times.
var myalias = Date;
myalias; //doc: Creates JavaScript Date instances which let you work with dates and times.
// This is variable foo.
v... | Date; //doc: Creates JavaScript Date instances which let you work with dates and times.
new Date; //doc: Creates JavaScript Date instances which let you work with dates and times.
var myalias = Date;
myalias; //doc: Creates JavaScript Date instances which let you work with dates and times.
// This is variable foo.
v... |
Add test for context manager | import pytest
import aiohttp
from aiohttp import web
@pytest.mark.run_loop
async def test_await(create_server, loop):
async def handler(request):
return web.HTTPOk()
app, url = await create_server()
app.router.add_route('GET', '/', handler)
resp = await aiohttp.get(url+'/', loop=loop)
a... | import pytest
import aiohttp
from aiohttp import web
@pytest.mark.run_loop
async def test_await(create_server, loop):
async def handler(request):
return web.HTTPOk()
app, url = await create_server()
app.router.add_route('GET', '/', handler)
resp = await aiohttp.get(url+'/', loop=loop)
a... |
Make the package installable with python3 | # -*- coding: utf-8 -*-
from pathlib import Path
from setuptools import setup, find_packages
install_requires = [
'pytz',
'requests',
'lxml',
'python-dateutil',
'parsedatetime',
'cached-property',
'click',
'enum34', # backported versions from Python3
'pathlib',
'configparser'... | # -*- coding: utf-8 -*-
import sys
if sys.version_info[0] != 2:
sys.exit("Sorry, Python 3 is not supported yet")
from setuptools import setup, find_packages
install_requires = [
'pytz',
'requests',
'lxml',
'python-dateutil',
'parsedatetime',
'cached-property',
'click',
'enum34', ... |
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;
use lxmpd;
class SongChangedEventListener
{
/**
* Create the event listener.
*
* @return void
*/
public function __cons... | <?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()
... |
Switch to go-yaml library from candiedyaml
[#126429343] | package config
import (
"io/ioutil"
"gopkg.in/yaml.v2"
)
type RoutingAPIConfig struct {
URI string `yaml:"uri"`
Port int `yaml:"port"`
AuthDisabled bool `yaml:"auth_disabled"`
}
type OAuthConfig struct {
TokenEndpoint string `yaml:"token_endpoint"`
Port int `yaml:"po... | package config
import (
"io/ioutil"
"github.com/cloudfoundry-incubator/candiedyaml"
)
type RoutingAPIConfig struct {
URI string `yaml:"uri"`
Port int `yaml:"port"`
AuthDisabled bool `yaml:"auth_disabled"`
}
type OAuthConfig struct {
TokenEndpoint string `yaml:"token_endpoint"`
Port ... |
Fix Event class instance variables | class Event:
def __init__(self, source, event, data=None):
self.source = source
self.event = event
self.data = data
SOURCE_OTHER = 0
SOURCE_GUI = 1
SOURCE_RUBIK = 2
SOURCE_SIMON = 3
SOURCE_GEARS = 4
EVENT_DEFAULT = 0
EVENT_BUTTON1 = 1
EVENT_BUTTON2 = 2
EVENT_BUTTON3 = 3
EVENT_BUTTON4 = 4
... | class Event:
source = None
event = None
data = None
def __init__(self, source, event, data=None):
self.source = source
self.event = event
self.data = data
SOURCE_OTHER = 0
SOURCE_GUI = 1
SOURCE_RUBIK = 2
SOURCE_SIMON = 3
SOURCE_GEARS = 4
EVENT_DEFAULT = 0
EVENT_BUTTON1 = 1
EV... |
Add twitter email on twitter package | Twitter = {};
var urls = {
requestToken: "https://api.twitter.com/oauth/request_token",
authorize: "https://api.twitter.com/oauth/authorize",
accessToken: "https://api.twitter.com/oauth/access_token",
authenticate: "https://api.twitter.com/oauth/authenticate"
};
// https://dev.twitter.com/docs/api/1.1/get/ac... | Twitter = {};
var urls = {
requestToken: "https://api.twitter.com/oauth/request_token",
authorize: "https://api.twitter.com/oauth/authorize",
accessToken: "https://api.twitter.com/oauth/access_token",
authenticate: "https://api.twitter.com/oauth/authenticate"
};
// https://dev.twitter.com/docs/api/1.1/get/ac... |
[http] Unify criteria for split name
Add missing Etag from zendframework/zf2#5302 c22ec11bf67f7d3f36edcd824ecdb26960c789d5 | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ... | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ... |
Add six module as require package
The six module is imported at `values.py` | from setuptools import setup, find_packages
# Dynamically calculate the version based on dbsettings.VERSION
version_tuple = (0, 7, None)
if version_tuple[2] is not None:
if type(version_tuple[2]) == int:
version = "%d.%d.%s" % version_tuple
else:
version = "%d.%d_%s" % version_tuple
else:
v... | from setuptools import setup, find_packages
# Dynamically calculate the version based on dbsettings.VERSION
version_tuple = (0, 7, None)
if version_tuple[2] is not None:
if type(version_tuple[2]) == int:
version = "%d.%d.%s" % version_tuple
else:
version = "%d.%d_%s" % version_tuple
else:
v... |
8: Create documentation of DataSource Settings
Task-Url: http://github.com/stoeps13/ibmcnx2/issues/issue/8 | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... | ######
# Check ExId (GUID) by Email through JDBC
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# Check ExId of a User in all Connections Appli... |
Use join for serializing words and lemmas to avoid printing last ; as required by ATF format. Print also references, notes and links. | from mako.template import Template
class Line(object):
template = Template("""\n${label}.\t\\
${' '.join(words)}\\
% if references:
% for reference in references:
^${reference}^
% endfor
% endif
% if lemmas:
\n#lem:\\
${'; '.join(lemmas)}\\
% endif
% if notes:
\n
% for note in notes:
${note.serialize()}
% endfor
... | from mako.template import Template
class Line(object):
template = Template("""${label}. \\
% for word in words:
${word} \\
% endfor
% if lemmas:
\n#lem: \\
% for lemma in lemmas:
${lemma}; \\
% endfor \n
%endif
""", output_encoding='utf-8')
def __init__(self, label):
self.label = label
self.... |
Prepare kill test for mock - use hyperspeed | # Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from __future__ import print_function
import sys, os, signal, time, subprocess32
sys.path.append('../../..')
from jenkinsflow.mocked import hyperspeed
def _killer(pid, sleep_time... | # Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from __future__ import print_function
import sys, os, signal, time, subprocess32
def _killer(pid, sleep_time, num_kills):
print("\nKiller going to sleep for", sleep_time, "sec... |
Clear the screen before drawing | package bobby;
import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
import javax.swing.JApplet;
/**
*
* @author Kiarash Korki <kiarash96@users.sf.net>
*/
public class SceneManager extends Thread {
private final JApplet parent;
private ArrayList<SceneObject> list;
publ... | package bobby;
import java.awt.Graphics;
import java.util.ArrayList;
import javax.swing.JApplet;
/**
*
* @author Kiarash Korki <kiarash96@users.sf.net>
*/
public class SceneManager extends Thread {
private final JApplet parent;
private ArrayList<SceneObject> list;
public SceneManager(JApplet ... |
Send triggered emails in the background | 'use strict';
var Promise = require('bluebird');
var Handlebars = require('handlebars');
var Notification = require('../../api/models/Notification');
var Users = require('../../api/collections/Users');
var users = new Users();
module.exports = function(router, resources) {
resources.actions.notify = function... | 'use strict';
var Promise = require('bluebird');
var Handlebars = require('handlebars');
var Notification = require('../../api/models/Notification');
var Users = require('../../api/collections/Users');
var users = new Users();
module.exports = function(router, resources) {
resources.actions.notify = function... |
Use get(), set(), unset() methods (with or w/o paths). | <?php
/**
* User: Alex Gusev <alex@flancer64.com>
*/
namespace Flancer32\Lib;
/**
* Access properties of the data object using accessors (getters & setters).
*
* @SuppressWarnings(PHPMD.CamelCaseMethodName)
*/
class DataT030AccessorsSimpleTest
extends \PHPUnit_Framework_TestCase
{
public function test_0... | <?php
/**
* User: Alex Gusev <alex@flancer64.com>
*/
namespace Flancer32\Lib;
/**
* Access properties of the data object using accessors (getters & setters).
*
* @SuppressWarnings(PHPMD.CamelCaseMethodName)
*/
class DataT030AccessorsSimpleTest
extends \PHPUnit_Framework_TestCase
{
public function test_0... |
Support for the exclude option | var Transform = require('broccoli-transform');
var RSVP = require('rsvp');
var requirejs = require('requirejs');
var mkdirp = require('mkdirp');
var fs = require('fs');
var path = require('path');
var _ = require('lodash');
function RequireJsFilter(inputTree, options) {
if (!(this instanceof RequireJsFilter)) {
... | var Transform = require('broccoli-transform');
var RSVP = require('rsvp');
var requirejs = require('requirejs');
var mkdirp = require('mkdirp');
var fs = require('fs');
var path = require('path');
var _ = require('lodash');
function RequireJsFilter(inputTree, options) {
if (!(this instanceof RequireJsFilter)) {
... |
Test on an Internet server |
// Constants
var constant = {};
constant.pageCount = 4;
constant.library = { // Canopé
name: "Canopé",
database: "http://laske.fr/tmp/torido/canope.php",
videos: "https://videos.reseau-canope.fr/download.php?file=lesfondamentaux/%id%_sd",
images: "https://www.reseau-canope.fr/lesfondamentaux/uploads/tx_cndpfond... |
// Constants
var constant = {};
constant.pageCount = 4;
constant.library = { // Canopé
name: "Canopé",
database: "http://localhost:81/torido/canope.php",
videos: "https://videos.reseau-canope.fr/download.php?file=lesfondamentaux/%id%_sd",
images: "https://www.reseau-canope.fr/lesfondamentaux/uploads/tx_cndpfond... |
Make ids BigInteger for postgres | from sqlalchemy import Column, BigInteger, String
from keybaseproofbot.database import Base
class Proof(Base):
__tablename__ = 'proofs'
user_id = Column(BigInteger, primary_key=True)
keybase_username = Column(String)
telegram_username = Column(String)
chat_id = Column(BigInteger)
message_id =... | from sqlalchemy import Column, Integer, String
from keybaseproofbot.database import Base
class Proof(Base):
__tablename__ = 'proofs'
user_id = Column(Integer, primary_key=True)
keybase_username = Column(String)
telegram_username = Column(String)
chat_id = Column(Integer)
message_id = Column(I... |
Fix bower config value for tests | var fs = require('fs'),
Libraries = require('../lib/libraries'),
should = require('should');
describe('Libraries', function() {
describe('#bowerLibraries', function() {
beforeEach(function() {
require('bower').config.directory = 'bower_components';
});
var readdirSync = fs.readdirSync,
... | var fs = require('fs'),
Libraries = require('../lib/libraries'),
should = require('should');
describe('Libraries', function() {
describe('#bowerLibraries', function() {
var readdirSync = fs.readdirSync,
statSync = fs.statSync,
context = {
event: {emit: function() {}}
};... |
Resolve path in case it involves a symlink
Reviewed By: ppwwyyxx
Differential Revision: D27823003
fbshipit-source-id: 67e6905f3c5c7bb1f593ee004160b195925f6d39 | # Copyright (c) Facebook, Inc. and its affiliates.
import importlib
from pathlib import Path
_PROJECTS = {
"point_rend": "PointRend",
"deeplab": "DeepLab",
"panoptic_deeplab": "Panoptic-DeepLab",
}
_PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent / "projects"
if _PROJECT_ROOT.is_dir():
# ... | # Copyright (c) Facebook, Inc. and its affiliates.
import importlib
from pathlib import Path
_PROJECTS = {
"point_rend": "PointRend",
"deeplab": "DeepLab",
"panoptic_deeplab": "Panoptic-DeepLab",
}
_PROJECT_ROOT = Path(__file__).parent.parent.parent / "projects"
if _PROJECT_ROOT.is_dir():
# This is tr... |
Change header and title classes | <?php
/**
* The template used for displaying page content in page.php
*
* @package Flacso
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="page-header">
<?php the_title( '<h1 class="page-title">', '</h1>' ); ?>
</header><!-- .page-header -->
<div class="entry-content">
<?p... | <?php
/**
* The template used for displaying page content in page.php
*
* @package Flacso
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<div class="entry-content">
... |
Replace SYS_IOCTL by cross platform version | // +build !windows
package gottyclient
import (
"encoding/json"
"fmt"
"golang.org/x/sys/unix"
"os"
"os/signal"
"syscall"
)
func notifySignalSIGWINCH(c chan<- os.Signal) {
signal.Notify(c, syscall.SIGWINCH)
}
func resetSignalSIGWINCH() {
signal.Reset(syscall.SIGWINCH)
}
func syscallTIOCGWINSZ() ([]byte, err... | // +build !windows
package gottyclient
import (
"encoding/json"
"fmt"
"os"
"os/signal"
"syscall"
"unsafe"
)
func notifySignalSIGWINCH(c chan<- os.Signal) {
signal.Notify(c, syscall.SIGWINCH)
}
func resetSignalSIGWINCH() {
signal.Reset(syscall.SIGWINCH)
}
func syscallTIOCGWINSZ() ([]byte, error) {
ws := wi... |
Return early from Submission.submit when already pending | 'use strict'
var Struct = require('observ-struct')
var Observ = require('observ')
var valueError = require('value-error')
var Event = require('weakmap-event')
var WeakError = require('weak-error')
module.exports = Submission
function Submission (data) {
data = data || {}
return Struct({
pending: Observ(data... | 'use strict'
var Struct = require('observ-struct')
var Observ = require('observ')
var valueError = require('value-error')
var Event = require('weakmap-event')
var WeakError = require('weak-error')
module.exports = Submission
function Submission (data) {
data = data || {}
return Struct({
pending: Observ(data... |
Fix typo in function name | import cozydb from 'cozydb';
import invariant from 'invariant';
import logger from 'debug';
import hasValue from '../hasValue';
const debug = logger('app:model:favorite_tag');
const FavoriteTag = cozydb.getModel('FavoriteTag', {
'label': String,
'application': String,
});
export default FavoriteTag;
Favorit... | import cozydb from 'cozydb';
import invariant from 'invariant';
import logger from 'debug';
import hasValue from '../hasValue';
const debug = logger('app:model:favorite_tag');
const FavoriteTag = cozydb.getModel('FavoriteTag', {
'label': String,
'application': String,
});
export default FavoriteTag;
Favorit... |
Use <label /> for a label | /*
* Localisation Manager
*
* @author: Nils Hörrmann, post@nilshoerrmann.de
* @source: http://github.com/symphonists/localisationmanager
*/
(function($) {
$(document).ready(function() {
// Language strings
Symphony.Language.add({
'Sort strings alphabetically': false
});
// Append sort option
var... | /*
* Localisation Manager
*
* @author: Nils Hörrmann, post@nilshoerrmann.de
* @source: http://github.com/symphonists/localisationmanager
*/
(function($) {
$(document).ready(function() {
// Language strings
Symphony.Language.add({
'Sort strings alphabetically': false
});
// Append sort option
var... |
Add stability annotation to ol.source.GeoJSON | goog.provide('ol.source.GeoJSON');
goog.require('ol.format.GeoJSON');
goog.require('ol.source.VectorFile');
/**
* @constructor
* @extends {ol.source.VectorFile}
* @param {olx.source.GeoJSONOptions=} opt_options Options.
* @todo stability experimental
*/
ol.source.GeoJSON = function(opt_options) {
var option... | goog.provide('ol.source.GeoJSON');
goog.require('ol.format.GeoJSON');
goog.require('ol.source.VectorFile');
/**
* @constructor
* @extends {ol.source.VectorFile}
* @param {olx.source.GeoJSONOptions=} opt_options Options.
*/
ol.source.GeoJSON = function(opt_options) {
var options = goog.isDef(opt_options) ? op... |
Use Carbon instead of DateTime | <?php
namespace HMS\Traits\Entities;
use Carbon\Carbon;
trait SoftDeletable
{
/**
* @var Carbon
*/
protected $deletedAt;
/**
* Sets deletedAt.
*
* @param Carbon|null $deletedAt
*
* @return $this
*/
public function setDeletedAt(Carbon $deletedAt = null)
{
... | <?php
namespace HMS\Traits\Entities;
trait SoftDeletable
{
/**
* @var \DateTime
*/
protected $deletedAt;
/**
* Sets deletedAt.
*
* @param \DateTime|null $deletedAt
*
* @return $this
*/
public function setDeletedAt(\DateTime $deletedAt = null)
{
$thi... |
Add client side stub to call dot-scripted module in the server. | /*******************************************************************************
* @license
* Copyright (c) 2012 VMware, Inc. All Rights Reserved.
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEP... | /*******************************************************************************
* @license
* Copyright (c) 2012 VMware, Inc. All Rights Reserved.
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEP... |
Remove old code in addFavorite | var Storage = require('FuseJS/Storage');
var data = 'favorites';
/* ...
-----------------------------------------------------------------------------*/
var addFavorite
, deleteFavorite
, getFavorites;
/* Functions
-----------------------------------------------------------------------------*/
addFavorite = functi... | var Storage = require('FuseJS/Storage');
var data = 'favorites';
/* ...
-----------------------------------------------------------------------------*/
var addFavorite
, deleteFavorite
, getFavorites;
/* Functions
-----------------------------------------------------------------------------*/
addFavorite = functi... |
Include sender address in completion log.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101358 91177308-0d34-0410-b5e6-96231b3b80d8 | #!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.argv) < 4:
print "completion_logger_server.py <listen address> <listen port> <log file>"
exit(1)
host = sys.argv[1]
port = int(sys.argv[2])
buf = 1024 * 8
addr = (host,port)
# Creat... | #!/usr/bin/env python
import sys
from socket import *
from time import localtime, strftime
def main():
if len(sys.argv) < 4:
print "completion_logger_server.py <listen address> <listen port> <log file>"
exit(1)
host = sys.argv[1]
port = int(sys.argv[2])
buf = 1024 * 8
addr = (host,port)
# Creat... |
Add a close class to the close button. | function overlay(name) {
var path = 'story/' + name + '.html';
var $overlay = $('#overlay').load(path, function() {
$overlay.show()
.append($('<span>Close</span>').attr({
'class': 'button close'
}).click(function() {
$overlay.hide();
})... | function overlay(name) {
var path = 'story/' + name + '.html';
var $overlay = $('#overlay').load(path, function() {
$overlay.show()
.append($('<span>Close</span>').attr({
'class': 'button'
}).click(function() {
$overlay.hide();
}));
... |
Add date/time created timestamp to Vote model |
from django.db import models
from django.contrib.auth.models import User
class Voter(models.Model):
'''
Models someone who may vote
'''
user = models.OneToOneField(User)
def __str__(self):
return self.user.username
class Flag(models.Model):
'''
Models a flag which may be voted o... |
from django.db import models
from django.contrib.auth.models import User
class Voter(models.Model):
'''
Models someone who may vote
'''
user = models.OneToOneField(User)
def __str__(self):
return self.user.username
class Flag(models.Model):
'''
Models a flag which may be voted o... |
BAP-16497: Change ClassLoader component
- test failing tests | <?php
namespace Oro\Bundle\TranslationBundle\Tests\Unit\Command\Stubs;
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class TestKernel extends Kernel
{
public function __construct()
{
parent::__cons... | <?php
namespace Oro\Bundle\TranslationBundle\Tests\Unit\Command\Stubs;
use Symfony\Component\ClassLoader\ClassLoader;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
class TestKernel extends Kernel
{
public function __construct()
{
parent::__construct('te... |
Tweak how request is generated for commandline.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php namespace Orchestra\Routing;
use Illuminate\Http\Request;
class RoutingServiceProvider extends \Illuminate\Routing\RoutingServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->registerRequestOnConsole();
pa... | <?php namespace Orchestra\Routing;
use Illuminate\Http\Request;
class RoutingServiceProvider extends \Illuminate\Routing\RoutingServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->registerRequestOnConsole();
pa... |
Disable integration test on Linux
See gh-19836 | /*
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | /*
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
Use routes from config object. | "use strict";
var View = require("./view");
var Router = require("./router");
var util = require("substance-util");
var _ = require("underscore");
// Substance.Application
// ==========================================================================
//
// Application abstraction suggesting strict MVC
var Application... | "use strict";
var View = require("./view");
var Router = require("./router");
var util = require("substance-util");
var _ = require("underscore");
// Substance.Application
// ==========================================================================
//
// Application abstraction suggesting strict MVC
var Application... |
Fix custom method options +
Allow callback to be passed to the submit method |
var api = require('@request/api')
module.exports = (client, provider, methods, config, transform) => {
return api(methods, {
api: function (name) {
this._options.api = name
return this
},
auth: function (arg1, arg2) {
var alias = (this._options.api || provider.api || '__default')
... |
var api = require('@request/api')
module.exports = (client, provider, methods, config, transform) => {
return api(methods, {
api: function (options, name) {
options.api = name
return this
},
auth: function (options, arg1, arg2) {
var alias = (options.api || provider.api || '__default'... |
Add rig_assets.json as package data. | version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for ... | version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for ... |
Fix message with 462 numeric | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.username = data["ident"]
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def process... | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.username = data["ident"]
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def process... |
Add link from conversations to message batches. | from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
start_date = model... | from django.db import models
from go.contacts.models import Contact
class Conversation(models.Model):
"""A conversation with an audience"""
user = models.ForeignKey('auth.User')
subject = models.CharField('Conversation Name', max_length=255)
message = models.TextField('Message')
start_date = model... |
Make TF2_BEHAVIOR=0 disable TF2 behavior.
Prior to this change, the mere presence of a TF2_BEHAVIOR
environment variable would enable TF2 behavior. With this,
setting that environment variable to "0" will disable it.
PiperOrigin-RevId: 223804383 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Fix token given story hrefs
Summary:
derp to tha derp
Fixes T2578.
Test Plan: click click
Reviewers: chad
Reviewed By: chad
CC: aran
Maniphest Tasks: T2578
Differential Revision: https://secure.phabricator.com/D5054 | <?php
final class PhabricatorTokenGivenFeedStory
extends PhabricatorFeedStory {
public function getPrimaryObjectPHID() {
return $this->getValue('objectPHID');
}
public function getRequiredHandlePHIDs() {
$phids = array();
$phids[] = $this->getValue('objectPHID');
$phids[] = $this->getValue('a... | <?php
final class PhabricatorTokenGivenFeedStory
extends PhabricatorFeedStory {
public function getPrimaryObjectPHID() {
return $this->getValue('objectPHID');
}
public function getRequiredHandlePHIDs() {
$phids = array();
$phids[] = $this->getValue('objectPHID');
$phids[] = $this->getValue('a... |
Revert "Add hypothesis as test requirement."
This reverts commit 7e340017f4bb0a8a99219f3896071ab07a017f4f. | from setuptools import setup, find_packages
import unittest
import doctest
# Read in the version number
exec(open('src/nash/version.py', 'r').read())
requirements = ["numpy==1.11.2"]
def test_suite():
"""Discover all tests in the tests dir"""
test_loader = unittest.TestLoader()
# Read in unit tests
t... | from setuptools import setup, find_packages
import unittest
import doctest
# Read in the version number
exec(open('src/nash/version.py', 'r').read())
requirements = ["numpy==1.11.2"]
test_requirements = ['hypothesis>=3.6.0']
def test_suite():
"""Discover all tests in the tests dir"""
test_loader = unittest.... |
Check for typeof string on cache hit | var xhr = require('xhr');
var defaults = require('lodash.defaults');
module.exports = function (options, callback) {
// Set default options
defaults(options, {
method: 'GET',
useCache: true,
json: {},
timeout: 60000 // 60 seconds
});
// Use URI and prepend the API host
if (typeof options.... | var xhr = require('xhr');
var defaults = require('lodash.defaults');
module.exports = function (options, callback) {
// Set default options
defaults(options, {
method: 'GET',
useCache: true,
json: {},
timeout: 60000 // 60 seconds
});
// Use URI and prepend the API host
if (typeof options.... |
Update jQuery and BS to latest version for tests | /**
* Jasmine test to check success callback
*/
describe('stan-loader-ok', function() {
// Declare status var
var status;
// Activate async
beforeEach(function(done) {
// Initiate $STAN loader using normal window load events
$STAN_Load([
'//code.jquery.com/jquery-1.11.2.min.js',
'//netdna.bootstrapcd... | /**
* Jasmine test to check success callback
*/
describe('stan-loader-ok', function() {
// Declare status var
var status;
// Activate async
beforeEach(function(done) {
// Initiate $STAN loader using normal window load events
$STAN_Load([
'//code.jquery.com/jquery-1.10.1.min.js',
'//netdna.bootstrapcd... |
Comment out buggy declation emitter | module.exports = {
entry: './src/confirm.ts',
output: {
path: './dist',
filename: 'angular2-bootstrap-confirm.js',
libraryTarget: 'umd',
library: 'ng2BootstrapConfirm'
},
externals: {
'angular2/core': {
root: ['ng', 'core'],
commonjs: 'angular2/core',
commonjs2: 'angular2/c... | module.exports = {
entry: './src/confirm.ts',
output: {
path: './dist',
filename: 'angular2-bootstrap-confirm.js',
libraryTarget: 'umd',
library: 'ng2BootstrapConfirm'
},
externals: {
'angular2/core': {
root: ['ng', 'core'],
commonjs: 'angular2/core',
commonjs2: 'angular2/c... |
Add check sub grid method | # Implement an algorithm that will check whether a given grid of numbers represents a valid Sudoku puzzle
def check_rows(grid):
i = 0
while i < len(grid):
j = 0
ref_check = {}
while j < len(grid[i]):
if grid[i][j] != '.' and grid[i][j] in ref_check:
return False
else:
ref_check[grid[i][j]] = 1
... | # Implement an algorithm that will check whether a given grid of numbers represents a valid Sudoku puzzle
def check_rows(grid):
i = 0
while i < len(grid):
j = 0
ref_check = {}
while j < len(grid[i]):
if grid[i][j] != '.' and grid[i][j] in ref_check:
return False
else:
ref_check[grid[i][j]] = 1
... |
Fix bug where load was being called on null. | <?php
namespace App\Http\ViewComposers;
use Illuminate\Contracts\View\View;
class NotificationsComposer
{
/**
* Binds the relevant notification information to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
if (auth()->check()) {
... | <?php
namespace App\Http\ViewComposers;
use Illuminate\Contracts\View\View;
class NotificationsComposer
{
/**
* Binds the relevant notification information to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$user = \Auth::user()->lo... |
Fix an issue where some versions of php need the $path property to be converted to a string. | <?php
namespace Swiftmade\Blogdown\Commands;
use Swiftmade\Blogdown\Parser;
use Illuminate\Console\Command;
use Swiftmade\Blogdown\Repository;
use Illuminate\Support\Facades\File;
class Build extends Command
{
/**
* @var Repository
*/
private $repository;
protected $signature = 'blog:build';
... | <?php
namespace Swiftmade\Blogdown\Commands;
use Swiftmade\Blogdown\Parser;
use Illuminate\Console\Command;
use Swiftmade\Blogdown\Repository;
use Illuminate\Support\Facades\File;
class Build extends Command
{
/**
* @var Repository
*/
private $repository;
protected $signature = 'blog:build';
... |
Fix for double attempt at circle on iOS. | // @flow
import React from 'react';
import { Image, Platform, View } from 'react-native';
import theme from '../../theme';
type Props = {
size?: number,
source: string,
style?: Object,
};
export default function Avatar({ size = 44, source, style, ...props }: Props) {
const styles = {
wrapper: {
bac... | // @flow
import React from 'react';
import { Image, View } from 'react-native';
import theme from '../../theme';
type Props = {
size?: number,
source: string,
style?: Object,
};
export default function Avatar({ size = 44, source, style, ...props }: Props) {
const styles = {
wrapper: {
backgroundCol... |
Update manifest files being bumped. | # Update uProxy version in all relevant places.
#
# Run with:
# python version.py <new version>
# e.g. python version.py 0.8.10
import json
import collections
import sys
import re
manifest_files = [
'src/chrome/app/manifest.json',
'src/chrome/extension/manifest.json',
'src/firefox/packag... | # Update uProxy version in all relevant places.
#
# Run with:
# python version.py <new version>
# e.g. python version.py 0.8.10
import json
import collections
import sys
import re
manifest_files = [
'src/chrome/app/dist_build/manifest.json',
'src/chrome/app/dev_build/manifest.json',
'src... |
Disable the registration portal for now | <?php
// Copyright 2019 Peter Beverloo. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.
error_reporting((E_ALL | E_STRICT) & ~E_WARNING);
ini_set('display_errors', 1);
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/... | <?php
// Copyright 2019 Peter Beverloo. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.
error_reporting((E_ALL | E_STRICT) & ~E_WARNING);
ini_set('display_errors', 1);
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/... |
:bug: Fix bug on CanBuildBaseString trait test. | <?php
use PHPUnit\Framework\TestCase;
use Risan\OAuth1\Signature\CanBuildBaseString;
use Risan\OAuth1\Signature\BaseStringBuilderInterface;
class CanBuildBaseStringTest extends TestCase
{
private $canBuildBaseStringStub;
function setUp()
{
$this->canBuildBaseStringStub = $this->getMockForTrait(Ca... | <?php
use PHPUnit\Framework\TestCase;
use Risan\OAuth1\Signature\CanBuildBaseString;
use Risan\OAuth1\Signature\BaseStringBuilderInterface;
class CanBuildBaseStringTest extends TestCase
{
private $canBuildBaseStringStub;
function setUp()
{
$this->canBuildBaseStringStub = $this->getMockForTrait(Ca... |
Fix handling of empty file | import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf.get('serfnode', {})
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
p... | import os
import uuid
from mischief.actors.pipe import get_local_ip
import yaml
def read_serfnode_yml():
with open('/serfnode.yml') as input:
conf = yaml.load(input) or {}
return conf['serfnode']
yml = read_serfnode_yml()
role = os.environ.get('ROLE') or yml.get('ROLE') or 'no_role'
peer = os... |
Add the 'get_work' part in the client example | package main
import (
"fmt"
"github.com/levigross/grequests"
"github.com/ryanskidmore/GoWork"
"strings"
)
func main() {
response, err := grequests.Get("http://127.0.0.1:3000/register", nil)
if err != nil {
panic("Unable to register:" + err.Error())
}
respdata := strings.Split(response.String(), ",")
id := ... | package main
import (
"fmt"
"github.com/levigross/grequests"
"github.com/ryanskidmore/GoWork"
"strings"
)
func main() {
response, err := grequests.Get("http://127.0.0.1:3000/register", nil)
if err != nil {
panic("Unable to register:" + err.Error())
}
respdata := strings.Split(response.String(), ",")
id := ... |
Remove setTimeout left over from debugging. | import React from 'react';
import PropTypes from 'prop-types';
import { useTranslator } from '@u-wave/react-translate';
import CircularProgress from '@material-ui/core/CircularProgress';
import Tooltip from '@material-ui/core/Tooltip';
import IconButton from '@material-ui/core/IconButton';
import ShuffleIcon from '@mat... | import React from 'react';
import PropTypes from 'prop-types';
import { useTranslator } from '@u-wave/react-translate';
import CircularProgress from '@material-ui/core/CircularProgress';
import Tooltip from '@material-ui/core/Tooltip';
import IconButton from '@material-ui/core/IconButton';
import ShuffleIcon from '@mat... |
Remove models/ subpackage from api due to migration to QuantEcon.applications | """
Import the main names to top level.
"""
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
from .estspec import smooth, periodogram, ar_periodogram
from .graph_tools import DiGraph
from .gridtools import cartesian, mlinspace
from .kalman import Kalman
from .lae i... | """
Import the main names to top level.
"""
from . import models as models
from .compute_fp import compute_fixed_point
from .discrete_rv import DiscreteRV
from .ecdf import ECDF
from .estspec import smooth, periodogram, ar_periodogram
from .graph_tools import DiGraph
from .gridtools import cartesian, mlinspace
from .k... |
doc: Update Neural Entity (now complete) | from Entity import *
class NeuralEntity(Entity):
"""Entity the represents timestamps of action potentials, i.e. spike times.
Cutouts of the waveforms corresponding to spike data in a neural entity
might be found in a separate :class:`SegmentEntity` (cf. :func:`source_entity_id`).
"""
def __init__(s... | from Entity import *
class NeuralEntity(Entity):
"""Entity the represents timestamps of action potentials, i.e. spike times.
Cutouts of the waveforms corresponding to spike data in a neural entity
might be found in a separate :class:`SegmentEntity` (cf. :func:`source_entity_id`).
"""
def __init__(s... |
Add error handling for posts_per_page type conversion | from app.models import Setting
class AppSettings(dict):
def __init__(self):
super().__init__()
self.update({setting.name: setting.value for setting in Setting.query.all()})
try:
self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page')))
except KeyError... | from app.models import Setting
class AppSettings(dict):
def __init__(self):
super().__init__()
self.update({setting.name: setting.value for setting in Setting.query.all()})
self.__setitem__('posts_per_page', int(self.__getitem__('posts_per_page')))
def __setitem__(self, key, value):
... |
Remove no-longer-necessary line of code | 'use strict'
var isPresent = require('is-present')
var hasClass = require('has-class-selector')
var SelectorTokenizer = require('css-selector-tokenizer')
module.exports = function classRepeat (selector, options) {
if (typeof selector !== 'string') {
throw new TypeError('class-repeat expects a string')
}
op... | 'use strict'
var isPresent = require('is-present')
var hasClass = require('has-class-selector')
var SelectorTokenizer = require('css-selector-tokenizer')
module.exports = function classRepeat (selector, options) {
if (typeof selector !== 'string') {
throw new TypeError('class-repeat expects a string')
}
op... |
Add a check for division by zero | package main
// Build a standalone executable with 'go build go-calc'
// Or just do a one time run test with 'go run go-calc 1 / 4'
import "fmt"
import "os" // For ARGV
import "strconv"
func main() {
var arg_count int = len(os.Args) - 1;
if (arg_count != 3) {
fmt.Fprintf(os.Stdout,"Usage: %s [num1] [+-/*] [num2... | package main
// Build a standalone executable with 'go build go-calc'
// Or just do a one time run test with 'go run go-calc 1 / 4'
import "fmt"
import "os" // For ARGV
import "strconv"
func main() {
var arg_count int = len(os.Args) - 1;
if (arg_count != 3) {
fmt.Fprintf(os.Stdout,"Usage: %s [num1] [+-/*] [num2... |
Move user login code to djangoautoconf. | from djangoautoconf.django_utils import retrieve_param
from django.utils import timezone
from provider.oauth2.backends import AccessTokenBackend
from provider.oauth2.models import AccessToken
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import login
from djangoautoconf.req_with_a... | from djangoautoconf.django_utils import retrieve_param
from django.utils import timezone
from provider.oauth2.backends import AccessTokenBackend
from provider.oauth2.models import AccessToken
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import login
def login_from_oauth2(request... |
Align bottom sheet to center | // @flow
import * as React from 'react';
import { View } from 'react-native';
import { Dimensions } from 'react-native';
import {
BottomSheet as CommonBottomSheet,
Device,
type OnDimensionsChange,
} from '@kiwicom/react-native-app-shared';
import { getWidth, openHeight, closedHeight } from '../bottomSheetDimens... | // @flow
import * as React from 'react';
import { View } from 'react-native';
import { Dimensions } from 'react-native';
import {
BottomSheet as CommonBottomSheet,
Device,
type OnDimensionsChange,
} from '@kiwicom/react-native-app-shared';
import { getWidth, openHeight, closedHeight } from '../bottomSheetDimens... |
Expand the entire job definition by default | import Ember from 'ember';
import JSONFormatterPkg from 'npm:json-formatter-js';
const { Component, computed, run } = Ember;
// json-formatter-js is packaged in a funny way that ember-cli-browserify
// doesn't unwrap properly.
const { default: JSONFormatter } = JSONFormatterPkg;
export default Component.extend({
c... | import Ember from 'ember';
import JSONFormatterPkg from 'npm:json-formatter-js';
const { Component, computed, run } = Ember;
// json-formatter-js is packaged in a funny way that ember-cli-browserify
// doesn't unwrap properly.
const { default: JSONFormatter } = JSONFormatterPkg;
export default Component.extend({
c... |
Use jQuery live events for radio button detection.
Allow the field to be used in Django inlines. | (function($)
{
$(document).ready(function(){
var widgets = $("ul.any_urlfield-url_type");
widgets.find("input").live('change', onUrlTypeChange);
// Apply by default
widgets.each(function(){ updatePanels($(this)); });
});
function onUrlTypeChange(event)
{
var widget = $(this).parent().clos... | (function($)
{
$(document).ready(function(){
var widgets = $("ul.any_urlfield-url_type");
widgets.find("input").change(onUrlTypeChange);
// Apply by default
widgets.each(function(){ updatePanels($(this)); });
});
function onUrlTypeChange(event)
{
var widget = $(this).parent().closest('.an... |
Make create tag group more compatible with older laravel | <?php
namespace Conner\Tagging\Console\Commands;
use Conner\Tagging\TaggingUtility;
use Conner\Tagging\Model\TagGroup;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
class GenerateTagGroup extends Command
{
protected $name = 'tagging:create-group';
protected $signature = ... | <?php
namespace Conner\Tagging\Console\Commands;
use Conner\Tagging\TaggingUtility;
use Conner\Tagging\Model\TagGroup;
use Illuminate\Console\Command;
class GenerateTagGroup extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 't... |
Add Appointment issuer (User) field support | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAppointmentsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('appointments', function(Blueprint $table)
{
$table->increments('id');
... | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAppointmentsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('appointments', function(Blueprint $table)
{
$table->increments('id');
... |
Adjust dir structure for exports | const siteSlug = process.argv[2];
const fs = require('fs');
import { getQuestionsStream, getAnswersStream, uninitDB } from './datastore.js';
import { decodify } from './codify.js';
const baseLang = 'en';
function createDirs(dir) {
let subdirs = dir.split('/').splice(1);
let path = './';
subdirs.forEach(subdir =>... | const siteSlug = process.argv[2];
const fs = require('fs');
import { getQuestionsStream, getAnswersStream, uninitDB } from './datastore.js';
import { decodify } from './codify.js';
const baseLang = 'en';
let sequence = Promise.resolve();
sequence = sequence.then(getQuestionsStream.bind(null, siteSlug, baseLang, { }, q... |
Add compound statements back in. | module.exports = grammar({
name: 'ruby',
extras: $ => [
$.comment,
$._line_break,
/[ \t\r]/
],
rules: {
program: $ => $._compound_statement,
_compound_statement: $ => repeat(seq($._statement, optional($._terminator))),
_statement: $ => choice($._expression),
_expression: $ => choic... | module.exports = grammar({
name: 'ruby',
extras: $ => [
$.comment,
$._line_break,
/[ \t\r]/
],
rules: {
program: $ => repeat(seq($._statement, optional($._terminator))),
_statement: $ => choice($._expression),
_expression: $ => choice($._argument),
_argument: $ => choice($._primary)... |
Update event firing to check first if event type exists | /**
* Event handler.
* @constructor
*/
function EventTarget(){
this._listeners = {};
}
/**
* @method
* @param {string} type
* @param {function} listener
*/
EventTarget.prototype.addListener = function(type, listener){
if (!(type in this._listeners)) {
this._listeners[type] = [];
}
this._... | /**
* Event handler.
* @constructor
*/
function EventTarget(){
this._listeners = {};
}
/**
* @method
* @param {string} type
* @param {function} listener
*/
EventTarget.prototype.addListener = function(type, listener){
if (!(type in this._listeners)) {
this._listeners[type] = [];
}
this._... |
Use full path to api in stead of relatieve path
At this moment a relative path is used (../../../), for the cde saikuWidget. But the preview of the dashboard and the 'normal' view are on a different directory level, so one of them needs an extra ../ Fixed by using the full path /pentaho/plugin/saiku/api But this won't... | var saikuWidgetComponent = BaseComponent.extend({
update : function() {
var myself=this;
var htmlId = "#" + myself.htmlObject;
if (myself.saikuFilePath.substr(0,1) == "/") {
myself.saikuFilePath = myself.saikuFilePath.substr(1,myself.saikuFilePath.length - 1 );
}
var parameters = {};
if (myself.parame... | var saikuWidgetComponent = BaseComponent.extend({
update : function() {
var myself=this;
var htmlId = "#" + myself.htmlObject;
if (myself.saikuFilePath.substr(0,1) == "/") {
myself.saikuFilePath = myself.saikuFilePath.substr(1,myself.saikuFilePath.length - 1 );
}
var parameters = {};
if (myself.parame... |
Add test for cli 'add' command | # Copyright (c) 2015 "Hugo Herter http://hugoherter.com"
#
# This file is part of Billabong.
#
# Intercom is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your o... | # Copyright (c) 2015 "Hugo Herter http://hugoherter.com"
#
# This file is part of Billabong.
#
# Intercom is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your o... |
TMS-227: Support sequences with value_type other than combination | import zc.form.field
import zc.form.interfaces
import zope.schema.interfaces
class DynamicCombination(zc.form.field.Combination):
def __init__(self, type_field, type_interface, **kw):
self.type_field = type_field
self.type_field.__name__ = "combination_00"
self.fields = (type_field,)
... | import zc.form.field
import zope.schema.interfaces
class DynamicCombination(zc.form.field.Combination):
def __init__(self, type_field, type_interface, **kw):
self.type_field = type_field
self.type_field.__name__ = "combination_00"
self.fields = (type_field,)
self.type_interface = ... |
Test against generated table object | <?php
namespace WyriHaximus\React\Tests\Cake\Orm;
use WyriHaximus\React\Cake\Orm\AsyncTableGenerator;
use WyriHaximus\React\Cake\Orm\GeneratedTable;
use WyriHaximus\React\TestApp\Cake\Orm\Table\ScreenshotsTable;
class AsyncTableGeneratorTest extends TestCase
{
public function testGenerate()
{
$tmpDir... | <?php
namespace WyriHaximus\React\Tests\Cake\Orm;
use WyriHaximus\React\Cake\Orm\AsyncTableGenerator;
use WyriHaximus\React\TestApp\Cake\Orm\Table\ScreenshotsTable;
class AsyncTableGeneratorTest extends TestCase
{
public function testGenerate()
{
$tmpDir = sys_get_temp_dir() . DS . uniqid('WyriHaximu... |
Define a mapping between byte and class. | # -*- coding: utf-8 -*-
"""
hyper/http20/frame
~~~~~~~~~~~~~~~~~~
Defines framing logic for HTTP/2.0. Provides both classes to represent framed
data and logic for aiding the connection when it comes to reading from the
socket.
"""
# A map of type byte to frame class.
FRAMES = {
0x00: DataFrame
}
class Frame(obje... | # -*- coding: utf-8 -*-
"""
hyper/http20/frame
~~~~~~~~~~~~~~~~~~
Defines framing logic for HTTP/2.0. Provides both classes to represent framed
data and logic for aiding the connection when it comes to reading from the
socket.
"""
class Frame(object):
"""
The base class for all HTTP/2.0 frames.
"""
# T... |
Update notification update api to PUT
Signed-off-by: Federico Claramonte <9aaaa8bfe6a7a51765b462c528e1446dcf049286@caviumnetworks.com> | //
// Copyright (c) 2017 Cavium
//
// SPDX-License-Identifier: Apache-2.0
//
package distro
import (
"io"
"net/http"
"github.com/go-zoo/bone"
)
func replyPing(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/text; charset=utf-8")
w.WriteHeader(http.StatusOK)
str := `pong`
... | //
// Copyright (c) 2017 Cavium
//
// SPDX-License-Identifier: Apache-2.0
//
package distro
import (
"io"
"net/http"
"github.com/go-zoo/bone"
)
func replyPing(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/text; charset=utf-8")
w.WriteHeader(http.StatusOK)
str := `pong`
... |
Change rule from warning to off | /**
* Created by AlexanderC on 9/15/15.
*/
/* eslint no-unused-vars: 0 */
'use strict';
var exports = module.exports = function(callback) {
var microservice = this.microservice;
var provisioning = this.provisioning;
if (this.isUpdate) {
console.log('Update! Skipping public bucket location retrieval post... | /**
* Created by AlexanderC on 9/15/15.
*/
/* eslint no-unused-vars: 1 */
'use strict';
var exports = module.exports = function(callback) {
var microservice = this.microservice;
var provisioning = this.provisioning;
if (this.isUpdate) {
console.log('Update! Skipping public bucket location retrieval post... |
Use https for gravatar images | <?php
/**
* Skeleton subclass for representing a row from the 'profile' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.... | <?php
/**
* Skeleton subclass for representing a row from the 'profile' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.