DevHeads.net

Postings by Gerald Bauer

sruby – Simple, Secure and Solid Ruby: Run Ruby Contract / Transaction Scripts on the Blockchain / World Computer

Hello,

I've published a new red paper [1] that introduces the new sruby
version / flavor.

What's sruby?

sruby - short for simple, secure & solid ruby - is a subset of mruby
that is a subset of "classic" ruby and lets you run contract /
transaction scripts on the blockchain (world computer).

Happy transacting with sruby. Questions and comments welcome. Cheers. Prost.

PS: Some sruby contract samples:

1) Hello, World!

Programming Crypto Blockchain Contracts (in Ruby) Step-by-Step Book / Guide. Let's Start with Ponzi & Pyramid Schemes...

Hello,

I've started a new (free online) step-by-step guide / booklet titled:

Programming Crypto Blockchain Contracts (with Ruby) Step-by-Step
Book / Guide. [1]
Let's Start with Ponzi & Pyramid Schemes. Run Your Own Lotteries,
Gambling Casinos and more on the Blockchain World Computer...

The first chapter about Ponzis & Pyramids is online with
ready-to-run contract scripts in ruby.

Ruby Quiz - Challenge #11 - Blockchain Contracts - Disassemble & Assemble Ethereum Virtual Machine (EVM) Opcodes / Bytecodes

Hello,

It's Friday. Ruby Quiz time! Join us. Let's keep going with a new
Ruby Quiz [1] every fortnight.

New kittyverse library / gem - helper classes for cattributes, trait types, traits, genes, genomes and more for cryptokitties and copycats cryptocollectibles (on the blockchain)

Hello,

I've put together a new kittyverse library / gem [1] that includes
helper classes for cattributes, trait types, traits, genes, genomes
and more for cryptokitties and copycats cryptocollectibles (on the
blockchain).

Ruby Quiz - Challenge #10 - Breeding Kitties - Mix Genes Using the Sooper-Sekret Formula in the GeneSciene CryptoKitties Blockchain Contract

Hello,

It's Friday. Ruby Quiz time! Join us. Let's keep going with a new
Ruby Quiz [1] every fortnight. Here we go:

Challenge #10 - Breeding Kitties - Mix Genes Using the Sooper-Sekret
Formula in the GeneSciene CryptoKitties Blockchain Contract

CryptoKitties lets you breed new kitties. Pick a matron and a sire and
a new bun is in the oven.

Now how does the "magic" mixing of genes work? What genes do new
(offspring) kitties inherit from parents?

Programming Crypto Collectibiles Step-by-Step Guide (w/ Ruby). Let's start w/ CryptoKitties...

Hello,

I've started a new (free online) book on github titled "Programming
Crypto Collectibiles Step-by-Step Book / Guide" [1].

Let's start with CryptoKitties & Copycats. Inside Unique Bits &
Bytes on the Blockchain...

Happy reading and programming w/ ruby. Cheers. Prost.

[1] <a href="https://github.com/cryptocopycats/programming-cryptocollectibles" title="https://github.com/cryptocopycats/programming-cryptocollectibles">https://github.com/cryptocopycats/programming-cryptocollectibles</a>

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

2018 - A Year of Ruby Conferences & Camps ++ 2019 - What's Upcoming?

Hello,

you can find all ruby conferences & camps from around the world of
the year 2018 @ the Planet Ruby Calendar 2018 [1] What was your
favorite? Any highlights?

For the upcoming year 2019 you can find all ruby conferences & camps
@ the Planet Ruby Calendar2019 [2]. What're looking forward too? Any
recommendations?

Happy coding with ruby. Cheers.

Ruby Quiz - Challenge #9 - Tally Up / Calculate the Standings Table for the English Premier League 2018/19 Season - And the Winner is... Liverpool? Manchester City?

Hello,

It's Friday. Ruby Quiz time! Join us. Let's keep going with a new
Ruby Quiz [1] every fortnight. Here we go:

Challenge #9 - Tally Up / Calculate the Standings Table for the
English Premier League 2018/19 Season
And the Winner is... Liverpool? Manchester City?

Let's tally up / calculate the standings table for the English Premier
League (EPL).

base32-alphabets library / gem v1.0 update - encode/decode bits & bytes in 5-bit groups (2^5=32) with kai, crockford or electrologica notations / alphabets

Hello,

I've updated the base32-alphabets library / gem [1]
(formerly known as base32-kai).

What's news in version 1.0?

Now you can encode / decode (big) numbers in 5-bit groups (2^5=32)
with Kai, Crockford or Electrologica notation / alphabet

Happy bits & bytes slicing with ruby
(or deciphering the CryptoKitties genome / genes / 240-bit integer number [2].

Cheers.

Ruby Quiz - Challenge #8 - Base32 Alphabet - Convert the Super "Sekretoooo" 240-Bit CryptoKitties Genome to Kai Notation - Annipurrsary!

Hello,

It's Friday. Ruby Quiz time! Join us. Let's keep going with a new
Ruby Quiz [1] every Friday. Here we go:

Challenge #8 - Base32 Alphabet - Convert the Super "Sekretoooo"
240-Bit CryptoKitties Genome to Kai Notation - Annipurrsary!

Annipurrsary!

One Year CryptoKitties! Copycats Unchained Command Line Tool (& Core Library) Updated

Hello,

To celebrate One Year CryptoKitties! I’ve updated the copycats
command line tool (and core library) - crypto kitties / cats
collectibles unchained [1] - with the latest (official) traits /
cattributes and more.

All copycats tools are free and open source (and all in ruby).

Happy genome genetics 12x4 slicing and 256-bits collecting w/ ruby.

[1] <a href="https://github.com/cryptocopycats/copycats" title="https://github.com/cryptocopycats/copycats">https://github.com/cryptocopycats/copycats</a>

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Ruby Quiz - Challenge #7 - Type Inference - Convert Strings to Null, Number, Not a Number (NaN), Date & More

Hello,

It's Friday. Ruby Quiz time! Join us. Let's keep going with a new
Ruby Quiz [1] every Friday.

Ruby Quiz - Challenge #6 - Build the Table of Contents (ToC) for Documents in Markdown

Hello,

It's Friday. Ruby quiz time! Join us. Let's keep going with a new
Ruby Quiz [1] coding challenge every Friday.
Here we go:

Ruby Quiz - Challenge #6 - Build the Table of Contents (ToC) for
Documents in Markdown

Let's read text documents and build up the table of contents from the
headings hierarchy / tree.

Markdown uses hashtags (`#`) for marking up headings.

CSV Reader (and Type Inference and Data Conversion) Benchmarks (Faster, Fasterer, Fastest) - And the Winner is... String#split

Hello,

I've put together some basic csv reader / parser benchmarks [1].
The "Raw" Read Benchmark returns all strings - no type inference or
data conversion (*)
and the Numerics Benchmark returns all numbers - simple type inference
or data conversion -
it's all numbers - all the time (except for the header row).

Here's the result for the numerics benchmark using the weather
station data from
the University of Waterloo, Ontario, Canada:

n = 100
user system total real
std: 20.781000 0.234000 21.015000 ( 21.039186)
split:

Mega List - Awesome Ruby Meetups & Orgs from Around the World - Updates Welcome!

Hello,

I've moved the collection of awesome Ruby meetups, code learning and
diversity organizations, and more from around the world to a new home
/ repo for making it easier to update / contribute.

See the all-in-one page "front end" mega list @
<a href="https://planetruby.github.io/meetups" title="https://planetruby.github.io/meetups">https://planetruby.github.io/meetups</a>

And find the "back end" source pages in text such as AFRICA.md,
AMERICA.md, ASIA.md, EUROPE.md, PACIFIC.md @
<a href="https://github.com/planetruby/meetups" title="https://github.com/planetruby/meetups">https://github.com/planetruby/meetups</a>

Anything missing? Updates more than welcome.

Cheers.

Ruby Quiz - New "Front End" Website (Pages) @ https://planetruby.github.io/quiz

Hello,

For easy reference (and for your information) - the "back end"
ruby quiz pages in the github repo now also get published (rendered)
on the "front end" thanks to jekyll (and github pages).

See <a href="https://planetruby.github.io/quiz" title="https://planetruby.github.io/quiz">https://planetruby.github.io/quiz</a> for "easy-to-read" pages using
the default primer theme.

Cheers. Prost.

PS: All quizzes are still open - send in your code snippets :-) or
questions and comments for public dicussions.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Ruby Quiz - Challenge #5 - Crypto Mining - Find the Winning Lucky Number - Nonce (=Number used ONCE) for the Proof-of-Work (PoW) Hash (SHA-256)

Hello,

It's Friday. Ruby Quiz time! Join us. Let's keep going with a new
Ruby Quiz [1] every Friday.
Here we go:

Challenge #5 -Crypto Mining - Find the Winning Lucky Number - Nonce
(=Number used ONCE) for the Proof-of-Work (PoW) Hash (SHA-256)

Let's find the the winning lucky lumber, that is, nonce (=Number used ONCE)
for the proof-of-work (PoW) hash using SHA-256.

Aside: What's a (Crypto) Hash?

Classic Bitcoin uses the SHA256 hash algorithm.

Ruby Conferences ‘n’ Camps in 2019 - What’s Upcoming? Anything Missing? (Please Tell)

Hello,

Over at planet ruby - we try the second year running put together a
"definitive" world wide ruby conferences & camps calendar for 2019 [1]
(see 2018 [2] for what happened this year :-) for all to use and
share.

If any ruby conference or camp is missing, let us know here (or
better edit the datafile in yaml [3] on github :-)). Yes, the calendar
page is built with ruby (and jekyll and friends) and all is open
source and dedicated to the public domain (that is, no rights
reserved; use as you please etc.)

Cheers.

Ruby Quiz - Challenge #4 - Turn Humanitarian eXchange Language (HXL) Tabular Records into Named Tuples

Hello,

Let's honor the tradition and post a new Ruby Quiz [1] every Friday.
Here we go:

Challenge #4 - Turn Humanitarian eXchange Language (HXL) Tabular
Records into Named Tuples

Let's turn tabular data using the Humanitarian eXchange Language (HXL)
hashtag convention from array of array of strings
to array of named tuples (also known as hash dictionaries).

Aside: What's Humanitarian eXchange Language (HXL)?

Humanitarian eXchange Language (HXL) [2]
is a (meta data) convention for
adding agreed on hashtags e.g.

csvhuman v0.1 - read tabular data in the CSV Humanitarian eXchange Language (HXL) format

Hello,

I've put together a first version of the csvhuman library / gem [1] that
adds support for the Humanitarian eXchange Language (HXL) to ruby
and lets you read tabular data in the
comma-separated values (CSV) with Humanitarian eXchange Language
(HXL) [2] hashtags format.

Questions and comments welcome.

[1] <a href="https://github.com/csvreader/csvhuman" title="https://github.com/csvreader/csvhuman">https://github.com/csvreader/csvhuman</a>
[2] <a href="https://github.com/csvspecs/csv-hxl" title="https://github.com/csvspecs/csv-hxl">https://github.com/csvspecs/csv-hxl</a>

Cheers.

record library / gem v1.2 - named tuples / records with typed structs / schemas

Hello,

I've updated the (new) record library / gem [1] that lets you define
named tuples / records with typed structs / schemas. How?

Step 1: Define a (typed) struct for your records / named tuples.

Ruby Quiz - Challenge #3 - Read the English Premier League (EPL) Standings Table from a Web Page

Hello,

Let's honor the tradition and post a new Ruby Quiz [1] every Friday.
Here we go:

Challenge #3 - Read the English Premier League (EPL) Standings Table
from a Web Page [2]

Let's read the English Premier League (EPL) Standings Table
from a web page.

Ruby Quiz Adopts Code of Conduct - Be A Mensch.

Hello,

To help build a strong and welcoming community the (new) Ruby Quiz
[1] has adopted a code of conduct [2].

Happy ruby quiz time. Be a mensch. Cheers. Prost.

[1] <a href="https://github.com/planetruby/quiz" title="https://github.com/planetruby/quiz">https://github.com/planetruby/quiz</a>
[2] <a href="https://github.com/planetruby/quiz/blob/master/CODE_OF_CONDUCT.md" title="https://github.com/planetruby/quiz/blob/master/CODE_OF_CONDUCT.md">https://github.com/planetruby/quiz/blob/master/CODE_OF_CONDUCT.md</a>

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Ruby Quiz #1 - Bonus - Three More Difficulty Levels (2, 3, 4) - Commas Inside Quotes and Double Up Quotes in Quotes, ...

Hello,

Thanks for the first three entries - all passing the level 1 test. Yay!

If that was too easy :-) I added three more difficulty levels
to the challenge.[1]
.

### Level 2 - Commas Inside Quotes and Double Up Quotes in Quotes

Let's turn Shakespeare's "literal" Hamlet quote:

```
Hamlet says, "Seems," madam! Nay it is; I know not "seems."
```

into

```
1, "Hamlet says, ""Seems,"" madam! Nay it is; I know not ""seems."""
```

And the test reads:

``` ruby
def test_parse_level2
records = [["1", "Hamlet says, \"Seems,\" madam!

Why the CSV standard library is broken (and how to fix it) Part VII or What's Your Type? Guess. Again. And Again. And Again. Guess What's a Schema For?

Hello,

I've written a new (and sevenths) episode on why the CSV standard
library is broken (and how to fix it).

The heart of the CSV standard library is the String#split kludge.

What else is dangerously simplistic and naive?

Let's have a look at the built-in type conversion [1].
Will it surprise you? Yes, it is broken, broken, broken. How? Why?

Questions and comments welcome. Cheers.

Ruby Quiz - Challenge #2 - Calculate the Bitcoin Genesis Block Hash (SHA-256)

Hello,

To kick start the new Ruby Quiz let's add another "real world" puzzle.

Challenge #2 - Calculate the Bitcoin Genesis Block Hash (SHA-256)

Let's calculate the classic bitcoin (crypto) block hash from scratch (zero).
Let's start with the genesis block, that is block #0
with the unique block hash id
`000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f`.

Note: You can search and browse bitcoin blocks using (online)
block explorers.

Why the CSV library is broken (Part VI) - or Fixes in Alternative CSV Libraries or Fast, Faster, Fasterer, Fastest

Hello,

I've written a new (and sixth) episode on why the CSV standard
library is broken (and how to fix it). Let's have a look at fixes
in alternative CSV libraries out there. [1]

The alternative listed are just a start - there are many more.
Any great alternative CSV libaries missing? Please, tell.

Also reprinted from the article (another) classic:

Unfortunately, the csv library is a dead horse.

Ruby Code Quiz - How can I parse quoted values with String#split?

Hello,

can anyone help out. I cannot get this to work.
I try to parse the line ‹"1", "2" , "3"›.
Ideally single or double quotes don't matter ‹"1", '2' , "3"›.

Any insight appreciated. Cheers. Prost.

The code:

parts = parse.split(@col_sep_split_separator, -1)
if parts.empty?
if in_extended_col
csv[-1] << @col_sep # will be replaced with a @row_sep
after the parts.each loop
else
csv << nil
end
end

# This loop is the hot path of csv parsing. Some things may be non-dry
# for a reason.

Why the CSV standard library is broken (and how to fix it), Part V or Escaping the Stray Quote Error Hell - Do You Want Single, Double, or French Quotes With That Comma?

Hello,

I've written a new (and fifth) episode on why the CSV standard
library is broken
(and how to fix it).

Let's have a look at quotes and leading and trailing spaces. The
episode is titled "Escaping the Stray Quote Error Hell - Do You Want
Single, Double, or French Quotes With That Comma?" [1]

Questions and comments welcome. Cheers.