Bienvenidos a un lugar donde la programación, los vídeos, las divagaciones y las subnormalidad se combinan para demostrar que el caos puede ser bello.
Serabe Reloaded
Conecto ergo sum. Non conecto ergo urgueo.
"Las tres cosas más peligrosas del mundo son: un programador con un soldador, un ingeniero de hardware con un parche de software y un usuario con una idea."
Proverbio Informático.
RMagick4J 0.3.6
I am glad to announce a new version of rmagick4j.
RMagick4J aims to implement the ImageMagick funcionality and the C
portions of RMagick for make it works in JRuby.
Current stable version: 0.3.6
Project URL: http://code.google.com/p/rmagick4j/
Installation: gem install rmagick4j
Google Summer of Code project should be thanked for making this new
release possible.
In release 0.3.6 you can find the next improvements:
- More Draw primitives (clip-path [creatin a clip-path and using a
clip-path], fill-rule, rotate, scale [reimplemented], skewX, slewY,
stroke-linecap, stroke-linejoin, stroke-miterlimit, translate). - Solve a bug with transparent stroke and line primitive.
- Added the following Draw instance methods:
- annotate
- get_multiline_type_metrics
- Solved a bug that caused the background become black while resizing
images with alpha channel.
Please try out your applications with rmagick4j and help us provide
feedback. It is our goal to make a fully-compatible implementation of
RMagick4j in JRuby.
Sustituyendo a las animadoras con Ruby en Mac.
El título del post puede sonar raro, pero lo que voy a mostrar hoy es cómo conseguir tu propia animadora en Mac con Ruby. Lo que haremos será hacer que nuestro ordenador, con una orden como:
ruby cheerleader.rb Serabe
Nos muestre por pantalla:
Dame una S
Dame una E
Dame una R
Dame una A
Dame una B
Dame una E
SERABE!!!
Además, utilizando el comando say de Mac, nos lo dirá (si queréis que lo grite, subid el volumen al máximo).
Empecemos con el código:
-
string = ARGV.join(' ')
Aquí simplemente recogemos los parámetros pasados por consola y los concatenamos con un espacio entre medias. Ahora la parte interesante:
-
string.each_byte do |b|
-
if /[a-zA-Z]/ =~ b.chr
-
shout = 'Dame una '+b.chr.upcase
-
puts shout
-
`say #{shout}`
-
end
-
end
Para cada letra, una vez comprobado que es una letra y no un espacio, construimos un grito ('Dame una S'), lo imprimimos por pantalla y hacemos que el comando say lo diga.
Finalmente, con un
-
puts string.upcase + '!!!'
-
-
`say #{string}`
Imprimimos la última frase.
Ya habéis visto cómo crearos vuestra propia cheerleader. En próximos episodios veremos cómo añadirle autoregeneración como Claire.
Mandalas
Según la wikipedia, un mandala es:
"Mándala es un término de origen sánscrito, que significa diagramas o representaciones simbólicas bastante complejas, utilizadas tanto en el budismo como en el hinduismo."
En un blog, he encontrado este tutorial de mandalas en YouTube:
Vía: ¿A que me parezco a Jodorowsky?
RMagick: Dibujar con patrones
Una interesante cualidad de la clase Draw de RMagick es la posibilidad de definir patrones a través del método pattern.
En primer lugar, lo básico:
-
require 'rubygems'
-
require 'RMagick'
-
-
include Magick
Ahora definamos el patrón. Para ello, necesitamos cinco parámetros, el nombre, dos números que recomiendo ponerlos a cero (después de unas cuantas pruebas, no he notado diferencias notables) y después las dimensiones del patrón.
-
draw = Draw.new
-
-
draw.pattern('circles', 0, 0, 10, 10) do
-
draw.stroke 'none'
-
draw.fill 'red'
-
draw.rectangle 0, 0, 10, 10
-
draw.stroke 'LightGreen'
-
draw.fill 'blue'
-
draw.circle 5, 5, 5, 0
-
end
Ya, por último, dibujamos un cuadrado y lo plasmamos en una imagen de 300x300.
-
draw.stroke 'circles'
-
draw.stroke_width 25
-
-
draw.fill 'none'
-
-
draw.polygon 150,0, 300,150, 150,300, 0,150
-
-
img = Image.new 300, 300
-
-
draw.draw img
-
-
img.write 'pattern.jpg'
Obteniéndose el siguiente resultado:
New RMagick4J release.
RMagick aims to implement the ImageMagick funcionality and the C portions of RMagick for make it works in JRuby.
Current stable version: 0.3.5
Project URL: http://code.google.com/p/rmagick4j/
Installation: gem install rmagick4j
Google Summer of Code project should be thanked for making this new release possible.
In release 0.3.5 the following improvements have been made:
- Implemented Draw primitives (affice, arc, pattern, path).
- Improved Image and ImageList:
- Implemented more of Pixel (from_HSL, to_HSL, <=>, fcmp, intensity).
- Implemented the fill classes.
- Added a side-by-side (MRI vs JRuby) image testing tool named Bullseye.
- Added 680 color names. It can search, but not retrieve the name correctly capitalized.
- Changed gem name from RMagick4J to rmagick4j.
This version should allow Gruff Graphs and Ruports to largely work without issues. Please try out your applications with rmagick4j and help us provide feedback. It is our goal to make a fully-compatible implementation of RMagick4j in JRuby.
Tweets del 29-06-2008
- Don't judge a book by its movie. #
Tweets del 28-06-2008
- Donald Knuth http://xkcd.com/163/ #
- Shoes http://tinyurl.com/43qae3 #
Tweets del 26-06-2008
Walk the fire.
Give me your secrets
Bring me a sign
Give me a reason
To walk the fire
See another dawn
Through our daughters’ eyes
You give me a reason
To walk the fire
The Unit, tema del opening de la 3ra temporada.
Tweets del 03-06-2008
- @enjutomojamuto pelo, pelo #
"En un beso, sabrás todo lo que he callado."
Neruda
