text
stringlengths
16
4.96k
positive
stringlengths
321
2.24k
negative
stringlengths
310
2.21k
Fix up some bugs in ecenter_network.
Drupal.behaviors.jqPlot = function(context) { if (Drupal.settings.jqPlot) { var replace = ['renderer', 'markerRenderer', 'labelRenderer', 'parseX', 'parseY', 'scrapeSingle', 'scrapeMultiple', 'processSeries']; /*$.each(Drupal.settings.jqPlot, function(selector, settings) { settings = Drupal.jqPlo...
Drupal.behaviors.jqPlot = function(context) { if (Drupal.settings.jqPlot) { var replace = ['renderer', 'markerRenderer', 'labelRenderer', 'parseX', 'parseY', 'scrapeSingle', 'scrapeMultiple', 'processSeries']; $.each(Drupal.settings.jqPlot, function(selector, settings) { settings = Drupal.jqPlot....
Test coverage on added function
<?php namespace Omnipay\Elavon\Message; use Omnipay\Tests\TestCase; class ConvergeGenerateTokenRequestTest extends TestCase { public function setUp() { $this->request = new ConvergeGenerateTokenRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize( ar...
<?php namespace Omnipay\Elavon\Message; use Omnipay\Tests\TestCase; class ConvergeGenerateTokenRequestTest extends TestCase { public function setUp() { $this->request = new ConvergeGenerateTokenRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize( ar...
Remove print of terminal output for debugging
#!/usr/bin/python3 import pyqrcode # sudo pip install pyqrcode def getQRArray(text, errorCorrection): """ Takes in text and errorCorrection (letter), returns 2D array of the QR code""" # White is True (1) # Black is False (0) # ECC: L7, M15, Q25, H30 # Create the object qr = pyqrcode.create(text, error=errorCo...
#!/usr/bin/python3 import pyqrcode # sudo pip install pyqrcode def getQRArray(text, errorCorrection): """ Takes in text and errorCorrection (letter), returns 2D array of the QR code""" # White is True (1) # Black is False (0) # ECC: L7, M15, Q25, H30 # Create the object qr = pyqrcode.create(text, error=errorCo...
examples: Modify the examples to avoid reading the whole input at once. This will let the map job operate on the inputs that are larger than the physical memory.
package main import ( "bufio" "fmt" "github.com/discoproject/goworker/jobutil" "github.com/discoproject/goworker/worker" "io" "log" "strings" ) func Map(reader io.Reader, writer io.Writer) { scanner := bufio.NewScanner(reader) for scanner.Scan() { text := scanner.Text() words := strings.Fields(text) fo...
package main import ( "fmt" "github.com/discoproject/goworker/jobutil" "github.com/discoproject/goworker/worker" "io" "io/ioutil" "strings" ) func Map(reader io.Reader, writer io.Writer) { body, err := ioutil.ReadAll(reader) jobutil.Check(err) strBody := string(body) words := strings.Fields(strBody) for _,...
Fix an error causing the css not being generated
module.exports = function () { var outputPath = "./<%= outFolder %>/"; var src = "./<%= srcFolder %>/"; var config = { vendor: { destPath: outputPath + "js", src: [] }, templates: src + "**/*.tpl.html", scss: { entry: src + "styles/<%= hAp...
module.exports = function () { var outputPath = "./<%= outFolder %>/"; var src = "./<%= srcFolder %>/"; var config = { vendor: { destPath: outputPath + "js", src: [] }, templates: src + "**/*.tpl.html", scss: { entry: src + "styles/<%= app...
Implement lcfirst for PHP < 5.3
<?php if (!function_exists('curl_init')) { throw new Exception('Userbin needs the CURL PHP extension.'); } if (!function_exists('json_decode')) { throw new Exception('Userbin needs the JSON PHP extension.'); } if (!function_exists('lcfirst')) { function lcfirst( $str ) { $str[0] = strtolower($str[0]); r...
<?php if (!function_exists('curl_init')) { throw new Exception('Userbin needs the CURL PHP extension.'); } if (!function_exists('json_decode')) { throw new Exception('Userbin needs the JSON PHP extension.'); } require(dirname(__FILE__) . '/Userbin/Userbin.php'); require(dirname(__FILE__) . '/Userbin/Errors.php');...
Fix incorrect date format in urlencoded parameter parser.
package ru.fitgraph.rest.elements; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; /** * Created by melges on 19.01.15. */ public class DateParameter { private static final SimpleDateFormat d...
package ru.fitgraph.rest.elements; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; /** * Created by melges on 19.01.15. */ public class DateParameter { private static final SimpleDateFormat d...
Add wildcard condition to handle navigation to non-root url
const path = require('path'); const morgan = require('morgan'); const bodyParser = require('body-parser'); const webpack = require('webpack'); const webpackConfig = require(process.env.WEBPACK_CONFIG ? process.env.WEBPACK_CONFIG : '../../webpack.config'); const compiler = webpack(webpackConfig); module.exports = (...
const path = require('path'); const morgan = require('morgan'); const bodyParser = require('body-parser'); const webpack = require('webpack'); const webpackConfig = require(process.env.WEBPACK_CONFIG ? process.env.WEBPACK_CONFIG : '../../webpack.config'); const compiler = webpack(webpackConfig); module.exports = (...
Revert "Revert "Ignore test that causes CI to fail on Java 7 - works locally."" This reverts commit 5d60bef3afd33f35a9789015a761f16e58c5cc4e.
package io.hawt.git; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import static io.hawt.git.GitFacadeTest.assertConfigDirectoryExists; import static io.hawt.git.GitFacadeTest.assertFileContents; import static io.hawt.git.GitFacadeTest.createTestGitFacade; /** * Te...
package io.hawt.git; import org.junit.After; import org.junit.Before; import org.junit.Test; import static io.hawt.git.GitFacadeTest.assertConfigDirectoryExists; import static io.hawt.git.GitFacadeTest.assertFileContents; import static io.hawt.git.GitFacadeTest.createTestGitFacade; /** * Tests we can clone a remote...
Add getter for futures positions for BitVc
package org.knowm.xchange.huobi.service; import org.knowm.xchange.Exchange; import org.knowm.xchange.huobi.BitVc; import org.knowm.xchange.huobi.BitVcFutures; import org.knowm.xchange.huobi.dto.trade.BitVcFuturesPosition; import org.knowm.xchange.huobi.dto.trade.BitVcFuturesPositionByContract; import si.mazi.rescu.Res...
package org.knowm.xchange.huobi.service; import org.knowm.xchange.Exchange; import org.knowm.xchange.huobi.BitVc; import org.knowm.xchange.huobi.BitVcFutures; import si.mazi.rescu.RestProxyFactory; public class BitVcFuturesServiceRaw { protected final BitVcFutures bitvc; protected final String accessKey; ...
Make listeners to show & hide description more consistent
// Place all the behaviors and hooks related to the matching controller here. // All this logic will automatically be available in application.js. // You can use CoffeeScript in this file: http://coffeescript.org/ ListenFor = (function() { var displaySection = function(section) { $(section).on('click', '.interes...
// Place all the behaviors and hooks related to the matching controller here. // All this logic will automatically be available in application.js. // You can use CoffeeScript in this file: http://coffeescript.org/ ListenFor = (function() { var displaySection = function(section) { $(section).on('click', '.interes...
Set sample server to test it's working
$(function () { 'use strict'; var peer = new Peer({ host: 'api.tandembox.co', port: 80, path: '/peer' }); peer.on('open', function (id) { $('h1').html('Hi ' + id + ' :)'); peer.connect('defaultId'); }); peer.on('call', function (call) { call.on(...
$(function () { 'use strict'; var peer = new Peer({ key: 'evycxpu0zuissjor' }); peer.on('open', function (id) { $('h1').html('Hi ' + id + ' :)'); peer.connect('defaultId'); }); peer.on('call', function (call) { call.on('stream', function (stream) { var streamUr...
Change database in test because Travis was failing
package com.mijecu25.sqlplus.compiler.core.statement; import java.sql.SQLException; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** * Test StatementUseDatabase * * @author Miguel Velez - miguelvelezmj25 * @version 0.1.0.2 */ public class TestStatem...
package com.mijecu25.sqlplus.compiler.core.statement; import java.sql.SQLException; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** * Test StatementUseDatabase * * @author Miguel Velez - miguelvelezmj25 * @version 0.1.0.1 */ public class TestStatem...
Add health update packet code
module.exports = { // Packet constants PLAYER_START: "1", PLAYER_ADD: "2", PLAYER_ANGLE: "2", PLAYER_UPDATE: "3", PLAYER_ATTACK :"4", LEADERBOAD: "5", PLAYER_MOVE: "3", PLAYER_REMOVE: "4", LEADERS_UPDATE: "5", LOAD_GAME_OBJ: "6", GATHER_ANIM: "7", AUTO_ATK: "7", W...
module.exports = { // Packet constants PLAYER_START: "1", PLAYER_ADD: "2", PLAYER_ANGLE: "2", PLAYER_UPDATE: "3", PLAYER_ATTACK :"4", LEADERBOAD: "5", PLAYER_MOVE: "3", PLAYER_REMOVE: "4", LEADERS_UPDATE: "5", LOAD_GAME_OBJ: "6", GATHER_ANIM: "7", AUTO_ATK: "7", W...
Add a way to fetch the calendar used in the EventApi
<?php /** * This file is part of the CalendArt package * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. * * @copyright Wisembly * @license http://www.opensource.org/licenses/MIT-License MIT License */ namespace CalendArt\Adapter; ...
<?php /** * This file is part of the CalendArt package * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. * * @copyright Wisembly * @license http://www.opensource.org/licenses/MIT-License MIT License */ namespace CalendArt\Adapter; ...
Add js resize script to header. git-svn-id: 245d8f85226f8eeeaacc1269b037bb4851d63c96@901 54a900ba-8191-11dd-a5c9-f1483cedc3eb
<?php session_start(); ?> <!DOCTYPE html> <head> <title>ClinicCases - Online Case Management Software for Law School Clinics</title> <meta name="robots" content="noindex"> <link rel="stylesheet" href="html/css/cm.css" type="text/css"> <link rel="stylesheet" href="html/css/cm_tabs.css" type="text/css"> <link rel="...
<?php session_start(); ?> <!DOCTYPE html> <head> <title>ClinicCases - Online Case Management Software for Law School Clinics</title> <meta name="robots" content="noindex"> <link rel="stylesheet" href="html/css/cm.css" type="text/css"> <link rel="stylesheet" href="html/css/cm_tabs.css" type="text/css"> <link rel="...
Return response instead of print on client side
import socket import sys def client(msg): client_socket = socket.socket( socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP) client_socket.connect(('127.0.0.1', 50000)) # sends command line message to server, closes socket to writing client_socket.sendall(msg) client_so...
import socket import sys def client(msg): client_socket = socket.socket( socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP) client_socket.connect(('127.0.0.1', 50000)) # sends command line message to server, closes socket to writing client_socket.sendall(msg) client_so...
Add user table to module init
import os from flask import Flask from flask.ext.assets import Bundle, Environment from flask.ext.login import LoginManager from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) # Load the app config app.config.from_object("config.Config") assets = Environment(app) db= SQLAlchemy(app) login = LoginMana...
import os from flask import Flask from flask.ext.assets import Bundle, Environment from flask.ext.login import LoginManager from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) # Load the app config app.config.from_object("config.Config") assets = Environment(app) db= SQLAlchemy(app) login = LoginMana...
Fix settings modal button position and size
import EtherscanProxy from '@/wallets/web3-provider/etherscan-proxy'; const SERVERURL = 'https://api.etherscan.io/api'; const API_KEY = 'DSH5B24BQYKD1AD8KUCDY3SAQSS6ZAU175'; describe('EtherScan Proxy', () => { xit('[Problem] should respond correct json rpc', async () => { expect.assertions(3); const ethProxy...
import EtherscanProxy from '@/wallets/web3-provider/etherscan-proxy'; const SERVERURL = 'https://api.etherscan.io/api'; const API_KEY = 'DSH5B24BQYKD1AD8KUCDY3SAQSS6ZAU175'; describe('EtherScan Proxy', () => { it('should respond correct json rpc', async () => { expect.assertions(3); const ethProxy = new Ethe...
Fix for gulp config file
var gulp = require('gulp'); // include plug-ins var jshint = require('gulp-jshint'); var mocha = require('gulp-mocha'); // JS hint task gulp.task('jshint', function() { gulp.src('./src/*.js') .pipe(jshint()) .pipe(jshint.reporter('default')); }); gulp.task('mocha_test', function() { return gulp.src(['te...
var gulp = require('gulp'); // include plug-ins var jshint = require('gulp-jshint'); var mocha = require('gulp-mocha'); // JS hint task gulp.task('jshint', function() { gulp.src('./src/*.js') .pipe(jshint()) .pipe(jshint.reporter('default')); }); gulp.task('mocha_test', function() { return gulp.src(['te...
Move dependencies from removed 'jquery.ui.…' modules to 'jquery.ui' This increases the extension's MediaWiki dependency to version 1.34. Bug: T219604 Change-Id: Ic0bbb86ec93fff32731d84a7919f4951a9111d5f
<?php /* QuickResponse Extension for MediaWiki. @license MIT License */ $wgExtensionCredits[ 'other' ][] = array( 'path' => __FILE__, 'name' => 'QuickResponse', 'version' => '0.3.0', 'url' => '', 'author' => 'Konarak Ratnakar', 'descriptionmsg' => 'quickresponse-desc' ); $wgMessagesDirs['Quic...
<?php /* QuickResponse Extension for MediaWiki. @license MIT License */ $wgExtensionCredits[ 'other' ][] = array( 'path' => __FILE__, 'name' => 'QuickResponse', 'version' => '0.3.0', 'url' => '', 'author' => 'Konarak Ratnakar', 'descriptionmsg' => 'quickresponse-desc' ); $wgMessagesDirs['Quic...
Use newline instead of carriage return for import of buildings from XLS
<?php require_once('../../../config.gen.inc.php'); require_once "MDB2.php"; require_once $install_path."lib/db.php"; $db = new db; $stmtd =& $db->connection->prepare("DELETE FROM Buildings"); $stmtd->execute(); $filename = "buildings.txt"; $fd = fopen ($filename, "r"); $contents = fread ($fd,filesize ($filename)); ...
<?php require_once('../../../config.gen.inc.php'); require_once "MDB2.php"; require_once $install_path."lib/db.php"; $db = new db; $stmtd =& $db->connection->prepare("DELETE FROM Buildings"); $stmtd->execute(); $filename = "buildings.txt"; $fd = fopen ($filename, "r"); $contents = fread ($fd,filesize ($filename)); ...
Change update value to produce less thrash on embedded side
import blinkycolor import serial class BlinkyTape(object): def __init__(self, port, baud_rate = 115200, pixel_count = 60): self._serial = serial.Serial(port, baud_rate) self._pixel_count = pixel_count self._pixels = [blinkycolor.BLACK] * self._pixel_count @property def pixel_count(...
import blinkycolor import serial class BlinkyTape(object): def __init__(self, port, baud_rate = 115200, pixel_count = 60): self._serial = serial.Serial(port, baud_rate) self._pixel_count = pixel_count self._pixels = [blinkycolor.BLACK] * self._pixel_count @property def pixel_count(...
Add log emit for initial connect
var util = require('../util'); var log = require('../log'); var logger = log.logger('websocket'); var clients_limit = 5; var nb_clients=0; var updater = require('../updater'); function setupBroadcasts(clients_sockets){ log.on('any',function(msg){ clients_sockets.emit('log',msg); }); updater.on('status', fun...
var util = require('../util'); var log = require('../log'); var logger = log.logger('websocket'); var clients_limit = 5; var nb_clients=0; var updater = require('../updater'); function setupBroadcasts(clients_sockets){ log.on('any',function(msg){ clients_sockets.emit('log',msg); }); updater.on('status', fun...
Include oauth2-provider's tests module in the installed package
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='edx-oauth2-provider', version='0.5.5', description='Provide OAuth2 access to edX installations', author='edX', url='https://github.com/edx/edx-oauth2-provider', license='AGPL', classifiers=[ 'Development...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='edx-oauth2-provider', version='0.5.4', description='Provide OAuth2 access to edX installations', author='edX', url='https://github.com/edx/edx-oauth2-provider', license='AGPL', classifiers=[ 'Development...
Add "prise de note" subject fixture
<?php namespace Ifensl\Bundle\PadManagerBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\FixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Ifensl\Bundle\PadManagerBundle\Entity\Subject; class LoadSubjectData implements FixtureInterface { /** * {@inheritDoc} */ public fun...
<?php namespace Ifensl\Bundle\PadManagerBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\FixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Ifensl\Bundle\PadManagerBundle\Entity\Subject; class LoadSubjectData implements FixtureInterface { /** * {@inheritDoc} */ public fun...
Remove progress bar if element if not loading anymore git-svn-id: 4e353c0944fe8da334633afc35765ef362dec675@4260 b4e469a2-07ce-4b26-9273-4d7d95a670c7
package org.helioviewer.plugins.eveplugin.view.linedataselector.cellrenderer; import java.awt.Component; import javax.swing.JProgressBar; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; import org.helioviewer.base.logging.Log; import org.helioviewer.plugins.eveplugin.view.linedataselect...
package org.helioviewer.plugins.eveplugin.view.linedataselector.cellrenderer; import java.awt.Component; import javax.swing.JProgressBar; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; import org.helioviewer.plugins.eveplugin.view.linedataselector.LineDataSelectorElement; public class...
Remove ul class from search form
<header> <div class="top-bar"> <div class="top-bar-title"> <span data-responsive-toggle="responsive-menu" data-hide-for="medium"> <!-- <button class="menu-icon dark" type="button" data-toggle></button> --> <button class="menu-icon dark" type="button" data-open="offCanvasLeft"></button> </s...
<header> <div class="top-bar"> <div class="top-bar-title"> <span data-responsive-toggle="responsive-menu" data-hide-for="medium"> <!-- <button class="menu-icon dark" type="button" data-toggle></button> --> <button class="menu-icon dark" type="button" data-open="offCanvasLeft"></button> </s...
Add dummy routes for API calls from organism search
<?php namespace AppBundle\Controller; use AppBundle\AppBundle; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\HttpFoundation\Request; class APIController extends Controller { /** * @param Request $request * @return \Symfon...
<?php namespace AppBundle\Controller; use AppBundle\AppBundle; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\HttpFoundation\Request; class APIController extends Controller { /** * @param Request $request * @return \Symfon...
Return a fresh collection every time - leave caching to calling application. This allows lists to be called for different languages and avoids hard-to-reason-about issues if the application applies transformations to the returned collection.
<?php namespace PeterColes\Countries; class Maker { public function lookup($locale = 'en', $flip = false) { $this->prep($locale); if ($flip) { return $this->countries->flip(); } return $this->countries; } public function keyValue($locale = 'en', $key = 'k...
<?php namespace PeterColes\Countries; class Maker { protected $countries = null; public function lookup($locale = 'en', $flip = false) { $this->prep($locale); if ($flip) { return $this->countries->flip(); } return $this->countries; } public function ...
Allow ember-power-select to be invoked transitively from another addon Also, the included hook is idempotent. The second time that is called is a noop
/* jshint node: true */ 'use strict'; // var path = require('path'); module.exports = { name: 'ember-power-select', included: function(appOrAddon) { let app = appOrAddon.app || appOrAddon; if (!app.__emberPowerSelectIncludedInvoked) { app.__emberPowerSelectIncludedInvoked = true; this._super....
/* jshint node: true */ 'use strict'; // var path = require('path'); module.exports = { name: 'ember-power-select', included: function(app) { this._super.included.apply(this, arguments); // Don't include the precompiled css file if the user uses ember-cli-sass if (!app.registry.availablePlugins['embe...
:bug: Fix potential null reference callback invokation Fixes #11328
var childProcess = require('child_process'); // Exit the process if the command failed and only call the callback if the // command succeed, output of the command would also be piped. exports.safeExec = function(command, options, callback) { if (!callback) { callback = options; options = {}; } if (!optio...
var childProcess = require('child_process'); // Exit the process if the command failed and only call the callback if the // command succeed, output of the command would also be piped. exports.safeExec = function(command, options, callback) { if (!callback) { callback = options; options = {}; } if (!optio...
Check if editor has parent
var _ = require('underscore'); var backbone = require('backbone'); var backboneBase = require('backbone-base'); var deepEmpty = require('deep-empty'); var outfile = require('datapackage-outfile'); var validator = require('datapackage-validate'); // Download validated datapackage module.exports = backbone.BaseView.ext...
var _ = require('underscore'); var backbone = require('backbone'); var backboneBase = require('backbone-base'); var deepEmpty = require('deep-empty'); var outfile = require('datapackage-outfile'); var validator = require('datapackage-validate'); // Download validated datapackage module.exports = backbone.BaseView.ext...
Fix URL to be HTTPS. random.org now redirects to HTTPS and we don't handle the redirect correctly, but if we start on HTTPS there is no redirect.
// // TrueRandom.java -- Java class TrueRandom // Project OrcSites // // $Id$ // // Copyright (c) 2009 The University of Texas at Austin. All rights reserved. // // Use and redistribution of this file is governed by the license terms in // the LICENSE file found in the project's top-level directory and also found at //...
// // TrueRandom.java -- Java class TrueRandom // Project OrcSites // // $Id$ // // Copyright (c) 2009 The University of Texas at Austin. All rights reserved. // // Use and redistribution of this file is governed by the license terms in // the LICENSE file found in the project's top-level directory and also found at //...
Add key prop for SongItem
import React, { PropTypes } from 'react' import SongItem from '../SongItem' class SongList extends React.Component { static propTypes = { fetchSongs: PropTypes.func.isRequired, songs: PropTypes.object, isFetching: PropTypes.bool.isRequired } render () { if (!this.props.songs || this.props.isFetc...
import React, { PropTypes } from 'react' import SongItem from '../SongItem' class SongList extends React.Component { static propTypes = { fetchSongs: PropTypes.func.isRequired, songs: PropTypes.object, isFetching: PropTypes.bool.isRequired } render () { if (!this.props.songs || this.props.isFetc...
Use valid fromlist parameter when calling __import__ This was working before, but it wasn't what I had intended to write. It doesn't really matter what is passed in here as long as it isn't an empty list.
# import_string was appropriated from django and then rewritten for broader # python support. The version of this method can't be imported from Django # directly because it didn't exist until 1.7. def import_string(dotted_path): """ Import a dotted module path. Returns the attribute/class designated by t...
# import_string was appropriated from django and then rewritten for broader # python support. The version of this method can't be imported from Django # directly because it didn't exist until 1.7. def import_string(dotted_path): """ Import a dotted module path. Returns the attribute/class designated by t...
Comment out @override in createJSModules
package com.allthatseries.RNAudioPlayer; import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; im...
package com.allthatseries.RNAudioPlayer; import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.facebook.react.ReactPackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; im...
Update Dates library, fix hour format and rename 'monthDayYear' to 'dayMonthYear'
import moment from 'moment'; import 'moment/locale/fr'; import 'moment-timezone'; moment.locale('fr'); export const dayMonthYear = (timestamp, timezone) => ( !timezone ? moment(timestamp).format('Do MMMM YYYY') : moment(timestamp).tz(timezone).format('Do MMMM YYYY') ); export const dayMonthYearAtTime = (timest...
import moment from 'moment'; import 'moment/locale/fr'; import 'moment-timezone'; moment.locale('fr'); export const monthDayYear = (timestamp, timezone) => ( !timezone ? moment(timestamp).format('MMMM Do, YYYY') : moment(timestamp).tz(timezone).format('MMMM Do, YYYY') ); export const dayMonthYearAtTime = (time...
Add compatibility for Python 2
# coding: utf-8 from __future__ import unicode_literals import io import six from setuptools.command import setopt from setuptools.extern.six.moves import configparser class TestEdit: @staticmethod def parse_config(filename): parser = configparser.ConfigParser() with io.open(filename, enco...
# coding: utf-8 from __future__ import unicode_literals import io import six from setuptools.command import setopt from setuptools.extern.six.moves import configparser class TestEdit: @staticmethod def parse_config(filename): parser = configparser.ConfigParser() with io.open(filename, enco...
[TASK] Set the 'findNestedDependencies' flag for the r.js optimizer to true
/** * Grunt-Contrib-RequireJS * @description Optimize RequireJS projects using r.js. * @docs https://github.com/gruntjs/grunt-contrib-requirejs */ var config = require("../Config"); module.exports = { deploy: { options: { mainConfigFile: config.JavaScripts.paths.devDir + "/" + config.JavaScripts.requireJS.co...
/** * Grunt-Contrib-RequireJS * @description Optimize RequireJS projects using r.js. * @docs https://github.com/gruntjs/grunt-contrib-requirejs */ var config = require("../Config"); module.exports = { deploy: { options: { mainConfigFile: config.JavaScripts.paths.devDir + "/" + config.JavaScripts.requireJS.co...
Send data using jsonp instead of cors
Kadira = {}; Kadira.options = __meteor_runtime_config__.kadira; if(Kadira.options && Kadira.options.endpoint) { Kadira.syncedDate = new Ntp(Kadira.options.endpoint); Kadira.syncedDate.sync(); } /** * Send error metrics/traces to kadira server * @param {Object} payload Contains browser info and error traces *...
Kadira = {}; Kadira.options = __meteor_runtime_config__.kadira; if(Kadira.options && Kadira.options.endpoint) { Kadira.syncedDate = new Ntp(Kadira.options.endpoint); Kadira.syncedDate.sync(); } /** * Send error metrics/traces to kadira server * @param {Object} payload Contains browser info and error traces *...
:sparkles: Add base and hasBase method to interface.
<?php namespace Risan\OAuth1\Config; interface UriConfigInterface { /** * Get the base URI. * * @return \Psr\Http\Message\UriInterface|null */ public function base(); /** * Check if base URI is set. * * @return boolean */ public function hasBase(); /** ...
<?php namespace Risan\OAuth1\Config; interface UriConfigInterface { /** * Get the URI for obtaining temporary credentials. Also known as request * token URI. * * @return \Psr\Http\Message\UriInterface */ public function temporaryCredentials(); /** * Get the URI for asking us...
Add AJAX call to delete an entry on a user's dashboard page
$(document).ready(function() { $('#login-link').on('click', function(event) { event.preventDefault(); var $target = $(event.target); $.ajax({ type: 'GET', url: $target.attr('href'), dataType: 'html' }).done(function(response){ $resp = $(response).children('.auth-container'); ...
$(document).ready(function() { $('#login-link').on('click', function(event) { event.preventDefault(); var $target = $(event.target); $.ajax({ type: 'GET', url: $target.attr('href'), dataType: 'html' }).done(function(response){ $resp = $(response).children('.auth-container') ...
Use PDO in the local cellid script With 13ae949 the `mysql` calls have been changed to calls using the `PDO` classes. This updates `cellid_local.php` to use `PDO` as well. It also uses the proper capitalisation of the columns because at least the SQLite driver is case sensitive.
<?php require_once("database.php"); $db = connect_save(); if ($db === null) { echo "Result:4"; die(); } if ($_REQUEST["myl"] != "") { $temp = split(":", $_REQUEST["myl"]); $mcc = $temp[0]; $mnc = $temp[1]; $lac = $temp[2]; $cid = $temp[3]; } else { $mcc = $_REQUEST["mcc"]; $mnc = $_REQUEST["mnc"];...
<?php require_once("config.php"); if(!@mysql_connect("$DBIP","$DBUSER","$DBPASS")) { echo "Result:4"; die(); } mysql_select_db("$DBNAME"); if ($_REQUEST["myl"] != "") { $temp = split(":", $_REQUEST["myl"]); $mcc = $temp[0]; $mnc = $temp[1]; $lac = $temp[2]; $cid = $temp[3]; } else { $mcc = $_REQUE...
Fix build break (renamed function)
from msrest import Serializer from ..commands import command, description from ._command_creation import get_mgmt_service_client @command('resource group list') @description('List resource groups') # TODO: waiting on Python Azure SDK bug fixes # @option('--tag-name -g <tagName>', L('the resource group's tag name')) # ...
from msrest import Serializer from ..commands import command, description from ._command_creation import get_service_client @command('resource group list') @description('List resource groups') # TODO: waiting on Python Azure SDK bug fixes # @option('--tag-name -g <tagName>', L('the resource group's tag name')) # @opti...
Select all is applied one time only (as opposed to on all subsequent updates too)
/* eslint no-unused-vars: 0 */ /****************/ /** Select All **/ /****************/ gridState.processors['select-all'] = { watches: ['selection','data'], runs: function (options) { var all = options.model.selection.all; if (typeof all !== "boolean") { delete options.model.select...
/* eslint no-unused-vars: 0 */ /****************/ /** Select All **/ /****************/ gridState.processors['select-all'] = { watches: ['selection','data'], runs: function (options) { var all = options.model.selection.all; if (typeof all !== "boolean") { delete options.model.select...
Add image property to callback data
'use strict'; var got = require('got'); var cheerio = require('cheerio'); var md = require('html-md'); module.exports = function(id, callback) { var url = 'http://www.stm.dk/_p_' + id + '.html'; got(url, function(err, data){ var $ = cheerio.load(data); var meta = $('meta[name="created"]'); var speec...
'use strict'; var got = require('got'); var cheerio = require('cheerio'); var md = require('html-md'); module.exports = function(id, callback) { var url = 'http://www.stm.dk/_p_' + id + '.html'; got(url, function(err, data){ var $ = cheerio.load(data); var meta = $('meta[name="created"]'); var speec...
Remove sanitize from marked conf
'use strict'; import {Pipe} from 'angular2/angular2'; import {JsonPointer} from './JsonPointer'; import marked from 'marked'; marked.setOptions({ renderer: new marked.Renderer(), gfm: true, tables: true, breaks: false, pedantic: false, smartLists: true, smartypants: false }); @Pipe({ name: 'keys' })...
'use strict'; import {Pipe} from 'angular2/angular2'; import {JsonPointer} from './JsonPointer'; import marked from 'marked'; marked.setOptions({ renderer: new marked.Renderer(), gfm: true, tables: true, breaks: false, pedantic: false, sanitize: true, smartLists: true, smartypants: false }); @Pipe({...
Fix call for status This might fix the UI call, but probably not
<?php /* PufferPanel - A Minecraft Server Management Panel Copyright (c) 2013 Dane Everitt This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your op...
<?php /* PufferPanel - A Minecraft Server Management Panel Copyright (c) 2013 Dane Everitt This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your op...
Use comments to build the assertion name
import { TAP_ASSERT_DONE, TAP_COMMENT, TAP_PLAN } from '../actions' const initialState = { assertions: {}, currentCount: 0, lastComment: null, nextEstimatedCount: 0, plan: undefined } const assertName = (name, lastComment) => ( lastComment ? `[ ${lastComment.replace(/^#\s+/, '')} ] ${name}` ...
import { TAP_ASSERT_DONE, TAP_PLAN } from '../actions' const initialState = { assertions: {}, currentCount: 0, nextEstimatedCount: 0, plan: undefined } export default (state = initialState, action) => { switch (action.type) { case TAP_ASSERT_DONE: return { ...state, assertions:...
Sort languages by alphabetical order
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ /*global define */ define(function (require, exports, module) { 'use strict'; // Code that needs to display user strings should call require("strings") to load // strings.js. This file will dynamically load strings.js...
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ /*global define */ define(function (require, exports, module) { 'use strict'; // Code that needs to display user strings should call require("strings") to load // strings.js. This file will dynamically load strings.js...
Use symbol.for for node environments with potentially multiple loads
import _ from 'lodash' const unique = Symbol.for('lacona-unique-key') export default unique function getUniqueValue (result) { if (!_.isObject(result)) { return result } else if (result[unique] != null) { if (_.isFunction(result[unique])) { return result[unique](result) } else { return res...
import _ from 'lodash' const unique = Symbol('lacona-unique-key') export default unique function getUniqueValue (result) { if (!_.isObject(result)) { return result } else if (result[unique] != null) { if (_.isFunction(result[unique])) { return result[unique](result) } else { return result[...
Add si_single to conditional controlling display of featured image
<?php echo "<!-- Using content.php template -->" ?> <?php if (is_single() || is_home()){ the_date('F j, Y', '<p class="date">', '</p>'); } ?> <h3><?php the_title() ?></h3> <?php if ((is_single() || is_home()) && get_option('show_byline_on_posts')) : ?> <div class="author-info"> <?php the_author(); ?> <p cl...
<?php if (is_single() || is_home()){ the_date('F j, Y', '<p class="date">', '</p>'); } ?> <h3><?php the_title() ?></h3> <?php if ((is_single() || is_home()) && get_option('show_byline_on_posts')) : ?> <div class="author-info"> <?php the_author(); ?> <p class="author-desc"> <small><?php the_author_meta(); ?>...
Update plugin to work with version 6
var redback = require('redback'), Hoek = require('hoek'), Defaults = require('./defaults'); exports.register = function (plugin, options, next) { var settings = Hoek.applyToDefaults(Defaults, options); if (!settings.enabled) { return next(); } var ratelimit; if (options.client) { ratelimit = redback.use(op...
var redback = require('redback'), Hoek = require('hoek'), Defaults = require('./defaults'); exports.register = function (plugin, options, next) { var settings = Hoek.applyToDefaults(Defaults, options); if (!settings.enabled) { return next(); } var ratelimit; if (options.client) { ratelimit = redback.use(op...
Use proper docblock for deprecation
<?php namespace Illuminate\Foundation\Bus; use ArrayAccess; /** * @deprecated since version 5.1. Use the DispatchesJobs trait instead. */ trait DispatchesCommands { /** * Dispatch a command to its appropriate handler. * * @param mixed $command * @return mixed */ protected function dispatch($command) ...
<?php namespace Illuminate\Foundation\Bus; use ArrayAccess; /** * This trait is deprecated. Use the DispatchesJobs trait. */ trait DispatchesCommands { /** * Dispatch a command to its appropriate handler. * * @param mixed $command * @return mixed */ protected function dispatch($command) { return a...
Remove initial error if reddit isn't given correct information
'use strict'; const r = require('../services/reddit'); let reportedItemNames = new Set(); let hasFinishedFirstRun = false; const SUBREDDITS = ['pokemontrades', 'SVExchange']; module.exports = { period: 60, onStart: true, task () { return r.get_subreddit(SUBREDDITS.join('+')).get_reports({limit: hasFinishedF...
'use strict'; const r = require('../services/reddit'); let reportedItemNames = new Set(); let hasFinishedFirstRun = false; const SUBREDDITS = ['pokemontrades', 'SVExchange']; module.exports = { period: 60, onStart: true, task () { return r.get_subreddit(SUBREDDITS.join('+')).get_reports({limit: hasFinishedF...
Fix e2e tests for mock data changes
describe('Praad App', function() { 'use strict'; describe('Offer list view', function() { var offers, clickPromise; beforeEach(function() { browser.manage().deleteAllCookies(); browser.get('/'); clickPromise = element(by.css('.popup')).element(by.css('label')).click(); offers = ele...
describe('Praad App', function() { 'use strict'; describe('Offer list view', function() { var offers, clickPromise; beforeEach(function() { browser.manage().deleteAllCookies(); browser.get('/'); clickPromise = element(by.css('.popup')).element(by.css('label')).click(); offers = ele...
Change state name from 'profile' to 'user'
angular .module('fitnessTracker', ['ui.router', 'templates', 'Devise']) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('signup', { url: '/signup', templateUrl: 'auth/_signup.html', controller: 'AuthenticationController as AuthCtrl' ...
angular .module('fitnessTracker', ['ui.router', 'templates', 'Devise']) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('signup', { url: '/signup', templateUrl: 'auth/_signup.html', controller: 'AuthenticationController as AuthCtrl' ...
Clear preferences first in Chrome test
/* * (C) Copyright 2015 Boni Garcia (http://bonigarcia.github.io/) * * 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 require...
/* * (C) Copyright 2015 Boni Garcia (http://bonigarcia.github.io/) * * 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 require...
Add table names to core model items
from django.db import models ## # Location Types ## class World(models.Model): name = models.CharField(max_length=30) homes = models.ManyToManyField(Home) class Meta: db_table = u'Worlds' class Home(models.Model): name = models.CharField(max_length=30) rooms = models.ManyToManyField(Room) class Meta: db_ta...
from django.db import models ## # Location Types ## class World(models.Model): name = models.CharField(max_length=30) homes = models.ManyToManyField(Home) class Home(models.Model): name = models.CharField(max_length=30) rooms = models.ManyToManyField(Room) class Room(models.Model): name = models.CharField(max_...
Move inital_build task into own function
import os from fabric.api import run, env, settings, cd, put, sudo from fabric.contrib import files import private GIT_REPO = 'git://github.com/lextoumbourou/lextoumbourou.com.git' def prod(): env.hosts = list(private.PROD_SERVERS) def local(): env.hosts = ['localhost'] def initial_build(): """ ...
import os from fabric.api import run, env, settings, cd, put, sudo from fabric.contrib import files import private def prod(): env.hosts = list(private.PROD_SERVERS) def local(): env.hosts = ['localhost'] def deploy(): """ Deploy code to production """ git_repo = 'git://github.com/lextoum...
Rewrite JS compilation task to make use of Webpack
const gulp = require('gulp'); const pump = require('pump'); const rename = require('gulp-rename'); const sass = require('gulp-sass'); const webpack = require('webpack-stream'); const uglify = require('gulp-uglify'); var config = { "pug": { "src": "./app/pug/*.pug", "dest": "./" }, "sass": { "src": "./app/sass...
const gulp = require('gulp'); const pump = require('pump'); const rename = require('gulp-rename'); const sass = require('gulp-sass'); const webpack = require('webpack-stream'); const uglify = require('gulp-uglify'); var config = { "pug": { "src": "./app/pug/*.pug", "dest": "./" }, "sass": { "src": "./app/sass...
Fix typo in package name.
package labels import ( "github.com/DVI-GI-2017/Jira__backend/models" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) const collection = "labels" func CheckExistence(mongo *mgo.Database, label *models.Label) (bool, error) { c, err := mongo.C(collection).Find(bson.M{"name": label.Name}).Count() return c != 0, err } ...
package projects import ( "github.com/DVI-GI-2017/Jira__backend/models" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) const collection = "labels" func CheckExistence(mongo *mgo.Database, label *models.Label) (bool, error) { c, err := mongo.C(collection).Find(bson.M{"name": label.Name}).Count() return c != 0, err }...
i18n: Replace `@NonNls` with more appropriate `@NlsSafe` annotation GitOrigin-RevId: f3872ea7425784c82ad9e77e3a04b1805ab2685a
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.buildout.config; import com.intellij.openapi.fileTypes.LanguageFileType; import com.intellij.openapi.util.NlsSafe; import icons.PythonIcons; import o...
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.buildout.config; import com.intellij.openapi.fileTypes.LanguageFileType; import icons.PythonIcons; import org.jetbrains.annotations.NonNls; import or...
Add some debug output for convenience.
'use strict'; var debug = require('debug')('frontend:mqtt'); var express = require('express'); var router = express.Router(); var auth = require('../../passport'); var restUtils = require('../utils'); var os = require('os'); router.post('/mqtt', auth.requireAPIAuth(), function(req, res) { var userId = req.user.id...
'use strict'; var express = require('express'); var router = express.Router(); var auth = require('../../passport'); var restUtils = require('../utils'); var os = require('os'); router.post('/mqtt', auth.requireAPIAuth(), function(req, res) { var userId = req.user.id; var topic = req.query.topic; var payload ...
Load the state before checking whether the state values match.
<?php namespace MartinBean\Facebook\Laravel; use Facebook\FacebookRedirectLoginHelper as BaseFacebookRedirectLoginHelper; use Request; use Session; class FacebookRedirectLoginHelper extends BaseFacebookRedirectLoginHelper { /** * Check if a redirect has a valid state. * * @return bool */ p...
<?php namespace MartinBean\Facebook\Laravel; use Facebook\FacebookRedirectLoginHelper as BaseFacebookRedirectLoginHelper; use Request; use Session; class FacebookRedirectLoginHelper extends BaseFacebookRedirectLoginHelper { /** * Check if a redirect has a valid state. * * @return bool */ p...
Test operator precedence and associativity
package golog import "testing" func TestBasic(t *testing.T) { single := make(map[string]string) single[`hello.`] = `hello` single[`a + b.`] = `+(a, b)` single[`first, second.`] = `','(first, second)` single[`\+ j.`] = `\+(j)` single[`a + b*c.`] = `+(a, *(b, c))` // test precedence singl...
package golog import "testing" func TestBasic(t *testing.T) { single := make(map[string]string) single[`hello.`] = `hello` single[`a + b.`] = `+(a, b)` single[`first, second.`] = `','(first, second)` single[`\+ j.`] = `\+(j)` for test, wanted := range single { got, err := ReadTermStrin...
Add a bit of timeout to make it work better
import { polyfill } from 'smoothscroll-polyfill'; polyfill(); const previousScrolls = {}; window.history.scrollRestoration = 'manual'; window.addEventListener('scroll', (e) => { const path = document.location.pathname previousScrolls[path] = window.scrollY; }); export default function initScrolling(port) { po...
import { polyfill } from 'smoothscroll-polyfill'; polyfill(); const previousScrolls = {}; window.history.scrollRestoration = 'manual'; window.addEventListener('scroll', (e) => { const path = document.location.pathname previousScrolls[path] = window.scrollY; }); export default function initScrolling(port) { po...
Add webkit support for AudioContext
const audio = document.querySelector('audio') const audioContext = new (window.AudioContext || window.webkitAudioContext) const audioSource = audioContext.createMediaElementSource(audio) const analyser = audioContext.createAnalyser() let frequencyData = new Uint8Array(200) audioSource.connect(analyser) audioSource.con...
'use strict' const audio = document.querySelector('audio') const audioContext = new window.AudioContext const audioSource = audioContext.createMediaElementSource(audio) const analyser = audioContext.createAnalyser() var frequencyData = new Uint8Array(200) audioSource.connect(analyser) audioSource.connect(audioContext...
[minor] Use buffers to prevent node from doing unwanted checks
'use strict'; var through = require('through2') , pumpify = require('pumpify') , split = require('split'); // // Expose the transform. // module.exports = condenseify; /** * Browserify transform to condense multiple blank lines * into a single blank line. * * @param {String} file File name * @param {Object}...
'use strict'; var through = require('through2') , pumpify = require('pumpify') , split = require('split') , regex = /^[ \t]+$/; // // Expose the transform. // module.exports = condenseify; /** * Browserify transform to condense multiple blank lines * into a single blank line. * * @param {String} file File ...
Add lang_id parameter into breadcrumbs. :)
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model app\models\CttStaticdataCountrys */ $this->title = Yii::t('app', 'Update {modelClass}: ', [ 'modelClass' => 'Ctt Staticdata Countrys', ]) . ' ' . $model->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Ctt Staticdata Count...
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model app\models\CttStaticdataCountrys */ $this->title = Yii::t('app', 'Update {modelClass}: ', [ 'modelClass' => 'Ctt Staticdata Countrys', ]) . ' ' . $model->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Ctt Staticdata Count...
Fix parameter spacing in statup update script invocation from workflow.
from airflow import DAG from airflow.operators import BashOperator, PythonOperator from datetime import datetime, timedelta default_args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime(2015, 6, 1), 'email': ['airflow@airflow.com'], 'email_on_failure': False, 'email_on_r...
from airflow import DAG from airflow.operators import BashOperator, PythonOperator from datetime import datetime, timedelta default_args = { 'owner': 'airflow', 'depends_on_past': False, 'start_date': datetime(2015, 6, 1), 'email': ['airflow@airflow.com'], 'email_on_failure': False, 'email_on_r...
[V0.4][Travis] Modify to match lexicographical order
//@@author A0143409J package seedu.address.logic.parser; import static org.junit.Assert.assertEquals; import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import java.lang.reflect.Field; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import seed...
//@@author A0143409J package seedu.address.logic.parser; import static org.junit.Assert.assertEquals; import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import java.lang.reflect.Field; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import seed...
Add closures with shared state example
package sh import "testing" func TestFunctionsClosures(t *testing.T) { for _, test := range []execTestCase{ { desc: "simpleClosure", execStr: ` fn func(a) { fn closure() { print($a) } return $closure } x <= func("1") y <= func("2") $x() $y() `, expectedStdo...
package sh import "testing" func TestFunctionsClosures(t *testing.T) { for _, test := range []execTestCase{ { desc: "simpleClosure", execStr: ` fn func(a) { fn closure() { print($a) } return $closure } x <= func("1") y <= func("2") $x() $y() `, expectedStdo...
Add a method to find all measurements.
# -*- coding: utf-8 -*- from sqlalchemy import ( Column, Date, Integer, MetaData, Numeric, String, Table, ) def define_tables(metadata): Table('measurement', metadata, Column('id', Integer, primary_key=True), Column('weight', Numeric(4, 1), nullable=False), Col...
# -*- coding: utf-8 -*- from sqlalchemy import ( Column, Date, Integer, MetaData, Numeric, String, Table, ) def define_tables(metadata): Table('measurement', metadata, Column('id', Integer, primary_key=True), Column('weight', Numeric(4, 1), nullable=False), Col...
Update the version to 0.1.8
#!/usr/bin/python # -*-coding:UTF-8 -*- from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) setup( name='dictmysqldb', version='0.1.8', description='A mysql package above MySQL-python for more convenient database manipulation with Python dictionar...
#!/usr/bin/python # -*-coding:UTF-8 -*- from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) setup( name='dictmysqldb', version='0.1.7', description='A mysql package above MySQL-python for more convenient database manipulation with Python dictionar...
Add all supported python versions to classifiers.
import sys from setuptools import setup, find_packages if sys.version_info < (2, 7, 0): print("Error: signac requires python version >= 2.7.x.") sys.exit(1) setup( name='signac', version='0.6.2', packages=find_packages(), zip_safe=True, author='Carl Simon Adorf', author_email='csadorf...
import sys from setuptools import setup, find_packages if sys.version_info < (2, 7, 0): print("Error: signac requires python version >= 2.7.x.") sys.exit(1) setup( name='signac', version='0.6.2', packages=find_packages(), zip_safe=True, author='Carl Simon Adorf', author_email='csadorf...
Use io.ReadFull instead of ioutil.ReadAll when reading Sensu API responses
package sensu import ( "fmt" "io" "net/http" "net/url" ) // ... func (api *API) doRequest(req *http.Request) ([]byte, *http.Response, error) { if api.User != "" && api.Pass != "" { req.SetBasicAuth(api.User, api.Pass) } res, err := api.Client.Do(req) if err != nil { status, ok := err.(*url.Error) if !o...
package sensu import ( "fmt" "io/ioutil" "net/http" "net/url" ) // ... func (api *API) doRequest(req *http.Request) ([]byte, *http.Response, error) { if api.User != "" && api.Pass != "" { req.SetBasicAuth(api.User, api.Pass) } res, err := api.Client.Do(req) if err != nil { status, ok := err.(*url.Error) ...
Remove incorrect debugging line, leave var_dump
<?php require_once('./config.php'); var_dump($_POST); $state = $_POST['shippingState']; if ( !strcmp("GA", $state) ) { // the shipping address is in Georgia, so go ahead $token = $_POST['stripeToken']; $email = $_POST['emailAddress']; echo "$token and $email"; $customer = St...
<?php require_once('./config.php'); echo "The POST is $_POST"; var_dump($_POST); $state = $_POST['shippingState']; if ( !strcmp("GA", $state) ) { // the shipping address is in Georgia, so go ahead $token = $_POST['stripeToken']; $email = $_POST['emailAddress']; echo "$token ...
Make config values not case-sensitive.
import os from traceback import format_exc from apps.config.models import ConfigValue import functions_general """ Handle the setting/retrieving of server config directives. """ def host_os_is(osname): """ Check to see if the host OS matches the query. """ if os.name == osname: return True return...
import os from traceback import format_exc from apps.config.models import ConfigValue import functions_general """ Handle the setting/retrieving of server config directives. """ def host_os_is(osname): """ Check to see if the host OS matches the query. """ if os.name == osname: return True return...
Fix Webpack global scope issue In webpack 4 (Angular 8) the `_global = ...` will return undefined causing "Cannot read property WebSocket of undefined"
var _global = (function () { if (!this && typeof global !== 'undefined') { return global; } return this; })(); var NativeWebSocket = _global.WebSocket || _global.MozWebSocket; var websocket_version = require('./version'); /** * Expose a W3C WebSocket class with just one or two arguments. */ function W3CWebSock...
var _global = (function() { return this; })(); var NativeWebSocket = _global.WebSocket || _global.MozWebSocket; var websocket_version = require('./version'); /** * Expose a W3C WebSocket class with just one or two arguments. */ function W3CWebSocket(uri, protocols) { var native_instance; if (protocols) { nativ...
Use pypi version of lucene-querybuilder
from setuptools import setup, find_packages setup( name='neomodel', version='0.3.6', description='An object mapper for the neo4j graph database.', long_description=open('README.rst').read(), author='Robin Edwards', author_email='robin.ge@gmail.com', zip_safe=True, url='http://github.com...
from setuptools import setup, find_packages setup( name='neomodel', version='0.3.6', description='An object mapper for the neo4j graph database.', long_description=open('README.rst').read(), author='Robin Edwards', author_email='robin.ge@gmail.com', zip_safe=True, url='http://github.com...
Remove code to remove leading ? on RQL queries
define([ 'rql/js-array', 'dojo/_base/declare', './Memory' ], function (arrayEngine, declare, Memory) { return declare([Memory], { // summary: // This is a mixin or base class that allows us to use RQL for querying/filtering for client stores filter: function (q, options) { // strip the leading '?' since...
define([ 'rql/js-array', 'dojo/_base/declare', './Memory' ], function (arrayEngine, declare, Memory) { return declare([Memory], { // summary: // This is a mixin or base class that allows us to use RQL for querying/filtering for client stores filter: function (q, options) { // strip the leading '?' since...
[RateLimiter] Fix CI on PHP 8.2
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\RateLimiter\Tests\Policy; use PHPUnit\Framework\TestC...
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\RateLimiter\Tests\Policy; use PHPUnit\Framework\TestC...
Modify key "phone" to "telefone"
(function(){ function close() { $('.md-show .md-close').click(); } function clean() { $('.md-show input[name="name"]').val(''), $('.md-show input[name="email"]').val(''), $('.md-show input[name="phone"]').val(''); } $('.btn-modal').click(function() { var name = $('.md-show input[name="n...
(function(){ function close() { $('.md-show .md-close').click(); } function clean() { $('.md-show input[name="name"]').val(''), $('.md-show input[name="email"]').val(''), $('.md-show input[name="phone"]').val(''); } $('.btn-modal').click(function() { var name = $('.md-show input[name="n...
Break up long, long line
import request from 'request'; import config from '../config/config'; export default { getFromConfig(callback) { let now = new Date(); let later = new Date().setDate(now.getDate() + 2); let url = 'https://www.googleapis.com/calendar/v3/calendars' + `/${config.google.calendarId}...
import request from 'request'; import config from '../config/config'; export default { getFromConfig(callback) { let now = new Date(); let later = new Date().setDate(now.getDate() + 2); let url = `https://www.googleapis.com/calendar/v3/calendars/${config.google.calendarId}/events?key=${con...
Fix field label in init as well as bind
export class Basefield { id = ''; label = ''; columns = 8; index = undefined; parent = undefined; init(id = '', {label = '', columns = 8, parent, index} = {}) { this.id = id; this.label = label; this.columns = columns; this.index = index; this.parent = parent; this.fixLabel(); r...
export class Basefield { id = ''; label = ''; columns = 8; index = undefined; parent = undefined; init(id = '', {label = '', columns = 8, parent, index} = {}) { this.id = id; this.label = label; this.columns = columns; this.index = index; this.parent = parent; return this; } bi...
PM-133: Simplify and clean the livestream data logger
from pymoku import Moku, MokuException, NoDataException from pymoku.instruments import * import time # Use Moku.get_by_serial() or get_by_name() if you don't know the IP m = Moku.get_by_name('example') i = Oscilloscope() m.attach_instrument(i) try: # 10Hz sample rate. The datalogger is actually just a mode of the Os...
from pymoku import Moku, MokuException, NoDataException from pymoku.instruments import * import time, logging, traceback logging.basicConfig(format='%(asctime)s:%(name)s:%(levelname)s::%(message)s') logging.getLogger('pymoku').setLevel(logging.INFO) # Use Moku.get_by_serial() or get_by_name() if you don't know the IP...
Set LOGPATH to nailgun folder by default
import os import os.path LOGPATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") LOGFILE = os.path.join(LOGPATH, "nailgun.log") LOGLEVEL = "DEBUG" CELERYLOGFILE = os.path.join(LOGPATH, "celery.log") CELERYLOGLEVEL = "DEBUG" PATH_TO_SSH_KEY = os.path.join(os.getenv("HOME"), ".ssh", "id_rsa") PATH_TO_B...
import os import os.path LOGPATH = "/var/log/nailgun" LOGFILE = os.path.join(LOGPATH, "nailgun.log") LOGLEVEL = "DEBUG" CELERYLOGFILE = os.path.join(LOGPATH, "celery.log") CELERYLOGLEVEL = "DEBUG" PATH_TO_SSH_KEY = os.path.join(os.getenv("HOME"), ".ssh", "id_rsa") PATH_TO_BOOTSTRAP_SSH_KEY = os.path.join(os.getenv("H...
Revert to name 'website' on error
import { Component } from 'react'; import h from 'react-hyperscript'; import Quote from './components/Quote'; import getRandomQuote from './utils/getRandomQuote'; class App extends Component { constructor(props) { super(props); this.state = { text: 'Loading...', name: 'website', }; } c...
import { Component } from 'react'; import h from 'react-hyperscript'; import Quote from './components/Quote'; import getRandomQuote from './utils/getRandomQuote'; class App extends Component { constructor(props) { super(props); this.state = { text: 'Loading...', name: 'website', }; } c...
Change to sample pachube script
import clr from System import * from System.Net import WebClient from System.Xml import XmlDocument from System.Diagnostics import Trace url = "http://pachube.com/api/" apiKey = "<Your-Pachube-Api-Key-Here>" environmentId = -1 def Publish(topic, data): ms = MemoryStream() Trace.WriteLine("Pachube Sample") ...
import clr from System import * from System.Net import WebClient from System.Xml import XmlDocument from System.Diagnostics import Trace url = "http://pachube.com/api/" apiKey = "40ab667a92d6f892fef6099f38ad5eb31e619dffd793ff8842ae3b00eaf7d7cb" environmentId = 2065 def Publish(topic, data): ms = MemoryStream() ...
Revert "Options rewrite started, allows for the built in primitive types now." This reverts commit c1b43ee736baf7be8abd224fba9d1aa19d17e944.
require('../CactusJuice.js'); module.exports = (function () { var Options = CactusJuice.Util.Options; var Assertion = CactusJuice.Dev.Assertion; var assertException = Assertion.exception.bind(Assertion); var JSON = CactusJuice.Util.JSON; var stringify = JSON.stringify; return { a : function (assert) {...
require('../CactusJuice.js'); module.exports = (function () { var Options = CactusJuice.Util.Options; var Assertion = CactusJuice.Dev.Assertion; var assertException = Assertion.exception.bind(Assertion); var JSON = CactusJuice.Util.JSON; var stringify = JSON.stringify; return { a : function (assert) {...
Change apiURL default from docker to localhost As this is a public repository, we can't assume everybody will be using docker and have the same container name. MOM-554
'use strict'; var fs = require('fs'); var path = require('path'); exports.getApiConfig = function() { return Object.freeze({ port: process.env.SERVER_PORT || 4002, heartbeat: process.env.HEARTBEAT === 'true', logLevel: process.env.LOG_LEVEL || 'info', api: Object.freeze({ apiURL: process.env.A...
'use strict'; var fs = require('fs'); var path = require('path'); exports.getApiConfig = function() { return Object.freeze({ port: process.env.SERVER_PORT || 4002, heartbeat: process.env.HEARTBEAT === 'true', logLevel: process.env.LOG_LEVEL || 'info', api: Object.freeze({ apiURL: process.env.A...
Fix debug build test failure Not really a bug here, v8 seems overzealous with this CHECK failure
let ivm = require('isolated-vm'); let isolate = new ivm.Isolate; function makeContext() { let context = isolate.createContextSync(); let global = context.global; global.setSync('ivm', ivm); isolate.compileScriptSync(` function makeReference(ref) { return new ivm.Reference(ref); } function isReference(ref)...
let ivm = require('isolated-vm'); let isolate = new ivm.Isolate; function makeContext() { let context = isolate.createContextSync(); let global = context.global; global.setSync('ivm', ivm); isolate.compileScriptSync(` function makeReference(ref) { return new ivm.Reference(ref); } function isReference(ref)...
Add private constructor to mockserializable.
package com.tinkerpop.gremlin.structure; import java.io.Serializable; /** * @author Stephen Mallette (http://stephen.genoprime.com) */ public class MockSerializable implements Serializable { private String testField; private MockSerializable() {} public MockSerializable(final String testField) { ...
package com.tinkerpop.gremlin.structure; import java.io.Serializable; /** * @author Stephen Mallette (http://stephen.genoprime.com) */ public class MockSerializable implements Serializable { private String testField; public MockSerializable(final String testField) { this.testField = testField; ...
Update motor API with new data model
from Adafruit_MotorHAT import Adafruit_MotorHAT class Vehicle: def __init__(self, motor_hat=Adafruit_MotorHAT()): self.motor_hat = motor_hat self.motors = [] def release(self): self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE) self.motor_hat.getMotor(2).run(Adafruit_Mo...
from Adafruit_MotorHAT import Adafruit_MotorHAT class Vehicle: def __init__(self, motor_hat=Adafruit_MotorHAT()): self.motor_hat = motor_hat self.motors = [] def release(self): self.motor_hat.getMotor(1).run(Adafruit_MotorHAT.RELEASE) self.motor_hat.getMotor(2).run(Adafruit_Mo...
Create solutions directory if it does not exist
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode class ClearEx...
# -*- coding: utf-8 -*- """ nbtutor - a small utility to indicate which cells should be cleared (exercises). """ import os try: from nbconvert.preprocessors.base import Preprocessor except ImportError: from IPython.nbconvert.preprocessors.base import Preprocessor from traitlets import Unicode class ClearEx...
Use valid k8s port name
/** * Copyright 2005-2016 Red Hat, Inc. * * Red Hat licenses this file to you 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 r...
/** * Copyright 2005-2016 Red Hat, Inc. * * Red Hat licenses this file to you 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 r...
Add gravity between the player and the big thing
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var player; var cursors; var heavy; function preload() { game.load.image('star', 'assets/star.png'); game.load.image('diamond', 'assets/diamond.png'); } function create() { game.physics.startSystem(Phaser.P...
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var player; var cursors; function preload() { game.load.image('star', 'assets/star.png'); game.load.image('diamond', 'assets/diamond.png'); } function create() { game.physics.startSystem(Phaser.Physics.ARCA...
Add send data ajax function
var mode = 0; //primary function calc_mode() { var modes = ["primary", "secondary", "tertiary"]; return modes[mode]; } function send_data() { $.ajax({ url: "calculate/"+primary+"/"+secondary+"/"+tertiary, context: document.body, type: "post", beforeSend :function() { //loading } }).done(function(data...
var mode = 0; //primary function calc_mode() { var modes = ["primary", "secondary", "tertiary"]; return modes[mode]; } $(function() { $(".add").button(); $(".edit").button(); $(".delete").button().click(function() { var res = confirm("Are you sure you want to delete this item?"); if (res) window.location....