Page MenuHomePhabricator
Paste Active Pastes
  • OK, so the answer to P108 lies in the fact it's a parameterised query using positional parameters.
    The key points to this are the limit() call and how it interacts with the fetchByParameter() call.
    Most of the code given can be ignored initially, so let's direct our focus immediately to the fetchByParameter() definition.
    ...
    • Feb 8 2017, 10:59 AM
    • 19 Lines
  • <?php
    // Spot the bug.
    //
    // This is returning no results for any status, like this:
    ...
    • Feb 8 2017, 1:04 AM
    • 259 Lines
    • PHP
  • MariaDB [production]> select opencount.day, opencount.opened, closecount.closed from
    -> (select date(timestamp) day, count(*) opened from log where action = 'Email Confirmed' and timestamp > '2016-12-31 23:59:59' group by date(timestamp)) opencount
    -> inner join
    -> (select count(*) closed, date(timestamp) day from log where action like 'Closed %' and timestamp > '2016-12-31 23:59:59' group by date(timestamp)) closecount
    -> on opencount.day = closecount.day
    ...
    • Feb 3 2017, 10:59 PM
    • 44 Lines
  • MariaDB [production]> select date(timestamp), count(*) from log where action = 'Email Confirmed' and timestamp > '2016-12-31 23:59:59' group by date(timestamp) order by date(timestamp) asc;
    +-----------------+----------+
    | date(timestamp) | count(*) |
    +-----------------+----------+
    | 2017-01-01 | 29 |
    ...
    • Feb 3 2017, 10:49 PM
    • 39 Lines
  • 12:53 -!- Helpmebot [helpmebot@wikimedia/bot/helpmebot] has quit [Remote host closed the connection]
    12:53 -!- Helpmebot [helpmebot@wikimedia/bot/helpmebot] has joined #wikipedia-en-accounts
    12:53 -!- mode/#wikipedia-en-accounts [+v Helpmebot] by ChanServ
    12:53 -!- Helpmebot [helpmebot@wikimedia/bot/helpmebot] has quit [Remote host closed the connection]
    12:53 -!- Helpmebot [helpmebot@wikimedia/bot/helpmebot] has joined #wikipedia-en-accounts
    ...
    • Jan 31 2017, 1:34 PM
    • 26 Lines
  • Jan 30 13:08:05 spearow sudo: jenkins : TTY=unknown ; PWD=/var/lib/jenkins/workspace/helpmebot-restart ; USER=root ; COMMAND=/usr/sbin/service helpmebot restart
    Jan 30 13:08:05 spearow sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
    Jan 30 13:08:05 spearow sudo: pam_unix(sudo:session): session closed for user root
    Jan 22 14:13:10 spearow sshd[24072]: Connection closed by 176.58.111.145 [preauth]
    Jan 30 13:08:09 spearow sudo: jenkins : TTY=unknown ; PWD=/var/lib/jenkins/workspace/helpmebot-restart ; USER=root ; COMMAND=/usr/sbin/service helpmebot restart
    ...
    • Jan 30 2017, 1:19 PM
    • 19 Lines
  • [23:54:33][stwalkerster@fearow:~]
    bash $ mysql
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 628085
    Server version: 5.5.54-0ubuntu0.14.04.1-log (Ubuntu)
    ...
    • Jan 25 2017, 11:55 PM
    • 97 Lines
  • MariaDB [test]> create table mytable (
    -> id varchar(50) not null,
    -> name varchar(50) null default '',
    -> primary key (id));
    Query OK, 0 rows affected (0.26 sec)
    ...
    • Jan 25 2017, 11:52 PM
    • 71 Lines
  • <complexstalk flag="me" lastupdate="11/09/2016 14:02:32" lasttrigger="11/22/2016 03:58:19" mail="False" immediatemail="True" description="Anything in my userspace except my talk page" expiry="12/31/9999 23:59:59" enabled="True">
    <and>
    <and>
    <page value="User( talk|):Stwalkerster(.*)" />
    <and>
    ...
    • Jan 17 2017, 9:48 PM
    • 18 Lines
    • XML
  • Filesort
    +- TEMPORARY
    table temporary(log,user,emailtemplate)
    +- JOIN
    +- Join buffer
    ...
    • Dec 20 2016, 11:49 AM
    • 26 Lines
  • +------+-------------+-------+------+---------------+------+---------+------+------+-------------------------------------------------+
    | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
    +------+-------------+-------+------+---------------+------+---------+------+------+-------------------------------------------------+
    | 1 | SIMPLE | user | ALL | NULL | NULL | NULL | NULL | 1284 | |
    | 1 | SIMPLE | user | ALL | NULL | NULL | NULL | NULL | 1284 | Using where; Using join buffer (flat, BNL join) |
    ...
    • Dec 20 2016, 11:08 AM
    • 18 Lines
  • <?php
    $pdo = new PDO('mysql:host=localhost;dbname=stwalkerster_ed_explore', 'stwalkerster', 'fl4smells');
    $query = $pdo->query('SELECT * FROM system WHERE x IS NULL OR y IS NULL OR z IS NULL');
    $update = $pdo->prepare('UPDATE system SET x = :x, y = :y, z = :z WHERE id = :id');
    ...
    • Dec 13 2016, 8:55 PM
    • 23 Lines
    • PHP
  • class minecraftHost {
    minecraft{ "mc1.5" : port => 25566, ensure => "absent" }
    minecraft{ "ohai" : port => 25566, ensure => "absent" }
    minecraft{ "creative" : port => 25567, ensure => "absent" }
    ...
    • Nov 17 2016, 12:12 AM
    • 227 Lines
    • Puppet
  • namespace GitHubImporter
    {
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    ...
    • Oct 25 2016, 1:26 AM
    • 190 Lines
    • C#
  • ; Start a new pool named 'pool-stw-hotel'.
    ; the variable $pool can we used in any directive and will be replaced by the
    ; pool name ('pool-stw-hotel' here)
    [pool-stw-hotel]
    ...
    • Oct 24 2016, 1:49 AM
    • 387 Lines
  • # Managed by puppet
    ################################################################################
    # HTTP section
    ...
    • Oct 24 2016, 1:49 AM
    • 105 Lines
  • <FilesMatch ".+\.ph(p[345]?|t|tml)$">
    SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch ".+\.phps$">
    SetHandler application/x-httpd-php-source
    ...
    • Oct 21 2016, 9:13 AM
    • 27 Lines
  • ; Start a new pool named 'stw-hotel'.
    ; the variable $pool can we used in any directive and will be replaced by the
    ; pool name ('stw-hotel' here)
    [stw-hotel]
    ...
    • Oct 21 2016, 8:53 AM
    • 387 Lines
  • # Managed by puppet
    ################################################################################
    # HTTP section
    ...
    • Oct 21 2016, 8:53 AM
    • 84 Lines
  • [20:45:37][root@fearow:~]
    bash $ /opt/certbot/le-gencert certonly -t --webroot -w /var/www/stwalkerster.co.uk/ -d stwalkerster.co.uk -d phabricator.stwalkerster.co.uk
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
    Obtaining a new certificate
    ...
    • Oct 20 2016, 8:47 PM
    • 38 Lines
  • * | | | | | | | | | | | | | | | | | | | 85ee6b4 Merge "Add a continuation button to ApiSandbox"
    |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
    | |_|_|_|/ / / / / / / / / / / / / / / /
    |/| | | | | | | | | | | | | | | | | | |
    | * | | | | | | | | | | | | | | | | | | bd61961 Add a continuation button to ApiSandbox
    ...
    • Oct 20 2016, 12:18 PM
    • 55 Lines
  • | idx_ban_active | active | |
    | idx_ban_duration | duration | 765 |
    | idx_ban_typeactive | "type,active" | 765 |
    | idx_comment_request | request | |
    | name | name | 765 |
    ...
    • Oct 7 2016, 11:26 PM
    • 32 Lines
    • Remarkup
  • public IEnumerable<int> Fibonacci()
    {
    int prev = -1;
    int next = 1;
    while (true)
    ...
    • Oct 4 2016, 9:03 AM
    • 12 Lines
    • C#
  • #!/usr/bin/env bash -ex
    function serverCommand {
    ssh -p 8022 jenkins@localhost 'echo '"'"$1"'"' > /mnt/minecraft/minecraft-'$BUILD_WORLD_UNIX_NAME'.fifo'
    }
    ...
    • Sep 27 2016, 11:16 PM
    • 49 Lines
    • Bash Scripting
  • * PeaEnumerator (~beancounter@cpc103060-sgyl39-2-0-cust1410.18-2.cable.virginm.net) has joined ##stwalkerster
    <stwalkerster> ?w battlestar Galactica
    <PeaEnumerator> stwalkerster: Battlestar Galactica | Battlestar Galactica is an American science fiction franchise created by Glen A. Larson. The franchise began with the original television series in 1978 and was later followed by a short-run sequel series (Galactica 1980), a line of book adaptations,... | https://en.wikipedia.org/wiki/Battlestar_Galactica
    <stwalkerster> https://en.wikipedia.org/wiki/Battlestar_Galactica
    <PeaEnumerator> Wikipedia | Battlestar Galactica | Battlestar Galactica is an American science fiction franchise created by Glen A. Larson. The franchise began with the original television series in 1978 and was later followed by a short-run sequel series (Galactica 1980), a line of book adaptations,...
    ...
    • Aug 24 2016, 11:44 PM
    • 17 Lines
  • description "Helpmebot"
    author "Simon Walker <simon@stwalkerster.co.uk>"
    start on started network
    stop on stopping network
    ...
    • Aug 22 2016, 5:33 PM
    • 16 Lines
  • <stwalkerster> https://en.wikipedia.org/wiki/Cylon_(Battlestar_Galactica)
    <HMBCounter> Wikipedia | Cylon (Battlestar Galactica) | The Cylons are a cybernetic civilization at war with the Twelve Colonies of humanity in the Battlestar Galactica science fiction franchise, in the original 1978 and 1980 series, the 2004 reimagining, as well as the spin-off prequel series, Caprica. In...
    <stwalkerster> https://en.wikipedia.org/wiki/battlestarwiki:Cylons_(RDM)
    <HMBCounter> Battlestar Wiki | Cylons (RDM)
    <stwalkerster> ?w Broadridge
    ...
    • Aug 20 2016, 10:18 PM
    • 14 Lines
  • diff --git a/pom.xml b/pom.xml
    index 396a31f..48b63fc 100644
    --- a/pom.xml
    +++ b/pom.xml
    @@ -28,6 +28,11 @@
    ...
    • Aug 14 2016, 10:47 PM
    • 64 Lines
    • Diff
  • [18:31:08][stwalkerster@fearow:~]
    bash $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 14.04.5 LTS
    ...
    • Aug 8 2016, 6:32 PM
    • 14 Lines
  • declare
    cursor c is
    select table_name
    from user_tables
    where compression <> 'ENABLED';
    ...
    • Aug 4 2016, 10:13 PM
    • 12 Lines
    • SQL
  • 2016-06-18 20:54:40,863 DEBUG Default.NetworkClient.Inbound - :(user) PRIVMSG (channel) :(message)
    Unhandled Exception:
    Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed.
    at Mono.Security.Protocol.Tls.RecordProtocol.ProcessAlert (AlertLevel alertLevel, AlertDescription alertDesc) [0x00000] in <filename unknown>:0
    ...
    • Jun 18 2016, 9:10 PM
    • 11 Lines
  • // Let's have a class. It's sealed for some reason so we can't extend it.
    public sealed class Foo
    {
    // This class has two properties, but has nothing useful here.
    public int Value1 {get;set;}
    ...
    • Jun 15 2016, 2:55 AM
    • 25 Lines
    • C#
  • var client = new ConduitClient(phabUrl, token);
    var maniphest = new Maniphest(client);
    var task = new ManiphestTask { Title = "Test task", Description = "woo test!" };
    ...
    • May 29 2016, 3:41 AM
    • 11 Lines
    • C#
  • #!/bin/bash -xe
    apt-get install php5-mysql php5-curl php5-apcu php5-gd
    cd /opt/phabricator/phabricator
    ...
    • May 28 2016, 10:21 PM
    • 19 Lines
    • Bash Scripting
  • #!/bin/bash -xe
    ################## update base packages ##################
    # disable cdrom
    ...
    • May 28 2016, 9:07 PM
    • 79 Lines
    • Bash Scripting
  • import os
    from common import marker_definitions
    from observer import JSObserver
    configWorldUnixName = os.environ.get('BUILD_WORLD_UNIX_NAME')
    ...
    • May 12 2016, 10:34 PM
    • 32 Lines
    • Python
  • // We define this function:
    function isHttps()
    {
    if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
    ...
    • May 12 2016, 5:16 PM
    • 44 Lines
    • PHP
  • EXPLAIN
    SELECT page_id, page_namespace, page_title
    FROM page
    LEFT JOIN pagelinks ON pl_namespace = page_namespace AND pl_title = page_title
    LEFT JOIN templatelinks ON tl_namespace = page_namespace AND tl_title = page_title
    ...
    • May 10 2016, 10:11 PM
    • 14 Lines
  • EXPLAIN
    SELECT page_id, page_namespace, page_title
    FROM page
    LEFT JOIN pagelinks ON pl_namespace = page_namespace AND pl_title = page_title
    LEFT JOIN templatelinks ON tl_namespace = page_namespace AND tl_title = page_title
    ...
    • Apr 17 2016, 4:33 PM
    • 11 Lines
    • SQL
  • EXPLAIN
    SELECT page_namespace, page_title
    FROM page
    LEFT JOIN pagelinks ON pl_namespace = page_namespace AND pl_title = page_title
    LEFT JOIN templatelinks ON tl_namespace = page_namespace AND tl_title = page_title
    ...
    • Apr 17 2016, 4:22 PM
    • 9 Lines
    • SQL
  • <?php
    ini_set("user_agent", 'ExampleProject/0.0 (wikimedia@stwalkerster.co.uk)');
    // bomb out early if no username specified
    ...
    • Apr 8 2016, 7:43 PM
    • 22 Lines
    • PHP
  • <?php
    $db = new PDO('mysql:host=localhost;dbname=enwiki_p', 'u2204', '');
    $statement = $db->prepare('select page_id, page_namespace, page_title from enwiki_p.categorylinks
    ...
    • Apr 8 2016, 6:11 PM
    • 38 Lines
    • PHP
  • -- create a temporary table to hold page IDs for results
    create temporary table if NOT EXISTS u2204__testing.pageid ( id int(11) PRIMARY KEY );
    -- enable recursion
    set MAX_SP_RECURSION_DEPTH = 255;
    ...
    • Apr 8 2016, 5:46 PM
    • 57 Lines
    • SQL
  • {{db-spam|help=off}}
    {| class="wikitable sortable"
    |+
    <ref>{{Cite web|url=www.akhbaarwala.com|title=Akhbaarwala|last=Srivastava|first=Priti|date=|website=Akhbaarwala|publisher=Priti Srivastava|access-date=}}</ref>
    ! colspan="2" |[[File:Akhbaarwala.png|thumb|271x271px|Newspaper Distributors]]
    ...
    • Apr 6 2016, 6:07 PM
    • 47 Lines
  • User Count Swap USS PSS RSS
    oident 1 0.00% 0.00% 0.00% 0.02%
    daemon 1 0.00% 0.00% 0.00% 0.02%
    ntp 1 0.01% 0.01% 0.01% 0.04%
    whoopsie 1 0.04% 0.00% 0.01% 0.07%
    ...
    • Mar 21 2016, 7:31 PM
    • 48 Lines
  • # Query 1: 0.00 QPS, 0.00x concurrency, ID 0x4230CEA3DE36DE14 at byte 334559
    # Scores: V/M = 0.32
    # Time range: 2016-03-13 22:10:24 to 2016-03-14 22:35:44
    # Attribute pct total min max avg 95% stddev median
    # ============ === ======= ======= ======= ======= ======= ======= =======
    ...
    • Mar 15 2016, 7:13 PM
    • 46 Lines
  • -ChanServ- 2 werdan7 +ARVefiorstv (SuperOp) (#wikipedia-en-help) [modified 4y 3w 3d ago, on Jan 28 22:07:00 2012]
    -ChanServ- 9 KFP +ARVefiorstv (SuperOp) (#wikipedia-en-help) [modified 4y 6w 2d ago, on Jan 08 23:39:09 2012]
    -ChanServ- 13 Golbez +AViotv (Op) (#wikipedia-en-help) [modified 6y 5w 5d ago, on Jan 12 18:53:30 2010]
    -ChanServ- 14 stwalkerster +ARVefiorstv (SuperOp) (#wikipedia-en-help) [modified 4y 6w 2d ago, on Jan 08 23:39:09 2012]
    -ChanServ- 16 bjelleklang +AViotv (Op) (#wikipedia-en-help) [modified 6y 5w 5d ago, on Jan 12 18:53:30 2010]
    ...
    • Feb 21 2016, 4:58 AM
    • 44 Lines
  • DEBUG Default.NetworkClient.Inbound [(null)] - :ChanServ!ChanServ@services. JOIN ##channelname * :Channel Services
    INFO Default.IrcClient [(null)] - Seen ChanServ!@ join channel ##channelname.
    ERROR Helpmebot.Services.JoinMessageService [(null)] - JoinMessage ratelimiting called with null channel or null hostname!
    • Feb 20 2016, 8:59 PM
    • 3 Lines