[ create a new paste ] login | about

slevy1ster

Name:
Email:
Site/Blog:
Location:
Default language:
Favorite languages:
About:

Saved pastes by slevy1ster:

C, pasted on Jan 30:
1
2
3
4
#include <stdio.h>
#include <strings.h>

int main(void){
...
view (15 lines, 4 lines of output)
C, pasted on Jan 29:
1
2
3
4
#include <stdio.h>
#include <strings.h>

int main(void){
...
view (11 lines, 2 lines of output)
C, pasted on Apr 4:
1
2
3
4
5
#include <stdio.h>
#include <string.h>

int main () {
   char str[] = "beta";
...
view (11 lines, 1 line of output)
Perl, pasted on Nov 20:
1
2
3
4
$f = 'flower';
$b = 'bed';
${$f . $b} = 'English lavender';
print("The fragrant ${$f . $b}...");
view (4 lines, 1 line of output)
Perl, pasted on Nov 19:
1
2
3
4
$f = 'flower';

# set dynamic variable
${$f . 'bed'} = 'English Lavender';
...
view (8 lines, 2 lines of output)
Perl, pasted on Nov 18:
1
2
$object->{'clr'} = "blue";
print("Lovely Texas $object->{'clr'}bonnets");
view (2 lines, 1 line of output)
Perl, pasted on Nov 18:
1
2
3
${" "} = "blank space";

print(${" "});
view (3 lines, 1 line of output)
Perl, pasted on Nov 16:
1
2
3
4
$num = 76;
$instruments = "trombones";

${$num . $instruments} = 'music man';      
...
view (6 lines, 1 line of output)
Perl, pasted on Nov 15:
1
2
3
4
$o->{"rose"} = "red";
$o->{"violet"} = "blue";

print( $o->{Test()} );
...
view (9 lines, 1 line of output)
Perl, pasted on Nov 14:
1
2
$city->{elevation} = "500 ft";
print($city->{elevation});
view (2 lines, 1 line of output)
Perl, pasted on Nov 10:
1
2
$flower= 'rose';
print("The garden has an impressive ${flower}bed.\n");
view (2 lines, 1 line of output)
Perl, pasted on Nov 9:
1
2
$man = 'barney';
print("The good man is named ${man}\n");
view (2 lines, 1 line of output)
Perl, pasted on Nov 2:
1
2
3
4
5
#!/usr/local/bin/perl

my %a;
$a{7} = 'seven';
$a{'hello'} = 'world';
...
view (6 lines, 1 line of output)
C, pasted on Aug 17:
1
2
3
4
5
#include <stdio.h>
int main() {


unsigned char c[] = {0x42, 0xe9, 0xcc, 0xcd};
...
view (26 lines, 5 lines of output)
C, pasted on Aug 17:
1
2
3
4
5
#include <stdio.h>
int main() {


unsigned char c[] = {0x42, 0xe9, 0xcc, 0xcd};
...
view (26 lines, 5 lines of output)
C, pasted on Aug 17:
1
2
3
4
5
#include <stdio.h>
int main() {


unsigned char c[] = {0x42, 0xe9, 0xcc, 0xcd};
...
view (25 lines, 5 lines of output)
C, pasted on Aug 17:
1
2
3
4
5
#include <stdio.h>
int main() {


unsigned char c[] = {0x42, 0xe9, 0xcc, 0xcd};
...
view (19 lines, 1 line of output)
C, pasted on Aug 16:
1
2
3
4
5
#include <stdio.h>

int main(){

long int li = 0x42e9cccd;
...
view (14 lines, 5 lines of output)
C, pasted on Aug 16:
1
2
3
4
5
#include <stdio.h>
int main() {
float snelheid;

unsigned char c[] = {0xcd, 0xcc, 0xe9, 0x42};
...
view (19 lines, 1 line of output)
C, pasted on Aug 15:
1
2
3
4
5
#include <stdio.h>
#include <string.h>

int main() {
 double f;
...
view (10 lines, 1 line of output)
C, pasted on Aug 15:
1
2
3
4
5
#include <stdio.h>
#include <string.h>

int main() {
 float f;
...
view (10 lines, 1 line of output)
C, pasted on Aug 13:
1
2
3
4
5
#include <stdio.h>

int main(void) {

int x=0;
...
view (10 lines, 2 lines of output)
C, pasted on Aug 13:
1
2
3
4
5
#include <stdio.h>

int main(void) {

int x=0;
...
view (9 lines, 2 lines of output)
C++, pasted on Jul 31:
1
2
3
4
5
#include <iostream>
using namespace std;


 int find(char f,string str) {
...
view (27 lines, 1 line of output)
C++, pasted on Jul 31:
1
2
3
4
5
#include <iostream>
using namespace std;


 int find(char f,string str) {
...
view (33 lines, 3 lines of output)
C, pasted on Jul 30:
1
2
3
4
5
#include <stdio.h>

void printnum ( int begin )
{
    printf( "%d", begin );
...
view (20 lines, 1 line of output)
C, pasted on Jul 30:
1
2
3
4
5
#include <stdio.h>

void printnum ( int begin )
{
    printf( "%d", begin );
...
view (18 lines, 1 line of output)
Perl, pasted on Jul 26:
1
2
print("\nNewlines start new lines\n")
print("\nCarriage Returns do not\n");
view (2 lines, 3 lines of output)
C, pasted on Jul 26:
1
2
3
4
5
#include <stdio.h>

int main (void) {
  printf("Currently, it is late.")
  printf("\nLater than you think.");
...
view (8 lines, 2 lines of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>

int main (void) {
  time_t seconds;
...
view (25 lines, 1 line of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>

int main (void) {
  time_t now = time(0);
...
view (24 lines, 2 lines of output)
C, pasted on Jun 27:
1
2
3
4
#include <stdio.h>
#include <time.h>

int main (void) {
...
view (14 lines, 1 line of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>


int main (void) {
...
view (22 lines, 2 lines of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>


int main (void) {
...
view (20 lines, 1 line of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>


int main (void) {
...
view (19 lines, 1 line of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>

typedef struct hour{
  int hour;
...
view (42 lines, 1 line of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>

typedef struct hour{
  int hour;
...
view (42 lines, 1 line of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>
 
typedef struct hour{
 
...
view (48 lines, 1 line of output)
C, pasted on Jun 27:
1
2
3
4
5
#include <stdio.h>
#include <time.h>
 
typedef struct date Date;
typedef struct hour Hour;
...
view (56 lines, 2 lines of output)
C, pasted on Jun 13:
1
2
3
4
5
#include <stdio.h>

char * getString(void)
{
    static char str[] = "textprint";
...
view (13 lines, 2 lines of output)
C, pasted on Jun 13:
1
2
3
4
5
#include <stdio.h>

char * getString(void)
{
    const * str = "textprint test";
...
view (13 lines, 1 line of output)
C, pasted on Jun 13:
1
2
3
4
5
#include <stdio.h>

char * getString()
{
    static char str[] = "textprint";
...
view (13 lines, 2 lines of output)
C, pasted on Jun 13:
1
2
3
4
5
#include <stdio.h>

char * getString()
{
    const * str = "textprint test";
...
view (13 lines, 2 lines of output)
C, pasted on Jun 13:
1
2
3
4
5
#include <stdio.h>

char * getString()
{
    char * str="textprint test";
...
view (13 lines, 1 line of output)
C, pasted on Jun 13:
1
2
3
4
5
#include <stdio.h>

char * getString()
{
    char * str="textprint";
...
view (14 lines, 1 line of output)
C, pasted on Jun 6:
1
2
3
4
5
#include <stdio.h>

union date {
 int year;
 char month;
...
view (18 lines, 1 line of output)
C, pasted on Jun 6:
1
2
3
4
5
#include <stdio.h>

union date {
 int year;
 char month;
...
view (18 lines, 1 line of output)
C, pasted on Jun 6:
1
2
3
4
5
#include <stdio.h>

union date {
 int year;
 
...
view (15 lines, 1 line of output)
C, pasted on Jun 6:
1
2
3
4
5
#include <stdio.h>

struct date {
 int year;
 char month;
...
view (16 lines, 1 line of output)
C, pasted on Jun 3:
1
2
3
4
#include<stdio.h>

int main()
{
...
view (15 lines, 2 lines of output)
C, pasted on May 23:
1
2
3
4
5
#include <stdio.h>

int main() {

   int sum = 17, count = 5;
...
view (14 lines, 3 lines of output)
C, pasted on May 23:
1
2
3
4
5
#include <stdio.h>

int main() {

   int sum = 17, count = 5;
...
view (14 lines, 1 line of output)
C, pasted on May 23:
1
2
3
4
5
#include <stdio.h>
#include <math.h>
int main() {

  int n = -6;
...
view (14 lines, 3 lines of output)
C, pasted on May 17:
1
2
3
4
5
#include <stdio.h>

int main() {
    if (__builtin_types_compatible_p(__typeof__(9 / 3 / 2 * 6 + 2 * 1.5), float)) {
        puts("float");
...
view (10 lines, 1 line of output)
C, pasted on May 17:
1
2
3
4
5
#include <stdio.h>

int main() {
    if (__builtin_types_compatible_p(__typeof__(9 / 3 / 2 * 6 + 2 * 1.5), float)) {
        puts("float");
...
view (10 lines, 1 line of output)
C, pasted on May 17:
1
2
3
4
5
#include <stdio.h>

int main(int argc, char **argv) {
    if (__builtin_types_compatible_p(__typeof__(9 / 3 / 2 * 6 + 2 * 1.5), float)) {
        puts("float");
...
view (10 lines, 1 line of output)
C, pasted on May 17:
1
2
3
4
#include <stdio.h>

int main(int argc, char **argv) {
    if (__builtin_types_compatible_p(__typeof__(1.5), float)) {
...
view (11 lines, 1 line of output)
C, pasted on May 16:
1
2
3
4
5
#include <stdio.h>
    
    void temp(int arr[], size_t arr_size)
    {
        int i;   
...
view (27 lines, 4 lines of output)
C, pasted on May 16:
1
2
3
4
5
#include <stdio.h>
    
    void temp(int arr[], size_t arr_size)
    {
        int i;   
...
view (24 lines, 1 line of output)
C, pasted on May 16:
1
2
3
4
5
#include <stdio.h>
void fun(int ptr[])
{
int i;
unsigned int n = sizeof(ptr)/sizeof(ptr[0]);
...
view (19 lines, 4 lines of output)
C, pasted on May 1:
1
2
3
4
5
#include <stdio.h>

 int main(){
    char alphabet[20];
    int i;
...
view (18 lines, 22 lines of output)
C, pasted on May 1:
1
2
3
4
5
#include <stdio.h>

 int main()
{
    char alphabet[20];
...
view (19 lines, 2 lines of output)
C, pasted on Apr 26:
1
2
3
4
#include <stdio.h>
#include <string.h>

void main() {
...
view (22 lines, 1 line of output)
C, pasted on Jun 29:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main(){
int n = 0;
...
view (9 lines, 1 line of output)
C, pasted on Jun 28:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main(){
int n = 0;
...
view (9 lines, 1 line of output)
C, pasted on May 29:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main(){
  int a = 1;
...
view (9 lines, 1 line of output)
PHP, pasted on Feb 12:
1
2
3
4
<?php
$a = 65;
$b = ~$a + 1;   // get twos complement
printf("%d\n0x%x\n\n",$b,$b);
...
view (13 lines, 9 lines of output)
PHP, pasted on Feb 12:
1
2
3
4
5
<?php
$a = 65;
$b = ~$a + 1;   // get twos complement
echo $b,"\n";
                 
...
view (13 lines, 7 lines of output)
PHP, pasted on Feb 12:
1
2
3
4
5
<?php
$a = 65;
$b = ~$a + 1;           // get 2s complement

echo $b,"\n";                 
...
view (16 lines, 7 lines of output)
PHP, pasted on Feb 11:
1
2
3
4
5
<?php

echo "int cast: ",(int)0xffffffff;   // -1
printf("\nprintf: %d\n",0xffffffff); // treat as a signed number -- first gets cast to an int?
echo "hexdec: ";
...
view (22 lines, 14 lines of output)
PHP, pasted on Feb 11:
1
2
3
4
<?php

printf("%x\n",~5 + 1);
printf("%x\n",pow(2,32) - 5);
...
view (14 lines, 8 lines of output)
PHP, pasted on Feb 11:
1
2
3
4
5
<?php

var_dump(0xffffffff);
printf("%x\n",PHP_INT_MAX);
printf("%x\n",~PHP_INT_MAX + 1);
...
view (9 lines, 8 lines of output)
PHP, pasted on Feb 10:
1
2
3
4
5
<?php

var_dump(0xffffffff);
printf("%x\n",PHP_INT_MAX);
printf("%x\n",~PHP_INT_MAX + 1);
...
view (7 lines, 5 lines of output)
PHP, pasted on Feb 10:
1
2
3
4
5
<?php
printf("\n%d\n",0xfffffffd);
echo "with echo: ",0xfffffffd,"\n";
$a = 65;
printf("%b\n",$a);
...
view (14 lines, 12 lines of output)
PHP, pasted on Feb 10:
1
2
3
4
5
<?php

echo $a = 5;
$tc = ~$a + 1;
printf("\n%x\n",$tc);
...
view (8 lines, 8 lines of output)
PHP, pasted on Feb 8:
1
2
3
4
5
<?php

$i = 0xFFFFFFFD;
$r = (0xFFFF & $i);   // shave off 4 bits
$x = $r - ( pow(2,16) );  
...
view (6 lines, 1 line of output)
PHP, pasted on Feb 8:
1
2
3
4
5
<?php

$i = 0xFFFFFFFD;
$r = (0xFFFF & $i);   // shave off 4 bits
$x = $r - (16 * 16 * 16 *16);  // $r - (2 ** 16);
...
view (6 lines, 1 line of output)
PHP, pasted on Feb 8:
1
2
3
4
<?php    

    $i = 0xFFFFFFFD;
    printf("%d\n",$i);
view (4 lines, 1 line of output)
C, pasted on Feb 8:
1
2
3
4
5
#include <stdio.h>

int main() {
    int i;
    i = 0xFFFFFFFD;
...
view (9 lines, 1 line of output)
C, pasted on Jan 29:
1
2
3
4
5
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
...
view (13 lines, 1 line of output)
C, pasted on Jan 28:
1
2
3
4
5
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
...
view (13 lines, 1 line of output)
C, pasted on Jan 27:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (13 lines, 1 line of output)
Python, pasted on Dec 14:
1
2
3
4
5
#Python

from math import pow

print 5.5 % 3.3
...
view (13 lines, 2 lines of output)
Perl, pasted on Dec 13:
1
2
3
4
5
my $n = 2 ** 64;

my $m = 2 ** 32;

print ($m % $n);
...
view (11 lines, 4 lines of output)
Perl, pasted on Dec 13:
1
2
3
4
5
my $n = 2 ** 64;

my $m = 2 ** 32;

print ($m % $n);
...
view (12 lines, 4 lines of output)
Perl, pasted on Dec 13:
1
2
3
4
use integer;
my $n = 2 ** 64;
my $m = 2 ** 32;
print ($m % $n),"\n";
view (4 lines, 1 line of output)
Perl, pasted on Dec 13:
1
2
3
my $n = 2 ** 64;
my $m = 2 ** 32;
print ($m % $n),"\n";
view (4 lines, 1 line of output)
Python, pasted on Dec 9:
1
2
3
4
5
#Python

from math import fmod

print fmod( float("inf"),  pow(2.,64.))
view (5 lines, 1 line of output)
Python, pasted on Dec 9:
1
2
3
4
5
#Python

from math import pow

print float("inf") % pow(2.,64.)
view (5 lines, 1 line of output)
Python, pasted on Dec 9:
1
2
3
from math import pow

print float("inf") % pow(2.,64.)
view (3 lines, 1 line of output)
Python, pasted on Dec 9:
1
2
3
#Python

print float("inf") % pow(2.,64.)
view (3 lines, 1 line of output)
C, pasted on Nov 19:
1
2
3
4
5
#include <stdio.h>
#include <math.h>

int main ()
{
...
view (10 lines, 1 line of output)
C, pasted on Nov 17:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

int main(){
...
view (9 lines, 1 line of output)
C, pasted on Nov 17:
1
2
3
4
5
#include <stdlib.h>
#include <math.h>


int main(){
...
view (10 lines, 6 lines of output)
C, pasted on Nov 17:
1
2
3
4
5
#include <stdlib.h>
#include <math.h>
#include <ieee.h>

int main(){
...
view (9 lines, 5 lines of output)
C, pasted on Nov 16:
1
2
3
4
5
void main() {

printf("%lf", (double) 1/ (double) 0);

}
view (5 lines, 1 line of output)
C, pasted on Nov 13:
1
2
3
void main() {

printf("%lf", 1.0/0.0);
...
view (6 lines, 1 line of output)
C, pasted on Nov 1:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

void neverExecuted() { puts("never\n"); }
void executed() { puts("executed\n"); }
...
view (18 lines, 3 lines of output)
Python, pasted on Nov 1:
1
2
list1 = ['physics', 'chemistry', 1997, 2000]
print "list1[0]: ", list1[0]
view (2 lines, 1 line of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main() {
   char str[5] = "0123";
...
view (16 lines, 1 line of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main() {
   char str[7] = "018912";
...
view (14 lines, 3 lines of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main() {
   char str[7] = "018912";
...
view (14 lines, 2 lines of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (16 lines, 2 lines of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (16 lines, 1 line of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (20 lines, 2 lines of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (20 lines, 2 lines of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (20 lines, 2 lines of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (19 lines, 2 lines of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (18 lines, 1 line of output)
C, pasted on Oct 30:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (20 lines, 1 line of output)
C, pasted on Oct 29:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (16 lines, 3 lines of output)
C, pasted on Oct 29:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (17 lines, 3 lines of output)
C, pasted on Oct 29:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

int main()
{
...
view (18 lines, 4 lines of output)
C, pasted on Oct 20:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (15 lines, 1 line of output)
C, pasted on Oct 19:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (15 lines, 1 line of output)
C, pasted on Oct 19:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (15 lines, 1 line of output)
PHP, pasted on Oct 11:
1
2
3
4
5
<?php

$a = new stdClass;

class b{}
...
view (11 lines, 6 lines of output)
C, pasted on Sep 27:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (16 lines, 1 line of output)
C, pasted on Sep 4:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (23 lines, 5 lines of output)
C, pasted on Aug 28:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (18 lines, 1 line of output)
C, pasted on Aug 28:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (17 lines, 1 line of output)
C, pasted on Aug 28:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (14 lines, 1 line of output)
PHP, pasted on Jul 12:
1
2
3
<?php

echo is_infinite( -INF );
view (3 lines, 1 line of output)
PHP, pasted on Jul 9:
1
2
3
4
<?php

$inf = INF;
var_dump($inf);
view (4 lines, 1 line of output)
C, pasted on Jan 27:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
...
view (26 lines, 3 lines of output)
C, pasted on Jan 27:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
...
view (26 lines, 3 lines of output)
C, pasted on Jan 27:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (27 lines, 3 lines of output)
C, pasted on Jan 27:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert_to_arr(char ** sv) {
...
view (56 lines, 7 lines of output)
C, pasted on Jan 27:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert_to_arr(char ** sv) {
...
view (57 lines, 9 lines of output)
C, pasted on Jan 25:
1
2
3
4
5
int main() {

int r=0;

printf("%d\n\n",printf("%d",printf("%d",printf("%s","ILOVECPROGRAM"))));
...
view (11 lines, 3 lines of output)
Python, pasted on Jan 25:
1
2
3
s = '1,2,3,\n,4,5,6,\n,7,8,9'        # subject  
repls = (',', '')                     # tuple sequence
print s.replace(repls[0], repls[1]) 
view (3 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
repls = (',', ''), ('\n', "\n")                         # tuple sequence
start = '1a,2,3,\n,4,5,6,\n,7,8,9'                          # subject
print reduce(lambda x, t: x.replace(*t), repls, start)      # lambda operator, 
view (3 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
4
5
#no const keyword in Python, so:
def constant(f):
    def fset(self, value):
        raise SyntaxError
    def fget(self):
...
view (24 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
4
5
#no const keyword in Python, so:
def constant(x):
    def wset(self, value):
        raise SyntaxError
    def xget(self):
...
view (21 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
4
5
#no const keyword in Python, so:
def constant(f):
    def fset(self, value):
        raise SyntaxError
    def fget(self):
...
view (21 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
4
repls = (',', '')                         
s = '1,2,3,\n,4,5,6,\n,7,8,9'
result = s.replace(repls[0],repls[1])
print result
...
view (17 lines, 10 lines of output)
Python, pasted on Jan 24:
1
2
3
4
repls = (',', '')                         
s = '1,2,3,\n,4,5,6,\n,7,8,9'
result = s.replace(repls[0],repls[1])
print result
...
view (16 lines, 9 lines of output)
Python, pasted on Jan 24:
1
2
3
4
repls = (',', '')                         
s = '1,2,3,\n,4,5,6,\n,7,8,9'
result = s.replace(repls[0],repls[1])
print result
...
view (6 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
repls = (',', ''), ('\n', "\n")                         # tuple sequence
s = '1a,2,3,\n,4,5,6,\n,7,8,9'                          # subject
print reduce(lambda a, t: a.replace(*t), repls, s)      # reduce uses lambda operator, repls seq of tuples , s == start
view (3 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
repls = (',', ''), ('\n', "\n")                         # tuple sequence
s = '1a,2,3,\n,4,5,6,\n,7,8,9'                          # subject
print reduce(lambda a, t: a.replace(*t), repls, s)      # reduce uses lambda operatot, repls seq of tuples , s == start
view (3 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
4
5
#no const keyword in Python, so:
def constant(f):
    def fset(self, value):
        raise SyntaxError
    def fget(self):
...
view (27 lines, 3 lines of output)
Python, pasted on Jan 24:
1
2
3
4
5
#no const keyword in Python, so:
def constant(f):
    def fset(self, value):
        raise SyntaxError
    def fget(self):
...
view (26 lines, 3 lines of output)
Perl, pasted on Jan 22:
1
2
3
4
5
my $d = '\n';
my $str = "1,2,3,$d,4,5,6,$d,7,8,9";
print $str,"\n";
$str =~ s/\\n/\n/g;
$str =~ s/,//g;  
...
view (6 lines, 4 lines of output)
Perl, pasted on Jan 22:
1
2
3
my $str = "'1,2,3\n,4,5,6\n7,8,9'";
$str =~ s/[',]//g;  # replace '' with ""
print $str;
view (5 lines, 3 lines of output)
Perl, pasted on Jan 22:
1
2
3
my $str = "'11,12,13\n,14,15,16\n17,18,19'";
$str =~ s/[',]//g;  # replace '' with ""
print $str;
view (5 lines, 3 lines of output)
Perl, pasted on Jan 22:
1
2
3
4
5
use constant EOL_CHAR => "\n";
my $str = '1,2,3\n,4,5,6\n7,8,9';
$str =~ s/,//g;

my @array = split(/\\n/,$str);
...
view (12 lines, 3 lines of output)
Perl, pasted on Jan 22:
1
2
3
my $str = "1,2,3\n,4,5,6\n7,8,9";
$str =~ s/,//g;
print $str;
view (3 lines, 3 lines of output)
Perl, pasted on Jan 22:
1
2
3
4
5
use warnings;
use constant foo => 10;
print foo;

BEGIN {
...
view (11 lines, 3 lines of output)
Perl, pasted on Jan 22:
1
2
3
4
5
use constant EOL_CHAR => "\n";

my @arr = qw( 123 456 789 );  # like bash and IFS

$\ = EOL_CHAR;
...
view (13 lines, 5 lines of output)
Perl, pasted on Jan 22:
1
2
3
4
5
use constant EOL_CHAR => "\n";

my @arr = qw( 123 456 789 );  # like bash and IFS

$\ = EOL_CHAR;
...
view (11 lines, 3 lines of output)
Perl, pasted on Jan 22:
1
2
3
4
5
my @arr = qw( 123 456 789 );

foreach(@arr) {
  
  print $_;
...
view (7 lines, 1 line of output)
Perl, pasted on Jan 22:
1
2
3
4
$str = "1,2,3\n,4,5,6\n7,8,9";
$str =~ s/,//g;

@array = split(/\\n/,$str);
...
view (11 lines, 3 lines of output)
Ruby, pasted on Jan 17:
1
2
str = String.new("1,2,3\n4,5,6\n7,8,9")
print str.gsub(/,/,'')
view (2 lines, 3 lines of output)
Ruby, pasted on Jan 16:
1
2
str = String.new('1,2,3\n4,5,6\n7,8,9')
puts str.gsub(/,/,'').split(/\\n/)
view (2 lines, 3 lines of output)
Ruby, pasted on Jan 16:
1
2
3
str = String.new('1,2,3\n4,5,6\n7,8,9')
no_commas = str.gsub(/,/,'') 
puts no_commas.split(/\\n/)
view (3 lines, 3 lines of output)
Ruby, pasted on Jan 16:
1
2
3
4
5
str = String.new('1,2,3\n4,5,6\n7,8,9')
puts "Data:\n#{str}\n"     # hash{var} gets value like in PHP

no_commas = str.gsub(/,/,'') 
puts "\nNow:\n#{no_commas}\n\n"
...
view (8 lines, 9 lines of output)
Ruby, pasted on Jan 16:
1
2
3
4
5
str = String.new('1,2,3\n4,5,6\n7,8,9')
puts "Data:\n#{str}\n"     # hash{var} gets value like in PHP
no_commas = str.gsub(/,/,'') 
puts "\nNow:\n#{no_commas}\n\n"
arr = no_commas.split(/\\n/)
...
view (6 lines, 9 lines of output)
Ruby, pasted on Jan 14:
1
2
3
4
5
#no need to create array first

myStr = String.new("1,2,3\n4,5,6\n7,8,9")
puts "The data:\n#{myStr}\n"
nocom = myStr.gsub(/,/,'') 
...
view (9 lines, 13 lines of output)
PHP, pasted on Jan 14:
1
2
3
4
5
<?php
$str = "1,2,3\n4,5,6\n7,8,9";
echo $str,"\n\n\n";

$arrStr =  preg_split("/[\\n]+/", $str);
...
view (16 lines, 8 lines of output)
Perl, pasted on Nov 30:
1
2
3
4
printf("%s: %d %d\n", ("C" < "CZ")? "true C < CZ" : "false C > CZ", 'C', 'CZ');

printf("%s\n", ("C" lt "CZ")? "true: C lt CZ" : "false b/c C gt CZ");
printf("%s\n", ("D" lt "CZ")? "true: D lt CZ" : "false b/c D gt CZ");
...
view (11 lines, 5 lines of output)
C, pasted on Nov 30:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (14 lines, 3 lines of output)
Perl, pasted on Nov 30:
1
2
3
4
printf("%s: %d %d\n", ("C" < "CZ")? "true C < CZ" : "false C > CZ", 'C', 'CZ');

printf("%s: %d %d\n", ("C" lt "CZ")? "true C lt CZ" : "false C gt CZ");
printf("%s: %d %d\n", ("D" lt "CZ")? "true D lt CZ" : "false D gt CZ");
...
view (11 lines, 5 lines of output)
C, pasted on Nov 30:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (12 lines, 3 lines of output)
C, pasted on Nov 30:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (12 lines, 3 lines of output)
C, pasted on Nov 30:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (11 lines, 2 lines of output)
Perl, pasted on Nov 30:
1
2
3
4
printf("%s: %d %d\n", ("C" < "CZ")? "true C < CZ" : "false C > CZ", 'C', 'CZ');

printf("%s: %d %d\n", ("C" lt "CZ")? "true C lt CZ" : "false C gt CZ");
printf("%s: %d %d\n", ("D" lt "CZ")? "true D lt CZ" : "false D gt CZ");
view (4 lines, 3 lines of output)
Python, pasted on Nov 12:
1
2
3
4
5
#no const keyword in Python, so:
def constant(f):
    def fset(self, value):
        raise SyntaxError
    def fget(self):
...
view (24 lines, 3 lines of output)
Perl, pasted on Nov 12:
1
2
3
4
5
use constant EOL_CHAR => "\n";
$str = '1,2,3\n,4,5,6\n7,8,9';
$str =~ s/,//g;

@array = split(/\\n/,$str);
...
view (12 lines, 3 lines of output)
Perl, pasted on Nov 12:
1
2
3
4
5
use constant EOL_CHAR => "\n";
$str = '1,2,3\n,4,5,6\n7,8,9';
$str =~ s/,//g;

@array = split(/\\n/,$str);
...
view (12 lines, 3 lines of output)
Ruby, pasted on Nov 12:
1
2
3
4
5
#no need to create array first

myStr = String.new('1,2,3\n4,5,6\n7,8,9')
puts "The data:\n#{myStr}\n"
nocom = myStr.gsub(/,/,'') 
...
view (8 lines, 6 lines of output)
C++, pasted on Nov 10:
1
2
3
4
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <sstream>
...
view (32 lines, 3 lines of output)
C++, pasted on Nov 9:
1
2
3
4
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <sstream>
...
view (26 lines, 3 lines of output)
C++, pasted on Nov 9:
1
2
3
4
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include <sstream>
...
view (26 lines, 3 lines of output)
C++, pasted on Nov 9:
1
2
3
4
5
#include <sstream>

using namespace std;

int main(){
...
view (18 lines, 4 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert_to_arr(char ** sv) {
...
view (63 lines, 7 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert_to_arr(char ** sv) {
...
view (63 lines, 7 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert_to_arr(char ** sv) {
...
view (64 lines, 7 lines of output)
Python, pasted on Nov 8:
1
2
3
4
5
line="1,2,3\n4,5,6\n7,8,9"
clean = line.replace(',','')
words = clean.split('\n');
for nums in words:
    print nums
view (5 lines, 3 lines of output)
Perl, pasted on Nov 8:
1
2
3
4
5
$str = "1,2,3\n,4,5,6\n7,8,9";
$str =~ s/,//g;
@array = split(/\n/,$str);
foreach( @array ) {
   print $_,"\n";
...
view (7 lines, 3 lines of output)
Perl, pasted on Nov 8:
1
2
3
4
5
$string = "1,2,3\n,4,5,6\n7,8,9";
$clean =~ s/,//g;
@array = split(/\n/,$clean);
foreach( @array ) {
   print $_,"\n";
...
view (7 lines)
Perl, pasted on Nov 8:
1
2
3
4
5
$string = "1,2,3\n,4,5,6\n7,8,9";
@array = split(/\n/,$string);
foreach( @array ) {
   $_ =~ s/,//g;
   print $_,"\n";
...
view (7 lines, 3 lines of output)
Perl, pasted on Nov 8:
1
2
3
4
5
$string = "1,2,3\n,4,5,6\n7,8,9";
@array = split(/\n/,$string);
$max = @array;   # 3 elements
for ($i=0; $i < $max; $i++)
{
...
view (9 lines, 3 lines of output)
Python, pasted on Nov 8:
1
2
3
4
5
line="1,2,3\n4,5,6\n7,8,9"
clean = line.replace(',','')
words = clean.split();
for nums in words:
    print nums
view (5 lines, 3 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert_to_arr(char ** sv) {
...
view (64 lines, 7 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void convert_to_arr(int x,int y, char ** sv) {
...
view (66 lines, 7 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
...
view (58 lines, 6 lines of output)
C, pasted on Nov 8:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
...
view (45 lines, 28 lines of output)
C, pasted on Nov 7:
1
2
3
4
5
#include <string.h>
#include <stdio.h>

int main()
{
...
view (23 lines, 7 lines of output)
C, pasted on Nov 7:
1
2
3
4
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
...
view (79 lines, 10 lines of output)
C, pasted on Oct 31:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
int main()
{
int $i;
...
view (9 lines, 1 line of output)
C, pasted on Oct 28:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
int main()
{
printf("%d", "7.100000000000000" == "7.10000000000000001");
...
view (7 lines, 1 line of output)
C, pasted on Oct 28:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
int main()
{
printf("%d", 7.100000000000000 == 7.10000000000000001);
...
view (7 lines, 1 line of output)
PHP, pasted on Aug 23:
1
2
3
4
5
<?php
class Test { function __construct(){ var_dump($this);}}
$t1 = new Test;
$other = new stdClass;
$t2 = new Test;
...
view (6 lines, 10 lines of output)
C, pasted on Aug 23:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
int main()
{
11-3;
...
view (7 lines)
Perl, pasted on Aug 21:
1
2
3
4
5
if (!0) {
   printf("False: Zero\n");
}
if (-16) { 
   printf("True: Non-Zero\n");
...
view (10 lines, 5 lines of output)
Perl, pasted on Aug 21:
1
2
3
4
5
if (!0) {
   printf("False: Zero\n");
}
if (-16) { 
   printf("True: Non-Zero\n");
...
view (10 lines, 4 lines of output)
Perl, pasted on Aug 21:
1
2
3
4
5
if (!0) {
   printf("False: Zero\n");
}
if (-16) { 
   printf("True: Non-Zero\n");
...
view (10 lines, 4 lines of output)
Perl, pasted on Aug 21:
1
2
3
4
5
printf("False: empty string %s\n", (3 < 2));
printf("True (Relational):  %d \n", (3 > 1));
if (!0) {
   printf("Zero is false\n");
}
...
view (9 lines, 4 lines of output)
Perl, pasted on Aug 21:
1
2
3
4
5
printf("False: empty string %s\n", (3 < 2));
printf("True:  %d \n", (3 > 1));
if (!0) {
   printf("Zero is false\n");
}
...
view (9 lines, 4 lines of output)
C, pasted on Aug 20:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
int main()
{
int a = 0;
...
view (13 lines, 3 lines of output)
C, pasted on Aug 20:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
int main()
{
int a = 0;
...
view (12 lines, 2 lines of output)
C, pasted on Aug 20:
1
2
3
4
5
#include <stdlib.h>
#include <stdio.h>
int main()
{
int a = 0;
...
view (12 lines, 2 lines of output)
C, pasted on Aug 19:
1
2
3
4
#include <stdio.h>
#include <stdlib.h>
int main() {
  printf("%d %d",!1,!0);
...
view (7 lines, 1 line of output)
C, pasted on Aug 13:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
int main() {
  int a=1,b=2,c=3;                // comma separator
  printf("%d %d %d\n",a,b,c);
...
view (13 lines, 3 lines of output)
C, pasted on Aug 11:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main() {
  char x = 99;
...
view (19 lines, 3 lines of output)
C, pasted on Jun 23:
1
2
3
4
5
int main() {
  int i=0;
  if("") printf("empty string is true");
  
  if(!0) printf("\nZero is false");
...
view (10 lines, 2 lines of output)
C, pasted on Jun 23:
1
2
3
4
5
int main() {

  if("") printf("empty string is true");
  
  if(!0) printf("\nZero is false");
...
view (7 lines, 2 lines of output)
C, pasted on Jun 13:
1
2
3
4
5
void main() {
int i=0;
    for (i = 1;;i++) {
        if (i > 10) {
            break;
...
view (9 lines, 1 line of output)
PHP, pasted on Jun 13:
1
2
3
4
5
<?php
for ($i = 1;;$i++) {
    if ($i > 10) {
        break;
    }
...
view (7 lines, 1 line of output)
PHP, pasted on Jun 13:
1
2
3
4
5
<?php
for ($i=0;;$i++){ // PHP5.4 and 5.2
    if ($i == 10) break;
	print $i;
}
view (5 lines, 1 line of output)
C, pasted on Jun 7:
1
2
3
4
5
#include <stdio.h>
#include <string.h>

int main(void) {
    if (0) { 
...
view (13 lines, 1 line of output)
Python, pasted on Jun 7:
1
2
3
4
if 0: 
    print "Zero is truthy"
else:
    print "Zero is not truthy"
view (4 lines, 1 line of output)
Ruby, pasted on Jun 7:
1
2
3
if (0) 
    puts "0 is truthy"
end
view (3 lines, 1 line of output)
Scheme, pasted on Jun 7:
1
(display(if 0 'true 'false))
view (1 line, 1 line of output)
Ruby, pasted on Jun 7:
1
2
3
4
print 2 == 1 + 1
print true == 1
print true == true
print true == "1"
...
view (14 lines, 3 lines of output)
Ruby, pasted on Jun 7:
1
2
3
4
print 2 == 1 + 1
print true == 1
print true == true
print true == "1"
...
view (11 lines, 2 lines of output)
C, pasted on Jun 2:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (12 lines, 1 line of output)
Python, pasted on May 21:
1
2
x = 1, y = 2, z = 3
print x, y, z
view (2 lines, 3 lines of output)
Perl, pasted on May 21:
1
2
my $x = 1, $y = 2, $z = 3;
print "x: $x, y: $y, z: $z";
view (3 lines, 1 line of output)
C, pasted on May 21:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (12 lines, 1 line of output)
Python, pasted on May 19:
1
2
if "0":
    print "non-empty string is true"
view (2 lines, 1 line of output)
C, pasted on May 19:
1
2
3
4
5
#include <stdio.h>
#include <string.h>

int main(void) {
    if ("0") printf("\%s", "zero");
...
view (7 lines, 1 line of output)
C, pasted on May 1:
1
2
3
4
5
#include <stdio.h>
#include <string.h>

int main(void) {
  int n = strlen("");
...
view (18 lines, 8 lines of output)
C, pasted on Apr 18:
1
2
3
4
#include <stdio.h>
#include <string.h>

int main(void) {
...
view (9 lines, 2 lines of output)
C, pasted on Apr 10:
1
2
3
4
5
#include <stdio.h>
#include <string.h>

int main(void) {
char *s1 = "10";
...
view (10 lines, 2 lines of output)
C, pasted on Apr 10:
1
2
3
4
5
#include <stdio.h>
#include <string.h>
int mystrCmp(const char * a, const char * b);

int mystrCmp(const char * a, const char * b){
...
view (18 lines, 2 lines of output)
C, pasted on Mar 28:
1
2
3
4
5
#include <stdio.h>
int main(void)
{
int x = 7;
int y = 3; 
...
view (9 lines, 2 lines of output)
C, pasted on Mar 24:
1
2
3
4
5
#include <stdio.h>
#include <string.h>
int mystrCmp(const char * a, const char * b);

int mystrCmp(const char * a, const char * b){
...
view (18 lines, 2 lines of output)
C, pasted on Mar 24:
1
2
3
4
5
#include <stdio.h>
#include <string.h>
int mystrCmp(const char * a, const char * b);

int mystrCmp(const char * a, const char * b){
...
view (18 lines, 2 lines of output)
C, pasted on Mar 24:
1
2
3
4
5
#include <stdio.h>
#include <string.h>

int main(void) {
char *s1 = "sharo";
...
view (10 lines, 2 lines of output)
C, pasted on Mar 12:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (16 lines, 1 line of output)
C, pasted on Mar 12:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct _array {
...
view (24 lines, 1 line of output)
C, pasted on Mar 11:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
...
view (16 lines, 1 line of output)
C, pasted on Mar 11:
1
2
3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
view (15 lines, 1 line of output)
C, pasted on Mar 11:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int comp_string(char **a, char **b) {
...
view (18 lines, 1 line of output)
C, pasted on Mar 11:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*int comp_string(char **a, char **b) {
...
view (18 lines, 1 line of output)
PHP, pasted on Mar 4:
1
2
3
<?php
define("M", strtoupper(date("M d Y",time())));
echo M;
view (3 lines, 1 line of output)
C, pasted on Jan 23:
1
2
3
4
5
#include <stdio.h>

int main( void)
{
     ;
...
view (6 lines)
Python, pasted on Jan 15:
1
print (2 ** 64) -1
view (1 line, 1 line of output)
PHP, pasted on Jan 15:
1
2
3
4
5
<?php
printf("%u\n",0xffffffff ); // 0 
printf("%d\n",0xffffffff); // 0
printf("%f\n", hexdec("0xffffffff"));
printf("%f\n",pow(2,64)-1);
...
view (9 lines, 6 lines of output)
C, pasted on Dec 31:
1
2
3
4
5
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
...
view (16 lines, 2 lines of output)
Ruby, pasted on Dec 26:
1
2
3
4
x = 100;
print ~-x

# output: 99
view (4 lines, 1 line of output)
Perl, pasted on Dec 26:
1
2
3
4
my $x = 100;
print ~-$x;

# prints 99
view (4 lines, 1 line of output)
C, pasted on Dec 24:
1
2
3
4
5
#include <math.h>
#include <stdio.h>
int main(void)
{
     int i = 100;
...
view (9 lines, 1 line of output)
Ruby, pasted on Dec 20:
1
2
3
4
n = -3
num = 2
puts n ** num
puts -3 ** 2
view (4 lines, 2 lines of output)
Ruby, pasted on Dec 20:
1
2
3
n = -3
num = 2
puts n ** num
view (3 lines, 1 line of output)
Ruby, pasted on Dec 20:
1
2
3
n = 0
num = 0
puts n ** num
view (3 lines, 1 line of output)
Python, pasted on Dec 20:
1
print 0 ** 0
view (1 line, 1 line of output)
Perl, pasted on Dec 20:
1
print 0 ** 0;
view (1 line, 1 line of output)
C, pasted on Dec 14:
1
2
3
4
5
#include <stdio.h>

int main(void)
{
    ;
...
view (6 lines)
C, pasted on Dec 14:
1
2
3
4
5
#include <stdio.h>

int main(void)
{
    ;printf("%s","Test\n");
...
view (7 lines, 1 line of output)
PHP, pasted on Dec 4:
1
2
3
4
5
<?php

$a = 10;
$b = 20;
$c = 30;
...
view (8 lines, 1 line of output)
Python, pasted on Nov 29:
1
2
3
4
#python - negative array indexing

a = (0,1,2,3,4,5,6,7)
print a[-1]
...
view (7 lines, 2 lines of output)
Python, pasted on Nov 29:
1
2
3
4
#python - negative array indexing

a = (0,1,2,3,4,5,6,7)
print a[-1]
view (4 lines, 1 line of output)
Python, pasted on Nov 29:
1
2
3
4
5
def x():
	a = "I am a bound variable"
	def y():
		return a
	return y
...
view (6 lines, 1 line of output)
Python, pasted on Nov 15:
1
2
3
4
5
def generate_ints(N):
	for i in range(N):
		yield i
		
gen = generate_ints(3)
...
view (8 lines, 3 lines of output)
Python, pasted on Oct 3:
1
2
3
4
5
name = "Wanda"
print "W"+"anda"
print name is "W"+"anda"
print name == "W"+"anda"
print name != False and name != True
...
view (7 lines, 5 lines of output)
Python, pasted on Oct 3:
1
2
3
4
5
name = "Wanda"
print "W"+"anda"
print name is "W"+"anda"
print name == "W"+"anda"
print name != False and name != True
...
view (6 lines, 4 lines of output)
Python, pasted on Oct 3:
1
2
3
4
name = "Wanda"
print "W"+"anda"
print name is "W"+"anda"
print name == "W"+"anda"
view (5 lines, 3 lines of output)
PHP, pasted on Jul 18:
1
2
3
4
5
<?php
echo PHP_INT_SIZE,"\n";
echo PHP_INT_MAX,"\n";

var_dump(0xffffffff);
...
view (7 lines, 5 lines of output)
PHP, pasted on Jul 18:
1
2
3
4
5
<?php

var_dump(0xffffffff);
printf("%u\n",0xffffffff);
printf("%d",0xffffffff);
view (5 lines, 3 lines of output)
C, pasted on Jul 17:
1
2
3
4
5
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
int main()
{
...
view (27 lines, 10 lines of output)
C, pasted on Jul 11:
1
2
3
4
5
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<limits.h>
#include<errno.h>
...
view (43 lines, 1 line of output)
PHP, pasted on Jul 2:
1
2
3
4
5
<?php

$a = "9223372036854775807";

$b = "9223372036854775808";
...
view (7 lines, 1 line of output)
PHP, pasted on Jul 2:
1
2
3
4
5
<?php

var_dump(

filter_var( "-2147483648",
...
view (9 lines, 1 line of output)
PHP, pasted on Jul 2:
1
2
3
4
5
<?php
define("PHP_INT_MIN",~PHP_INT_MAX);
var_dump( PHP_INT_MIN );
var_dump( -PHP_INT_MAX-1 );
var_dump( (int) 0x80000000 );
view (5 lines, 3 lines of output)
Python, pasted on Jul 2:
1
print isinstance(-2147483648, (int))    
view (1 line, 1 line of output)
PHP, pasted on Jul 2:
1
2
3
<?php

print is_int(-2147483648)? "true\n\n" : "false\n\n";
view (4 lines, 2 lines of output)
PHP, pasted on Jul 1:
1
2
3
4
<?php

$zip_code = 09876-0001;
echo $zip_code,"\n"; // -1
...
view (10 lines, 4 lines of output)
Ruby, pasted on Jul 1:
1
print 08, "\n"
view (2 lines, 3 lines of output)
C, pasted on Jul 1:
1
2
3
4
5
#include <stdio.h>
main(){

  printf("\n%d\n",08);
  return 0;
...
view (8 lines, 1 line of output)
Perl, pasted on Jul 1:
1
2
#perl
print 08;
view (3 lines, 2 lines of output)
Python, pasted on Jul 1:
1
print 08
view (1 line, 4 lines of output)
PHP, pasted on Jul 1:
1
2
3
4
5
<?php

var_dump(dechex((float) "4294967295")); // 'ffffffff'

var_dump(dechex(0 + "4294967295")); // 'ffffffff'
view (5 lines, 2 lines of output)
PHP, pasted on Jul 1:
1
2
3
4
5
<?php

var_dump(dechex("4294967295")); // '7fffffff'

var_dump( hexdec("7fffffff")); // 2147483647
view (5 lines, 2 lines of output)
PHP, pasted on Jul 1:
1
2
3
4
5
<?php

var_dump(  0xffffffff ); // float 4294967295

var_dump( (int) 0xffffffff ); // int -1
view (5 lines, 2 lines of output)
PHP, pasted on Jul 1:
1
2
3
4
<?php
var_dump( 0x001fffffffffffff ); // float 9.007199254741E+15

var_dump( (int) 0x001fffffffffffff); // int -1
view (4 lines, 2 lines of output)
PHP, pasted on Jul 1:
1
2
3
<?php
printf("%u\n",0xffffffff );// 4294967295 
printf("%d\n",0xffffffff );// -1
view (3 lines, 2 lines of output)
C, pasted on Jul 1:
1
2
3
4
5
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
int main(){
printf("%lu\n",0xffffffff );// 4294967295 
...
view (8 lines, 2 lines of output)
C, pasted on Apr 23:
1
2
3
4
5
#include<limits.h>
#include<stdio.h>
#include<stdlib.h>
int main()
{
...
view (16 lines, 4 lines of output)