rplantiko
|
codepad
|
|
rplantiko
|
Saved pastes by rplantiko:
# 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) |
use strict;
use warnings;
use List::Util 'sum';
# Abiturnoten im Ländervergleich (2014, KMK)
|
view (153 lines, 17 lines of output) |
# 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) |
# 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) |
# 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) |
# 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) |
// Track differences - a component for automatic numeric tests
#include <iostream>
#include <sstream>
#include <stdio.h>
|
view (128 lines, 4 lines of output) |
# 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) |
// 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) |