DevHeads.net

Postings by Gerald Bauer

Talk Notes - The State of Bool in Ruby - Everything Your Never Wanted to Know

Hello,

For the Vienna.rb April meetup I've put together talk notes on:
The State of Bool in Ruby - Everything Your Never Wanted to Know [1].

The contents reads:

- Trivia Quiz - The States of Bool
- Bool Basics
- Classes, Classes, Classes
- Truthy and Falsy - (Almost) Everything is True
- The state of built-in bool conversions - `to_s`, `to_i`,
`to_b`, `to_bool`
- safebool Library / Gem
- Prior Art
- Some Older Bool / Boolean Libraries
- `ActiveRecord::Type::Boolean < Value`
- Bool Conversion
- Empty String
- Number Two
- Choose

Ruby Conferences 'n' Camps in 2019 Update - What's Upcoming in April? What's News?

Hello,

I've updated the Ruby Conferences 'n' Camps in 2019 - What's Upcoming? [1]
Calendar page @ Planet Ruby.

What's News? Added Deccan RubyConf (in August in Pune, Maharashtra, India),
RubyConf Colombia (in September in Medellín, Colombia), and more.

Happy meeting up with rubyists in 2019. Cheers. Prost.

PS: Do you have a favorite conference?

safebool gem / library - safe bool(ean) type adds Bool(), to_b, to_bool, bool?, false?, true?, true.is_a?(Bool)==true, false.is_a?(Bool)==true, and more

Hello,

I've bundled up all the bool(ean) "hacks" in the safebool gem / library [1]
The new safe bool(ean) type adds Bool(), to_b, to_bool, bool?, false?, true?,
true.is_a?(Bool)==true, false.is_a?(Bool)==true, and more.

From the readme:

Why Bool in Ruby?

```
false.class #=> FalseClass
true.class #=> TrueClass
false.is_a?(Bool) #=> NameError: uninitialized constant Bool
true.is_a?(Bool) #=> NameError: uninitialized constant Bool
true.class.ancestors #=> [TrueClass, Object, Kernel, BasicObject]
false.class.ancestors #=> [TrueClass, Object, Kernel, BasicObj

enums v1.2 library / gem adds (enum) flags w/ bitwise-operators for set (|) / unset (&~) / toggle (^)

Hello,

I've added (bit) enum flags with bitwise-operators
for set (|) / unset (&~) / toggle (^) to the enums library / gem [1].

Use the new flags option for the enum helper or the new Flag class.

Gem of the Week - hexapdf - Read and Write PDF Documents; Merge, Extract, Optimize and Much More

Hello,

I'm restarting (and updating) the Gem of the Week Series [1]
that highlights a new ruby library every week on Thursdays.

Let's welcome the hexapdf gem / library and command line tools [2a][2b] -
read and write PDF documents; start from zero or merge, extract,
optimize and much more.

Thanks to Thomas Leitner for the write-up (and the great gem).

Happy coding with ruby. Cheers.

Vienna.rb Talks Notes - Contracts, Contracts, Contracts - Code Your Own (Crypto Blockchain) Contracts w/ Ruby (sruby), Universum & Co

Hello,

World premiere! The world's first official (secure) ruby talk happened at
the Vienna Ruby (Crypto) meetup tonight. The talk agenda / notes read:

- What's a (Smart) Contract?
- Code is Law?
- Contract-Oriented Programming Languages
- Genesis - Bitcoin Script
- Ivy - Higher-Level Bitcoin Script
- History Corner - Bitcoin - The World's Worst Database for
Everything? - Bitcoin Maximalism in Action
- Turing Complete and the Halting Problem
- Fees, Fees, Fees - $$$ - There's No Free Lunch
- What's the World's Most Popular Programming Language?

units-time library / gem v1.0 - units of time (in epoch time) for secure ruby (sruby)

Hello,

I've put together a "standalone" library / gem for
units of time (in epoch time) incl.

Awesome Rubies Updated (Now Incl. mruby/c, sruby (s6), and More)

Hello,

I've updated the Awesome Rubies [1] page that collects compilers,
interpreters, virtual machines, parsers, doc generators, version
managers, and more.

What’s news? Let’s welcome mruby/c, sruby (s6) and more.

Anything missing? Contributions welcome. Let us know.

Happy coding with rubies. Cheers. Prost.

[1] <a href="https://github.com/planetruby/awesome-rubies" title="https://github.com/planetruby/awesome-rubies">https://github.com/planetruby/awesome-rubies</a>

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

enums 1.0 library / gem - safe enumeration types for ruby e.g. enum :Color, [:red, :green, :blue]

Hello,

I've put together a new enums library / gem [1] for safe
enumeration types in ruby.

Yes, enums are just a set of symbolic keys bound to unique integer numbers.
Why not just use symbols :-) or constants? Do we really need a new enum type
and (yet another) library?

(Secure) Ruby Quiz - Code Challenge #3 - Powerball Mega Millions Grand Prize - Create a Power Play Contract for America's Most Popular Lottery

Hello,

It's Friday. (Secure) Ruby Quiz Time!

Let's use America's most popular lottery - Powerball Mega Millions -
and make it provable fair by - surprise, surprise -
putting the machinery on the blockchain with a contract script in
(secure) ruby, of course [1].

First let's warm-up with the simplest possible lottery
from the book "Building Games with Ethereum Smart Contracts"
by Kedar Iyer and Chris Dannen.

Join us. Question or comments welcome.
Note, the ruby-talk mailing list right here is the "official" sruby channel.

Cheers. Prost.

(Secure) Ruby to Solidity (Source-to-Source) Cross-Compiler Cheat Sheet / White Paper

Hello,

I've started a new white paper / cheat sheet on
a (secure) ruby to solidity (source-to-source) cross-compiler [1].

If anyone is interested in how to turn ruby into solidity (and
ethereum virtual machine (evm) bytecode) let us know!
Question or comments welcome. Yes, the ruby-talk mailing list
right here is the "official" sruby channel.

Cheers.

Designing sruby (Secure Ruby) - Use ivars (@balance) or Storage class (storage.balance) for (Blockchain) State?

Hello,

If anyone follows along about the new ruby variant / flavor called sruby
- Small, Smart, Secure, Safe, Solid & Sound (S6) Ruby.

Here's a language design choice: How to track the contract's
(blockchain) state?

a) Let's (re)use ruby's ivars (object instance variables) e.g.:

def initialize
@owner = msg.sender
@counter = 0
@bets = Mapping.of( Integer => Bet )
end

or b) let's use a more "explicit" Storage class e.g.:

def initialize
storage[:owner] = msg.sender
storage[:counter] = 0
storage[:bets] = Mapping.of( Integer => Bet )
end

Ruby Quiz - (Crypto) Blockchain Contract Edition - Challenge #2 - Code Challenge #2 - Create a PonzICO Investment Contract - Blockchain Performance Art

Hello,

to kickstart the new ruby quiz (crypto) blockchain contract edition
let's add another (easier) coding challenge:

Challenge #2 - Create a PonzICO Investment Contract - Blockchain
Performance Art [1]

Let's use the live and "real world" blockchain performance art
PonzICO investment contract [2] running on the Ethereum world computer.

Read the PonzICO White Paper [3] for how the investment scheme and
dividend payouts work and what your money will get used for (hint:
thanks for the free Tesla - don't forget to vote on the color :-) and
maybe a two bedroom condo in San Franc

safestruct gem - Safe Data Structures (Array, Hash, Struct) - Say Goodbye to Null / Nil (and the Billion Dollar Mistake)

Hello,

I've put together a new safestruct gem / library [1] that collects
safe data structures (array, hash, struct)
and lets you say goodbye to null / nil (and maybe)
to fix the billion dollar mistake.

How can the code work without nil?

Let's say hello to zero :-).
The new rule for NO null/nil ever (again) is:

**All variables - including structs, arrays and mappings (hash
dictionaries) -
MUST ALWAYS get set (initialized) to ZERO (default) values.**

What's zero?

|----------------|----------------------------|
| Type | Value |
|----

Ruby Quiz - (Crypto) Blockchain Contract Edition - Challenge #1 - Create a 3x3 Tic-Tac-Toe Player vs Player Game Contract

Hello,

I've started a new ruby quiz for secure (crypto) contract blockchain
scripting [1].

Challenge #1 - Create a 3x3 Tic-Tac-Toe Player vs Player Game Contract

Let's use the "Creating a Tic-Tac-Toe Smart Contract" [2] tutorial
and "real-world" sample contract from the EOS.IO blockchain.

The challenge: Code a contract for a 3x3 tic-tac-toe player vs player game
using sruby :-).

Can you do better (than the EOS.IO C++ "monster")?

Post your code snippets (or questions or comments) on the "official"
Ruby Quiz Channel,
that is, right here on the ruby-talk mailing list.

Cheers.

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.