[ create a new paste ] login | about

GiM

Name: Michal Spadlinski
Email:
Site/Blog: http://gim.jogger.pl/
Location: Poland
Default language: D
Favorite languages: D, C, Python
About:

Saved pastes by GiM:

C, pasted on Jan 8:
1
2
3
4
5
#include <stdio.h>
#include <stdlib.h>

short int gabs(short int x) {
   /* signed shift */
...
view (27 lines, 2 lines of output)
C++, pasted on Aug 31:
1
2
3
4
5
int foo() {
  //*
  int ret = 5;
  /*/
  int ret = 6;
...
view (22 lines, 1 line of output)
C++, pasted on Jun 29:
1
2
3
4
5
#include <iostream>

class Foo {
 int x;
 friend void bar(Foo&);
...
view (25 lines, 2 lines of output)
C++, pasted on Nov 15:
1
2
3
4
#include <iostream>

using std::cout;
using std::endl;
...
view (51 lines, 8 lines of output)
D, pasted on Sep 18:
1
2
3
4
5
import std.stdio;

void main()
{
    cfloat temp = 1.0 - float.infinity *1.0i; 
...
view (9 lines, 2 lines of output)
C++, pasted on Jun 10:
1
2
3
4
5
#include <cstdio>

enum Testerka { a, b, c, d, e, f };

Testerka &operator++(Testerka &p, int x)
...
view (28 lines, 2 lines of output)
C++, pasted on Jun 10:
1
2
3
4
5
#include <cstdio>

// May the force be with you
#define private public
#define protected public
...
view (27 lines, 1 line of output)
C++, pasted on Jun 10:
1
2
3
4
5
/* GiM */
#include <cstdio>
#include <cstdlib>

struct Test {
...
view (21 lines, 3 lines of output)
Plain Text, pasted on Jan 14:
1
2
3
4
5
<?xml version="1.0" encoding="UTF-8" ?>
<project name="sample" default="compile" basedir=".">
        <property file="build.properties" />

        <macrodef name="compile" >
...
view (37 lines)
C++, pasted on Jan 7:
1
2
3
4
5
template <void (*F)()>
struct SigFoo { static const int x = 0; };

template <class T>
struct RequiredStatics {
...
view (29 lines)
D, pasted on Sep 2:
1
2
3
4
5
template RetriveFields(T, char[] name, int u)
{
        static if (is(T == struct) || is(T == class))
        {   
            static if (u < T.tupleof.length)
...
view (37 lines)
D, pasted on Sep 2:
1
2
3
4
5
import tango.io.Stdout;

char toupper(char letter)
{
    if (letter >= 'a' && letter <= 'z')
...
view (43 lines, 2 lines of output)
D, pasted on Jun 29:
1
2
3
4
5
extern(C) int write(int fd, char *buf, int len);
void gwrite(char[] str) { write(2, str.ptr, str.length); }

interface Big { void brother(); }
void foo(Big biggy) { biggy.brother(); }
...
view (10 lines, 2 lines of output)
D, pasted on Jun 25:
1
2
3
4
5
import tango.io.Stdout;

void main()
{
  int a=20,b=-20;
...
view (31 lines, 14 lines of output)
D, pasted on Jun 18:
1
2
3
4
5
template fib(int n:0) {
    enum { fib = 0 }
}

template fib(int n:1) {
...
view (41 lines)
D, pasted on May 22:
1
2
3
4
5
import tango.io.Stdout;

template Foo() { int x = 9; }

void main()
...
view (13 lines, 2 lines of output)
D, pasted on May 22:
1
2
3
4
5
import tango.io.Stdout;

void main()
{
    int x = 7;
...
view (11 lines, 1 line of output)
D, pasted on May 20:
1
2
3
4
5
/* Michal 'GiM' Spadlinski
 * FizzBuzz on delegates
 */
import tango.io.Stdout;
import tango.text.convert.Integer;
...
view (19 lines, 100 lines of output)
D, pasted on May 20:
1
2
3
4
/* D - ArraySeq - size, capacity, length
 */
import tango.util.collection.ArraySeq;
import tango.io.Stdout;
...
view (18 lines, 1 line of output)
D, pasted on May 20:
1
2
3
4
/* Michal 'GiM' Spadlinski
 * dear children, don't do this at home :>
 */
import tango.io.Stdout;
...
view (94 lines, 2 lines of output)
C++, pasted on May 3:
1
2
3
4
5
#include <iostream>

class A {
public: virtual void blah() { std::cout << "in a" << std::endl; }
        void dupa() { std::cout << "dupA" << std::endl; }
...
view (48 lines, 16 lines of output)
C++, pasted on May 1:
1
2
3
4
5
char *b1 = new char[dlugosc_genotypu], *b2=b1;
int flag=1;
for (i = 0; i < dlugosc_genotypu; i++)
{
    if( ((float)rand()/(RAND_MAX + 1.0))< wsk_pop->prawd_pkt_krzyzowania )
...
view (22 lines)
D, pasted on Apr 25:
1
2
3
4
5
/+ Michal 'GiM' Spadlinski +/
import tango.io.Stdout;
import tango.math.Random;

void blink(T, U)(T t, bool delegate(ref U) cond, void delegate(ref U) act)
...
view (47 lines, 18 lines of output)
D, pasted on Apr 25:
1
2
3
4
5
/+ Michal 'GiM' Spadlinski +/
import tango.io.Stdout;
import tango.math.Random;

class Kontener
...
view (31 lines, 1 line of output)
D, pasted on Apr 25:
1
2
3
4
5
/+ Michal 'GiM' Spadlinski +/
import tango.io.Stdout;

void blink(T, U)(T t, bool delegate(ref U) cond, void delegate(ref U) act)
{
...
view (23 lines, 14 lines of output)
C++, pasted on Apr 24:
1
2
3
4
5
#include <iostream>                                                                                     
#include <vector>                                                                                       
                                                                                                        
class A {                                                                                               
    public:                                                                                             
...
view (56 lines, 16 lines of output)
D, pasted on Apr 17:
1
2
3
4
5
import tango.io.Stdout;

class Baz { void blinkenlights() {Stdout("Baz").newline; } }
class Bar : Baz { void blinkenlights() { Stdout("Bar").newline; } }
class Foo(T) {
...
view (21 lines, 1 line of output)
C++, pasted on Apr 9:
1
2
3
4
5
/* Michal 'GiM' Spadlinski */
#include <iostream>

class Bar {
    public: mutable int i;
...
view (24 lines, 2 lines of output)