[ create a new paste ] login | about

rplantiko

Name: Rüdiger Plantiko
Email:
Site/Blog: http://ruediger-plantiko.net
Location: Winterthur, Switzerland
Default language:
Favorite languages:
About:

Saved pastes by rplantiko:

Perl, pasted on Nov 26:
1
2
3
4
5
# Densely Packed Decimals (DPD) encoding 
# Unpack three decimal digits from only 10 bits
# See https://en.wikipedia.org/wiki/Densely_packed_decimal

#  These are the rules
...
view (49 lines, 12 lines of output)
Perl, pasted on Sep 4:
1
2
3
4
5
use strict;
use warnings;
use List::Util 'sum';

# Abiturnoten im Ländervergleich (2014, KMK)
...
view (153 lines, 17 lines of output)
Perl, pasted on Jun 28:
1
2
3
4
# A range as flip-flop

use strict;
use warnings;
...
view (23 lines, 5 lines of output)
Perl, pasted on Oct 1:
1
2
3
4
5
# Finding an error in ABAP code
# One branch of a large CASE ... WHEN was incorrect

use strict;
use warnings;
...
view (260 lines, 1 line of output)
Perl, pasted on Sep 2:
1
2
3
4
5
# Taking over an object's symbol table at runtime

# I thought of an object for DB access:
# A DB statement has a prepare step and an execute step
# The prepare statement could be performed once in the constructor
...
view (51 lines, 2 lines of output)
Perl, pasted on Oct 24:
1
2
3
4
5
# Another everyday perl
# Split up ABAP code along form ... endform blocks into several portions

use strict;
use warnings;
...
view (209 lines, 3 lines of output)
Perl, pasted on Aug 7:
1
2
3
4
5
# Everyday perl
# An everyday perl script, showing some useful techniques
# Here, the task is:
#   Search in a text for occurrences of 
#    setFieldValue( ..., "<field>" )
...
view (240 lines, 28 lines of output)
C++, pasted on Oct 24:
1
2
3
4
5
// Track differences - a component for automatic numeric tests

#include <iostream>
#include <sstream>
#include <stdio.h>
...
view (128 lines, 4 lines of output)
C, pasted on Sep 25:
1
2
3
4
5
// Rational numbers with exposed type

typedef struct {
  int numer;
  int denom;
...
view (61 lines, 7 lines of output)
Perl, pasted on Aug 1:
1
2
3
4
5
# Since the DRY violation of repeating color codes in CSS bothered me,
# I made a meta-CSS in the form of a simplistic perl file

# The simplest way to do this in Perl is by using the built-in 
# variable substitution mechanism (interpolation)
...
view (43 lines, 17 lines of output)
C++, pasted on Jun 18:
1
2
3
4
5
// Mimic a "public readonly" attribute (as in C# and ABAP)
// Inspired by Peter Ammon, http://bytes.com/topic/c/answers/62093-read-only-data-members

class F {
private: 
...
view (21 lines, 2 lines of output)
C++, pasted on Jun 18:
1
2
3
4
5
// A pair of any "things". It can be swapped.

template <class T>
class Pair {
  public:
...
view (32 lines, 2 lines of output)
C++, pasted on Jun 18:
1
2
3
4
5
// Example for method chaining in C++

class F {
  private: 
    unsigned int eax;
...
view (21 lines, 1 line of output)