Skip to content

Tag: ruby

Translating python raw string / regex to ruby

I’m currently trying to translate a python script to ruby. Now I’m stuck on a part that uses a raw string for a regex. This is the original python code: This is my attempt to translate it to ruby: Unfortunately I must be doing it wrong because I get this error: I also tried: But it results in the …

Python’s enumerate in Ruby?

Is something built in for this? It doesn’t need to have it’s members immutable, it just needs to be in the standard library. I don’t want to be the guy who subclasses the Array class to add a Python feature to a project. Does it have a different name in Ruby? Answer Something like this in Py…

generate video pixel by pixel, programmatically

I’d like to generate an animation pixel by pixel programmatically. Preferably in Hi-Def, in Python or in Ruby. I thought about using PIL to make each frame and then convert the frames into video. Is there a better way to do this? EDIT: Clarification, this is 2D and I need the pixels to be precise. EDITE…