Skip to content Skip to sidebar Skip to footer
Showing posts with the label Ruby

Python Assignment Quirk W/ List Index Assign, Dict Index Assign, And Dict.get

In ruby 2.4: x = ['a'] y = {} x[0] = y[x[0]] = y.fetch(x[0], y.length) puts y #=> {'… Read more Python Assignment Quirk W/ List Index Assign, Dict Index Assign, And Dict.get

Find In Files Using Ruby Or Python

A popular text editor has the following 'find in files' feature that opens in a dialog box:… Read more Find In Files Using Ruby Or Python

Ruby Hash Equivalent To Python Dict Setdefault

In Python it is possible to read a dictionary/hash key while at the same time setting the key to a … Read more Ruby Hash Equivalent To Python Dict Setdefault

Python Equivalent Of Ruby's .select

I have an list/array, lets call it x, and I want to create a new list/array, lets call this one z, … Read more Python Equivalent Of Ruby's .select

Does Ruby Have Something Like Python's List Comprehensions?

Python has a nice feature: print([j**2 for j in [2, 3, 4, 5]]) # => [4, 9, 16, 25] In Ruby it&#… Read more Does Ruby Have Something Like Python's List Comprehensions?

Expression Evaluator For C#/python/ruby

We have semi-complicated expressions in the format: '25 + [Variable1] > [Variable2]' We … Read more Expression Evaluator For C#/python/ruby