DevHeads.net

Postings by Gerald Bauer

Ruby Conferences & Camps in 2020 - What's Upcoming? Anything Missing? Updates Welcome

Hello,

I've updated the Ruby Conferences & Camps in 2020 - What's
Upcoming? page [1]. For what happened this year, see the 2019 page
[2].

Anything missing? Updates welcome, see data/conferences2020.yml [3] file
in the planetruby/calendar repo.

Cheers. Prost.

[1] <a href="http://planetruby.github.io/calendar/2020" title="http://planetruby.github.io/calendar/2020">http://planetruby.github.io/calendar/2020</a>
[2] <a href="http://planetruby.github.io/calendar/2019" title="http://planetruby.github.io/calendar/2019">http://planetruby.github.io/calendar/2019</a>
[3] <a href="https://github.com/planetruby/calendar/blob/master/_data/conferences2020.yml" title="https://github.com/planetruby/calendar/blob/master/_data/conferences2020.yml">https://github.com/planetruby/calendar/blob/master/_data/conferences2020...</a>

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

sportdb v2.0 - command line tool for reading text datasets (leagues, clubs, match schedules, etc.) in any SQL dababase (e.g. football.db, england.db, etc.)

Hello,

I've updated the sportdb command line tool / library [1] that lets
you read in (parse) datasets (e.g. leagues, clubs, match schedules,
etc.)
in plain text in your SQL database of choice (e.g. SQLite, PostgreSQL, etc.)

What's news in 2.0?

The setup and formats have been made easier, for example, all
datasets are now in plain text (e.g.

date-formats library / gem - read / parse dates (and times) from around the world

Hello,

I've put together a date-formats library / gem [1] that lets you
read / parse date (and times) from around the world.

Let's try a French date e.g.

```
DateFormats.parse( 'Lundi 1 Janvier', lang: 'fr')
#=> <Date: 2019-01-01 ((2458485j,0s,0n),+0s,2299161j)>
```

or a Spanish date e.g.

```
DateFormats.parse( '1 Ene', lang: 'es' )`
#=> <Date: 2019-01-01 ((2458485j,0s,0n),+0s,2299161j)>
```

and so on. Happy date wrangling with ruby. Cheers.

sportdb-readers Gem - sport.db Readers for Leagues, Seasons, Clubs, Match Schedules and Results, and More

Hello,

I've put together the sportdb-reader gem / library [1] that
lets you read in (import) text datafiles into any SQL database (using
the sport.db schema / tables) using `SportDb.read`.

Try it with the English Premier League e.g. 2019-20/1-premierleague.txt [2]
or the Deutsche Bundesliga e.g. 2019-20/1-bundesliga.txt [3], for example.

From the readme:

**Step 1**

Setup the (SQL) database.

footballdb-leagues Gem - Match the World's Top 100+ Football Leagues & Cups

Hello,

I've put together the footballdb-leagues gem / library [1]
that bundles-up an all-in-one football.db /leagues datafile
and lets you match 100+ football league & cup names
from around the world "out-of-the-gem / box" with zero-configuration.

It's as easy as:

```
require 'footballdb/leagues'

pp League.all
```

resulting in:

```
[#<League @name="English Premier League", @country="England", ...>,
#<League @name="English Championship", @country="England", ...>,
#<League @name="English League One", @country="England", ...>,
#<League @name="English League Two", @country=

Vienna.rb • Wien.rb - Meetups & Learn Togethers Upcoming in Austria

Hello,

If anyone happens to be in Central Europe in Austria you're invited
to join us to meetup with fellow rubyists in a Vienna coffee house
every first Tuesday of the month [1]. Upcoming dates includes:

- Tuesday, November 5th, 2019, 7-9pm
- Tuesday, December 3rd, 2019, 7-9pm

@ Segafredo Espresso Praterstern

Greetings from Vienna. Cheers.

Working with / Importing (Football) CSV Packages into an SQL Database with the sportdb Gem(s) in Ruby

Hello,

I've written up / published a new from zero / scratch getting
started guide for importing football.csv packages [1]
into an SQL database. The example uses all English football leagues, clubs
and matches (from 1888-89 to today) [2].

Ruby Conferences 'n' Camps in 2019 Update - What's Upcoming in Sept? Nov? Dec? What's News?

Hello,
I've updated the Ruby Conferences 'n' Camps in 2019 - What's
Upcoming?

sportdb Gem Guide Updated - Working w/ Football CSV Files - English Premier League 2019/20 - Let's Build the Standings Table

Hello,

I've updated the hands-on getting started guide for the sportdb
text library / gem.

Let's build the standings table for the English Premier League (EPL)
for the 2019/20 season from all 40 matches (as of Sept/2) in the
comma-separated values (.csv) format.

In a nutshell:

```
require 'sportdb/text'

matches = CsvMatchReader.read( 'england/2010s/2019-20/eng.1.csv' )

standings = SportDb::Struct::Standings.new
standings.update( matches )

standings.to_a.each do |l|
print '%2d.

footballdata gem - download & import 22+ top football leagues from Joseph Buchdahl's Football Data

Hello,

I've put together a new sportdb-source-footballdata gem / library [1]
that lets you download & import 22+ top football leagues
from 25 seasons back to 1993/94 from Joseph Buchdahl's Football Data
website (updated twice a week).

Leagues include the English Premier League, the German Bundesliga,
the Spanish Primera Division (La Liga), the Brazilian Série A, the
Japanese J1 League, and many more.

Downloading all 570+ datafiles (in comma-separated values format)
is as easy as:

```
require 'sportdb/source/footballdata'

Footballdata.download
```

And importing the datafi

footballdb-clubs Gem / Library - Match 1500+ Football Club Names from 100+ Leagues from Around the World

Hello,

I've put together a new footballdb-clubs gem / library [1]
that bundles-up an all-in-one football.db /clubs datafile [2]
and lets you match 1500+ football club names from around the world
"out-of-the-gem / box " with zero-configuration.

It's as easy as:

``` ruby
require 'footballdb/clubs'

pp Club.all
```

resulting in:

```
[#<Club @name="Al Ahly", @city="Cairo", @country="Egypt", ...>,
#<Club @name="Al Mokawloon Al Arab", @city="Cairo", @country="Egypt", ...>,
#<Club @name="El Dakhleya", @city="Cairo", @country="Egypt", ...>,
#<Club @name="El Entag El

Alphabets Benchmarks - How many ways to unaccent a text string? Turn AÄÁaäá into AAAaaa. And the winner is...

Hello,

let's try out half a dozen ways to unaccent a text string? [1]

The challenge - What's the fastest way to turn `AÄÁaäá EÉeé IÍiíï
NÑnñ OÖÓoöó Ssß UÜÚuüú`
into `AAAaaa EEee IIiii NNnn OOOooo Ssss UUUuuu`?

Let's benchmark and the winner (so far) is... Spoiler: `gsub` .

NON_ALPHA_CHAR_REGEX = /[^A-Za-z0-9 ]/ # use/try regex constant
for speed-up
def unaccent_gsub( text, mapping )
text.gsub( NON_ALPHA_CHAR_REGEX ) do |ch|
mapping[ch] || ch
end
end

Can you find a faster way? Show us.

Happy data (and text) wrangling with ruby. Cheers.

fifa gem - the world's football countries and codes (incl. non-member countries and irregular codes)

Hello,

I've put together a new fifa gem / library [1]
that includes all the world's football countries and codes
(incl.

Artichoke Ruby - a ruby made with rust - Try the playground in your browser running on a WebAssembly build

Hello,

I've added Artichoke Ruby [1a] to the Awesome Rubies (collection) page [2].

What's Artichoke Ruby? It's a new upcoming ruby in rust by Ryan
Lopopolo et al.

You can try Artichoke in your browser [1b]. Yes, the Artichoke
playground runs a WebAssembly build of Artichoke.

Congrats to Ryan Lopopolo for the inspiring code.

What's your take? Cheers.

Football Data Wrangling w/ Ruby - Match 1500+ Football Club Names from Around the World using the sportdb Library and Open football.db Datasets

Hello,

To prepare for the 2019/2020 football season kick-off I've put together
a football data wrangling w/ sample that lets you match 1500+
football club names
from 100+ leagues from around the world using the sportdb gem / library
and open football.db (public domain) datasets.
Example:

``` ruby
require 'sportdb/config'

## note: requires a local copy of the football.db clubs datasets
## see <a href="https://github.com/openfootball/clubs" title="https://github.com/openfootball/clubs">https://github.com/openfootball/clubs</a>
SportDb::Import.config.clubs_dir = './clubs'

m = SportDb::Import.config.clubs.match( 'Arsenal' )
m.size # 3 club matches found
#=> 3
m[0].na

Ruby Conferences 'n' Camps in 2019 Update - What's Upcoming in July? Aug? Sept? What's News?

Hello,

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

Ruby Quiz - Challenge #15 - Generate the Bitcoin (Base58) Address from the (Elliptic Curve) Public Key

Hello,

I've posted a new ruby quiz:

Challenge #15 - Generate the Bitcoin (Base58) Address from the
(Elliptic Curve) Public Key [1].

Start from scratch or, yes, use any library / gem you can find.

To qualify for solving the code challenge / puzzle you must pass
the test [2]:

``` ruby
require 'minitest/autorun'

class RubyQuizTest < MiniTest::Test

def test_addr
pubkey =
'0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352'

pkh = pk_to_pkh( pubkey )
assert_equal 'f54a5851e9372b87810a8e60cdd2e7cfd80b6e31', pkh

prefix = '00'

sportdb-import gem - New football.db Match Importer for CSV Packages (incl. England, Deutschland, and More)

Hello,

I've added a new (quick) importer for datafiles and packages
in the comma-separated values (csv) format to the sportdb library /
tool family [1].

For example let's import all datafiles for all seasons (from 1888-89 to today)
for England [2]:

require 'sportdb/import'

SportDb.connect( adapter: 'sqlite3',
database: './eng.db' )

## build database schema / tables
SportDb.create_all

## turn on logging to console
ActiveRecord::Base.logger = Logger.new(STDOUT)

pack = CsvMatchImporter.new( './england' )
pack.import_leagues

Happy da

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 updated the free (open source) kittyverse library / gem that
includes helper classes
for cattributes, trait types, traits, genes, genomes and more for
cryptokitties and copycats cryptocollectibles (on the blockchain).
Example:

Use the Traits helper class to lookup trait types (e.g.

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

Hello,

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

- Tue+Wed May/14+15(2d) - Ruby Conference Cracow @ Cracow, Poland
- Fri+Sat May/17+18(2d) - Balkan Ruby @ Sofia, Bulgaria
- Fri May/24 (1d) - Pivorak Conf @ Lviv, Ukraine
- Sat+Sun May/25+26(2d) - Ruby Unconf Hamburg @ Hamburg, Germany

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

PS: Do you have a favorite conference?

Contract Scripting for Everyone: (Hyperledger) FabCar Registration Sample - From Go Lang Chaincode to (Secure) Ruby Contract Scripts

Hello,

for the Vienna Hyperledger Meetup I've put together a talk titled:

Contract Scripting for Everyone: (Hyperledger) FabCar Registration Sample
From Go Lang Chaincode to (Secure) Ruby Contract Scripts

that shows that - surprise, surprise - (secure) ruby works great for
(contract) scripting. Code is code and Hyperledger Fabric is really
just a key-value store, that is, a simple hash table.

Awesome Types & Type Signatures / Annotations for Ruby

Hello,

I've started to put together a new awesome page collection about
all things types, type signatures / annotations and more for ruby -
incl. bool, bytes, buffer, enum, flag, record, data and more [1].

Is static the new dynamic? Any type gems / libraries missing?
Please, add or tell.

Happy coding with ruby with types. Cheers. Prost.

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

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

Types & Type Signatures (for Ruby) Incl. Bool, Enums, Flags, Records, and More

Hello,

I've started a new org that collects types and type signatures
(typesigs) for ruby [1].

Ruby3 Will Have Types

Hello,

Today's biggest (most upvoted) story on Hacker News:

Ruby3 Will Have Types [1]

Any comments or thoughts here on ruby-talk about the breaking news?

Here are my two cents:

As a head start you can add the missing Bool type today :-), use the
safebool library / gem [2]

Sorbet is a great inspiring project.

Programming Bits, Bytes 'n' Blocks (in Ruby) Step-by-Step Book - Let's start with the types of strings, that is, bytes, (string) buffers, and (frozen) strings, ...

Hello,

I've started a new (free online) book(let) titled:

Programming Bits, Bytes 'n' Blocks (in Ruby) Step-by-Step Book / Guide [1]

Let's start with the three types of strings, that is, bytes,
(string) buffers, and (frozen) strings, ...

Trivia Question: What's the difference between?

1) String.new
2) String.new("")
3) ""

Happy bits & bytes slicing & dicing with ruby. Cheers.

Programming Bitcoin Script Transaction (Crypto) Contracts Step-by-Step (in Ruby)

Hello,

I've started a new (free online) book(let) titled
Programming Bitcoin Script Transaction (Crypto) Contracts
Step-by-Step (in Ruby) [1].

Let's start with building your own bitcoin stack machine from zero /
scratch and let's run your own bitcoin ops (operations)...
Example:

## A simple stack machine
def op_add( stack )
left = stack.pop
right = stack.pop
stack.push( left + right )
end

def op_2( stack )
stack.push( 2 )
end

## Let's run!

stack = []
op_2( stack ) #=> stack = [2]
op_2( stack ) #=> stack = [2,2]
op_add( stack ) #=> st

pragmas gem / library - language syntax pragmas - turn on the future today or add your own ideas for easy (re)use for everyone - let's evolve the ruby language together by experimenting in the wild in a pragma(tic) way

Hello,

I've put together a new pragmas gem / library [1] for language syntax pragmas
that lets you turn on the future today or add your own ideas for easy
(re)use for everyone.

Let's evolve the ruby language together by experimenting in the wild
in a pragma(tic) way.

First language syntax pragmas include match patterns, enum and type
types, auto numbered arguments, and more.

michelson library / gem - test simulator / runtime for type-safe 'n' functional (crypto) contracts (in yes, it's just ruby)

Hello,

I've put together michelson [1] - a test simulator and runtime library / gem
that lets you write and run type-safe 'n' functional (crypto)
contracts in yes, it's just ruby.

See the Let's Count [2] or the Let's Vote [3] examples to get started
with functional type-safe Liquidity (OCaml/ReasonML)-style programming in ruby.

```
######################################
# Let's Count - 0, 1, 2, 3
type :Storage, Integer

init [],
def storage()
0
end

entry [Integer],
def inc( by, storage )
[[], storage + by]
end

################################
## Test, Test, Test

storage = stor

Design Question / Challenge - From SmartPy Contract to Yes, It's Just Ruby - Let's Play Nim (The Ancient Math Subtraction Game)

Hello,

Here's another design question / challenge:

Turn the SmartPy contract that lets you play Nim (the ancient math
subtraction game) into a "Yes, It's Just Ruby" version.